Re: [PATCH v2 3/7] leds: leds-mt6323: Specify registers and specs in platform data

Alexandre Mergnat
2023-04-13T10:12:51Z

On 12/04/2023 17:33, AngeloGioacchino Del Regno wrote:
> In order to enhance the flexibility of this driver and let it support
> more than just one MediaTek LEDs IP for more than just one PMIC,
> add platform data structure specifying the register offsets and
> data that commonly varies between different IPs.
>
> This commit brings no functional changes.
>
> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
> ---
> drivers/leds/leds-mt6323.c | 145 ++++++++++++++++++++++++++++---------
> 1 file changed, 112 insertions(+), 33 deletions(-)
>
> diff --git a/drivers/leds/leds-mt6323.c b/drivers/leds/leds-mt6323.c
> index 17ee88043f52..a5b2d06e9d63 100644
> --- a/drivers/leds/leds-mt6323.c
> +++ b/drivers/leds/leds-mt6323.c
> @@ -37,18 +37,16 @@
> * Register for MT6323_ISINK_CON0 to setup the

Comment should be changed.

> * duty cycle of the blink.
> */
> -#define MT6323_ISINK_CON0(i) (MT6323_ISINK0_CON0 + 0x8 * (i))
> +#define MT6323_ISINK_CON(r, i) (r + 0x8 * (i))
> #define MT6323_ISINK_DIM_DUTY_MASK (0x1f << 8)
> #define MT6323_ISINK_DIM_DUTY(i) (((i) << 8) & \
> MT6323_ISINK_DIM_DUTY_MASK)
>

After that, it should be ok.

Reviewed-by: Alexandre Mergnat <amergnat@baylibre.com>

Regards,
Alexandre