[PATCH v2 3/7] leds: leds-mt6323: Specify registers and specs in platform data
Alexandre Mergnat
amergnat at baylibre.com
Thu Apr 13 03:11:43 PDT 2023
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 at 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 at baylibre.com>
Regards,
Alexandre
More information about the Linux-mediatek
mailing list