Commit graph

213 commits

Author SHA1 Message Date
Priit Laes a79cb3901e staging: fbtft: Use standard MIPI DCS command defines for fbtft driver
This patch makes use of the standard MIPI Display Command Set to remove
some of the magic constants found in source code.

Signed-off-by: Priit Laes <plaes@plaes.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-07 19:39:27 -08:00
Priit Laes 79f5da7d33 staging: fbtft: Use standard MIPI DCS command defines for st7735r
This patch makes use of the standard MIPI Display Command Set to remove
some of the magic constants found in source code.

Signed-off-by: Priit Laes <plaes@plaes.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-07 19:39:27 -08:00
Priit Laes 3d6924dd6a staging: fbtft: Use standard MIPI DCS command defines for s6d02a1
This patch makes use of the standard MIPI Display Command Set to remove
some of the magic constants found in source code.

Signed-off-by: Priit Laes <plaes@plaes.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-07 19:39:27 -08:00
Priit Laes 49475ed0cb staging: fbtft: Use standard MIPI DCS command defines for ili9486
This patch makes use of the standard MIPI Display Command Set to remove
some of the magic constants found in source code.

Signed-off-by: Priit Laes <plaes@plaes.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-07 19:39:27 -08:00
Priit Laes 89823edc63 staging: fbtft: Use standard MIPI DCS command defines for ili9481
This patch makes use of the standard MIPI Display Command Set to remove
some of the magic constants found in source code.

Signed-off-by: Priit Laes <plaes@plaes.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-07 19:39:27 -08:00
Priit Laes 467786c19a staging: fbtft: Use standard MIPI DCS command defines for ili9341
This patch makes use of the standard MIPI Display Command Set to remove
some of the magic constants found in source code.

Signed-off-by: Priit Laes <plaes@plaes.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-07 19:39:27 -08:00
Priit Laes 261a984c88 staging: fbtft: Use standard MIPI DCS command defines for ili9340
This patch makes use of the standard MIPI Display Command Set to remove
some of the magic constants found in source code.

Signed-off-by: Priit Laes <plaes@plaes.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-07 19:39:27 -08:00
Priit Laes 13c1226992 staging: fbtft: Use standard MIPI DCS command defines for ili9163
This patch makes use of the standard MIPI Display Command Set to remove
some of the magic constants found in source code.

Signed-off-by: Priit Laes <plaes@plaes.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-07 19:39:27 -08:00
Priit Laes 9580893255 staging: fbtft: Use standard MIPI DCS command defines for hx8357d
This patch makes use of the standard MIPI Display Command Set to remove
some of the magic constants found in source code.

Signed-off-by: Priit Laes <plaes@plaes.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-07 19:39:27 -08:00
Priit Laes fbf461d176 staging: fbtft: Use standard MIPI DCS command defines for hx8353d
This patch makes use of the standard MIPI Display Command Set to remove
some of the magic constants found in source code.

Signed-off-by: Priit Laes <plaes@plaes.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-07 19:39:27 -08:00
Ben Gilbert fd59f106f4 Staging: fbtft: Removed commented out/dead code
Deleted various commented out lines that have been replaced by write_reg()

Signed-off-by: Ben Gilbert <gillie59978@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-07 19:37:36 -08:00
Nizam Haider 2fe9f8caad Staging: fbtft: fbtft-core: Removed unnecessary checks
The driver core clears the driver data to NULL after device_release
or on probe failure.

Signed-off-by: Nizam Haider <nijamh@cdac.in>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-07 19:37:36 -08:00
Linus Torvalds 75f5db39ff spi: Updates for v4.4
Quite a lot of activity in SPI this cycle, almost all of it in drivers
 with a few minor improvements and tweaks in the core.
 
  - Updates to pxa2xx to support Intel Broxton and multiple chip selects.
  - Support for big endian in the bcm63xx driver.
  - Multiple slave support for the mt8173
  - New driver for the auxiliary SPI controller in bcm2835 SoCs.
  - Support for Layerscale SoCs in the Freescale DSPI driver.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQEcBAABAgAGBQJWOehzAAoJECTWi3JdVIfQTPYH+wYMDG8gAIw2s0AJ4DvVe4qZ
 sOAm1UgUJZxssrEA6BNqbfM0dfRo+oQJKmRd0Dc5n7LEMsYHdI/5yKHk8PCS6ZzD
 iQyQCzbd0thDAqwuPaMP62cyPDHwyJX22VGTsgVnj6AZqAQ+9+g4SPKhFnm1Mlm4
 hmDi6fdSrsqo8k8gkpVN8RFOfVsjAV1dLtAauQRWDHrqMxXURSrKG76eqAqUa5bn
 BLPXBoj5PA0DMLPO2j+ADZwWN723LrI2mSSlc+ThjEX/OIt2OhAoiOTV5RPqaafy
 TIsCkh68q/gYAsL5HtvvmgZByl41FLYiO0Z+rXmWUyMMbnvhZTLws9S2BNpBLuk=
 =DgXG
 -----END PGP SIGNATURE-----

