video: backlight: lm3533_bl: Set initial mapping mode from DT

Add support to obtain the initial mapping mode from DT instead of leaving
it unconfigured.

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

View File

@ -36,6 +36,7 @@ struct lm3533_bl {
u32 pwm;
bool have_als;
bool linear;
};
@ -230,8 +231,14 @@ static const struct attribute_group *lm3533_bl_attribute_groups[] = {
static int lm3533_bl_setup(struct lm3533_bl *bl)
{
int ctrlbank = lm3533_bl_get_ctrlbank_id(bl);
int ret;
ret = regmap_assign_bits(bl->regmap, LM3533_REG_CTRLBANK_AB_BCONF,
CTRLBANK_AB_BCONF_MODE(ctrlbank), bl->linear);
if (ret)
return ret;
ret = lm3533_ctrlbank_set_max_current(&bl->cb, bl->max_current);
if (ret)
return ret;
@ -285,6 +292,9 @@ static int lm3533_bl_probe(struct platform_device *pdev)
props.max_brightness = LM3533_BL_MAX_BRIGHTNESS;
props.brightness = default_brightness;
bl->linear = device_property_read_bool(&pdev->dev,
"ti,linear-mapping-mode");
bd = devm_backlight_device_register(&pdev->dev, name, &pdev->dev,
bl, &lm3533_bl_ops, &props);
if (IS_ERR(bd)) {