Skip to content

Create sub-device per LED

Sakari Ailus linux-leds linux-media 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest3 patches 2 repliesIn review
  2. v23 patches 10 repliesSuperseded
  3. v12 patches 9 repliesSuperseded

Changes in v3 from the cover letter

- Add Hans's acks and Rui's reviewed-by.

- Use IS_ERR() instead of IS_ERR_OR_NULL() to check v4l2_flash_init() success --- it never returns NULL.

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3staging: greybus: light: fix memory leak in v4l2 registerdrivers/staging/greybus/light.c+9 -201 reply
2/3v4l2-flash-led-class: Create separate sub-devices for indicatorsdrivers/leds/leds-aat1290.c drivers/leds/leds-max77693.c drivers/media/v4l2-core/v4l2-flash-led-class.c +2 more+117 -680 replies
2/3v4l2-flash-led-class: Create separate sub-devices for indicatorsdrivers/leds/leds-aat1290.c drivers/leds/leds-max77693.c drivers/media/v4l2-core/v4l2-flash-led-class.c +2 more+117 -670 replies
2/3v4l2-flash-led-class: Create separate sub-devices for indicatorsdrivers/leds/leds-aat1290.c drivers/leds/leds-max77693.c drivers/media/v4l2-core/v4l2-flash-led-class.c +2 more+117 -671 reply
3/3v4l2-flash-led-class: Document v4l2_flash_init() referencesinclude/media/v4l2-flash-led-class.h+6 -00 replies

Reviews trailers per patch

All 5 patches have a Reviewed-by or Acked-by.

PatchJacek AnaszewskiPavel MachekRui Miguel SilvaHans VerkuilViresh Kumar
1/3A-b R-b
2/3R-b R-b R-b A-b A-b A-b R-b R-b R-b A-b A-b A-b
2/3R-b R-b R-b A-b A-b A-b R-b R-b R-b A-b A-b A-b
2/3R-b R-b R-b A-b A-b A-b R-b R-b R-b A-b A-b A-b
3/3A-b A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 5 reviewers.

Read the v3 thread

Cover letter [PATCH v3 0/3] Create sub-device per LED

Hi folks,

The original design decision in the V4L2 flash API allows controlling a two LEDs (an indicator and a flash) through a single sub-device. This covered virtually all flash driver chips back then but this no longer holds as there are many LED driver chips with multiple flash LED outputs. This necessitates creating as many sub-devices as there are flash LEDs.

Additionally the flash LEDs can be associated to different sensors. This is not unconceivable although not very probable.

This patchset splits the indicator and flash LEDs exposed by the V4L2 flash class framework into multiple sub-devices. This way the driver creates the sub-devices individually for each LED which will also facilitate fwnode matching (e.g. will you refer to LED or a LED driver chip with a phandle?).

Note that this set depends on patch 85f7ff9702bc ("media:
v4l2-flash: Use led_classdev instead of led_classdev_flash for indicator") in mediatree master.

since v2:

- Add Hans's acks and Rui's reviewed-by.

- Use IS_ERR() instead of IS_ERR_OR_NULL() to check v4l2_flash_init() success --- it never returns NULL.

since v1:

- Drop patch "staging: greybus: light: Don't leak memory for no gain" in favour of Rui's "staging: greybus: light: fix memory leak in v4l2 register".

- Rebase "staging: greybus: light: fix memory leak in v4l2 register" on "media: v4l2-flash: Use led_classdev instead of led_classdev_flash for indicator" already in mediatree.

- Add "v4l2-flash-led-class: Document v4l2_flash_init() references" to the set.

Rui Miguel Silva (1):
staging: greybus: light: fix memory leak in v4l2 register

Sakari Ailus (2):
v4l2-flash-led-class: Create separate sub-devices for indicators
v4l2-flash-led-class: Document v4l2_flash_init() references

 drivers/leds/leds-aat1290.c                    |   4 +-
 drivers/leds/leds-max77693.c                   |   4 +-
 drivers/media/v4l2-core/v4l2-flash-led-class.c | 113 +++++++++++++++----------
 drivers/staging/greybus/light.c                |  42 ++++-----
 include/media/v4l2-flash-led-class.h           |  47 +++++++---
 5 files changed, 127 insertions(+), 83 deletions(-)
Signature · 1 line
2.11.0