This series is a reworked version of the previous seried: 
misc: introduce STATUS LED activity function

This series port and expand the legacy concept of LED boot from
the legacy Status LED API to new LED API.

One thing that many device need is a way to communicate to the
user that the device is actually doing something.

This is especially useful for recovery steps where an
user (for example) insert an USB drive, keep a button pressed
and the device autorecover.

There is currently no way to signal the user externally that
the bootloader is processing/recoverying aside from setting
a LED on.

A solid LED on is not enough and won't actually signal any
kind of progress.
Solution is the good old blinking LED but uboot doesn't
suggest (and support) interrupts and almost all the LED
are usually GPIO LED that doesn't support HW blink.

Additional Kconfg are also introduced to set the LED boot and
activity. Those are referenced by label.

A documentation for old and these new LED API is created.

(world tested with the azure pipeline)

Changes v5:
- Use led_get_by_label and don't cache led dev
- Improve Kconfig for /options location
- Add Reviewed-by tags
- Enable blink also on MTD read
- Drop additional get_state in led_sw_on_state_change from v4
Changes v4:
- Drop led_set_state/period_by_label
- Switch to /options/u-boot
- Rework to cache label and dev in led uclass
- Add multiple patch for additional helper
- Rework patches to limit ifdef in some place
Changes v3:
- Switch to /config property
Changes v2:
- Drop GPIO SW implementation
- Add fix for new LED SW BLINK

Christian Marangi (11):
  led: toggle LED on initial SW blink
  dm: core: implement ofnode_options helpers
  led: implement LED boot API
  common: board_r: rework BOOT LED handling
  led: implement LED activity API
  tftp: implement support for LED activity
  mtd: implement support for LED activity
  ubi: implement support for LED activity
  doc: introduce led.rst documentation
  test: dm: Add tests for LED boot and activity
  test: dm: Expand ofnode options test with new helper

 arch/sandbox/dts/test.dts  |   5 ++
 cmd/mtd.c                  |   9 +++
 cmd/ubi.c                  |  13 ++-
 common/board_r.c           |  28 +++++--
 doc/api/index.rst          |   1 +
 doc/api/led.rst            |  10 +++
 drivers/core/ofnode.c      |  33 ++++++++
 drivers/led/Kconfig        |  24 ++++++
 drivers/led/led-uclass.c   | 162 +++++++++++++++++++++++++++++++++++++
 drivers/led/led_sw_blink.c |  17 +++-
 include/dm/ofnode.h        |  41 ++++++++++
 include/led.h              | 147 ++++++++++++++++++++++++++++++++-
 include/status_led.h       |  13 +++
 net/net.c                  |   4 +
 net/tftp.c                 |   5 ++
 test/dm/led.c              |  72 +++++++++++++++++
 test/dm/ofnode.c           |   9 +++
 17 files changed, 579 insertions(+), 14 deletions(-)
 create mode 100644 doc/api/led.rst

-- 
2.45.2

Reply via email to