Merge tag 'spi-v4.4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi

Pull spi updates from Mark Brown:
 "Quite a lot of activity in SPI this cycle, almost all of it in drivers
  with a few minor improvements and tweaks in the core.

   - Updates to pxa2xx to support Intel Broxton and multiple chip selects.
   - Support for big endian in the bcm63xx driver.
   - Multiple slave support for the mt8173
   - New driver for the auxiliary SPI controller in bcm2835 SoCs.
   - Support for Layerscale SoCs in the Freescale DSPI driver"

* tag 'spi-v4.4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi: (87 commits)
  spi: pxa2xx: Rework self-initiated platform data creation for non-ACPI
  spi: pxa2xx: Add support for Intel Broxton
  spi: pxa2xx: Detect number of enabled Intel LPSS SPI chip select signals
  spi: pxa2xx: Add output control for multiple Intel LPSS chip selects
  spi: pxa2xx: Use LPSS prefix for defines that are Intel LPSS specific
  spi: Add DSPI support for layerscape family
  spi: ti-qspi: improve ->remove() callback
  spi/spi-xilinx: Fix race condition on last word read
  spi: Drop owner assignment from spi_drivers
  spi: Add THIS_MODULE to spi_driver in SPI core
  spi: Setup the master controller driver before setting the chipselect
  spi: dw: replace magic constant by DW_SPI_DR
  spi: mediatek: mt8173 spi multiple devices support
  spi: mediatek: handle controller_data in mtk_spi_setup
  spi: mediatek: remove mtk_spi_config
  spi: mediatek: Update document devicetree bindings to support multiple devices
  spi: fix kernel-doc warnings about missing return desc in spi.c
  spi: fix kernel-doc warnings about missing return desc in spi.h
  spi: pxa2xx: Align a few defines
  spi: pxa2xx: Save other reg_cs_ctrl bits when configuring chip select
  ...
2015-11-05 13:15:12 -08:00
Mark Brown 4c84518523 Merge remote-tracking branches 'spi/topic/omap-100k', 'spi/topic/omap-uwire', 'spi/topic/owner', 'spi/topic/pxa' and 'spi/topic/pxa2xx' into spi-next 2015-11-04 11:02:12 +00:00
Andrew F. Davis 3821a065f5 spi: Drop owner assignment from spi_drivers
An spi_driver does not need to set an owner, it will be populated by the
driver core.

Signed-off-by: Andrew F. Davis <afd@ti.com>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-10-28 10:30:17 +09:00
Dennis Menschel 646287ba9f staging: fbtft: fix voltage settings for C-Berry28
This patch fixes some internal voltage settings for the C-Berry28 display.
The original example source files for the C-Berry28 as provided by
its vendor admatec contained six issues where a command parameter's value
didn't match its corresponding comment.
I've informed admatec about these discrepancies on 2015-08-25. In the
meantime, I've assumed the comments to be more reliable than the code,
and thus have used these values to write the initial C-Berry28 driver.
After having received a reply from admatec on 2015-10-16 that the issues
have been fixed in their example code, it has turned out that for the
voltages VCOM and AVDD, the code was indeed correct, but the comments
were wrong. This patch is meant to fix these two pending mistakes.

Signed-off-by: Dennis Menschel <menschel-d@posteo.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-24 19:42:37 -07:00
Dennis Menschel ef8f317795 staging: fbtft: use init function instead of init sequence
This patch converts the default init sequence of the ST7789V
display controller into an init function, as init sequences
are considered deprecated by the maintainers of fbtft.

Signed-off-by: Dennis Menschel <menschel-d@posteo.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-24 19:42:37 -07:00
Dennis Menschel 5d7b169214 staging: fbtft: remove redundant set_addr_win() function
This patch removes the function set_addr_win() from fb_st7789v.c, as its
definition is redundant to the default implementation fbtft_set_addr_win()
which can be found in fbtft-core.c.

Signed-off-by: Dennis Menschel <menschel-d@posteo.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-24 19:42:37 -07:00
Dennis Menschel 598af18afc staging: fbtft: use MIPI DCS for ST7789V and C-Berry28
This patch makes use of the standard MIPI Display Command Set to remove
redundant entries from the command enum of the ST7789V display controller
and also some of the magic constants found in the init sequence of the
C-Berry28 display.

