diff mbox series

[v5,7/7] leds: rgb: Update PM8350C lpg_data to support two-nvmem PPG Scheme

Message ID 20230929003901.15086-8-quic_amelende@quicinc.com
State Superseded
Headers show
Series Add support for LUT PPG | expand

Commit Message

Anjelique Melendez Sept. 29, 2023, 12:39 a.m. UTC
Update the pm8350c lpg_data struct so that pm8350c devices are treated as
PWM devices that support two-nvmem PPG scheme.

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

Comments

Lee Jones Oct. 5, 2023, 1:45 p.m. UTC | #1
On Thu, 28 Sep 2023, Anjelique Melendez wrote:

> Update the pm8350c lpg_data struct so that pm8350c devices are treated as
> PWM devices that support two-nvmem PPG scheme.
> 
> Signed-off-by: Anjelique Melendez <quic_amelende@quicinc.com>
> ---
>  drivers/leds/rgb/leds-qcom-lpg.c | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)

Reviewed-by: Lee Jones <lee@kernel.org>

> diff --git a/drivers/leds/rgb/leds-qcom-lpg.c b/drivers/leds/rgb/leds-qcom-lpg.c
> index 910c7cf740cc..8962ea13df29 100644
> --- a/drivers/leds/rgb/leds-qcom-lpg.c
> +++ b/drivers/leds/rgb/leds-qcom-lpg.c
> @@ -1800,11 +1800,13 @@ static const struct lpg_data pm8150l_lpg_data = {
>  static const struct lpg_data pm8350c_pwm_data = {
>  	.triled_base = 0xef00,
>  
> +	.lut_size = 122,
> +
>  	.num_channels = 4,
>  	.channels = (const struct lpg_channel_data[]) {
> -		{ .base = 0xe800, .triled_mask = BIT(7) },
> -		{ .base = 0xe900, .triled_mask = BIT(6) },
> -		{ .base = 0xea00, .triled_mask = BIT(5) },
> +		{ .base = 0xe800, .triled_mask = BIT(7), .sdam_offset = 0x48 },
> +		{ .base = 0xe900, .triled_mask = BIT(6), .sdam_offset = 0x56 },
> +		{ .base = 0xea00, .triled_mask = BIT(5), .sdam_offset = 0x64 },
>  		{ .base = 0xeb00 },
>  	},
>  };
> -- 
> 2.41.0
>
diff mbox series

Patch

diff --git a/drivers/leds/rgb/leds-qcom-lpg.c b/drivers/leds/rgb/leds-qcom-lpg.c
index 910c7cf740cc..8962ea13df29 100644
--- a/drivers/leds/rgb/leds-qcom-lpg.c
+++ b/drivers/leds/rgb/leds-qcom-lpg.c
@@ -1800,11 +1800,13 @@  static const struct lpg_data pm8150l_lpg_data = {
 static const struct lpg_data pm8350c_pwm_data = {
 	.triled_base = 0xef00,
 
+	.lut_size = 122,
+
 	.num_channels = 4,
 	.channels = (const struct lpg_channel_data[]) {
-		{ .base = 0xe800, .triled_mask = BIT(7) },
-		{ .base = 0xe900, .triled_mask = BIT(6) },
-		{ .base = 0xea00, .triled_mask = BIT(5) },
+		{ .base = 0xe800, .triled_mask = BIT(7), .sdam_offset = 0x48 },
+		{ .base = 0xe900, .triled_mask = BIT(6), .sdam_offset = 0x56 },
+		{ .base = 0xea00, .triled_mask = BIT(5), .sdam_offset = 0x64 },
 		{ .base = 0xeb00 },
 	},
 };