History log of /linux-master/drivers/staging/fbtft/fb_s6d1121.c
Revision Date Author Comments
# ec03c210 03-May-2021 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

staging: fbtft: Rectify GPIO handling

The infamous commit c440eee1a7a1 ("Staging: staging: fbtft: Switch to
the GPIO descriptor interface") broke GPIO handling completely.
It has already four commits to rectify and it seems not enough.
In order to fix the mess here we:

1) Set default to "inactive" for all requested pins

2) Fix CS#, RD#, and WR# pins polarity since it's active low
and GPIO descriptor interface takes it into consideration
from the Device Tree or ACPI

3) Consolidate chip activation (CS# assertion) under default
->reset() callback

To summarize the expectations about polarity for GPIOs:

RD# Low
WR# Low
CS# Low
RESET# Low
DC or RS High
RW High
Data 0 .. 15 High

See also Adafruit learning course [1] for the example of the schematics.

While at it, drop unneeded NULL checks, since GPIO API is tolerant to that.

[1]: https://learn.adafruit.com/adafruit-2-8-and-3-2-color-tft-touchscreen-breakout-v2/downloads

Fixes: 92e3e884887c ("Staging: fbtft: Fix GPIO handling")
Fixes: b918d1c27066 ("Staging: fbtft: Fix reset assertion when using gpio descriptor")
Fixes: dbc4f989c878 ("Staging: fbtft: Fix probing of gpio descriptor")
Fixes: c440eee1a7a1 ("Staging: fbtft: Switch to the gpio descriptor interface")
Cc: Jan Sebastian Götte <linux@jaseg.net>
Cc: Nishad Kamdar <nishadkamdar@gmail.com>
Reviewed-by: Phil Reid <preid@electromag.com.au>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20210503172114.27891-2-andriy.shevchenko@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 64e9c200 06-Sep-2019 Colin Ian King <colin.king@canonical.com>

staging: fbtft: make several arrays static const, makes object smaller

Don't populate the arrays on the stack but instead make them
static const. Makes the object code smaller by 1329 bytes.

Before:
text data bss dec hex filename
5581 1488 64 7133 1bdd drivers/staging/fbtft/fb_hx8340bn.o
5444 1264 0 6708 1a34 drivers/staging/fbtft/fb_hx8347d.o
3581 1360 0 4941 134d drivers/staging/fbtft/fb_ili9163.o
7154 1552 0 8706 2202 drivers/staging/fbtft/fb_ili9320.o
7478 2544 0 10022 2726 drivers/staging/fbtft/fb_ili9325.o
6327 1424 0 7751 1e47 drivers/staging/fbtft/fb_s6d1121.o
6498 1776 0 8274 2052 drivers/staging/fbtft/fb_ssd1289.o

After:
text data bss dec hex filename
5376 1584 64 7024 1b70 drivers/staging/fbtft/fb_hx8340bn.o
5276 1328 0 6604 19cc drivers/staging/fbtft/fb_hx8347d.o
3581 1360 0 4941 134d drivers/staging/fbtft/fb_ili9163.o
6905 1616 0 8521 2149 drivers/staging/fbtft/fb_ili9320.o
7229 2608 0 9837 266d drivers/staging/fbtft/fb_ili9325.o
6030 1488 0 7518 1d5e drivers/staging/fbtft/fb_s6d1121.o
6249 1872 0 8121 1fb9 drivers/staging/fbtft/fb_ssd1289.o

(gcc version 9.2.1, amd64)

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20190906153052.31846-1-colin.king@canonical.com


# 5817eca0 06-Sep-2019 Colin Ian King <colin.king@canonical.com>

staging: fbtft: make several arrays static const, makes object smaller

Don't populate the arrays on the stack but instead make them
static const. Makes the object code smaller by 1329 bytes.

Before:
text data bss dec hex filename
5581 1488 64 7133 1bdd drivers/staging/fbtft/fb_hx8340bn.o
5444 1264 0 6708 1a34 drivers/staging/fbtft/fb_hx8347d.o
3581 1360 0 4941 134d drivers/staging/fbtft/fb_ili9163.o
7154 1552 0 8706 2202 drivers/staging/fbtft/fb_ili9320.o
7478 2544 0 10022 2726 drivers/staging/fbtft/fb_ili9325.o
6327 1424 0 7751 1e47 drivers/staging/fbtft/fb_s6d1121.o
6498 1776 0 8274 2052 drivers/staging/fbtft/fb_ssd1289.o

After:
text data bss dec hex filename
5376 1584 64 7024 1b70 drivers/staging/fbtft/fb_hx8340bn.o
5276 1328 0 6604 19cc drivers/staging/fbtft/fb_hx8347d.o
3581 1360 0 4941 134d drivers/staging/fbtft/fb_ili9163.o
6905 1616 0 8521 2149 drivers/staging/fbtft/fb_ili9320.o
7229 2608 0 9837 266d drivers/staging/fbtft/fb_ili9325.o
6030 1488 0 7518 1d5e drivers/staging/fbtft/fb_s6d1121.o
6249 1872 0 8121 1fb9 drivers/staging/fbtft/fb_ssd1289.o

(gcc version 9.2.1, amd64)

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Link: https://lore.kernel.org/r/20190906153052.31846-1-colin.king@canonical.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 92e3e884 17-Jul-2019 Jan Sebastian Götte <linux@jaseg.net>

Staging: fbtft: Fix GPIO handling

Commit c440eee1a7a1 ("Staging: fbtft: Switch to the gpio descriptor
interface") breaks GPIO handling. In several places, checks to only set
a GPIO if it was configured ended up backwards.
I have tested this fix. The fixed driver works with a ili9486
display connected to a raspberry pi via SPI.

Fixes: c440eee1a7a1d ("Staging: fbtft: Switch to the gpio descriptor interface")
Tested-by: Jan Sebastian Götte <linux@jaseg.net>
Reviewed-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
Signed-off-by: Jan Sebastian Götte <linux@jaseg.net>
Link: https://lore.kernel.org/r/75ada52f-afa1-08bc-d0ce-966fc1110e70@jaseg.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# c440eee1 16-Jan-2019 Nishad Kamdar <nishadkamdar@gmail.com>

Staging: fbtft: Switch to the gpio descriptor interface

This switches the fbtft driver to use GPIO descriptors
rather than numerical gpios:

Utilize the GPIO library's intrinsic handling of OF GPIOs
and polarity. If the line is flagged active low, gpiolib
will deal with this.

Remove gpios from platform device structure. Neither assign
statically numbers to gpios in platform device nor allow
gpios to be parsed as module parameters.

Signed-off-by: Nishad Kamdar <nishadkamdar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# c21cbb5e 07-Aug-2018 Leonardo Brás <leobras.c@gmail.com>

staging: fbtft: Adjust some empty-line problems - Style

Erases some blank lines.

Signed-off-by: Leonardo Brás <leobras.c@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 0b1533c6 07-Aug-2018 Leonardo Brás <leobras.c@gmail.com>

staging: fbtft: Puts macro arguments in parenthesis to avoid precedence issues - Style

Puts macro arguments in parenthesis to avoid precedence issues.
Some large lines were broken to fit the 80-char limit.

Signed-off-by: Leonardo Brás <leobras.c@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 78c00ccc 11-Jan-2018 Greg Kroah-Hartman <gregkh@linuxfoundation.org>

staging: fbtft: remove redundant license text

Now that the SPDX tag is in all fbtft files, that identifies the license
in a specific and legally-defined manner. So the extra GPL text wording
can be removed as it is no longer needed at all.

This is done on a quest to remove the 700+ different ways that files in
the kernel describe the GPL license text. And there's unneeded stuff
like the address (sometimes incorrect) for the FSF which is never
needed.

No copyright headers or other non-license-description text was removed.

Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 783de57c 11-Jan-2018 Greg Kroah-Hartman <gregkh@linuxfoundation.org>

staging: fbtft: add SPDX identifiers

It's good to have SPDX identifiers in all files to make it easier to
audit the kernel tree for correct licenses.

Fix up the all of the staging fbtft drivers to have a proper SPDX
identifier, based on the license text in the file itself. The SPDX
identifier is a legally binding shorthand, which can be used instead of
the full boiler plate text.

This work is based on a script and data from Thomas Gleixner, Philippe
Ombredanne, and Kate Stewart.

Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Kate Stewart <kstewart@linuxfoundation.org>
Cc: Philippe Ombredanne <pombredanne@nexb.com>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 22eb36b8 02-Feb-2017 Arnd Bergmann <arnd@arndb.de>

staging: fbtft: change 'gamma' array to u32

Having a local variable of 1024 bytes on 64-bit architectures is a bit
too much, and I ran into this warning while trying to see what functions
use the largest stack:

drivers/staging/fbtft/fbtft-sysfs.c: In function 'store_gamma_curve':
drivers/staging/fbtft/fbtft-sysfs.c:132:1: warning: the frame size of 1032 bytes is larger than 1024 bytes [-Wframe-larger-than=]

As there is no need for 64-bit gamma values (on 32-bit architectures,
we don't use those either), I'm changing the type from 'unsigned long'
to 'u32' here, which cuts the required space in half everywhere.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# a40fe155 25-Aug-2016 Anson Jacob <ansonjacob.aj@gmail.com>

staging: fbtft: fb_s6d1121.c: Fix checkpatch warning

Fix checkpatch.pl warning:
Block comments use * on subsequent lines

Signed-off-by: Anson Jacob <ansonjacob.aj@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 64ffdc38 21-Sep-2015 Shraddha Barke <shraddha.6596@gmail.com>

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>


# 94c0a544 03-Sep-2015 Anish Bhatt <anish7@gmail.com>

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>


# 1014c2ce 03-Sep-2015 Anish Bhatt <anish7@gmail.com>

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>


# e7322187 03-Sep-2015 Anish Bhatt <anish7@gmail.com>

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>


# 4a1a8383 02-Sep-2015 Anish Bhatt <anish7@gmail.com>

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>


# 153fe946 20-Mar-2015 Geert Uytterhoeven <geert@linux-m68k.org>

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>


# e469616b 25-Feb-2015 Yeliz Taneroglu <yeliztaneroglu@gmail.com>

Staging: fbtft: removed trailing whitespace

The following patch fixes the checkpatch.pl warning:
Removed all trailing whitespace in fb_s6d1121.c

Signed-off-by: Yeliz Taneroglu <yeliztaneroglu@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 7a39e965 31-Dec-2014 Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

staging: fbtft: add fb_s6d1121 driver

This commit adds the fb_s6d1121 driver from the fbtft project at
https://github.com/notro/fbtft.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Noralf Tronnes <notro@tronnes.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>