Skip to contentSkip to conversation

backlight: hx8357: Convert to agnostic GPIO API

PATCH Superseded Andy Shevchenko 3 participants 5 messages Mar 17, 2023 – Jun 6, 2023

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 backlight: hx8357: Convert to agnostic GPIO API

The of_gpio.h is going to be removed. In preparation of that convert the driver to the agnostic API.

---
 drivers/gpio/gpiolib-of.c        |  4 +-
 drivers/video/backlight/hx8357.c | 74 ++++++++++----------------------
 2 files changed, 24 insertions(+), 54 deletions(-)
drivers/gpio/gpiolib-of.c +2 -2
index 1436cdb5fa26..cdd536a391be 100644
@@ -184,7 +184,7 @@ static void of_gpio_try_fixup_polarity(const struct device_node *np,
 		const char *propname;
 		bool active_high;
 	} gpios[] = {
-#if !IS_ENABLED(CONFIG_LCD_HX8357)
+#if IS_ENABLED(CONFIG_LCD_HX8357)
 		/*
 		 * Himax LCD controllers used incorrectly named
 		 * "gpios-reset" property and also specified wrong
@@ -452,7 +452,7 @@ static struct gpio_desc *of_find_gpio_rename(struct device_node *np,
 		 */
 		const char *compatible;
 	} gpios[] = {
-#if !IS_ENABLED(CONFIG_LCD_HX8357)
+#if IS_ENABLED(CONFIG_LCD_HX8357)
 		/* Himax LCD controllers used "gpios-reset" */
 		{ "reset",	"gpios-reset",	"himax,hx8357" },
 		{ "reset",	"gpios-reset",	"himax,hx8369" },
drivers/video/backlight/hx8357.c +22 -52

120 lines not on this page · raw message

Signature · 1 line
2.39.2
Reviewed-by on v1 1/1
#1 lore raw
Quoted 4 lines · Andy Shevchenko

The of_gpio.h is going to be removed. In preparation of that convert the driver to the agnostic API.

Thanks for fixing this Andy!

Quoted 6 lines
drivers/gpio/gpiolib-of.c +1 -1
-#if !IS_ENABLED(CONFIG_LCD_HX8357)
+#if IS_ENABLED(CONFIG_LCD_HX8357)
                /*
                 * Himax LCD controllers used incorrectly named
                 * "gpios-reset" property and also specified wrong

drivers/gpio/gpiolib-of.c static struct gpio_desc *of_find_gpio_rename(struct device_node *np, · line 458

Quoted 8 lines
drivers/gpio/gpiolib-of.c +1 -1
@@ -452,7 +452,7 @@ static struct gpio_desc *of_find_gpio_rename(struct device_node *np,
                 */
                const char *compatible;
        } gpios[] = {
-#if !IS_ENABLED(CONFIG_LCD_HX8357)
+#if IS_ENABLED(CONFIG_LCD_HX8357)
                /* Himax LCD controllers used "gpios-reset" */
                { "reset",      "gpios-reset",  "himax,hx8357" },
                { "reset",      "gpios-reset",  "himax,hx8369" },

Eh what happened here .. it's even intuitively wrong. I would add

Fixes fbbbcd177a27 ("gpiolib: of: add quirk for locating reset lines

with legacy bindings")

It wasn't used until now it seems so not a regression and no need for a separate patch.

Other than that it looks correct.

Yours,
Linus Walleij

#2 lore raw
Quoted 10 lines · Linus Walleij
Quoted 4 lines · Andy Shevchenko

The of_gpio.h is going to be removed. In preparation of that convert the driver to the agnostic API.

Thanks for fixing this Andy!

Quoted 16 lines
Quoted 6 lines
drivers/gpio/gpiolib-of.c +1 -1
-#if !IS_ENABLED(CONFIG_LCD_HX8357)
+#if IS_ENABLED(CONFIG_LCD_HX8357)
                /*
                 * Himax LCD controllers used incorrectly named
                 * "gpios-reset" property and also specified wrong

drivers/gpio/gpiolib-of.c static struct gpio_desc *of_find_gpio_rename(struct device_node *np, · line 458

Quoted 8 lines
drivers/gpio/gpiolib-of.c +1 -1
@@ -452,7 +452,7 @@ static struct gpio_desc *of_find_gpio_rename(struct device_node *np,
                 */
                const char *compatible;
        } gpios[] = {
-#if !IS_ENABLED(CONFIG_LCD_HX8357)
+#if IS_ENABLED(CONFIG_LCD_HX8357)
                /* Himax LCD controllers used "gpios-reset" */
                { "reset",      "gpios-reset",  "himax,hx8357" },
                { "reset",      "gpios-reset",  "himax,hx8369" },

Eh what happened here .. it's even intuitively wrong.

I believe it had to be something like

	#if 0 && IS_ENABLED()

to show that this change is for the future.
Currently it does something unneeded for the kernels with that option off.

Quoted 3 lines

I would add

Fixes fbbbcd177a27 ("gpiolib: of: add quirk for locating reset lines

with legacy bindings")

I'm not sure. But it's fine, I can add it. Just want to double confirm you really want this Fixes tag.

Quoted 2 lines

It wasn't used until now it seems so not a regression and no need for a separate patch.

Exactly why I'm not sure about the tag :-)

Quoted 2 lines

Other than that it looks correct.

Thank you!

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#3 lore raw
Quoted 45 lines · Andy Shevchenko
Quoted 10 lines · Linus Walleij
Quoted 4 lines · Andy Shevchenko

The of_gpio.h is going to be removed. In preparation of that convert the driver to the agnostic API.

Thanks for fixing this Andy!

Quoted 16 lines
Quoted 6 lines
drivers/gpio/gpiolib-of.c +1 -1
-#if !IS_ENABLED(CONFIG_LCD_HX8357)
+#if IS_ENABLED(CONFIG_LCD_HX8357)
                /*
                 * Himax LCD controllers used incorrectly named
                 * "gpios-reset" property and also specified wrong

drivers/gpio/gpiolib-of.c static struct gpio_desc *of_find_gpio_rename(struct device_node *np, · line 458

Quoted 8 lines
drivers/gpio/gpiolib-of.c +1 -1
@@ -452,7 +452,7 @@ static struct gpio_desc *of_find_gpio_rename(struct device_node *np,
                 */
                const char *compatible;
        } gpios[] = {
-#if !IS_ENABLED(CONFIG_LCD_HX8357)
+#if IS_ENABLED(CONFIG_LCD_HX8357)
                /* Himax LCD controllers used "gpios-reset" */
                { "reset",      "gpios-reset",  "himax,hx8357" },
                { "reset",      "gpios-reset",  "himax,hx8369" },

Eh what happened here .. it's even intuitively wrong.

I believe it had to be something like

	#if 0 && IS_ENABLED()

to show that this change is for the future.
Currently it does something unneeded for the kernels with that option off.

Quoted 3 lines

I would add

Fixes fbbbcd177a27 ("gpiolib: of: add quirk for locating reset lines

with legacy bindings")

I'm not sure. But it's fine, I can add it. Just want to double confirm you really want this Fixes tag.

Quoted 2 lines

It wasn't used until now it seems so not a regression and no need for a separate patch.

Quoted 6 lines

Exactly why I'm not sure about the tag :-)

Quoted 2 lines

Other than that it looks correct.

Thank you!

Lee, is anything I can do here to move this forward?

Signature · 2 lines
With Best Regards,
Andy Shevchenko
Reviewed-by
#4 lore raw
Quoted 46 lines · Andy Shevchenko
Quoted 45 lines · Andy Shevchenko
Quoted 10 lines · Linus Walleij
Quoted 4 lines · Andy Shevchenko

The of_gpio.h is going to be removed. In preparation of that convert the driver to the agnostic API.

Thanks for fixing this Andy!

Quoted 16 lines
Quoted 6 lines
drivers/gpio/gpiolib-of.c +1 -1
-#if !IS_ENABLED(CONFIG_LCD_HX8357)
+#if IS_ENABLED(CONFIG_LCD_HX8357)
                /*
                 * Himax LCD controllers used incorrectly named
                 * "gpios-reset" property and also specified wrong

drivers/gpio/gpiolib-of.c static struct gpio_desc *of_find_gpio_rename(struct device_node *np, · line 458

Quoted 8 lines
drivers/gpio/gpiolib-of.c +1 -1
@@ -452,7 +452,7 @@ static struct gpio_desc *of_find_gpio_rename(struct device_node *np,
                 */
                const char *compatible;
        } gpios[] = {
-#if !IS_ENABLED(CONFIG_LCD_HX8357)
+#if IS_ENABLED(CONFIG_LCD_HX8357)
                /* Himax LCD controllers used "gpios-reset" */
                { "reset",      "gpios-reset",  "himax,hx8357" },
                { "reset",      "gpios-reset",  "himax,hx8369" },

Eh what happened here .. it's even intuitively wrong.

I believe it had to be something like

	#if 0 && IS_ENABLED()

to show that this change is for the future.
Currently it does something unneeded for the kernels with that option off.

Quoted 3 lines

I would add

Fixes fbbbcd177a27 ("gpiolib: of: add quirk for locating reset lines

with legacy bindings")

I'm not sure. But it's fine, I can add it. Just want to double confirm you really want this Fixes tag.

Quoted 2 lines

It wasn't used until now it seems so not a regression and no need for a separate patch.

Quoted 8 lines
Quoted 6 lines

Exactly why I'm not sure about the tag :-)

Quoted 2 lines

Other than that it looks correct.

Thank you!

Lee, is anything I can do here to move this forward?

Backlight code looks OK to me (although I might regard the Fixes:
discussion as unresolved)there is an unresolved):

Daniel.