Signed-off-by: Dennis Menschel <menschel-d@posteo.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-24 19:42:37 -07:00
Shivani Bhardwaj f1092794c0 Staging: fbtft: fb_ssd1331: Remove unnecessary cast
Compiler can typecast variables implicitly so, explicit type cast is not
required and should be removed.
Semantic patch used:

@@
type T;
T e;
identifier x;
@@

* T x = (T)e;

Signed-off-by: Shivani Bhardwaj <shivanib134@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-16 22:56:23 -07:00
Shivani Bhardwaj e788b70f3b Staging: fbtft: fb_ra8875: Remove useless cast
Remove explicit type conversion as it is not required.
Semantic patch used:

@@
type T;
T e;
identifier x;
@@

* T x = (T)e;

Signed-off-by: Shivani Bhardwaj <shivanib134@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-16 22:56:23 -07:00
Shivani Bhardwaj 193ef31524 Staging: fbtft: fb_agm1264k-fl: Remove unnecessary cast
Remove explicit typecast from variables as compiler can typecast
implicitly.
Semantic patch used:

@@
type T;
T e;
identifier x;
@@

* T x = (T)e;

Signed-off-by: Shivani Bhardwaj <shivanib134@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-16 22:56:23 -07:00
Cristina Moraru ed400c9617 staging: fbtft: Fix multi-line comment style
Thus use the preferred style for multi-line coments as
mentioned in Documentation/CodingStyle.

It also silences 'Block comments use * on subsequent lines'
checkpatch.pl warnings.

Signed-off-by: Cristina Moraru <cristina.moraru09@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-16 22:56:23 -07:00
Lars Svensson 6b626c77be staging: fbtft: access screen buffer directly
In fbtft-bus.c:fbtft_write_vmem16_bus9(), ioread8() is used for
accessing the provided screen array. Since screen_buffer actually
points to an ordinary buffer, instead access it directly.

Signed-off-by: Lars Svensson <lars1.svensson@sonymobile.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-13 10:52:31 -07:00
Lars Svensson 4b6dc179dc staging: fbtft: use alternate screen pointer
Member screen_base in struct fb_info is declared with __iomem
qualifier causing sparse warnings when used as a regular ponter.
To avoid the warnings, instead use alternate non-__iomem pointer,
screen_buffer, troughout the driver.

Signed-off-by: Lars Svensson <lars1.svensson@sonymobile.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-13 10:51:30 -07:00
Dennis Menschel e9f6806551 staging: fbtft: add support for C-Berry28 display
This patch adds support for the C-Berry28, a small 2.8" color display
with a resolution of 320x240 pixels from admatec for the Raspberry Pi.
It uses the Sitronix ST7789V display controller along with a custom
init sequence and custom gamma curves.

Signed-off-by: Dennis Menschel <menschel-d@posteo.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-13 10:49:12 -07:00
Dennis Menschel d4c402ff35 staging: fbtft: add support for ST7789V display controller
This patch adds support for the Sitronix ST7789V display controller.
The controller is intended for small color displays with a resolution
of up to 320x240 pixels.

Signed-off-by: Dennis Menschel <menschel-d@posteo.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-13 10:49:12 -07:00
Ksenija Stanojevic 367e8560e8 Staging: fbtbt: Replace timespec with ktime_t
struct timespec will overflow in year 2038, so replace it with
ktime_t. And replace functions that use struct timespec,
timespec_sub with ktime_sub. Also use monotonic time instead of real
time, by replacing getnstimeofday with ktime_get, to be more robust
against leap seconds and settimeofday() calls.

Signed-off-by: Ksenija Stanojevic <ksenija.stanojevic@gmail.com>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-08 10:50:27 +01:00
Shraddha Barke 6f6347ef49 Staging: fbtft: Remove debug messages related to DEBUG_BACKLIGHT
Remove debug messages related to fbtft_par_dbg(DEBUG_BACKLIGHT.. )
as this info can be obtained using kernel function tracer

Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-02 11:31:29 +02:00
Shraddha Barke 2bcaa1e955 Staging: fbtft: Remove debug messages related to DEBUG_WRITE_VMEM
Remove debug messages related to fbtft_par_dbg(DEBUG_WRITE_VMEM.. )
as this info can be obtained using kernel function tracer

Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-02 11:31:29 +02:00
Greg Kroah-Hartman bcabc6f328 Merge 4.3-rc3 into staging-next
We want the staging fixes in here as well.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-29 01:52:40 +02:00
Shraddha Barke 64ffdc383b Staging: fbtft: Remove debug messages
Remove debug messages related to fbtft_par_dbg(DEBUG_INIT_DISPLAY.. )
as this info can be obtained using kernel function tracer

Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-21 09:56:50 -07:00
Stefan Wahren dd3afa57c5 staging: fbtft: replace master->setup() with spi_setup()
Calling the setup of the SPI master directly causes a NULL pointer
dereference with master drivers without a separate setup function.
This problem is reproduceable on ARM MXS platform.

