video: backlight: lm3533_bl: Implement backlight_scale property

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

Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
Reviewed-by: Daniel Thompson (RISCstar) <danielt@kernel.org>
Link: https://patch.msgid.link/20260731113632.158440-14-clamor95@gmail.com
Signed-off-by: Lee Jones <lee@kernel.org>
This commit is contained in:
Svyatoslav Ryhel 2026-07-31 14:36:31 +03:00 committed by Lee Jones
parent 879dd08125
commit 0077e5ed83

View File

@ -141,6 +141,7 @@ static ssize_t store_linear(struct device *dev, struct device_attribute *attr,
{
struct lm3533_bl *bl = dev_get_drvdata(dev);
int ctrlbank = lm3533_bl_get_ctrlbank_id(bl);
struct backlight_device *bd = bl->bd;
unsigned long linear;
int ret;
@ -152,6 +153,9 @@ static ssize_t store_linear(struct device *dev, struct device_attribute *attr,
if (ret)
return ret;
bd->props.scale = linear ? BACKLIGHT_SCALE_LINEAR :
BACKLIGHT_SCALE_NON_LINEAR;
return len;
}
@ -294,6 +298,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);