Commit Graph

6 Commits

Author SHA1 Message Date
Thomas Stranger 850382bfd2 drivers: led: lp50xx: brightness: don't check uint >= 0
No need to check if an uint8_t is greater or equal 0 in
lp50xx_set_brightness.
Fixes CID 322654

Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
2024-02-10 16:32:23 +01:00
Mathieu Anquetin ce674d9098 drivers: led: lp50xx: fix led index
The led identifer should refer to devicetree ordering, not to the index
used by the controller. This way, it will be possible to deactivate
some leds or to reorganize the indexing if necessary.

Signed-off-by: Mathieu Anquetin <mathieu.anquetin@groupe-cahors.com>
2023-08-04 13:18:01 +02:00
Mathieu Anquetin d6c98db2cf drivers: led: lp50xx: add power management
Enable device power management using the low-power modes of the LP50XX
family.

Signed-off-by: Mathieu Anquetin <mathieu.anquetin@groupe-cahors.com>
2023-08-04 13:18:01 +02:00
Mathieu Anquetin 8807930248 drivers: led: lp50xx: add enable gpio
Some boards may have connected the enable pin of the chipset to a GPIO.
On these boards, it is necessary to configure and set this GPIO before
using the chipset, otherwise the I2C circuitry is disabled.

Based on initial work from:
  - Marek Janus <marek.janus@grinn-global.com>
  - Rico Ganahl <rico.ganahl@bytesatwork.ch>

Signed-off-by: Mathieu Anquetin <mathieu.anquetin@groupe-cahors.com>
2023-08-04 13:18:01 +02:00
Mathieu Anquetin 3c1b4d0a1f drivers: led: lp50xx: add reset
The LP50XX family has a specific register to reset the configuration to
default state from any other state. Use this instead of relying on the
manual configuration of registers during startup.

Based on initial work from: Marek Janus <marek.janus@grinn-global.com>

Signed-off-by: Mathieu Anquetin <mathieu.anquetin@groupe-cahors.com>
2023-08-04 13:18:01 +02:00
Mathieu Anquetin 26f4fab391 drivers: led: lp503x: extend driver to all lp50xx devices
Add support for LP5009, LP5012, LP5018 and LP5024 devices which only
differ by the number of LEDs they can control.

Also, update application sample to run on all these new supported
devices.

Based on initial work from:
  - Marek Janus <marek.janus@grinn-global.com>
  - Rico Ganahl <rico.ganahl@bytesatwork.ch>

Signed-off-by: Mathieu Anquetin <mathieu.anquetin@groupe-cahors.com>
2023-08-04 13:18:01 +02:00