linux-stable/drivers/staging
Andy Shevchenko fbe80b3ee9 staging: fbtft: Rectify GPIO handling
[ Upstream commit ec03c21043 ]

The infamous commit c440eee1a7 ("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: 92e3e88488 ("Staging: fbtft: Fix GPIO handling")
Fixes: b918d1c270 ("Staging: fbtft: Fix reset assertion when using gpio descriptor")
Fixes: dbc4f989c8 ("Staging: fbtft: Fix probing of gpio descriptor")
Fixes: c440eee1a7 ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-07-14 16:53:36 +02:00
..
android
axis-fifo
board
clocking-wizard
comedi staging: comedi: cb_pcidas64: fix request_irq() warn 2021-04-07 14:47:40 +02:00
emxx_udc staging: emxx_udc: fix loop in _nbu2ss_nuke() 2021-06-03 08:59:15 +02:00
exfat exfat: Month timestamp metadata accidentally incremented 2021-01-17 14:05:34 +01:00
fbtft staging: fbtft: Rectify GPIO handling 2021-07-14 16:53:36 +02:00
fieldbus
fsl-dpaa2
fwserial staging: fwserial: fix TIOCSSERIAL permission check 2021-05-14 09:44:11 +02:00
gasket
gdm724x staging: gdm724x: Fix DMA from stack 2021-03-04 10:26:46 +01:00
goldfish
greybus staging: greybus: uart: fix unprivileged TIOCCSERIAL 2021-05-14 09:44:20 +02:00
gs_fpgaboot
iio staging: iio: cdc: ad7746: avoid overwrite of num_channels 2021-06-03 08:59:04 +02:00
isdn
kpc2000
ks7010 staging: ks7010: prevent buffer overflow in ks_wlan_set_scan() 2021-03-17 17:03:53 +01:00
media media: imx-csi: Skip first few frames from a BT.656 source 2021-07-14 16:53:14 +02:00
most staging: most: sound: add sanity check for function argument 2021-03-07 12:20:45 +01:00
mt7621-dma staging/mt7621-dma: mtk-hsdma.c->hsdma-mt7621.c 2021-03-04 10:26:46 +01:00
mt7621-dts
mt7621-pci
mt7621-pci-phy
mt7621-pinctrl pinctrl: ralink: rt2880: avoid to error in calls is pin is already enabled 2021-06-23 14:41:27 +02:00
netlogic
nvec
octeon
octeon-usb
olpc_dcon
pi433
qlge
ralink-gdma
rtl8188eu staging: rtl8188eu: fix potential memory corruption in rtw_check_beacon_data() 2021-03-17 17:03:53 +01:00
rtl8192e staging: rtl8192e: Change state information from u16 to u8 2021-04-07 14:47:44 +02:00
rtl8192u staging: rtl8192u: Fix potential infinite loop 2021-05-14 09:44:20 +02:00
rtl8712 staging: rtl8712: Fix possible buffer overflow in r8712_sitesurvey_cmd 2021-03-17 17:03:54 +01:00
rtl8723bs staging: rtl8723bs: Fix uninitialized variables 2021-06-16 11:59:39 +02:00
rts5208
sm750fb
speakup
unisys
uwb
vc04_services staging: bcm2835-audio: Replace unsafe strcpy() with strscpy() 2021-03-07 12:20:45 +01:00
vme
vt6655
vt6656
wilc1000
wlan-ng
wusbcore
Kconfig
Makefile