Re: as3645a flash userland interface

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




Hi Pavel and others,

On 09/14/17 13:07, Pavel Machek wrote:
> Hi!
> 
>>>>>> What directory are the flash controls in?
>>>>>>
>>>>>> /sys/class/leds/led-controller:flash ?
>>>>>>
>>>>>> Could we arrange for something less generic, like
>>>>>>
>>>>>> /sys/class/leds/main-camera:flash ?
>>>>>
>>>>> I'd rather avoid overcomplicating this. LED class device name pattern
>>>>> is well defined to devicename:colour:function
>>>>> (see Documentation/leds/leds-class.txt, "LED Device Naming" section).
>>>>>
>>>>> In this case "flash" in place of the "function" segment makes the
>>>>> things clear enough I suppose.
>>>>
>>>> It does not.
>>>>
>>>> Phones usually have two cameras, front and back, and these days both
>>>> cameras have their flash.
>>>>
>>>> And poor userspace flashlight application can not know if as3645
>>>> drivers front LED or back LED. Thus, I'd set devicename to
>>>> front-camera or main-camera -- because that's what it is associated
>>>> with. Userspace does not care what hardware drives the LED, but needs
>>>> to know if it is front or back camera.
>>>
>>> The name of a LED flash class device isn't fixed and is derived
>> >from DT label property. Name in the example of some DT bindings
>>> will not force people to apply similar pattern for the other
>>> drivers and even for the related one. No worry about having
>>> to keep anything forever basing on that.
>>
>> Isn't the V4L2 subdev/Media Controller API supposed to provide means
>> for associating flash LEDs with camera sensors? You seem to be 

It should, and will, but doesn't do that yet. The information will soon
available to the kernel but even that's not yet in mainline.

insisting
>> on using the sysfs leds interface for that, which is not a primary
>> interface for camera flash AFAICT.
> 
> a) subdev/media controller API currently does not provide such means.
> 
> b) if we have /sys/class/leds interface to userland, it should be
> useful.
> 
> c) having flashlight application going through media controller API is
> a bad joke.

d) V4L2 sub-devices are always related to a master device (that usually
has the DMA engine). In the absence of that, there will be no sub-device
node either. In other words, if you don't have a camera, you won't have
a sub-device. And it's perfectly possible to have a flash LED without a
camera.

For what's worth, I think there was a Nokia (S30 ?) phone long, long
time ago with a torch LED but no camera. 1100 maybe? The old one, not
the new one.

-- 
Regards,

Sakari Ailus
sakari.ailus@xxxxxxxxxxxxxxx

Attachment: signature.asc
Description: OpenPGP digital signature


[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux