Skip to content

leds: leds-lp55xx: overhaul driver

Christian Marangi linux-devicetree linux-leds lkml 8 versions – Applied

Status from this message: Applied, thanks!

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v8 Latest20 patches 2 repliesApplied
  2. v720 patches 8 repliesApplied
  3. v620 patches 8 repliesApplied
Earlier versions · 5
VersionPostedPatchesRepliesStatus
v520 patches0 repliesSuperseded
v43 patches1 replySuperseded
v33 patches2 repliesSuperseded
v23 patches1 replySuperseded
v13 patches1 replySuperseded

Changes in v8 from the cover letter

- Rebase on top of for-leds-next (assuming the 3 commit got dropped) Changes v7:
- Add Suggested-by tag
- Fix checkpatch error for complex macro (rework define)
- Add missing values for fader conversion
- Align some function with redundant new line
- Capitalize every commit title

Patches in v8 Applied

#Subject and filesSizeRepliesApplied
1/20dt-bindings: leds-lp55xx: Limit pwr-sel property to ti,lp8501Documentation/devicetree/bindings/leds/leds-lp55xx.yaml+10 -00 replies
2/20dt-bindings: leds-lp55xx: Add new ti,lp5569 compatibleDocumentation/devicetree/bindings/leds/leds-lp55xx.yaml+1 -00 replies
3/20leds: leds-lp55xx: Generalize stop_all_engine OPdrivers/leds/leds-lp5521.c drivers/leds/leds-lp5523.c drivers/leds/leds-lp5562.c +3 more+84 -340 replies
4/20leds: leds-lp55xx: Generalize probe/remove functionsdrivers/leds/leds-lp5521.c drivers/leds/leds-lp5523.c drivers/leds/leds-lp5562.c +3 more+127 -3620 replies
5/20leds: leds-lp55xx: Generalize load_engine functiondrivers/leds/leds-lp5521.c drivers/leds/leds-lp5523.c drivers/leds/leds-lp5562.c +3 more+43 -840 replies
6/20leds: leds-lp55xx: Generalize load_engine_and_select_page functiondrivers/leds/leds-lp5523.c drivers/leds/leds-lp55xx-common.c drivers/leds/leds-lp55xx-common.h +1 more+21 -330 replies
7/20leds: leds-lp55xx: Generalize run_engine functiondrivers/leds/leds-lp5521.c drivers/leds/leds-lp5523.c drivers/leds/leds-lp5562.c +3 more+65 -1460 replies
8/20leds: leds-lp55xx: Generalize update_program_memory functiondrivers/leds/leds-lp5521.c drivers/leds/leds-lp5523.c drivers/leds/leds-lp5562.c +3 more+79 -1980 replies
9/20leds: leds-lp55xx: Generalize firmware_loaded functiondrivers/leds/leds-lp5521.c drivers/leds/leds-lp5523.c drivers/leds/leds-lp5562.c +3 more+30 -880 replies
10/20leds: leds-lp55xx: Generalize led_brightness functiondrivers/leds/leds-lp5521.c drivers/leds/leds-lp5523.c drivers/leds/leds-lp55xx-common.c +2 more+29 -410 replies
11/20leds: leds-lp55xx: Generalize multicolor_brightness functiondrivers/leds/leds-lp5521.c drivers/leds/leds-lp5523.c drivers/leds/leds-lp55xx-common.c +1 more+24 -400 replies
12/20leds: leds-lp55xx: Generalize set_led_current functiondrivers/leds/leds-lp5521.c drivers/leds/leds-lp5523.c drivers/leds/leds-lp55xx-common.c +2 more+26 -240 replies
13/20leds: leds-lp55xx: Generalize turn_off_channels functiondrivers/leds/leds-lp5523.c drivers/leds/leds-lp55xx-common.c drivers/leds/leds-lp55xx-common.h +1 more+13 -180 replies
14/20leds: leds-lp55xx: Generalize stop_engine functiondrivers/leds/leds-lp5521.c drivers/leds/leds-lp5523.c drivers/leds/leds-lp55xx-common.c +1 more+20 -340 replies
15/20leds: leds-lp55xx: Generalize sysfs engine_load and engine_modedrivers/leds/leds-lp5521.c drivers/leds/leds-lp5523.c drivers/leds/leds-lp55xx-common.c +1 more+117 -1861 reply
16/20leds: leds-lp55xx: Generalize sysfs engine_ledsdrivers/leds/leds-lp5523.c drivers/leds/leds-lp55xx-common.c drivers/leds/leds-lp55xx-common.h+131 -1290 replies
17/20leds: leds-lp55xx: Generalize sysfs master_faderdrivers/leds/leds-lp5523.c drivers/leds/leds-lp55xx-common.c drivers/leds/leds-lp55xx-common.h+156 -1390 replies
18/20leds: leds-lp55xx: Support ENGINE program up to 128 bytesdrivers/leds/leds-lp5523.c drivers/leds/leds-lp5562.c drivers/leds/leds-lp55xx-common.c +1 more+49 -190 replies
19/20leds: leds-lp55xx: Drop deprecated definesdrivers/leds/leds-lp5521.c drivers/leds/leds-lp5523.c drivers/leds/leds-lp5562.c +1 more+0 -1160 replies
20/20leds: leds-lp5569: Add support for Texas Instruments LP5569drivers/leds/Kconfig drivers/leds/Makefile drivers/leds/leds-lp5569.c+558 -30 replies

