From: Jacek Anaszewski <j.anaszewski@samsung.com>
To: Sakari Ailus <sakari.ailus@iki.fi>
Cc: linux-leds@vger.kernel.org, devicetree@vger.kernel.org,
linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
kyungmin.park@samsung.com, b.zolnierkie@samsung.com
Subject: Re: [PATCH/RFC v4 00/21] LED / flash API integration
Date: Thu, 07 Aug 2014 10:31:57 +0200 [thread overview]
Message-ID: <53E3397D.8050708@samsung.com> (raw)
In-Reply-To: <53E336FA.2050306@samsung.com>
On 08/07/2014 10:21 AM, Jacek Anaszewski wrote:
> Hi Sakari,
>
> On 08/06/2014 08:53 AM, Sakari Ailus wrote:
>> Hi Jacek,
>>
>> On Fri, Jul 11, 2014 at 04:04:03PM +0200, Jacek Anaszewski wrote:
>> ...
>>> 1) Who should register V4L2 Flash sub-device?
>>>
>>> LED Flash Class devices, after introduction of the Flash Manager,
>>> are not tightly coupled with any media controller. They are maintained
>>> by the Flash Manager and made available for dynamic assignment to
>>> any media system they are connected to through multiplexing devices.
>>>
>>> In the proposed rough solution, when support for V4L2 Flash sub-devices
>>> is enabled, there is a v4l2_device created for them to register in.
>>> This however implies that V4L2 Flash device will not be available
>>> in any media controller, which calls its existence into question.
>>>
>>> Therefore I'd like to consult possible ways of solving this issue.
>>> The option I see is implementing a mechanism for moving V4L2 Flash
>>> sub-devices between media controllers. A V4L2 Flash sub-device
>>> would initially be assigned to one media system in the relevant
>>> device tree binding, but it could be dynamically reassigned to
>>> the other one. However I'm not sure if media controller design
>>> is prepared for dynamic modifications of its graph and how many
>>> modifications in the existing drivers this solution would require.
>>
>> Do you have a use case where you would need to strobe a flash from
>> multiple
>> media devices at different times, or is this entirely theoretical?
>> Typically
>> flash controllers are connected to a single source of hardware strobe (if
>> there's one) since the flash LEDs are in fact mounted next to a specific
>> camera sensor.
>
> I took into account such arrangements in response to your message [1],
> where you were considering configurations like "one flash but two
> cameras", "one camera and two flashes". And you also called for
> proposing generic solution.
>
> One flash and two (or more) cameras case is easily conceivable -
> You even mentioned stereo cameras. One camera and many flashes
> arrangement might be useful in case of some professional devices which
> might be designed so that they would be able to apply different scene
> lighting. I haven't heard about such devices, but as you said
> such a configuration isn't unthinkable.
>
>> If this is a real issue the way to solve it would be to have a single
>> media
>> device instead of many.
>
> I was considering adding media device, that would be a representation
> of a flash manager, gathering all the registered flashes. Nonetheless,
> finally I came to conclusion that a v4l2-device alone should suffice,
> just to provide a Flash Manager representation allowing for v4l2-flash
> sub-devices to register in.
> All the features provided by the media device are useless in case
> of a set of V4L2 Flash sub-devices. They couldn't have any linkage
> in such a device. The only benefit from having media device gathering
> V4L2 Flash devices would be possibility of listing them.
>
>>> 2) Consequences of locking the Flash Manager during flash strobe
>>>
>>> In case a LED Flash Class device depends on muxes involved in
>>> routing the other LED Flash Class device's strobe signals,
>>> the Flash Manager must be locked for the time of strobing
>>> to prevent reconfiguration of the strobe signal routing
>>> by the other device.
>>
>> I wouldn't be concerned of this in particular. It's more important we do
>> actully have V4L2 flash API supported by LED flash drivers and that
>> they do
>> implement the API correctly.
>>
>> It's at least debatable whether you should try to prevent user space from
>> doing silly things or not. With complex devices it may relatively easily
>> lead to wrecking havoc with actual use cases which we certainly do not
>> want.
>>
>> In this case, if you just prevent changing the routing (do you have a use
>> case for it?) while strobing, someone else could still change the routing
>> just before you strobe.
>
> Originally I started to implementing this so that strobe signal routing
> was altered upon setting strobe source. With such an implementation the
> use case would be as follows:
>
> 1. Process 1 sets strobe source to external
> 2. Process 2 sets strobe source to software
> 3. Process 1 strobes the flash, unaware that strobe source setting has
> been changed
It is of course too generic use case. The more specific one could
be the situation when there are many users in the system that
want to take the picture in the same time. It is not valid in
case of mobile devices though.
> To avoid such problems I changed the implementation so that the
> routing is set in the led_flash_manager_setup_strobe function called
> from led_set_flash_strobe and led_set_external_strobe functions.
> led_flash_manager_setup_strobe sets strobe signal routing
> and strobes the flash under lock and holds it for the flash timeout
> period, which prevents spurious reconfiguration.
>
> Nonetheless, I agree that trying to handle this problem is troublesome,
> and would affect current V4L2 Flash SPI semantics. If you don't share
> my concerns I am happy to leave this locking solution out :)
>
> Best Regards,
> Jacek Anaszewski
>
> [1] http://www.spinics.net/lists/linux-leds/msg01617.html
next prev parent reply other threads:[~2014-08-07 8:31 UTC|newest]
Thread overview: 55+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-11 14:04 [PATCH/RFC v4 00/21] LED / flash API integration Jacek Anaszewski
2014-07-11 14:04 ` [PATCH/RFC v4 01/21] leds: make brightness type consistent across whole subsystem Jacek Anaszewski
2014-07-11 14:04 ` [PATCH/RFC v4 02/21] leds: implement sysfs interface locking mechanism Jacek Anaszewski
2014-07-16 15:35 ` Sakari Ailus
2014-07-11 14:04 ` [PATCH/RFC v4 03/21] leds: Improve and export led_update_brightness Jacek Anaszewski
2014-07-11 14:04 ` [PATCH/RFC v4 04/21] leds: Reorder include directives Jacek Anaszewski
[not found] ` <1405087464-13762-5-git-send-email-j.anaszewski-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2014-07-16 15:42 ` Sakari Ailus
2014-07-11 14:04 ` [PATCH/RFC v4 05/21] leds: avoid using deprecated DEVICE_ATTR macro Jacek Anaszewski
[not found] ` <1405087464-13762-6-git-send-email-j.anaszewski-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2014-07-16 15:46 ` Sakari Ailus
2014-07-11 14:04 ` [PATCH/RFC v4 06/21] leds: add API for setting torch brightness Jacek Anaszewski
2014-07-16 21:54 ` Sakari Ailus
2014-08-04 12:35 ` Jacek Anaszewski
2014-08-04 12:50 ` Sakari Ailus
2014-08-07 13:12 ` Jacek Anaszewski
2014-08-14 4:39 ` Sakari Ailus
2014-08-18 19:55 ` Richard Purdie
2014-08-18 20:06 ` Sakari Ailus
2014-07-11 14:04 ` [PATCH/RFC v4 07/21] of: add of_node_ncmp wrapper Jacek Anaszewski
[not found] ` <1405087464-13762-8-git-send-email-j.anaszewski-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2014-07-16 22:00 ` Sakari Ailus
2014-07-28 13:41 ` Grant Likely
2014-07-11 14:04 ` [PATCH/RFC v4 08/21] leds: Add sysfs and kernel internal API for flash LEDs Jacek Anaszewski
2014-07-11 14:04 ` [PATCH/RFC v4 09/21] Documentation: leds: Add description of LED Flash Class extension Jacek Anaszewski
2014-07-11 14:04 ` [PATCH/RFC v4 10/21] Documentation: leds: add exemplary asynchronous mux driver Jacek Anaszewski
2014-07-11 14:04 ` [PATCH/RFC v4 11/21] DT: leds: Add flash led devices related properties Jacek Anaszewski
2014-07-11 14:04 ` [PATCH/RFC v4 12/21] DT: Add documentation for LED Class Flash Manger Jacek Anaszewski
2014-07-11 14:04 ` [PATCH/RFC v4 13/21] v4l2-device: add v4l2_device_register_subdev_node API Jacek Anaszewski
2014-07-11 14:04 ` [PATCH/RFC v4 14/21] v4l2-ctrls: add control for flash strobe signal providers Jacek Anaszewski
2014-07-11 14:04 ` [PATCH/RFC v4 15/21] media: Add registration helpers for V4L2 flash Jacek Anaszewski
2014-07-21 11:12 ` Sakari Ailus
[not found] ` <53CCF59E.3070200-X3B1VOXEql0@public.gmane.org>
2014-08-04 14:43 ` Jacek Anaszewski
[not found] ` <53DF9C2A.8060403-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2014-08-11 12:26 ` Sakari Ailus
[not found] ` <20140811122628.GG16460-S+BSfZ9RZZmRSg0ZkenSGLdO1Tsj/99ntUK59QYPAWc@public.gmane.org>
2014-08-11 13:27 ` Jacek Anaszewski
2014-08-11 13:45 ` Jacek Anaszewski
2014-08-14 4:34 ` Sakari Ailus
[not found] ` <20140814043436.GM16460-S+BSfZ9RZZmRSg0ZkenSGLdO1Tsj/99ntUK59QYPAWc@public.gmane.org>
2014-08-14 8:25 ` Jacek Anaszewski
2014-08-20 14:41 ` Sakari Ailus
2014-08-21 8:38 ` Jacek Anaszewski
2014-07-11 14:04 ` [PATCH/RFC v4 16/21] leds: Add support for max77693 mfd flash cell Jacek Anaszewski
2014-07-21 14:12 ` Sakari Ailus
2014-07-11 14:04 ` [PATCH/RFC v4 17/21] DT: Add documentation for the mfd Maxim max77693 Jacek Anaszewski
2014-07-11 14:04 ` [PATCH/RFC v4 18/21] leds: Add driver for AAT1290 current regulator Jacek Anaszewski
2014-07-11 14:04 ` [PATCH/RFC v4 19/21] of: Add Skyworks Solutions, Inc. vendor prefix Jacek Anaszewski
2014-07-11 14:04 ` [PATCH/RFC v4 20/21] DT: Add documentation for the Skyworks AAT1290 Jacek Anaszewski
2014-07-11 14:04 ` [PATCH/RFC v4 21/21] ARM: dts: add aat1290 current regulator device node Jacek Anaszewski
2014-07-16 17:19 ` [PATCH/RFC v4 00/21] LED / flash API integration Bryan Wu
2014-07-16 17:21 ` Bryan Wu
2014-08-08 6:43 ` Jacek Anaszewski
2014-08-08 16:59 ` Bryan Wu
2014-08-11 14:24 ` Jacek Anaszewski
2014-08-06 6:53 ` Sakari Ailus
[not found] ` <20140806065358.GC16460-S+BSfZ9RZZmRSg0ZkenSGLdO1Tsj/99ntUK59QYPAWc@public.gmane.org>
2014-08-07 8:21 ` Jacek Anaszewski
2014-08-07 8:31 ` Jacek Anaszewski [this message]
2014-08-14 5:03 ` Sakari Ailus
[not found] ` <20140814050338.GO16460-S+BSfZ9RZZmRSg0ZkenSGLdO1Tsj/99ntUK59QYPAWc@public.gmane.org>
2014-08-14 10:35 ` Jacek Anaszewski
2014-08-15 4:48 ` Sakari Ailus
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=53E3397D.8050708@samsung.com \
--to=j.anaszewski@samsung.com \
--cc=b.zolnierkie@samsung.com \
--cc=devicetree@vger.kernel.org \
--cc=kyungmin.park@samsung.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-leds@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=sakari.ailus@iki.fi \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).