Thread (34 messages) 34 messages, 4 authors, 23d ago
COLD23d

[PATCH v3 10/11] video: backlight: lm3533_bl: Implement backlight_scale property

From: Svyatoslav Ryhel <hidden>
Date: 2026-06-01 15:19:15
Also in: dri-devel, linux-devicetree, linux-iio, linux-leds, lkml
Subsystem: backlight class/subsystem, framebuffer layer, the rest · Maintainers: Lee Jones, Daniel Thompson, Jingoo Han, Helge Deller, Linus Torvalds

Since the device supports linear and non-linear modes, implement the
backlight_scale property to describe this state.

Signed-off-by: Svyatoslav Ryhel <redacted>
---
 drivers/video/backlight/lm3533_bl.c | 6 ++++++
 1 file changed, 6 insertions(+)
diff --git a/drivers/video/backlight/lm3533_bl.c b/drivers/video/backlight/lm3533_bl.c
index f0d88b7bc229..945625c54fc4 100644
--- a/drivers/video/backlight/lm3533_bl.c
+++ b/drivers/video/backlight/lm3533_bl.c
@@ -161,6 +161,7 @@ static ssize_t store_linear(struct device *dev,
 					const char *buf, size_t len)
 {
 	struct lm3533_bl *bl = dev_get_drvdata(dev);
+	struct backlight_device *bd = bl->bd;
 	int id = lm3533_bl_get_ctrlbank_id(bl);
 	unsigned long linear;
 	int ret;
@@ -174,6 +175,9 @@ static ssize_t store_linear(struct device *dev,
 	if (ret)
 		return ret;
 
+	bd->props.scale = linear ? BACKLIGHT_SCALE_LINEAR :
+				   BACKLIGHT_SCALE_NON_LINEAR;
+
 	return len;
 }
 
@@ -309,6 +313,8 @@ static int lm3533_bl_probe(struct platform_device *pdev)
 
 	bl->linear = device_property_read_bool(&pdev->dev,
 					       "ti,linear-mapping-mode");
+	props.scale = bl->linear ? BACKLIGHT_SCALE_LINEAR :
+				   BACKLIGHT_SCALE_NON_LINEAR;
 
 	bd = devm_backlight_device_register(&pdev->dev, name, &pdev->dev,
 					    bl, &lm3533_bl_ops, &props);
-- 
2.51.0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help