On 12/04/2023 17:33, AngeloGioacchino Del Regno wrote:
Add basic code to turn on and off WLEDs and wire up MT6332 support
to take advantage of it.
This is a simple approach due to to the aforementioned PMIC supporting
only on/off status so, at the time of writing, it is impossible for me
to validate more advanced functionality due to lack of hardware.
Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@xxxxxxxxxxxxx>
---
drivers/leds/leds-mt6323.c | 171 +++++++++++++++++++++++++++++++++++--
1 file changed, 164 insertions(+), 7 deletions(-)
diff --git a/drivers/leds/leds-mt6323.c b/drivers/leds/leds-mt6323.c
index 5d95dbd9a761..202b38ac32f6 100644
--- a/drivers/leds/leds-mt6323.c
+++ b/drivers/leds/leds-mt6323.c
@@ -418,6 +538,7 @@ static int mt6323_led_probe(struct platform_device *pdev)
int ret;
unsigned int status;
u32 reg;
+ u8 max_leds;
leds = devm_kzalloc(dev, sizeof(*leds), GFP_KERNEL);
if (!leds)
@@ -428,6 +549,7 @@ static int mt6323_led_probe(struct platform_device *pdev)
leds->pdata = device_get_match_data(dev);
regs = leds->pdata->regs;
spec = leds->pdata->spec;
+ max_leds = spec->max_leds + spec->max_wleds;
I haven't access to the datasheet so I have to ask you:
Why the max leds value is the addition of max led and wled ?
IMO, the datasheed give you the max supported led OR wled on its bus function to the maximum supplied current by the PMIC (I assume LED or WLED have different need). Or the PMIC has 2 bus, one for led and another for wled ?