Skip to content
/ linux Public

Commit 54540e5

Browse files
barni2000gregkh
authored andcommitted
backlight: qcom-wled: Support ovp values for PMI8994
[ Upstream commit f29f972 ] WLED4 found in PMI8994 supports different ovp values. Fixes: 6fc632d ("video: backlight: qcom-wled: Add PMI8994 compatible") Signed-off-by: Barnabás Czémán <barnabas.czeman@mainlining.org> Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com> Reviewed-by: Daniel Thompson (RISCstar) <danielt@kernel.org> Link: https://patch.msgid.link/20260116-pmi8950-wled-v3-2-e6c93de84079@mainlining.org Signed-off-by: Lee Jones <lee@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 784936c commit 54540e5

File tree

1 file changed

+39
-2
lines changed

1 file changed

+39
-2
lines changed

drivers/video/backlight/qcom-wled.c

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1244,6 +1244,15 @@ static const struct wled_var_cfg wled4_ovp_cfg = {
12441244
.size = ARRAY_SIZE(wled4_ovp_values),
12451245
};
12461246

1247+
static const u32 pmi8994_wled_ovp_values[] = {
1248+
31000, 29500, 19400, 17800,
1249+
};
1250+
1251+
static const struct wled_var_cfg pmi8994_wled_ovp_cfg = {
1252+
.values = pmi8994_wled_ovp_values,
1253+
.size = ARRAY_SIZE(pmi8994_wled_ovp_values),
1254+
};
1255+
12471256
static inline u32 wled5_ovp_values_fn(u32 idx)
12481257
{
12491258
/*
@@ -1357,6 +1366,29 @@ static int wled_configure(struct wled *wled)
13571366
},
13581367
};
13591368

1369+
const struct wled_u32_opts pmi8994_wled_opts[] = {
1370+
{
1371+
.name = "qcom,current-boost-limit",
1372+
.val_ptr = &cfg->boost_i_limit,
1373+
.cfg = &wled4_boost_i_limit_cfg,
1374+
},
1375+
{
1376+
.name = "qcom,current-limit-microamp",
1377+
.val_ptr = &cfg->string_i_limit,
1378+
.cfg = &wled4_string_i_limit_cfg,
1379+
},
1380+
{
1381+
.name = "qcom,ovp-millivolt",
1382+
.val_ptr = &cfg->ovp,
1383+
.cfg = &pmi8994_wled_ovp_cfg,
1384+
},
1385+
{
1386+
.name = "qcom,switching-freq",
1387+
.val_ptr = &cfg->switch_freq,
1388+
.cfg = &wled3_switch_freq_cfg,
1389+
},
1390+
};
1391+
13601392
const struct wled_u32_opts wled5_opts[] = {
13611393
{
13621394
.name = "qcom,current-boost-limit",
@@ -1423,8 +1455,13 @@ static int wled_configure(struct wled *wled)
14231455
break;
14241456

14251457
case 4:
1426-
u32_opts = wled4_opts;
1427-
size = ARRAY_SIZE(wled4_opts);
1458+
if (of_device_is_compatible(dev->of_node, "qcom,pmi8994-wled")) {
1459+
u32_opts = pmi8994_wled_opts;
1460+
size = ARRAY_SIZE(pmi8994_wled_opts);
1461+
} else {
1462+
u32_opts = wled4_opts;
1463+
size = ARRAY_SIZE(wled4_opts);
1464+
}
14281465
*cfg = wled4_config_defaults;
14291466
wled->wled_set_brightness = wled4_set_brightness;
14301467
wled->wled_sync_toggle = wled3_sync_toggle;

0 commit comments

Comments
 (0)