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@xxxxxxxxxxxxx>
---
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
* 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)