So fix this issue by using spi_setup() instead.

Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Acked-by: Noralf Trønnes <noralf@tronnes.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-13 09:33:58 -07:00
Stefan Wahren cabb5b2a28 staging: fbtft: fix 9-bit SPI support detection
Since the result of the setup function isn't adequate to check
9-bit SPI support, we better check bits_per_word_mask. Btw this
change avoids a NULL pointer dereference with master drivers
without a separate setup function.

Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Acked-by: Noralf Trønnes <noralf@tronnes.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-13 09:33:58 -07:00
Sudip Mukherjee e714b7eab1 staging: fbtft: change log level
Reduce the log level of some of the pr_* calls and remove 2 pr_debug
calls which just prints "init" and "exit".

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-12 18:25:02 -07:00
Sudip Mukherjee 805deadbc2 staging: fbtft: start using pr_fmt
Instead of defining DRVNAME and using it in all calls to pr_* family of
macros lets start using pr_fmt.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-12 18:25:02 -07:00
Sudip Mukherjee 962539a068 staging: fbtft: use dev_*
Use dev_* family of macros where we have a reference of a device.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-12 18:25:02 -07:00
Sudip Mukherjee fb7014df15 staging: fbtft: do not use magic numbers
Using magic numbers are not good coding practise. Use
FBTFT_GPIO_NAME_SIZE as defined in the header files.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-12 18:24:53 -07:00
Sudip Mukherjee eb6a2dbf32 staging: fbtft: use strncpy instead of strcpy
Using strcpy() is a security risk as the destination buffer size is not
checked and we may over-run the buffer. Use strncpy() instead, while
mentioning the buffer size leaving place for the NULL termination.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-12 18:24:53 -07:00
Anish Bhatt 94c0a54427 staging/fbtft : Add missing whitespace around operators
Add blank spaces around operators where recommended
by checkpatch.pl

Signed-off-by: Anish Bhatt <anish@chelsio.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-12 18:24:37 -07:00
Anish Bhatt 1014c2ce08 staging/fbtft : Fix multiple/missing blank line issues
Remove or add blank lines as recommended by checkpatch.pl

Signed-off-by: Anish Bhatt <anish@chelsio.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-12 18:24:36 -07:00
Anish Bhatt c3eeca503d staging/fbtft : Remove unicode characters
Remove stray unicode quotes around name

Signed-off-by: Anish Bhatt <anish@chelsio.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-12 18:24:36 -07:00
Anish Bhatt e73221877a staging/fbtft : Remove repeated set_addr_win debug messages
fbtft_par_dbg(DEBUG_SET_ADDR_WIN.. ) is repeated in every
set_addr_win() handler, this could be replicated by using the kernel
function tracer instead.

Signed-off-by: Anish Bhatt <anish@chelsio.com>
Suggested-by: Greg KH <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-12 18:24:36 -07:00
Anish Bhatt e6ea2028e0 staging/fbtft : Use BIT() macro when possible
Based on checkpatch.pl recommendations, (1 << x)
is replaced by BIT(x)

Signed-off-by: Anish Bhatt <anish@chelsio.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-12 18:24:36 -07:00
Mike Rapoport 6d657dac56 staging: fbtft: fb_watterott: define backlight_ops statically
instead of devm_kzalloc'ing them

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-12 18:24:36 -07:00
Mike Rapoport 23801e3438 staging: fbtft: fb_ssd1351: define backlight_ops statically
instead of devm_kzalloc'ing them

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-12 18:24:36 -07:00
Mike Rapoport ed20c6fbf7 staging: fbtft: fbtft_request_gpios: reduce nesting
Returning immediately if no platform_data or platform_data->gpios is
specified reduceis code nesting

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-12 18:24:35 -07:00
Mike Rapoport c18d116d92 staging: fbtft: fbtft-core: define backlight_ops statically
instead of devm_kzalloc'ing them

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-12 18:24:35 -07:00
Mike Rapoport e7f506bd0e staging: fbtft: remove unused bl_ops from fbtft_unregister_backlight
The only usage of bl_ops variable in fbtft_unregister_backlight function
was assigment of a value to that variable, therefore the assignment and
the variable itself can be safely removed

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-12 18:24:35 -07:00
Anish Bhatt 4a1a838362 staging/fbtft : Remove FSF mailing address
checkpatch.pl recommends that this is no longer required.
Also replaces ASCII-art copyright notice with simple text

