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?).
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(-)
--
2.11.0
Unnecessary platform_set_drvdata() has been removed since the driver
core clears the driver data to NULL after device release or on
probe failure. There is no need to manually clear the device
driver data to NULL.
The Coccinelle semantic patch used to make this change is as follows:
//<smpl>
@@
struct platform_device *pdev;
@@
- platform_set_drvdata(pdev, NULL);
//</smpl>
Signed-off-by: Amitoj Kaur Chawla <amitoj1606(a)gmail.com>
---
drivers/staging/greybus/arche-platform.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/staging/greybus/arche-platform.c b/drivers/staging/greybus/arche-platform.c
index eced2d2..358b260 100644
--- a/drivers/staging/greybus/arche-platform.c
+++ b/drivers/staging/greybus/arche-platform.c
@@ -607,7 +607,6 @@ static int arche_platform_remove(struct platform_device *pdev)
device_remove_file(&pdev->dev, &dev_attr_state);
device_for_each_child(&pdev->dev, NULL, arche_remove_child);
arche_platform_poweroff_seq(arche_pdata);
- platform_set_drvdata(pdev, NULL);
if (usb3613_hub_mode_ctrl(false))
dev_warn(arche_pdata->dev, "failed to control hub device\n");
--
2.7.4