2021-02-19 14:11:02

by Kiran Gunda

[permalink] [raw]
Subject: [PATCH V1 0/2] Fix WLED FSC Sync and brightness Sync settings

The FSC (Full scale current) setting is not updated properly due to the
wrong register toggling for WLED5. Also the ILED_SYNC toggle and MOD_SYNC
toggle sequence is updated as per the hardware team recommendation to fix
the FSC update and brightness update issue.

Kiran Gunda (2):
backlight: qcom-wled: Fix FSC update issue for WLED5
backlight: qcom-wled: Correct the sync_toggle sequence

drivers/video/backlight/qcom-wled.c | 37 +++++++++++++++++++++++++------------
1 file changed, 25 insertions(+), 12 deletions(-)

--
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


2021-02-19 14:12:03

by Kiran Gunda

[permalink] [raw]
Subject: [PATCH V1 2/2] backlight: qcom-wled: Correct the sync_toggle sequence

Currently the FSC SYNC_BIT and MOD_SYNC_BIT are toggled
from 1 to 0 to update the FSC and brightenss settings.
Change this sequence form 0 to 1 as per the hardware team
recommendation to update the FSC and brightness correctly.

Signed-off-by: Kiran Gunda <[email protected]>
---
drivers/video/backlight/qcom-wled.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/video/backlight/qcom-wled.c b/drivers/video/backlight/qcom-wled.c
index aef52b9..19f83ac 100644
--- a/drivers/video/backlight/qcom-wled.c
+++ b/drivers/video/backlight/qcom-wled.c
@@ -337,13 +337,13 @@ static int wled3_sync_toggle(struct wled *wled)

rc = regmap_update_bits(wled->regmap,
wled->ctrl_addr + WLED3_SINK_REG_SYNC,
- mask, mask);
+ 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);
+ mask, mask);

return rc;
}
@@ -353,17 +353,17 @@ 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)
--
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

2021-02-19 18:13:36

by Pavel Machek

[permalink] [raw]
Subject: Re: [PATCH V1 0/2] Fix WLED FSC Sync and brightness Sync settings

Hi!

> The FSC (Full scale current) setting is not updated properly due to the
> wrong register toggling for WLED5. Also the ILED_SYNC toggle and MOD_SYNC
> toggle sequence is updated as per the hardware team recommendation to fix
> the FSC update and brightness update issue.

If this is phone hardware, it might make sense to cc:
phone-devel@vger...

Best regards,
Pavel

--
http://www.livejournal.com/~pavelmachek


Attachments:
(No filename) (442.00 B)
signature.asc (201.00 B)
Download all attachments

2021-02-24 12:40:58

by Kiran Gunda

[permalink] [raw]
Subject: Re: [PATCH V1 0/2] Fix WLED FSC Sync and brightness Sync settings

On 2021-02-19 23:38, Pavel Machek wrote:
> Hi!
>
>> The FSC (Full scale current) setting is not updated properly due to
>> the
>> wrong register toggling for WLED5. Also the ILED_SYNC toggle and
>> MOD_SYNC
>> toggle sequence is updated as per the hardware team recommendation to
>> fix
>> the FSC update and brightness update issue.
>
> If this is phone hardware, it might make sense to cc:
> phone-devel@vger...
>
Yes. it is for phone hardware. Will cc the email.
> Best regards,
> Pavel