Loading arch/arm64/boot/dts/qcom/pm660l.dtsi +1 −0 Original line number Diff line number Diff line Loading @@ -163,6 +163,7 @@ label = "backlight"; qcom,pmic-revid = <&pm660l_revid>; qcom,auto-calibration; qcom,sync-dly = <800>; status = "ok"; }; Loading drivers/video/backlight/qcom-spmi-wled.c +26 −1 Original line number Diff line number Diff line /* Copyright (c) 2015, Sony Mobile Communications, AB. * * Copyright (c) 2018-2019, The Linux Foundation. All rights reserved. * Copyright (c) 2018-2020, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -91,6 +91,7 @@ #define WLED_SINK_REG_STR_MOD_EN BIT(7) #define WLED_SINK_SYNC_DLY_REG(n) (0x51 + (n * 0x10)) #define WLED_SINK_SYNC_DLY_MASK GENMASK(2, 0) #define WLED_SINK_FS_CURR_REG(n) (0x52 + (n * 0x10)) #define WLED_SINK_FS_MASK GENMASK(3, 0) Loading Loading @@ -207,6 +208,7 @@ struct wled_config { int string_cfg; int mod_sel; int cabc_sel; int sync_dly; bool en_cabc; bool ext_pfet_sc_pro_en; bool auto_calib_enabled; Loading Loading @@ -1254,6 +1256,14 @@ static int wled4_setup(struct wled *wled) if (rc < 0) return rc; addr = wled->sink_addr + WLED_SINK_SYNC_DLY_REG(i); rc = regmap_update_bits(wled->regmap, addr, WLED_SINK_SYNC_DLY_MASK, wled->cfg.sync_dly); if (rc < 0) return rc; temp = i + WLED_SINK_CURR_SINK_SHFT; sink_en |= 1 << temp; } Loading Loading @@ -1339,6 +1349,7 @@ static const struct wled_config wled4_config_defaults = { .fs_current = 10, .ovp = 1, .switch_freq = 11, .sync_dly = 2, .string_cfg = 0xf, .mod_sel = -EINVAL, .cabc_sel = -EINVAL, Loading Loading @@ -1404,6 +1415,15 @@ static const struct wled_var_cfg wled4_ovp_cfg = { .size = ARRAY_SIZE(wled4_ovp_values), }; static const u32 wled4_sync_dly_values[] = { 0, 200, 400, 600, 800, 1000, 1200, 1400, }; static const struct wled_var_cfg wled4_sync_dly_cfg = { .values = wled4_sync_dly_values, .size = ARRAY_SIZE(wled4_sync_dly_values), }; static inline u32 wled5_ovp_values_fn(u32 idx) { /* Loading Loading @@ -2126,6 +2146,11 @@ static int wled_configure(struct wled *wled, struct device *dev) .val_ptr = &cfg->string_cfg, .cfg = &wled_string_cfg, }, { .name = "qcom,sync-dly", .val_ptr = &cfg->sync_dly, .cfg = &wled4_sync_dly_cfg, }, }; const struct wled_u32_opts wled5_opts[] = { Loading Loading
arch/arm64/boot/dts/qcom/pm660l.dtsi +1 −0 Original line number Diff line number Diff line Loading @@ -163,6 +163,7 @@ label = "backlight"; qcom,pmic-revid = <&pm660l_revid>; qcom,auto-calibration; qcom,sync-dly = <800>; status = "ok"; }; Loading
drivers/video/backlight/qcom-spmi-wled.c +26 −1 Original line number Diff line number Diff line /* Copyright (c) 2015, Sony Mobile Communications, AB. * * Copyright (c) 2018-2019, The Linux Foundation. All rights reserved. * Copyright (c) 2018-2020, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -91,6 +91,7 @@ #define WLED_SINK_REG_STR_MOD_EN BIT(7) #define WLED_SINK_SYNC_DLY_REG(n) (0x51 + (n * 0x10)) #define WLED_SINK_SYNC_DLY_MASK GENMASK(2, 0) #define WLED_SINK_FS_CURR_REG(n) (0x52 + (n * 0x10)) #define WLED_SINK_FS_MASK GENMASK(3, 0) Loading Loading @@ -207,6 +208,7 @@ struct wled_config { int string_cfg; int mod_sel; int cabc_sel; int sync_dly; bool en_cabc; bool ext_pfet_sc_pro_en; bool auto_calib_enabled; Loading Loading @@ -1254,6 +1256,14 @@ static int wled4_setup(struct wled *wled) if (rc < 0) return rc; addr = wled->sink_addr + WLED_SINK_SYNC_DLY_REG(i); rc = regmap_update_bits(wled->regmap, addr, WLED_SINK_SYNC_DLY_MASK, wled->cfg.sync_dly); if (rc < 0) return rc; temp = i + WLED_SINK_CURR_SINK_SHFT; sink_en |= 1 << temp; } Loading Loading @@ -1339,6 +1349,7 @@ static const struct wled_config wled4_config_defaults = { .fs_current = 10, .ovp = 1, .switch_freq = 11, .sync_dly = 2, .string_cfg = 0xf, .mod_sel = -EINVAL, .cabc_sel = -EINVAL, Loading Loading @@ -1404,6 +1415,15 @@ static const struct wled_var_cfg wled4_ovp_cfg = { .size = ARRAY_SIZE(wled4_ovp_values), }; static const u32 wled4_sync_dly_values[] = { 0, 200, 400, 600, 800, 1000, 1200, 1400, }; static const struct wled_var_cfg wled4_sync_dly_cfg = { .values = wled4_sync_dly_values, .size = ARRAY_SIZE(wled4_sync_dly_values), }; static inline u32 wled5_ovp_values_fn(u32 idx) { /* Loading Loading @@ -2126,6 +2146,11 @@ static int wled_configure(struct wled *wled, struct device *dev) .val_ptr = &cfg->string_cfg, .cfg = &wled_string_cfg, }, { .name = "qcom,sync-dly", .val_ptr = &cfg->sync_dly, .cfg = &wled4_sync_dly_cfg, }, }; const struct wled_u32_opts wled5_opts[] = { Loading