Skip to content

Commit 9684607

Browse files
committed
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
2 parents 5cc4671 + f8d76c2 commit 9684607

File tree

2 files changed

+20
-4
lines changed

2 files changed

+20
-4
lines changed

drivers/gpio/gpio-mmio.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -619,8 +619,6 @@ int bgpio_init(struct gpio_chip *gc, struct device *dev,
619619
ret = gpiochip_get_ngpios(gc, dev);
620620
if (ret)
621621
gc->ngpio = gc->bgpio_bits;
622-
else
623-
gc->bgpio_bits = roundup_pow_of_two(round_up(gc->ngpio, 8));
624622

625623
ret = bgpio_setup_io(gc, dat, set, clr, flags);
626624
if (ret)

drivers/gpio/gpiolib-of.c

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,24 @@ static void of_gpio_try_fixup_polarity(const struct device_node *np,
202202
* helper, and be consistent with what other drivers do.
203203
*/
204204
{ "qi,lb60", "rb-gpios", true },
205+
#endif
206+
#if IS_ENABLED(CONFIG_PCI_LANTIQ)
207+
/*
208+
* According to the PCI specification, the RST# pin is an
209+
* active-low signal. However, most of the device trees that
210+
* have been widely used for a long time incorrectly describe
211+
* reset GPIO as active-high, and were also using wrong name
212+
* for the property.
213+
*/
214+
{ "lantiq,pci-xway", "gpio-reset", false },
215+
#endif
216+
#if IS_ENABLED(CONFIG_TOUCHSCREEN_TSC2005)
217+
/*
218+
* DTS for Nokia N900 incorrectly specified "active high"
219+
* polarity for the reset line, while the chip actually
220+
* treats it as "active low".
221+
*/
222+
{ "ti,tsc2005", "reset-gpios", false },
205223
#endif
206224
};
207225
unsigned int i;
@@ -504,9 +522,9 @@ static struct gpio_desc *of_find_gpio_rename(struct device_node *np,
504522
{ "reset", "reset-n-io", "marvell,nfc-uart" },
505523
{ "reset", "reset-n-io", "mrvl,nfc-uart" },
506524
#endif
507-
#if !IS_ENABLED(CONFIG_PCI_LANTIQ)
525+
#if IS_ENABLED(CONFIG_PCI_LANTIQ)
508526
/* MIPS Lantiq PCI */
509-
{ "reset", "gpios-reset", "lantiq,pci-xway" },
527+
{ "reset", "gpio-reset", "lantiq,pci-xway" },
510528
#endif
511529

512530
/*

0 commit comments

Comments
 (0)