# \[PATCH\] backlight: qcom-wled: Use sink\_addr for sync toggle

- Subsystems: FRAMEBUFFER LAYER, ARM/QUALCOMM MAILING LIST, BACKLIGHT CLASS/SUBSYSTEM, THE REST
- Maintainers: Helge Deller, Lee Jones, Daniel Thompson, Jingoo Han, Linus Torvalds
- List: linux-fbdev
- 4 messages, 4 authors
- Page: https://ratatoskr.run/linux-fbdev/2021/03/6299621/t

## \[PATCH\] backlight: qcom-wled: Use sink\_addr for sync toggle

- From: Marijn Suijten \<marijn.suijten@somainline.org\>
- Date: 2021-03-14 10:14:28 
- Message: https://ratatoskr.run/linux-fbdev/2021/03/6299621.md

```text
From: Obeida Shamoun <redacted>

WLED3_SINK_REG_SYNC is, as the name implies, a sink register offset.
Therefore, use the sink address as base instead of the ctrl address.

This fixes the sync toggle on wled4, which can be observed by the fact
that adjusting brightness now works.

It has no effect on wled3 because sink and ctrl base addresses are the
same.  This allows adjusting the brightness without having to disable
then reenable the module.

Signed-off-by: Obeida Shamoun <redacted>
Signed-off-by: Konrad Dybcio <redacted>
Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org>
---
 drivers/video/backlight/qcom-wled.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/video/backlight/qcom-wled.c b/drivers/video/backlight/qcom-wled.c
index 091f07e7c145..fc8b443d10fd 100644
--- a/drivers/video/backlight/qcom-wled.c
+++ b/drivers/video/backlight/qcom-wled.c
@@ -336,13 +336,13 @@ 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,
+				wled->sink_addr + WLED3_SINK_REG_SYNC,
 				mask, mask);
 	if (rc < 0)
 		return rc;
 
 	rc = regmap_update_bits(wled->regmap,
-				wled->ctrl_addr + WLED3_SINK_REG_SYNC,
+				wled->sink_addr + WLED3_SINK_REG_SYNC,
 				mask, WLED3_SINK_REG_SYNC_CLEAR);
 
 	return rc;
-- 
2.30.2

```

## Re: \[PATCH\] backlight: qcom-wled: Use sink\_addr for sync toggle

- From: Daniel Thompson \<hidden\>
- Date: 2021-03-15 12:22:38 
- Message: https://ratatoskr.run/linux-fbdev/2021/03/6300500.md

```text
On Sun, Mar 14, 2021 at 11:11:10AM +0100, Marijn Suijten wrote:
> From: Obeida Shamoun <redacted>
> 
> WLED3_SINK_REG_SYNC is, as the name implies, a sink register offset.
> Therefore, use the sink address as base instead of the ctrl address.
> 
> This fixes the sync toggle on wled4, which can be observed by the fact
> that adjusting brightness now works.
> 
> It has no effect on wled3 because sink and ctrl base addresses are the
> same.  This allows adjusting the brightness without having to disable
> then reenable the module.
> 
> Signed-off-by: Obeida Shamoun <redacted>
> Signed-off-by: Konrad Dybcio <redacted>
> Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org>

LGTM, although an acked-by from Kiran would be nice to have:
Reviewed-by: Daniel Thompson <redacted>


Daniel.


> ---
>  drivers/video/backlight/qcom-wled.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/video/backlight/qcom-wled.c b/drivers/video/backlight/qcom-wled.c
> index 091f07e7c145..fc8b443d10fd 100644
> --- a/drivers/video/backlight/qcom-wled.c
> +++ b/drivers/video/backlight/qcom-wled.c
> @@ -336,13 +336,13 @@ 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,
> +				wled->sink_addr + WLED3_SINK_REG_SYNC,
>  				mask, mask);
>  	if (rc < 0)
>  		return rc;
>  
>  	rc = regmap_update_bits(wled->regmap,
> -				wled->ctrl_addr + WLED3_SINK_REG_SYNC,
> +				wled->sink_addr + WLED3_SINK_REG_SYNC,
>  				mask, WLED3_SINK_REG_SYNC_CLEAR);
>  
>  	return rc;
> -- 
> 2.30.2
> 
```

## Re: \[PATCH\] backlight: qcom-wled: Use sink\_addr for sync toggle

- From: \<hidden\>
- Date: 2021-03-17 04:01:31 
- Message: https://ratatoskr.run/linux-fbdev/2021/03/6304397.md

```text
On 2021-03-15 17:51, Daniel Thompson wrote:
> On Sun, Mar 14, 2021 at 11:11:10AM +0100, Marijn Suijten wrote:
>> From: Obeida Shamoun <redacted>
>>
>> WLED3_SINK_REG_SYNC is, as the name implies, a sink register offset.
>> Therefore, use the sink address as base instead of the ctrl address.
>>
>> This fixes the sync toggle on wled4, which can be observed by the fact
>> that adjusting brightness now works.
>>
>> It has no effect on wled3 because sink and ctrl base addresses are the
>> same.  This allows adjusting the brightness without having to disable
>> then reenable the module.
>>
>> Signed-off-by: Obeida Shamoun <redacted>
>> Signed-off-by: Konrad Dybcio <redacted>
>> Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org>
>
> LGTM, although an acked-by from Kiran would be nice to have:
> Reviewed-by: Daniel Thompson <redacted>
>
>
> Daniel.
>
>
Acked-by: Kiran Gunda <redacted>

>> ---
>>  drivers/video/backlight/qcom-wled.c | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/video/backlight/qcom-wled.c b/drivers/video/backlight/qcom-wled.c
>> index 091f07e7c145..fc8b443d10fd 100644
>> --- a/drivers/video/backlight/qcom-wled.c
>> +++ b/drivers/video/backlight/qcom-wled.c
>> @@ -336,13 +336,13 @@ 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,
>> +				wled->sink_addr + WLED3_SINK_REG_SYNC,
>>  				mask, mask);
>>  	if (rc < 0)
>>  		return rc;
>>
>>  	rc = regmap_update_bits(wled->regmap,
>> -				wled->ctrl_addr + WLED3_SINK_REG_SYNC,
>> +				wled->sink_addr + WLED3_SINK_REG_SYNC,
>>  				mask, WLED3_SINK_REG_SYNC_CLEAR);
>>
>>  	return rc;
>> --
>> 2.30.2
>>
```

## Re: \[PATCH\] backlight: qcom-wled: Use sink\_addr for sync toggle

- From: Lee Jones \<hidden\>
- Date: 2021-03-17 09:16:39 
- Message: https://ratatoskr.run/linux-fbdev/2021/03/6304763.md

```text
On Sun, 14 Mar 2021, Marijn Suijten wrote:

> From: Obeida Shamoun <redacted>
> 
> WLED3_SINK_REG_SYNC is, as the name implies, a sink register offset.
> Therefore, use the sink address as base instead of the ctrl address.
> 
> This fixes the sync toggle on wled4, which can be observed by the fact
> that adjusting brightness now works.
> 
> It has no effect on wled3 because sink and ctrl base addresses are the
> same.  This allows adjusting the brightness without having to disable
> then reenable the module.
> 
> Signed-off-by: Obeida Shamoun <redacted>
> Signed-off-by: Konrad Dybcio <redacted>
> Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org>
> ---
>  drivers/video/backlight/qcom-wled.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Applied, thanks.

-- 
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog
```
