gpio fixes for v6.10-rc7

- add two OF lookup quirks for TSC2005 and MIPS Lantiq
 - don't try to figure out bgpio_bits from the "ngpios" property in gpio-mmio
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEFp3rbAvDxGAT0sefEacuoBRx13IFAmaH/YEACgkQEacuoBRx
 13KYAQ/9HKJvGoca6VqWUoasxDpa8tKsb9ApRDz4b503q8nyXz85CJm4Kaf28T+8
 +4LBbXrcKoelENiz0JUyT0jq/di8GevcQEgQHgqJDKd7hppEEIyrCfpbDFka6Flb
 /hbm5M486Q7W3lkZ3oUU7DnuZq8xymALJr4xhhKh7wgNa7Cwot65qQw4aGyOnx8K
 xfQaFkDM5GZqPKcI7nPvLQSn5rjcI472YTWX/vmJ9hV1iJcmJVfZEMp4dpwsdVQm
 OrkqCy2dbrCn9l6eZA+TYaxq8qlFG5UxRI1ynm8VaUw7BehwUv+ZmQA61APtlyLg
 B3AzEpvQEGPqfmXoM4sam4ofq07ivF23/nynNcLPDIz9e9Qle3MSWcD3BPj03PKC
 Jx5QvE1lxSXfxhB4F69p0xM4+/S4vuV00dZDFQybWn49P9pILbdJobAh+C8aNzsZ
 ZsuVtie7732lyQ6IFppUcABUTRyf1dlCRcDT53VEYCojGIr/9vWbRB8ja5WrGhN5
 wXIo3wqGPwmb+4UaMQTXc3NCTCk1HmZKxcanXQep7j8aGit00c/Gy7EPx8LRiTrx
 QMHUnvV9Ghi1F364r0ptby99NnOfFRGIr1Go+QsGvtcqnPL+OaMinpfDfFsbSTfD
 bxNdaO7x1k/VA7kAAQA/eFNhm6n+quhzrDJDi8stYojong2gztI=
 =eXnz
 -----END PGP SIGNATURE-----

Merge tag 'gpio-fixes-for-v6.10-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux

Pull gpio fixes from Bartosz Golaszewski:
 "Two OF lookup quirks and one fix for an issue in the generic gpio-mmio
  driver:

   - add two OF lookup quirks for TSC2005 and MIPS Lantiq

   - don't try to figure out bgpio_bits from the 'ngpios' property in
     gpio-mmio"

* tag 'gpio-fixes-for-v6.10-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux:
  gpiolib: of: add polarity quirk for TSC2005
  gpio: mmio: do not calculate bgpio_bits via "ngpios"
  gpiolib: of: fix lookup quirk for MIPS Lantiq
This commit is contained in:
Linus Torvalds 2024-07-05 11:39:30 -07:00
commit 968460731f
2 changed files with 20 additions and 4 deletions

View file

@ -619,8 +619,6 @@ int bgpio_init(struct gpio_chip *gc, struct device *dev,
ret = gpiochip_get_ngpios(gc, dev); ret = gpiochip_get_ngpios(gc, dev);
if (ret) if (ret)
gc->ngpio = gc->bgpio_bits; gc->ngpio = gc->bgpio_bits;
else
gc->bgpio_bits = roundup_pow_of_two(round_up(gc->ngpio, 8));
ret = bgpio_setup_io(gc, dat, set, clr, flags); ret = bgpio_setup_io(gc, dat, set, clr, flags);
if (ret) if (ret)

View file

@ -202,6 +202,24 @@ static void of_gpio_try_fixup_polarity(const struct device_node *np,
* helper, and be consistent with what other drivers do. * helper, and be consistent with what other drivers do.
*/ */
{ "qi,lb60", "rb-gpios", true }, { "qi,lb60", "rb-gpios", true },
#endif
#if IS_ENABLED(CONFIG_PCI_LANTIQ)
/*
* According to the PCI specification, the RST# pin is an
* active-low signal. However, most of the device trees that
* have been widely used for a long time incorrectly describe
* reset GPIO as active-high, and were also using wrong name
* for the property.
*/
{ "lantiq,pci-xway", "gpio-reset", false },
#endif
#if IS_ENABLED(CONFIG_TOUCHSCREEN_TSC2005)
/*
* DTS for Nokia N900 incorrectly specified "active high"
* polarity for the reset line, while the chip actually
* treats it as "active low".
*/
{ "ti,tsc2005", "reset-gpios", false },
#endif #endif
}; };
unsigned int i; unsigned int i;
@ -504,9 +522,9 @@ static struct gpio_desc *of_find_gpio_rename(struct device_node *np,
{ "reset", "reset-n-io", "marvell,nfc-uart" }, { "reset", "reset-n-io", "marvell,nfc-uart" },
{ "reset", "reset-n-io", "mrvl,nfc-uart" }, { "reset", "reset-n-io", "mrvl,nfc-uart" },
#endif #endif
#if !IS_ENABLED(CONFIG_PCI_LANTIQ) #if IS_ENABLED(CONFIG_PCI_LANTIQ)
/* MIPS Lantiq PCI */ /* MIPS Lantiq PCI */
{ "reset", "gpios-reset", "lantiq,pci-xway" }, { "reset", "gpio-reset", "lantiq,pci-xway" },
#endif #endif
/* /*