diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2021-04-28 16:02:58 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2021-04-28 16:02:58 -0700 |
commit | c969f2451b5343a01635d35542f48bc14b44f6b3 (patch) | |
tree | 1274dd1f5c783a5900b9e08cd71c471f32d02761 /drivers/video/backlight/qcom-wled.c | |
parent | 71a5cc28e88b0db69c3f83d4061ad4cc684af09f (diff) | |
parent | 04758386757c1ef339b18d996976911be61d5efb (diff) | |
download | linux-next-c969f2451b5343a01635d35542f48bc14b44f6b3.tar.gz |
Merge tag 'backlight-next-5.13' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/backlight
Pull backlight updates from Lee Jones:
"New Device Support:
- Add support for PMI8994 to Qualcom WLED
- Add support for KTD259 to Kinetic KTD253
Fix-ups:
- Device Tree related fix-ups; kinetic,ktd253
- Use proper sequence during sync_toggle; qcom-wled
- Fix Wmisleading-indentation warnings; jornada720_bl
Bug Fixes:
- Fix sync toggle on WLED4; qcom-wled
- Fix FSC update on WLED5; qcom-wled"
* tag 'backlight-next-5.13' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/backlight:
backlight: journada720: Fix Wmisleading-indentation warning
backlight: qcom-wled: Correct the sync_toggle sequence
backlight: qcom-wled: Fix FSC update issue for WLED5
dt-bindings: backlight: Add Kinetic KTD259 bindings
backlight: ktd253: Support KTD259
backlight: qcom-wled: Use sink_addr for sync toggle
dt-bindings: backlight: qcom-wled: Add PMI8994 compatible
Diffstat (limited to 'drivers/video/backlight/qcom-wled.c')
-rw-r--r-- | drivers/video/backlight/qcom-wled.c | 41 |
1 files changed, 27 insertions, 14 deletions
diff --git a/drivers/video/backlight/qcom-wled.c b/drivers/video/backlight/qcom-wled.c index 091f07e7c145..7c02f87c51c2 100644 --- a/drivers/video/backlight/qcom-wled.c +++ b/drivers/video/backlight/qcom-wled.c @@ -336,34 +336,34 @@ static int wled3_sync_toggle(struct wled *wled) unsigned int mask = GENMASK(wled->max_string_count - 1, 0); rc = regmap_update_bits(wled->regmap, - wled->ctrl_addr + WLED3_SINK_REG_SYNC, - mask, mask); + wled->sink_addr + WLED3_SINK_REG_SYNC, + mask, WLED3_SINK_REG_SYNC_CLEAR); if (rc < 0) return rc; rc = regmap_update_bits(wled->regmap, - wled->ctrl_addr + WLED3_SINK_REG_SYNC, - mask, WLED3_SINK_REG_SYNC_CLEAR); + wled->sink_addr + WLED3_SINK_REG_SYNC, + mask, mask); return rc; } -static int wled5_sync_toggle(struct wled *wled) +static int wled5_mod_sync_toggle(struct wled *wled) { int rc; u8 val; - val = (wled->cfg.mod_sel == MOD_A) ? WLED5_SINK_REG_SYNC_MOD_A_BIT : - WLED5_SINK_REG_SYNC_MOD_B_BIT; rc = regmap_update_bits(wled->regmap, wled->sink_addr + WLED5_SINK_REG_MOD_SYNC_BIT, - WLED5_SINK_REG_SYNC_MASK, val); + WLED5_SINK_REG_SYNC_MASK, 0); if (rc < 0) return rc; + val = (wled->cfg.mod_sel == MOD_A) ? WLED5_SINK_REG_SYNC_MOD_A_BIT : + WLED5_SINK_REG_SYNC_MOD_B_BIT; return regmap_update_bits(wled->regmap, wled->sink_addr + WLED5_SINK_REG_MOD_SYNC_BIT, - WLED5_SINK_REG_SYNC_MASK, 0); + WLED5_SINK_REG_SYNC_MASK, val); } static int wled_ovp_fault_status(struct wled *wled, bool *fault_set) @@ -445,10 +445,23 @@ static int wled_update_status(struct backlight_device *bl) goto unlock_mutex; } - rc = wled->wled_sync_toggle(wled); - if (rc < 0) { - dev_err(wled->dev, "wled sync failed rc:%d\n", rc); - goto unlock_mutex; + if (wled->version < 5) { + rc = wled->wled_sync_toggle(wled); + if (rc < 0) { + dev_err(wled->dev, "wled sync failed rc:%d\n", rc); + goto unlock_mutex; + } + } else { + /* + * For WLED5 toggling the MOD_SYNC_BIT updates the + * brightness + */ + rc = wled5_mod_sync_toggle(wled); + if (rc < 0) { + dev_err(wled->dev, "wled mod sync failed rc:%d\n", + rc); + goto unlock_mutex; + } } } @@ -1459,7 +1472,7 @@ static int wled_configure(struct wled *wled) size = ARRAY_SIZE(wled5_opts); *cfg = wled5_config_defaults; wled->wled_set_brightness = wled5_set_brightness; - wled->wled_sync_toggle = wled5_sync_toggle; + wled->wled_sync_toggle = wled3_sync_toggle; wled->wled_cabc_config = wled5_cabc_config; wled->wled_ovp_delay = wled5_ovp_delay; wled->wled_auto_detection_required = |