Signed-off-by: Anish Bhatt <anish@chelsio.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-12 18:24:35 -07:00
Joe Perches cd951ddc2d staging: fbtft: Remove unnecessary externs
Using 'extern' is not necessary for function prototypes.

Miscellanea:

o Reflow alignments

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-14 18:51:56 -07:00
Fabio Falzoi dbb588a4f7 Staging: fbtft: Use a struct to describe each LCD controller
Use a struct flexfb_lcd_controller to holds chip properties, instead of
relying on a long 'if - else if' chain.
This allows to:
- use a simple linear search to verify if a certain LCD controller
model is supported or not.
- add support for a new LCD chip controller simply defining a new
flexfb_lcd_controller struct.

Signed-off-by: Fabio Falzoi <fabio.falzoi84@gmail.com>
Acked-by: Noralf Trønnes <noralf@tronnes.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-07 15:10:58 -07:00
Geert Uytterhoeven 24b7d011a6 staging: fbtft: Allow compile test of GPIO consumers if !GPIOLIB
The GPIO subsystem provides dummy GPIO consumer functions if GPIOLIB is
not enabled. Hence drivers that depend on GPIOLIB, but use GPIO consumer
functionality only, can still be compiled if GPIOLIB is not enabled.

Relax the dependency on GPIOLIB if COMPILE_TEST is enabled, where
appropriate.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-03 17:45:02 -07:00
Noralf Trønnes ad6d8812aa staging: fbtft: core: Don't set device platform_data
Pass platform_data as an argument to fbtft_framebuffer_alloc()
instead of using dev->platform_data.

This fixes an issue where the device comes from Device Tree
and fbtft_probe_common() sets dev->platform_data to allocated
memory. When the module is reloaded, dev->platform_data points
to freed memory.

Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-03 17:45:02 -07:00
Henri Chain a1560f9bec Staging: fbtft: Add support for the Ultrachip UC1611 LCD controller
This is a driver chip for 240x160 4-bit greyscale LCDs.
It is capable of 4-wire (8 bit) or 3-wire (9 bit) SPI that have both been
tested. (It also has a 6800 or 8080-style parallel interface, but I have
not included support for it.)

Signed-off-by: Henri Chain <henri.chain@eleves.ec-nantes.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-07-14 19:17:50 -07:00
Noralf Trønnes dc4b206893 staging: fbtft: Add reset to fbtft_init_display_dt()
When an init sequence is present in the Device Tree,
fbtft_init_display_dt() is used to initialize the display.
Add missing reset function call and activation of
chip select for parallel bus.

Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-07-14 19:16:16 -07:00
Fabio Falzoi a1bf5205b2 Staging: fbtft: Fix spacing coding style issue
This patch fixes the following checkpatch.pl error:

CHECK:SPACING at line 318.

Signed-off-by: Fabio Falzoi <fabio.falzoi84@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-07-14 19:16:16 -07:00
Fabio Falzoi 4906c43a34 Staging: fbtft: Fix parenthesis alignment coding style issue
This patch fixes the following checkpatch.pl error:

CHECK:PARENTHESIS_ALIGNMENT at line 217.

Signed-off-by: Fabio Falzoi <fabio.falzoi84@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-07-14 19:16:16 -07:00
Fabio Falzoi df127f13c2 Staging: fbtft: Remove unnecessary multiple blank lines
This patch removes some unnecessary multiple blank lines to fix the
following checkpatch errors:

CHECK:LINE_SPACING at lines 29, 67, 131, 287, 299, 312, 326, 351 and
364.

Signed-off-by: Fabio Falzoi <fabio.falzoi84@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-07-14 19:16:16 -07:00
Fabio Falzoi f0a2db08e3 Staging: fbtft: Remove paragraph about writing to FSF
Remove paragraph about writing to the Free Software Foundation's
mailing address from GPL notice.
This patch fixes the following checkpatch error:

CHECK:FSF_MAILING_ADDRESS at line 17.

Signed-off-by: Fabio Falzoi <fabio.falzoi84@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-07-14 19:16:15 -07:00
Anton Gerasimov 38e127275f staging: fbtft: correct a typo in a comment
Typo in a comment to register write corrected.

Signed-off-by: Anton Gerasimov <anton.gerasimov@openmailbox.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-13 14:50:11 -07:00
Anton Gerasimov 6684d0c4c8 staging: fbtft: reformat hardcoded sequences
Added spaces after commas in initialization sequences and removed
unnecessary line continuations.