Reviews trailers per patch

2 of 20 patches have a Reviewed-by or Acked-by.

PatchRob Herring (Arm)Conor Dooley
1/20A-b
2/20A-b
3/20
4/20
5/20
6/20
7/20
8/20
9/20
10/20
11/20
12/20
13/20
14/20
15/20
16/20
17/20
18/20
19/20
20/20

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v8 thread

Cover letter [PATCH v8 00/20] leds: leds-lp55xx: overhaul driver

This long series is (as requested) a big overhaul of the lp55xx based LED driver.

As notice for these kind of LED chip there was the bad habit of copy the old driver and just modify it enough to make it work with the new model. Till v4 I was also doing the same by following the pattern and the code format of previous driver.

Since Lee didn't like this, here is the BIG series that generalize pretty much anything in the 4 model currently supported.

Indeed, although the LED chip have fundamental difference (page support), things can be generalized and produce slimmer drivers by putting everything in the lp55xx-common shared module.

This result in the new model lp5569 being very small with only the selftest portion to be custom.

Lee also wasn't clear by the meaning of ENGINE in these LED driver, so here some simple explaination. This is very common on these TI LED chip. The ENGINE (there are always 3) is just some kind of processor that execute a program (precompiled code ASM like) loaded in the SRAM. Sysfs is used to load the pattern, and to start and stop the engine.

These pattern can do all kind of complex thing with LEDs. Old LED chip had 32bytes of space for the pattern but newer one (like lp5569) have pages and if correctly configured can have massive pattern. These pattern can do all kind of magic like loops that make the LED pulse, change color and all kind of stuff.

(For Lee, sorry if you will have to repeat some review that I might
have missed in the lp5569 driver)

Changes v8:
- Rebase on top of for-leds-next (assuming the 3 commit got dropped) Changes v7:
- Add Suggested-by tag
- Fix checkpatch error for complex macro (rework define)
- Add missing values for fader conversion
- Align some function with redundant new line
- Capitalize every commit title
Changes v6:
- Fix compilation warning for ret unused in read_poll_timeout (no idea why this is flagged only on some particular arch...)
- Fix missing bitfield.h in lp55x-common.c (again it seems this header gets included in the flow if the arch use them or not...)
Changes v5:
- Big generalization patch
- Rework lp5569 driver with new generalized functions
- Drop all copyright header in lp5569 as the driver got reworked entirely and it's not based on previous one anymore.
Changes v4:
- Fix reported buffer overflow due to a copypaste error
- Add comments to describe fw size logic
Changes v3:
- Add ACK tag to DT patch
- Enlarge and support program size up to 128bytes
Changes v2:
- Add ACK tag to DT patch
- Fix compilation error with target that doesn't
include bitfield.h

Christian Marangi (20):
dt-bindings: leds-lp55xx: Limit pwr-sel property to ti,lp8501
dt-bindings: leds-lp55xx: Add new ti,lp5569 compatible
leds: leds-lp55xx: Generalize stop_all_engine OP
leds: leds-lp55xx: Generalize probe/remove functions
leds: leds-lp55xx: Generalize load_engine function
leds: leds-lp55xx: Generalize load_engine_and_select_page function
leds: leds-lp55xx: Generalize run_engine function
leds: leds-lp55xx: Generalize update_program_memory function
leds: leds-lp55xx: Generalize firmware_loaded function
leds: leds-lp55xx: Generalize led_brightness function
leds: leds-lp55xx: Generalize multicolor_brightness function
leds: leds-lp55xx: Generalize set_led_current function
leds: leds-lp55xx: Generalize turn_off_channels function
leds: leds-lp55xx: Generalize stop_engine function
leds: leds-lp55xx: Generalize sysfs engine_load and engine_mode
leds: leds-lp55xx: Generalize sysfs engine_leds
leds: leds-lp55xx: Generalize sysfs master_fader
leds: leds-lp55xx: Support ENGINE program up to 128 bytes
leds: leds-lp55xx: Drop deprecated defines
leds: leds-lp5569: Add support for Texas Instruments LP5569

 .../devicetree/bindings/leds/leds-lp55xx.yaml |  11 +
 drivers/leds/Kconfig                          |  16 +-
 drivers/leds/Makefile                         |   1 +
 drivers/leds/leds-lp5521.c                    | 405 +---------
 drivers/leds/leds-lp5523.c                    | 734 ++---------------
 drivers/leds/leds-lp5562.c                    | 261 +-----
 drivers/leds/leds-lp5569.c                    | 544 +++++++++++++
 drivers/leds/leds-lp55xx-common.c             | 743 +++++++++++++++++-
 drivers/leds/leds-lp55xx-common.h             | 163 ++--
 drivers/leds/leds-lp8501.c                    | 313 +-------
 10 files changed, 1540 insertions(+), 1651 deletions(-)
 create mode 100644 drivers/leds/leds-lp5569.c
Signature · 1 line
2.45.1