diff mbox series

[v6,5/7] leds: rgb: leds-qcom-lpg: Update PMI632 lpg_data to support PPG

Message ID 20231020182218.22217-6-quic_amelende@quicinc.com (mailing list archive)
State Superseded
Headers show
Series Add support for LUT PPG | expand

Commit Message

Anjelique Melendez Oct. 20, 2023, 6:22 p.m. UTC
Update the pmi632 lpg_data struct so that pmi632 devices use PPG
for LUT pattern.

Signed-off-by: Anjelique Melendez <quic_amelende@quicinc.com>
Reviewed-by: Lee Jones <lee@kernel.org>
---
 drivers/leds/rgb/leds-qcom-lpg.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

Comments

Luca Weiss Oct. 23, 2023, 7:21 a.m. UTC | #1
On Fri Oct 20, 2023 at 8:22 PM CEST, Anjelique Melendez wrote:
> Update the pmi632 lpg_data struct so that pmi632 devices use PPG
> for LUT pattern.

Hi Anjelique,

The hw_pattern now works as expected on PMI632, with the commands
written in [0]! Thanks!

Tested-by: Luca Weiss <luca.weiss@fairphone.com>

[0] https://lore.kernel.org/linux-arm-msm/CVX5ZUGU9BVE.2TA819U1AI6BZ@otso/

>
> Signed-off-by: Anjelique Melendez <quic_amelende@quicinc.com>
> Reviewed-by: Lee Jones <lee@kernel.org>
> ---
>  drivers/leds/rgb/leds-qcom-lpg.c | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/leds/rgb/leds-qcom-lpg.c b/drivers/leds/rgb/leds-qcom-lpg.c
> index 0c6d0e593c06..92fee512d965 100644
> --- a/drivers/leds/rgb/leds-qcom-lpg.c
> +++ b/drivers/leds/rgb/leds-qcom-lpg.c
> @@ -1640,11 +1640,13 @@ static const struct lpg_data pm8994_lpg_data = {
>  static const struct lpg_data pmi632_lpg_data = {
>  	.triled_base = 0xd000,
>  
> +	.lut_size = 64,
> +
>  	.num_channels = 5,
>  	.channels = (const struct lpg_channel_data[]) {
> -		{ .base = 0xb300, .triled_mask = BIT(7) },
> -		{ .base = 0xb400, .triled_mask = BIT(6) },
> -		{ .base = 0xb500, .triled_mask = BIT(5) },
> +		{ .base = 0xb300, .triled_mask = BIT(7), .sdam_offset = 0x48 },
> +		{ .base = 0xb400, .triled_mask = BIT(6), .sdam_offset = 0x56 },
> +		{ .base = 0xb500, .triled_mask = BIT(5), .sdam_offset = 0x64 },
>  		{ .base = 0xb600 },
>  		{ .base = 0xb700 },
>  	},
diff mbox series

Patch

diff --git a/drivers/leds/rgb/leds-qcom-lpg.c b/drivers/leds/rgb/leds-qcom-lpg.c
index 0c6d0e593c06..92fee512d965 100644
--- a/drivers/leds/rgb/leds-qcom-lpg.c
+++ b/drivers/leds/rgb/leds-qcom-lpg.c
@@ -1640,11 +1640,13 @@  static const struct lpg_data pm8994_lpg_data = {
 static const struct lpg_data pmi632_lpg_data = {
 	.triled_base = 0xd000,
 
+	.lut_size = 64,
+
 	.num_channels = 5,
 	.channels = (const struct lpg_channel_data[]) {
-		{ .base = 0xb300, .triled_mask = BIT(7) },
-		{ .base = 0xb400, .triled_mask = BIT(6) },
-		{ .base = 0xb500, .triled_mask = BIT(5) },
+		{ .base = 0xb300, .triled_mask = BIT(7), .sdam_offset = 0x48 },
+		{ .base = 0xb400, .triled_mask = BIT(6), .sdam_offset = 0x56 },
+		{ .base = 0xb500, .triled_mask = BIT(5), .sdam_offset = 0x64 },
 		{ .base = 0xb600 },
 		{ .base = 0xb700 },
 	},