Signed-off-by: Anton Gerasimov <anton.gerasimov@openmailbox.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-13 14:50:11 -07:00
Anton Gerasimov 9026b5d5af staging: fbtft: rearrange comments for readability
Placed comments to register writes before the function calls to
eliminate long strings and make code more readable.

Signed-off-by: Anton Gerasimov <anton.gerasimov@openmailbox.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-13 14:50:11 -07:00
Anton Gerasimov bc573c5131 staging: fbtft: eliminate code duplication
Eliminated code duplication when searching for a display.

Signed-off-by: Anton Gerasimov <anton.gerasimov@openmailbox.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-13 14:50:10 -07:00
Anton Gerasimov 8e56b95551 staging: fbtft: remove unnecessary spaces before tabs
The patch removes spaces before tabs so that checkpatch.pl is content.

Signed-off-by: Anton Gerasimov <anton.gerasimov@openmailbox.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-13 14:50:10 -07:00
Anton Gerasimov 6c604d6657 staging: fbtft: remove unnecessary line continuations
Removed unnecessary line continuations in several lines.

Signed-off-by: Anton Gerasimov <anton.gerasimov@openmailbox.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-13 14:50:10 -07:00
Anton Gerasimov 56cda8acd7 staging: fbtft: make module descriptions greppable
Split module description strings are merged for searchability.

Signed-off-by: Anton Gerasimov <anton.gerasimov@openmailbox.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-13 14:48:26 -07:00
Anton Gerasimov c26c5e739e staging: fbtft: replace spaces with tabs
Indentation with spaces fixed.

Signed-off-by: Anton Gerasimov <anton.gerasimov@openmailbox.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-13 14:48:26 -07:00
Anton Gerasimov 1e6acab05c staging: fbtft: put spaces around assignment operators
Put spaces around assignment operators for readability.

Signed-off-by: Anton Gerasimov <anton.gerasimov@openmailbox.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-13 14:48:26 -07:00
Anton Gerasimov 3c588452c2 staging: fbtft: split long strings
Split long function declarations, function calls, comments etc.

Signed-off-by: Anton Gerasimov <anton.gerasimov@openmailbox.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-13 14:48:26 -07:00
Sudip Mukherjee 11f2323ad3 staging: fbtft: fix build error
while building on i386 it gives a build warning about msg undeclared.

Fixes: e6ffd1ba55 ("staging: fbtft: fix out of bound access")
Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-09 10:37:52 -07:00
Sudip Mukherjee e6ffd1ba55 staging: fbtft: fix out of bound access
str was 16 bytes but was mentioned as 128 in snprintf.
again msg is 128 bytes but not sufficient to hold the complete debug
message of register values.
Now removed the use of str, msg and print the register values from the
loop.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-08 13:22:45 -07:00
Madhusudhanan Ravindran b38c760ab0 staging: fbtft: replace fbtft_dev_dbg with standard dev_dbg call
This patch attempts to simplify the debugging using standard
dev_dbg call so that individual debug prints can be enabled or
disbled by dynamic debugging rather than using module params.

