media: v4l2-flash-led-class: Create separate sub-devices for indicators
authorSakari Ailus <sakari.ailus@linux.intel.com>
Tue, 18 Jul 2017 13:26:59 +0000 (09:26 -0400)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Sun, 27 Aug 2017 00:26:35 +0000 (20:26 -0400)
commit503dd28af108888c505e8d6a86f4acf5eb20f3b7
treedea246924c83804906a36d125b2d33f26af68de8
parent428359cbfe086f43cb84b7ab7b48e7e7862700e2
media: v4l2-flash-led-class: Create separate sub-devices for indicators

The V4L2 flash interface allows controlling multiple LEDs through a single
sub-devices if, and only if, these LEDs are of different types. This
approach scales badly for flash controllers that drive multiple flash LEDs
or for LED specific associations. Essentially, the original assumption of a
LED driver chip that drives a single flash LED and an indicator LED is no
longer valid.

Address the matter by registering one sub-device per LED.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Jacek Anaszewski <jacek.anaszewski@gmail.com>
Acked-by: Pavel Machek <pavel@ucw.cz>
Reviewed-by: Rui Miguel Silva <rmfrfs@gmail.com> (for greybus/light)
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/leds/leds-aat1290.c
drivers/leds/leds-max77693.c
drivers/media/v4l2-core/v4l2-flash-led-class.c
drivers/staging/greybus/light.c
include/media/v4l2-flash-led-class.h