Skip to contentSkip to conversation

drm/omap: sharp ls037v7dw01: restore optional GPIOs

PATCH In review Russell King 3 participants 3 messages Dec 7, 2018

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/omap: sharp ls037v7dw01: restore optional GPIOs

The binding document for this device says that all GPIOs are optional, but the driver fails to bind on OMAP3 LDP, reporting:

panel-sharp-ls037v7dw01: probe of display failed with error -2

Unfortunately, commit ca8c67dafdb7 ("fbdev: omap2: improve usage of gpiod API") removed the -ENOENT handling without converting the gpiod function to use the optional variant, causing all GPIOs to become mandatory.

Since the LDP hard-wires some of the panel control signals, there are no GPIOs that could be specified in DT to satisfy this.

Switch the driver to use the devm_gpiod_get_index_optional() rather than devm_gpiod_get_index() to conform to its binding documentation.

Fixes ca8c67dafdb7 ("fbdev: omap2: improve usage of gpiod API")
---
 drivers/gpu/drm/omapdrm/displays/panel-sharp-ls037v7dw01.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/omapdrm/displays/panel-sharp-ls037v7dw01.c +1 -1
index 64b1369cb274..68f2f8d9c430 100644
@@ -151,7 +151,7 @@ static  int sharp_ls_get_gpio_of(struct device *dev, int index, int val,
 
 	*gpiod = NULL;
 
-	gd = devm_gpiod_get_index(dev, desc, index, GPIOD_OUT_LOW);
+	gd = devm_gpiod_get_index_optional(dev, desc, index, GPIOD_OUT_LOW);
 	if (IS_ERR(gd))
 		return PTR_ERR(gd);
 
Signature · 6 lines
2.7.4

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Acked-by on v1 1/1
#1 lore raw
Quoted 10 lines · Russell King

The binding document for this device says that all GPIOs are optional, but the driver fails to bind on OMAP3 LDP, reporting:

panel-sharp-ls037v7dw01: probe of display failed with error -2

Unfortunately, commit ca8c67dafdb7 ("fbdev: omap2: improve usage of gpiod API") removed the -ENOENT handling without converting the gpiod function to use the optional variant, causing all GPIOs to become mandatory.

Quoted 8 lines

Since the LDP hard-wires some of the panel control signals, there are no GPIOs that could be specified in DT to satisfy this.

Switch the driver to use the devm_gpiod_get_index_optional() rather than devm_gpiod_get_index() to conform to its binding documentation.

Fixes ca8c67dafdb7 ("fbdev: omap2: improve usage of gpiod API")

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Acked-by on v1 1/1
#2 lore raw
In reply to Russell King
Quoted 10 lines · Russell King

The binding document for this device says that all GPIOs are optional, but the driver fails to bind on OMAP3 LDP, reporting:

panel-sharp-ls037v7dw01: probe of display failed with error -2

Unfortunately, commit ca8c67dafdb7 ("fbdev: omap2: improve usage of gpiod API") removed the -ENOENT handling without converting the gpiod function to use the optional variant, causing all GPIOs to become mandatory.

Quoted 8 lines

Since the LDP hard-wires some of the panel control signals, there are no GPIOs that could be specified in DT to satisfy this.

Switch the driver to use the devm_gpiod_get_index_optional() rather than devm_gpiod_get_index() to conform to its binding documentation.

Fixes ca8c67dafdb7 ("fbdev: omap2: improve usage of gpiod API")

Right, it seems I missed that the GPIOs were optional before ca8c67dafdb7. Thanks for catching (and sorry for having to catch).

Best regards
Uwe

Signature · 6 lines
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel