[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240111100631.GL7948@google.com>
Date: Thu, 11 Jan 2024 10:06:31 +0000
From: Lee Jones <lee@...nel.org>
To: Anjelique Melendez <quic_amelende@...cinc.com>
Cc: pavel@....cz, thierry.reding@...il.com, robh+dt@...nel.org,
krzysztof.kozlowski+dt@...aro.org, conor+dt@...nel.org,
agross@...nel.org, andersson@...nel.org, luca.weiss@...rphone.com,
konrad.dybcio@...aro.org, u.kleine-koenig@...gutronix.de,
quic_subbaram@...cinc.com, quic_gurus@...cinc.com,
linux-leds@...r.kernel.org, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-arm-msm@...r.kernel.org,
linux-pwm@...r.kernel.org
Subject: Re: [PATCH v8 4/7] leds: rgb: leds-qcom-lpg: Add support for PPG
through single SDAM
On Thu, 21 Dec 2023, Anjelique Melendez wrote:
> In some PMICs like pmi632, the pattern look up table (LUT) and LPG
> configuration is stored in a single SDAM module instead of LUT
> peripheral. This feature is called PPG. PPG uses Qualcomm Programmable
> Boot Sequencer (PBS) inorder to trigger pattern sequences for PMICs.
>
> Signed-off-by: Anjelique Melendez <quic_amelende@...cinc.com>
> Tested-by: Luca Weiss <luca.weiss@...rphone.com>
> ---
> drivers/leds/rgb/leds-qcom-lpg.c | 268 ++++++++++++++++++++++++++++---
> 1 file changed, 244 insertions(+), 24 deletions(-)
>
> diff --git a/drivers/leds/rgb/leds-qcom-lpg.c b/drivers/leds/rgb/leds-qcom-lpg.c
> index 68d82a682bf6..a76cb1d6b7b5 100644
> --- a/drivers/leds/rgb/leds-qcom-lpg.c
> +++ b/drivers/leds/rgb/leds-qcom-lpg.c
> @@ -8,11 +8,13 @@
> #include <linux/bitfield.h>
> #include <linux/led-class-multicolor.h>
> #include <linux/module.h>
> +#include <linux/nvmem-consumer.h>
> #include <linux/of.h>
> #include <linux/platform_device.h>
> #include <linux/pwm.h>
> #include <linux/regmap.h>
> #include <linux/slab.h>
> +#include <linux/soc/qcom/qcom-pbs.h>
[...]
> +static void lpg_sdam_apply_lut_control(struct lpg_channel *chan)
> +{
> + struct nvmem_device *lpg_chan_sdam = chan->lpg->lpg_chan_sdam;
> + unsigned int lo_idx = chan->pattern_lo_idx;
> + unsigned int hi_idx = chan->pattern_hi_idx;
> + u8 val = 0, conf = 0;
> +
> + if (!chan->ramp_enabled || chan->pattern_lo_idx == chan->pattern_hi_idx)
Nit: you can use lo_idx and hi_idx here instead, right?
Please fix this up subsequently.
--
Lee Jones [李琼斯]
Powered by blists - more mailing lists