diff mbox series

[v7,2/5] dt-bindings: leds: Add LED_COLOR_ID_MOONLIGHT definitions

Message ID 1605696462-391-3-git-send-email-gene.chen.richtek@gmail.com
State Needs Review / ACK
Headers show
Series leds: mt6360: Add LED driver for MT6360 | expand

Checks

Context Check Description
robh/checkpatch success

Commit Message

Gene Chen Nov. 18, 2020, 10:47 a.m. UTC
From: Gene Chen <gene_chen@richtek.com>

Add LED_COLOR_ID_MOONLIGHT definitions

Signed-off-by: Gene Chen <gene_chen@richtek.com>
---
 include/dt-bindings/leds/common.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Pavel Machek Nov. 18, 2020, 9:37 p.m. UTC | #1
Hi!

> From: Gene Chen <gene_chen@richtek.com>
> 
> Add LED_COLOR_ID_MOONLIGHT definitions

Why is moonlight a color? Camera flashes are usually white, no?

At least it needs a comment...

Best regards,
								Pavel
								


> Signed-off-by: Gene Chen <gene_chen@richtek.com>
> ---
>  include/dt-bindings/leds/common.h | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/include/dt-bindings/leds/common.h b/include/dt-bindings/leds/common.h
> index 52b619d..1409e9a 100644
> --- a/include/dt-bindings/leds/common.h
> +++ b/include/dt-bindings/leds/common.h
> @@ -33,7 +33,8 @@
>  #define LED_COLOR_ID_MULTI	8	/* For multicolor LEDs */
>  #define LED_COLOR_ID_RGB	9	/* For multicolor LEDs that can do arbitrary color,
>  					   so this would include RGBW and similar */
> -#define LED_COLOR_ID_MAX	10
> +#define LED_COLOR_ID_MOONLIGHT	10
> +#define LED_COLOR_ID_MAX	11
>  
>  /* Standard LED functions */
>  /* Keyboard LEDs, usually it would be input4::capslock etc. */
Gene Chen Nov. 19, 2020, 2:20 a.m. UTC | #2
Pavel Machek <pavel@ucw.cz> 於 2020年11月19日 週四 上午5:37寫道:
>
> Hi!
>
> > From: Gene Chen <gene_chen@richtek.com>
> >
> > Add LED_COLOR_ID_MOONLIGHT definitions
>
> Why is moonlight a color? Camera flashes are usually white, no?
>
> At least it needs a comment...
>
> Best regards,
>                                                                 Pavel
>

Moonlight has more current level(150mA) from general RGB LED (24mA).
It can be used as night-light and usually use color AMBER.
Camera flashes are usually use two flash LED. One is YELLOW, and one is WHITE.

>
>
> > Signed-off-by: Gene Chen <gene_chen@richtek.com>
> > ---
> >  include/dt-bindings/leds/common.h | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/include/dt-bindings/leds/common.h b/include/dt-bindings/leds/common.h
> > index 52b619d..1409e9a 100644
> > --- a/include/dt-bindings/leds/common.h
> > +++ b/include/dt-bindings/leds/common.h
> > @@ -33,7 +33,8 @@
> >  #define LED_COLOR_ID_MULTI   8       /* For multicolor LEDs */
> >  #define LED_COLOR_ID_RGB     9       /* For multicolor LEDs that can do arbitrary color,
> >                                          so this would include RGBW and similar */
> > -#define LED_COLOR_ID_MAX     10
> > +#define LED_COLOR_ID_MOONLIGHT       10
> > +#define LED_COLOR_ID_MAX     11
> >
> >  /* Standard LED functions */
> >  /* Keyboard LEDs, usually it would be input4::capslock etc. */
>
> --
> http://www.livejournal.com/~pavelmachek
Pavel Machek Nov. 19, 2020, 7:44 a.m. UTC | #3
Hi!

> > > From: Gene Chen <gene_chen@richtek.com>
> > >
> > > Add LED_COLOR_ID_MOONLIGHT definitions
> >
> > Why is moonlight a color? Camera flashes are usually white, no?
> >
> > At least it needs a comment...
> >
> > Best regards,
> >                                                                 Pavel
> >
> 
> Moonlight has more current level(150mA) from general RGB LED (24mA).
> It can be used as night-light and usually use color AMBER.
> Camera flashes are usually use two flash LED. One is YELLOW, and one
>is WHITE.

From what I seen, night-lights are usually differetent "temperatures"
of white. Cool white + warm white.

I believe "warm white" would be easier to understand than
"moonlight"...

Best regards,
								Pavel
Gene Chen Nov. 19, 2020, 7:55 a.m. UTC | #4
Pavel Machek <pavel@ucw.cz> 於 2020年11月19日 週四 下午3:44寫道:
>
> Hi!
>
> > > > From: Gene Chen <gene_chen@richtek.com>
> > > >
> > > > Add LED_COLOR_ID_MOONLIGHT definitions
> > >
> > > Why is moonlight a color? Camera flashes are usually white, no?
> > >
> > > At least it needs a comment...
> > >
> > > Best regards,
> > >                                                                 Pavel
> > >
> >
> > Moonlight has more current level(150mA) from general RGB LED (24mA).
> > It can be used as night-light and usually use color AMBER.
> > Camera flashes are usually use two flash LED. One is YELLOW, and one
> >is WHITE.
>
> From what I seen, night-lights are usually differetent "temperatures"
> of white. Cool white + warm white.
>
> I believe "warm white" would be easier to understand than
> "moonlight"...
>

ACK, I will change color "LED_COLOR_ID_WHITE"

> Best regards,
>                                                                 Pavel
>
> --
> http://www.livejournal.com/~pavelmachek
Pavel Machek Nov. 19, 2020, 8:38 a.m. UTC | #5
Hi!

> > > Moonlight has more current level(150mA) from general RGB LED (24mA).
> > > It can be used as night-light and usually use color AMBER.
> > > Camera flashes are usually use two flash LED. One is YELLOW, and one
> > >is WHITE.
> >
> > From what I seen, night-lights are usually differetent "temperatures"
> > of white. Cool white + warm white.
> >
> > I believe "warm white" would be easier to understand than
> > "moonlight"...
> 
> ACK, I will change color "LED_COLOR_ID_WHITE"

If you have two leds that differ only in one being "cool white" and
one being "warm white", you may need to introduce defines for one of
them.

If not, keeping "LED_COLOR_ID_WHITE" is enough.

Best regards,
								Pavel
Jacek Anaszewski Nov. 19, 2020, 9:03 p.m. UTC | #6
Hi Pavel, Gene,

On 11/18/20 10:37 PM, Pavel Machek wrote:
> Hi!
> 
>> From: Gene Chen <gene_chen@richtek.com>
>>
>> Add LED_COLOR_ID_MOONLIGHT definitions
> 
> Why is moonlight a color? Camera flashes are usually white, no?
> 
> At least it needs a comment...

That's my fault, In fact I should have asked about adding
LED_FUNCTION_MOONLIGHT, it was evidently too late for me that evening...
Pavel Machek Nov. 19, 2020, 9:57 p.m. UTC | #7
On Thu 2020-11-19 22:03:14, Jacek Anaszewski wrote:
> Hi Pavel, Gene,
> 
> On 11/18/20 10:37 PM, Pavel Machek wrote:
> >Hi!
> >
> >>From: Gene Chen <gene_chen@richtek.com>
> >>
> >>Add LED_COLOR_ID_MOONLIGHT definitions
> >
> >Why is moonlight a color? Camera flashes are usually white, no?
> >
> >At least it needs a comment...
> 
> That's my fault, In fact I should have asked about adding
> LED_FUNCTION_MOONLIGHT, it was evidently too late for me that evening...

Aha, that makes more sense.

But please let's call it "torch" if we do that, as that is already
used in kernel sources... and probably in the interface, too:

./arch/arm/mach-pxa/ezx.c:    	       	  .name = "a910::torch",

Best regards,
							Pavel
Jacek Anaszewski Nov. 19, 2020, 10:26 p.m. UTC | #8
On 11/19/20 10:57 PM, Pavel Machek wrote:
> On Thu 2020-11-19 22:03:14, Jacek Anaszewski wrote:
>> Hi Pavel, Gene,
>>
>> On 11/18/20 10:37 PM, Pavel Machek wrote:
>>> Hi!
>>>
>>>> From: Gene Chen <gene_chen@richtek.com>
>>>>
>>>> Add LED_COLOR_ID_MOONLIGHT definitions
>>>
>>> Why is moonlight a color? Camera flashes are usually white, no?
>>>
>>> At least it needs a comment...
>>
>> That's my fault, In fact I should have asked about adding
>> LED_FUNCTION_MOONLIGHT, it was evidently too late for me that evening...
> 
> Aha, that makes more sense.
> 
> But please let's call it "torch" if we do that, as that is already
> used in kernel sources... and probably in the interface, too:

I'd say that torch is something different that moonlight,
but we would need more input from Gene to learn more about
the nature of light emitted by ML LED on his device.

Please note that torch is usually meant as the other mode of
flash LED (sometimes it is called "movie mode"), which is already
handled by brightness file of LED class flash device (i.e. its LED class
subset), and which also maps to v4l2-flash TORCH mode.

> ./arch/arm/mach-pxa/ezx.c:    	       	  .name = "a910::torch",
> 
> Best regards,
> 							Pavel
>
Gene Chen Nov. 23, 2020, 3 a.m. UTC | #9
Jacek Anaszewski <jacek.anaszewski@gmail.com> 於 2020年11月20日 週五 上午6:26寫道:
>
> On 11/19/20 10:57 PM, Pavel Machek wrote:
> > On Thu 2020-11-19 22:03:14, Jacek Anaszewski wrote:
> >> Hi Pavel, Gene,
> >>
> >> On 11/18/20 10:37 PM, Pavel Machek wrote:
> >>> Hi!
> >>>
> >>>> From: Gene Chen <gene_chen@richtek.com>
> >>>>
> >>>> Add LED_COLOR_ID_MOONLIGHT definitions
> >>>
> >>> Why is moonlight a color? Camera flashes are usually white, no?
> >>>
> >>> At least it needs a comment...
> >>
> >> That's my fault, In fact I should have asked about adding
> >> LED_FUNCTION_MOONLIGHT, it was evidently too late for me that evening...
> >
> > Aha, that makes more sense.
> >
> > But please let's call it "torch" if we do that, as that is already
> > used in kernel sources... and probably in the interface, too:
>
> I'd say that torch is something different that moonlight,
> but we would need more input from Gene to learn more about
> the nature of light emitted by ML LED on his device.
>
> Please note that torch is usually meant as the other mode of
> flash LED (sometimes it is called "movie mode"), which is already
> handled by brightness file of LED class flash device (i.e. its LED class
> subset), and which also maps to v4l2-flash TORCH mode.
>

It's used to front camera fill light.
More brightness than screen backlight, and more soft light than flash.
I think LED_ID_COLOR_WHITE is okay.

> > ./arch/arm/mach-pxa/ezx.c:                      .name = "a910::torch",
> >
> > Best regards,
> >                                                       Pavel
> >
>
> --
> Best regards,
> Jacek Anaszewski
Jacek Anaszewski Nov. 23, 2020, 8:52 p.m. UTC | #10
On 11/23/20 4:00 AM, Gene Chen wrote:
> Jacek Anaszewski <jacek.anaszewski@gmail.com> 於 2020年11月20日 週五 上午6:26寫道:
>>
>> On 11/19/20 10:57 PM, Pavel Machek wrote:
>>> On Thu 2020-11-19 22:03:14, Jacek Anaszewski wrote:
>>>> Hi Pavel, Gene,
>>>>
>>>> On 11/18/20 10:37 PM, Pavel Machek wrote:
>>>>> Hi!
>>>>>
>>>>>> From: Gene Chen <gene_chen@richtek.com>
>>>>>>
>>>>>> Add LED_COLOR_ID_MOONLIGHT definitions
>>>>>
>>>>> Why is moonlight a color? Camera flashes are usually white, no?
>>>>>
>>>>> At least it needs a comment...
>>>>
>>>> That's my fault, In fact I should have asked about adding
>>>> LED_FUNCTION_MOONLIGHT, it was evidently too late for me that evening...
>>>
>>> Aha, that makes more sense.
>>>
>>> But please let's call it "torch" if we do that, as that is already
>>> used in kernel sources... and probably in the interface, too:
>>
>> I'd say that torch is something different that moonlight,
>> but we would need more input from Gene to learn more about
>> the nature of light emitted by ML LED on his device.
>>
>> Please note that torch is usually meant as the other mode of
>> flash LED (sometimes it is called "movie mode"), which is already
>> handled by brightness file of LED class flash device (i.e. its LED class
>> subset), and which also maps to v4l2-flash TORCH mode.
>>
> 
> It's used to front camera fill light.
> More brightness than screen backlight, and more soft light than flash.
> I think LED_ID_COLOR_WHITE is okay.

So why in v6 you assigned LED_COLOR_ID_AMBER to it?

Regardless of that, now we're talking about LED function - you chose
LED_FUNCTION_INDICATOR for it, but inferring from your above description
- it certainly doesn't fit here.

Also register names, containing part "ML" indicate that this LED's
intended function is moonlinght, which your description somehow
corroborates.

Moonlight LEDs become ubiquitous nowadays so sooner or later we will
need to add this function anyway [0].

[0] 
https://landscapelightingoakville.com/what-is-moon-lighting-and-why-does-it-remain-so-popular/
diff mbox series

Patch

diff --git a/include/dt-bindings/leds/common.h b/include/dt-bindings/leds/common.h
index 52b619d..1409e9a 100644
--- a/include/dt-bindings/leds/common.h
+++ b/include/dt-bindings/leds/common.h
@@ -33,7 +33,8 @@ 
 #define LED_COLOR_ID_MULTI	8	/* For multicolor LEDs */
 #define LED_COLOR_ID_RGB	9	/* For multicolor LEDs that can do arbitrary color,
 					   so this would include RGBW and similar */
-#define LED_COLOR_ID_MAX	10
+#define LED_COLOR_ID_MOONLIGHT	10
+#define LED_COLOR_ID_MAX	11
 
 /* Standard LED functions */
 /* Keyboard LEDs, usually it would be input4::capslock etc. */