linux-leds.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jacek Anaszewski <jacek.anaszewski@gmail.com>
To: Linus Walleij <linus.walleij@linaro.org>,
	Hans Verkuil <hverkuil@xs4all.nl>
Cc: Pavel Machek <pavel@ucw.cz>, Dan Murphy <dmurphy@ti.com>,
	Linux LED Subsystem <linux-leds@vger.kernel.org>,
	newbytee@protonmail.com, Stephan Gerhold <stephan@gerhold.net>,
	Sakari Ailus <sakari.ailus@linux.intel.com>
Subject: Re: [PATCH 2/2] leds: rt8515: Add Richtek RT8515 LED driver
Date: Thu, 15 Oct 2020 22:39:06 +0200	[thread overview]
Message-ID: <542c2f4c-a51a-cc90-632f-31c891b7146f@gmail.com> (raw)
In-Reply-To: <CACRpkdYgf8OPc2EqmPu=O2dr+ns4e3kTGyVi3A2Thd9v1wQGuA@mail.gmail.com>

Hi Linus,

On 10/14/20 12:52 PM, Linus Walleij wrote:
> Hi Jakub!

Jacek :-)

> thanks for the review. I fixed all comments but I have a problem
> with the below:
> 
> On Thu, Aug 13, 2020 at 11:04 PM Jacek Anaszewski
> <jacek.anaszewski@gmail.com> wrote:
>> On 8/12/20 11:07 AM, Linus Walleij wrote:
> 
>>> +     /* Init flash intensity setting */
>>> +     s = &v4l2_sd_cfg->intensity;
>>> +     s->min = 0;
>>> +     s->max = rt->fled.led_cdev.max_brightness;
>>> +     s->step = 1;
>>
>> struct v4l2_flash_config's intensity property tells V4L2 flash framework
>> how to convert LED class brightness levels to microamperes used by
>> the V4L2 flash subdevice.
>>
>> See max77693_init_v4l2_flash_config() in drivers/leds/leds-max77693.c
>> for a reference.
> 
> I understand, but I'm a bit of lost here, because I do not have
> any datsheet for the Richtek RT8515. The outoftree code
> that exists for example for Asus Zenfone:
> https://github.com/ZenfoneArea/android_kernel_asus_zenfone5/blob/master/linux/modules/camera/drivers/media/i2c/rt8515.c
> 
> The intensity is set to min/max in percent
> (0-100%) so the numerals 1-100 step 1 so
> the same as the brightness.

In such case there is not much we can do and your solution
seems reasonable.

> Is the V4L2 API such defined that if you don't know
> what microamperes that correspond to a certain setting
> it is better to simply not implement it? I can certainly
> remove it.

That would be a question to the author of V4L2 API.

Adding Sakari.

> I don't quite understand why V4L2 needs to control this
> in uA but I suppose they have a good reason. It however
> creates a really high bar for out-of-tree code from
> non-cooperative vendors. I'll try to send a mail to
> Richtek and ask for the datasheet though, stranger things
> have happened.

-- 
Best regards,
Jacek Anaszewski

  reply	other threads:[~2020-10-15 20:39 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-12  9:07 [PATCH 1/2] dt-bindings: leds: Add DT binding for Richtek RT8515 Linus Walleij
2020-08-12  9:07 ` [PATCH 2/2] leds: rt8515: Add Richtek RT8515 LED driver Linus Walleij
2020-08-13 21:04   ` Jacek Anaszewski
2020-10-14 10:52     ` Linus Walleij
2020-10-15 20:39       ` Jacek Anaszewski [this message]
2020-08-13 21:06 ` [PATCH 1/2] dt-bindings: leds: Add DT binding for Richtek RT8515 Jacek Anaszewski
2020-08-19 21:05   ` Linus Walleij
2020-08-19 21:20     ` Jacek Anaszewski
2020-09-09  8:37       ` Pavel Machek

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=542c2f4c-a51a-cc90-632f-31c891b7146f@gmail.com \
    --to=jacek.anaszewski@gmail.com \
    --cc=dmurphy@ti.com \
    --cc=hverkuil@xs4all.nl \
    --cc=linus.walleij@linaro.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=newbytee@protonmail.com \
    --cc=pavel@ucw.cz \
    --cc=sakari.ailus@linux.intel.com \
    --cc=stephan@gerhold.net \
    /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).