Signed-off-by: Madhusudhanan Ravindran <mravindr@visteon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-08 13:21:37 -07:00
Heiner Kallweit 9cd491e8c3 staging: fbtft: Add support for Himax HX8357D controller
The Himax HX8357D is used e.g. by the Adafruit PITFT Plus 3.5".
Adafruit added HX8357D support to an own fork of fbtft and support
Raspbian only (https://github.com/adafruit/adafruit-rpi-fbtft/).
They don't intend to push it upstream but gave me the ok to do so.
Original author: Sean Cross <xobs@kosagi.com>

I just applied small changes to the driver to align it with the other
fbtft drivers.
- add "compatible" argument to FBTFT_REGISTER_DRIVER call
- add missing MODULE_ALIAS declarations

Tested successfully with this display on an RPI2 under Arch Linux ARM
(kernel 3.18.13).

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-01 06:26:30 +09:00
Carlos E. Garcia 69e98df782 Staging: fixed multiple spelling errors.
Fixed multiple spelling errors.

Signed-off-by: Carlos E. Garcia <carlos@cgarcia.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-08 09:23:58 +02:00
Tolga Ceylan 02eb884f4e drivers: staging: fbtft: fbtft-bus.c: Fix different address space warning on I/O mem
To fix sparse warning of incorrect type in assignment
(different address space), added annotation __iomem to
vmem8 and modified direct reads with ioread8().

Signed-off-by: Tolga Ceylan <tolga.ceylan@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-08 09:23:58 +02:00
Nicolas Iooss 27cbc73aac Staging: fbtft: fix header guard typo
drivers/staging/fbtft/internal.h header guard tests for
__LINUX_FBTFT__INTERNAL_H but then defines __LINUX_FBTFT_INTERNAL_H
(only 1 underscore) and uses the same name for the #endif comment.
Use the same name everywhere.

Signed-off-by: Nicolas Iooss <nicolas.iooss_linux@m4x.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-04-30 16:51:21 +02:00
Geert Uytterhoeven 8e1a4c7f71 staging: fbtft: Disable DMA support if DMA is not available
If NO_DMA=y:

    drivers/built-in.o: In function `fbtft_framebuffer_alloc':
    (.text+0xb53cae): undefined reference to `dmam_alloc_coherent'

As DMA support is already optional, make it depend on HAS_DMA.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-04-30 16:51:21 +02:00
Charlie Wong Super a94ac1590b staging: fbtft: Add a blank line after declarations
scripts/checkpatch.pl WARNING: Missing a blank line after declarations

Signed-off-by: Charlie Wong Super <1213charlie@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-04-30 16:39:44 +02:00
Charlie Wong Super afe11f108a staging: fbtft: Replace spaces to tab
Spaces at the start of the line, replace the leading space to tabs

Signed-off-by: Charlie Wong Super <1213charlie@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-04-30 16:39:44 +02:00
Masanari Iida 92def781ee staging: fbtft: Fix typo in fbtft
This patch fix spelling typo in comment and printk within fbtft

Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-26 13:07:29 +01:00
Cláudio Maia 4178549e4c Staging: fbtft: fb_pcd8544: Fix comments style
This patch fixes the following errors by refactoring the comments'
style:

WARNING: line over 80 characters
ERROR: code indent should use tabs where possible

Signed-off-by: Cláudio Maia <crrm@isep.ipp.pt>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-26 13:06:54 +01:00
Cláudio Maia 14cf23b155 Staging: fbtft: fb_pcd8544: Fix warning line over 80 characters
This patch fixes the following checkpatch warning:

WARNING: line over 80 characters

Signed-off-by: Cláudio Maia <crrm@isep.ipp.pt>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-26 13:06:54 +01:00
Kozhevnikov Anatoly 3b143b5503 staging: fbtft: Add support for ili9163 controller
Driver for ili9163-based displays (for example: Nokia 5110)

Signed-off-by: Kozhevnikov Anatoly <shilo.xyz@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-26 13:06:54 +01:00
Helen Fornazier 4ebe6f46cb staging: fbtft: Remove do {} while(0) in single statement macro
This patch fixes the checkpatch.pl warning:

WARNING: Single statement macros should not use a do {} while (0) loop
+#define write_reg(par, ...)                                              \
+do {                                                                     \
+       par->fbtftops.write_register(par, NUMARGS(__VA_ARGS__), __VA_ARGS__); \
+} while (0)

Signed-off-by: Helen Fornazier <helen.fornazier@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-26 10:40:31 +01:00
Helen Fornazier 1f5f636c77 staging: fbtft: Add space around '='
This patch fixes the checkpatch.pl error:

ERROR: spaces required around that '=' (ctx:VxV)
+                       sdev->bits_per_word=9;
                                           ^

Signed-off-by: Helen Fornazier <helen.fornazier@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-26 10:40:31 +01:00
Geert Uytterhoeven 153fe94641 staging: fbtft: Do not use binary constants
Gcc < 4.3 doesn't understand binary constants (0b*):

drivers/staging/fbtft/fbtft-sysfs.c:156:19: error: invalid suffix "b111" on integer constant
drivers/staging/fbtft/fb_hx8340bn.c:159:3: error: invalid suffix "b1111" on integer constant
drivers/staging/fbtft/fb_hx8340bn.c:159:11: error: invalid suffix "b1111" on integer constant
drivers/staging/fbtft/fb_hx8340bn.c:159:19: error: invalid suffix "b11111" on integer constant
drivers/staging/fbtft/fb_hx8340bn.c:159:28: error: invalid suffix "b1111" on integer constant
drivers/staging/fbtft/fb_hx8340bn.c:159:36: error: invalid suffix "b1111" on integer constant
drivers/staging/fbtft/fb_hx8340bn.c:159:44: error: invalid suffix "b1111" on integer constant
drivers/staging/fbtft/fb_hx8340bn.c:159:52: error: invalid suffix "b11111" on integer constant
drivers/staging/fbtft/fb_hx8340bn.c:160:3: error: invalid suffix "b111" on integer constant
...

Hence use hexadecimal constants (0x*) instead.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-24 23:06:56 +01:00
Helen Fornazier 42efd0016c staging: fbtft: Fix indentation style by space
This patch fixes the checkpatch.pl warning and error:

WARNING: please, no spaces at the start of a line

ERROR: code indent should use tabs where possible

Signed-off-by: Helen Fornazier <helen.fornazier@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-23 22:35:24 +01:00
Helen Fornazier c7d853268d staging: fbtft: remove trailing white space
Clean useless trailing white spaces

Signed-off-by: Helen Fornazier <helen.fornazier@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-23 22:35:24 +01:00
Peter Poklop f3e5df4348 Staging: fbtft: add declaration of non-static functions
This patch fixes these sparse warnings:
drivers/staging/fbtft/fbtft-sysfs.c:23:5: warning: symbol 'fbtft_gamma_parse_str' was not declared. Should it be static?
drivers/staging/fbtft/fbtft-sysfs.c:153:6: warning: symbol 'fbtft_expand_debug_value' was not declared. Should it be static?
drivers/staging/fbtft/fbtft-sysfs.c:209:6: warning: symbol 'fbtft_sysfs_init' was not declared. Should it be static?
drivers/staging/fbtft/fbtft-sysfs.c:216:6: warning: symbol 'fbtft_sysfs_exit' was not declared. Should it be static?

Signed-off-by: Peter Poklop <peter.poklop@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-20 13:54:50 +01:00
Ravindran, Madhusudhanan (M.) 6a938a8cef staging: fbtft: Fix potential null dereference
This error is found by smatch tool.

Signed-off-by: Madhusudhanan Ravindran <mravindr@visteon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-20 13:54:50 +01:00
Madhusudhanan Ravindran aa5735f139 staging: fbtft: Use kmemdup rather than duplicating its implementation
The semantic patch that makes this change is available
in scriptcoccinelle/api/memdup.cocci.

Signed-off-by: Madhusudhanan Ravindran <mravindran04@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-20 13:54:45 +01:00
Vatika Harlalka afbd19eea3 Staging: fbtft: Remove unnecessary print messages
These print functions are called at the beginning
of the function and do not indicate any abnormal condition.

Signed-off-by: Vatika Harlalka <vatikaharlalka@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-16 16:20:49 +01:00
Aya Mahfouz b30367c086 staging: fbtft: fbtft_device.c: remove extra parentheses around function arguments
Removes extra parentheses around function arguments. Issue
detected and resolved using the following coccinelle script:

@@
expression e;
identifier f;
@@

f(...,
-(
e
-)
,...)

Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-15 18:41:13 +01:00
Aya Mahfouz 248d828514 staging: fbtft: fbtft-io.c: remove extra parentheses around function arguments
Removes extra parentheses around function arguments. Issue
detected and resolved using the following coccinelle script:

@@
expression e;
identifier f;
@@

f(...,
-(
e
-)
,...)

Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-15 18:41:13 +01:00
Aya Mahfouz 0401b42d8b staging: fbtft: fb_st7735r.c: remove extra parentheses around function arguments
Removes extra parentheses around function arguments. Issue
detected and resolved using the following coccinelle script:

@@
expression e;
identifier f;
@@

f(...,
-(
e
-)
,...)

Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-15 18:41:13 +01:00
Aya Mahfouz 6e686d777d staging: fbtft: fb_s6d02a1.c: remove extra parentheses around function arguments
Removes extra parentheses around function arguments. Issue
detected and resolved using the following coccinelle script:

@@
expression e;
identifier f;
@@

f(...,
-(
e
-)
,...)

Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-15 18:41:13 +01:00
Aya Mahfouz 53ce1c05cc staging: fbtft: fb_hx8353d.c: remove extra parentheses around function arguments
Removes extra parentheses around function arguments. Issue
detected and resolved using the following coccinelle script:

@@
expression e;
identifier f;
@@

f(...,
-(
e
-)
,...)

Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-15 18:41:12 +01:00
Aya Mahfouz 721bc827d4 staging: fbtft: fb_hx8340bn.c: remove extra parentheses around function arguments
Removes extra parentheses around function arguments. Issue
detected and resolved using the following coccinelle script:

@@
expression e;
identifier f;
@@

f(...,
-(
e
-)
,...)

Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-15 18:41:12 +01:00
Aya Mahfouz 6b38452785 staging: fbtft: fb_agm1264k-fl.c: remove extra parentheses around function arguments
Removes extra parentheses around function arguments. Issue
detected and resolved using the following coccinelle script:

@@
expression e;
identifier f;
@@

f(...,
-(
e
-)
,...)

Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-15 18:41:12 +01:00