Skip to contentSkip to conversation

backlight: rave-sp: don't touch initial state and register with correct device

PATCH Applied Lucas Stach 3 participants 3 messages Jul 8, 2019 – Jul 25, 2019

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

PATCH v2 1/1 backlight: rave-sp: don't touch initial state and register with correct device

This way the backlight can be referenced through its device node and enabling/disabling can be managed through the panel driver.

---
 drivers/video/backlight/rave-sp-backlight.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
drivers/video/backlight/rave-sp-backlight.c +8 -2
index 462f14a1b19d..05b5f003a3d1 100644
@@ -48,14 +48,20 @@ static int rave_sp_backlight_probe(struct platform_device *pdev)
 	struct device *dev = &pdev->dev;
 	struct backlight_device *bd;
 
-	bd = devm_backlight_device_register(dev, pdev->name, dev->parent,
+	bd = devm_backlight_device_register(dev, pdev->name, dev,
 					    dev_get_drvdata(dev->parent),
 					    &rave_sp_backlight_ops,
 					    &rave_sp_backlight_props);
 	if (IS_ERR(bd))
 		return PTR_ERR(bd);
 
-	backlight_update_status(bd);
+	/*
+	 * If there is a phandle pointing to the device node we can
+	 * assume that another device will manage the status changes.
+	 * If not we make sure the backlight is in a consistent state.
+	 */
+	if (!dev->of_node->phandle)
+		backlight_update_status(bd);
 
 	return 0;
 }
Signature · 6 lines
2.20.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Reviewed-by on v2 1/1
#1 lore raw
Quoted 4 lines · Lucas Stach

This way the backlight can be referenced through its device node and enabling/disabling can be managed through the panel driver.

Quoted 34 lines
---
 drivers/video/backlight/rave-sp-backlight.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
drivers/video/backlight/rave-sp-backlight.c +8 -2
index 462f14a1b19d..05b5f003a3d1 100644
@@ -48,14 +48,20 @@ static int rave_sp_backlight_probe(struct platform_device *pdev)
 	struct device *dev = &pdev->dev;
 	struct backlight_device *bd;
 
-	bd = devm_backlight_device_register(dev, pdev->name, dev->parent,
+	bd = devm_backlight_device_register(dev, pdev->name, dev,
 					    dev_get_drvdata(dev->parent),
 					    &rave_sp_backlight_ops,
 					    &rave_sp_backlight_props);
 	if (IS_ERR(bd))
 		return PTR_ERR(bd);
 
-	backlight_update_status(bd);
+	/*
+	 * If there is a phandle pointing to the device node we can
+	 * assume that another device will manage the status changes.
+	 * If not we make sure the backlight is in a consistent state.
+	 */
+	if (!dev->of_node->phandle)
+		backlight_update_status(bd);
 
 	return 0;
 }
Signature · 1 line
2.20.1

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

Applied
#2 lore raw
In reply to Lucas Stach
Quoted 7 lines · Lucas Stach

This way the backlight can be referenced through its device node and enabling/disabling can be managed through the panel driver.

---
 drivers/video/backlight/rave-sp-backlight.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

Applied, thanks.

Signature · 8 lines
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel