summaryrefslogtreecommitdiff
path: root/drivers/leds/leds-lp5569.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* leds: leds-lp5569: Enable chip after chip configurationChristian Marangi2024-07-121-8/+11
| | | | | | | | | | | | | Documentation say that clock internal config needs to be set BEFORE chip is enabled. Align code to this and move the CHIP enable after the CHIP is configured. While at it also make use of STATUS reg and check when STARTUP is completed instead of sleep for 1-2 ms. Signed-off-by: Christian Marangi <ansuelsmth@gmail.com> Link: https://lore.kernel.org/r/20240712004556.15601-3-ansuelsmth@gmail.com Signed-off-by: Lee Jones <lee@kernel.org>
* leds: leds-lp5569: Better handle enabling clock internal settingChristian Marangi2024-07-121-5/+10
| | | | | | | | | | | | | Better handle enabling clock internal setting. In further testing it was notice that internal clock config MUST be set before clock output config or the LED CHIP might stop working. This wasn't documented and was actually found on devices that have 2 chip chained where one chip provide clock for the other. Signed-off-by: Christian Marangi <ansuelsmth@gmail.com> Link: https://lore.kernel.org/r/20240712004556.15601-2-ansuelsmth@gmail.com Signed-off-by: Lee Jones <lee@kernel.org>
* leds: leds-lp5569: Fix typo in driver nameChristian Marangi2024-07-121-1/+1
| | | | | | | | | Remove extra x from driver name as this was a typo from copy-paste error. Signed-off-by: Christian Marangi <ansuelsmth@gmail.com> Link: https://lore.kernel.org/r/20240712004556.15601-1-ansuelsmth@gmail.com Signed-off-by: Lee Jones <lee@kernel.org>
* leds: leds-lp55xx: Convert mutex lock/unlock to guard APIChristian Marangi2024-07-111-13/+5
| | | | | | | | | | | Convert any entry of mutex lock/unlock to guard API and simplify code. With the use of guard API, handling for selttest functions can be greatly simplified. Suggested-by: Markus Elfring <Markus.Elfring@web.de> Signed-off-by: Christian Marangi <ansuelsmth@gmail.com> Link: https://lore.kernel.org/r/20240626221520.2846-3-ansuelsmth@gmail.com Signed-off-by: Lee Jones <lee@kernel.org>
* leds: leds-lp5569: Convert to sysfs_emit APIChristian Marangi2024-07-041-7/+7
| | | | | | | | | | | | Convert sprintf to the much safer sysfs_emit API to handle output for sysfs. Also better handle situation where on the same chip there may be LED open and shorted at the same time. Signed-off-by: Christian Marangi <ansuelsmth@gmail.com> Link: https://lore.kernel.org/r/20240626221520.2846-1-ansuelsmth@gmail.com Signed-off-by: Lee Jones <lee@kernel.org>
* leds: leds-lp5569: Add support for Texas Instruments LP5569Christian Marangi2024-06-261-0/+544
Add support for Texas Instruments LP5569 LED driver. Texas Instruments LP5569 is 9 channels chip with programmable engines. It almost a copy of LP5523 with fundamental changes to regs order and regs content. Has difference in how the clock is handled and doesn't support detecting clock time automatically, different handling for selftest and different scheme for the status regs. LED chip supports ENGINE and MUX to group LED and run precompiled code with magic values to run patterns. This is loaded via the sysfs entry and it's passed as a string of ASCII HEX char. One some devices using this LED Controller (a NBG7815 Router) it was found loading big precompiled pattern with up to 96 bytes of code. To have support for this "extended" scenario, hardcode each engine to support 4 pages of precompiled pattern (128 bytes of code) and 1 page for each MUX. This gives plenty of space for any kind precompiled pattern keeping simple logic for page handling of each engine and mux. Signed-off-by: Christian Marangi <ansuelsmth@gmail.com> Link: https://lore.kernel.org/r/20240626160027.19703-21-ansuelsmth@gmail.com Signed-off-by: Lee Jones <lee@kernel.org>