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 New
Headers show
Series leds: mt6360: Add LED driver for MT6360 | expand

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
Pavel Machek Nov. 19, 2020, 8:38 a.m. UTC | #4
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
-- 
http://www.livejournal.com/~pavelmachek
Jacek Anaszewski Nov. 19, 2020, 9:03 p.m. UTC | #5
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...

-- 
Best regards,
Jacek Anaszewski
Jacek Anaszewski Nov. 19, 2020, 10:26 p.m. UTC | #6
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

> 


-- 
Best regards,
Jacek Anaszewski
Gene Chen Nov. 23, 2020, 3 a.m. UTC | #7
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 | #8
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/
Gene Chen Nov. 24, 2020, 7:33 a.m. UTC | #9
Jacek Anaszewski <jacek.anaszewski@gmail.com> 於 2020年11月24日 週二 上午4:52寫道:
>

> 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/

>


We use term "Moonlight" as reference says
"When you are trying to imitate moonlight you need to use low voltage,
softer lighting. You don’t want something that’s too bright"
which is focus on brightness instead of color.

So we surpose Moonlight can be white or amber.

Should I add LED_FUNCTION_MOONLIGHT and set LED_COLOR_ID_WHITE?

> --

> Best regards,

> Jacek Anaszewski
Gene Chen Nov. 24, 2020, 8:32 a.m. UTC | #10
Fix Typo.

Gene Chen <gene.chen.richtek@gmail.com> 於 2020年11月24日 週二 下午3:33寫道:
>
> Jacek Anaszewski <jacek.anaszewski@gmail.com> 於 2020年11月24日 週二 上午4:52寫道:
> >
> > 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?
> >

we suppose Moonlight can be white or amber.

> > 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/
> >
>
> According to reference,
> "When you are trying to imitate moonlight you need to use low voltage,
> softer lighting. You don’t want something that’s too bright"
> which is focus on brightness instead of color.
>
> So we suppose Moonlight can be white or amber.
>
> Should I add LED_FUNCTION_MOONLIGHT and set LED_COLOR_ID_WHITE?
>
> > --
> > Best regards,
> > Jacek Anaszewski
Jacek Anaszewski Nov. 24, 2020, 9:38 p.m. UTC | #11
On 11/24/20 8:33 AM, Gene Chen wrote:
> Jacek Anaszewski <jacek.anaszewski@gmail.com> 於 2020年11月24日 週二 上午4:52寫道:

>>

>> 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/

>>

> 

> We use term "Moonlight" as reference says

> "When you are trying to imitate moonlight you need to use low voltage,

> softer lighting. You don’t want something that’s too bright"

> which is focus on brightness instead of color.

> 

> So we surpose Moonlight can be white or amber.

> 

> Should I add LED_FUNCTION_MOONLIGHT and set LED_COLOR_ID_WHITE?


Regarding the function - yes, the reference backs that up.
Regarding the color - if you feel that it properly describes the
LED color then go for it.

-- 
Best regards,
Jacek Anaszewski
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. */