Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mtd: rawnand: ingenic: move the GPIO quirk to gpiolib-of.c

We have a special place for OF polarity quirks in gpiolib-of.c. Let's
move this over there so that it doesn't pollute the driver.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Miquel Raynal <miquel.raynal@bootlin.com>
Acked-by: Paul Cercueil <paul@crapouillou.net>
Reviewed-by: Andy Shevchenko <andy@kernel.org>

+9 -12
+9
drivers/gpio/gpiolib-of.c
··· 192 192 */ 193 193 { "himax,hx8357", "gpios-reset", false }, 194 194 { "himax,hx8369", "gpios-reset", false }, 195 + /* 196 + * The rb-gpios semantics was undocumented and qi,lb60 (along with 197 + * the ingenic driver) got it wrong. The active state encodes the 198 + * NAND ready state, which is high level. Since there's no signal 199 + * inverter on this board, it should be active-high. Let's fix that 200 + * here for older DTs so we can re-use the generic nand_gpio_waitrdy() 201 + * helper, and be consistent with what other drivers do. 202 + */ 203 + { "qi,lb60", "rb-gpios", true }, 195 204 #endif 196 205 }; 197 206 unsigned int i;
-12
drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c
··· 380 380 return ret; 381 381 } 382 382 383 - /* 384 - * The rb-gpios semantics was undocumented and qi,lb60 (along with 385 - * the ingenic driver) got it wrong. The active state encodes the 386 - * NAND ready state, which is high level. Since there's no signal 387 - * inverter on this board, it should be active-high. Let's fix that 388 - * here for older DTs so we can re-use the generic nand_gpio_waitrdy() 389 - * helper, and be consistent with what other drivers do. 390 - */ 391 - if (of_machine_is_compatible("qi,lb60") && 392 - gpiod_is_active_low(nand->busy_gpio)) 393 - gpiod_toggle_active_low(nand->busy_gpio); 394 - 395 383 nand->wp_gpio = devm_gpiod_get_optional(dev, "wp", GPIOD_OUT_LOW); 396 384 397 385 if (IS_ERR(nand->wp_gpio)) {