Message ID | 1606906011-25633-1-git-send-email-gene.chen.richtek@gmail.com |
---|---|
Headers | show |
Series | leds: mt6360: Add LED driver for MT6360 | expand |
On Wed 2020-12-02 18:46:49, Gene Chen wrote: > From: Gene Chen <gene_chen@richtek.com> > > Add LED_FUNCTION_MOONLIGHT definitions > > Signed-off-by: Gene Chen <gene_chen@richtek.com> > Acked-by: Jacek Anaszewski <jacek.anaszewski@gmail.com> > Acked-by: Rob Herring <robh@kernel.org> > --- > include/dt-bindings/leds/common.h | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/include/dt-bindings/leds/common.h b/include/dt-bindings/leds/common.h > index 52b619d..843e65d 100644 > --- a/include/dt-bindings/leds/common.h > +++ b/include/dt-bindings/leds/common.h > @@ -78,6 +78,7 @@ > #define LED_FUNCTION_INDICATOR "indicator" > #define LED_FUNCTION_LAN "lan" > #define LED_FUNCTION_MAIL "mail" > +#define LED_FUNCTION_MOONLIGHT "moonlight" There's "torch" function that should be used for this. I guess comment should be added with explanation what exactly that is and how should the LED be named. Best regards, Pavel
Hi! > > > +++ b/include/dt-bindings/leds/common.h > > > @@ -78,6 +78,7 @@ > > > #define LED_FUNCTION_INDICATOR "indicator" > > > #define LED_FUNCTION_LAN "lan" > > > #define LED_FUNCTION_MAIL "mail" > > > +#define LED_FUNCTION_MOONLIGHT "moonlight" > > > > There's "torch" function that should be used for this. I guess comment > > should be added with explanation what exactly that is and how should > > the LED be named. > > > > According to mail, 11/25 "Re: [PATCH v7 2/5] dt-bindings: leds: Add > LED_COLOR_ID_MOONLIGHT definitions", > The Moonlight LED is LED which maximum current more than torch, but > less than flash. Such as front camera fill light. > I think our channel is moonlight, not torch. > I will add this description to comment. > We can't exactly define moonlight current level, because every vendor > has their own specification. So... what is the timelimit on moonlight? But if it is used for camera illumination, I believe it should be simply called flash. Best regards, Pavel -- http://www.livejournal.com/~pavelmachek
Hi Gene, Thanks for the update. On 12/2/20 11:46 AM, Gene Chen wrote: > From: Gene Chen <gene_chen@richtek.com> > > Add bindings document for LED support on MT6360 PMIC > > Signed-off-by: Gene Chen <gene_chen@richtek.com> > --- > .../devicetree/bindings/leds/leds-mt6360.yaml | 159 +++++++++++++++++++++ > 1 file changed, 159 insertions(+) > create mode 100644 Documentation/devicetree/bindings/leds/leds-mt6360.yaml > > diff --git a/Documentation/devicetree/bindings/leds/leds-mt6360.yaml b/Documentation/devicetree/bindings/leds/leds-mt6360.yaml > new file mode 100644 > index 0000000..73c67b1 > --- /dev/null > +++ b/Documentation/devicetree/bindings/leds/leds-mt6360.yaml Acked-by: Jacek Anaszewski <jacek.anaszewski@gmail.com>
On Thu, Dec 03, 2020 at 09:06:42PM +0100, Jacek Anaszewski wrote: > Hi Pavel, > > On 12/3/20 12:40 PM, Pavel Machek wrote: > > Hi! > > > > > > > +++ b/include/dt-bindings/leds/common.h > > > > > @@ -78,6 +78,7 @@ > > > > > #define LED_FUNCTION_INDICATOR "indicator" > > > > > #define LED_FUNCTION_LAN "lan" > > > > > #define LED_FUNCTION_MAIL "mail" > > > > > +#define LED_FUNCTION_MOONLIGHT "moonlight" > > > > > > > > There's "torch" function that should be used for this. I guess comment > > > > should be added with explanation what exactly that is and how should > > > > the LED be named. > > > > > > > > > > According to mail, 11/25 "Re: [PATCH v7 2/5] dt-bindings: leds: Add > > > LED_COLOR_ID_MOONLIGHT definitions", > > > The Moonlight LED is LED which maximum current more than torch, but > > > less than flash. Such as front camera fill light. > > > I think our channel is moonlight, not torch. > > > I will add this description to comment. > > > We can't exactly define moonlight current level, because every vendor > > > has their own specification. > > > > So... what is the timelimit on moonlight? > > > > But if it is used for camera illumination, I believe it should be > > simply called flash. > > Let's keep FLASH reserved for LED flash class devices. > This device has already two other flash iouts. > > Also iouts amperage gives clue that they have three different > functions. Perhaps there should just be a table of currents and max times rather than trying to continually expand this while tied to function. One could simply want an LED brighter when blinking than steady state would allow for. Rob
On Wed, Dec 02, 2020 at 06:46:50PM +0800, Gene Chen wrote: > From: Gene Chen <gene_chen@richtek.com> > > Add bindings document for LED support on MT6360 PMIC > > Signed-off-by: Gene Chen <gene_chen@richtek.com> > --- > .../devicetree/bindings/leds/leds-mt6360.yaml | 159 +++++++++++++++++++++ > 1 file changed, 159 insertions(+) > create mode 100644 Documentation/devicetree/bindings/leds/leds-mt6360.yaml > > diff --git a/Documentation/devicetree/bindings/leds/leds-mt6360.yaml b/Documentation/devicetree/bindings/leds/leds-mt6360.yaml > new file mode 100644 > index 0000000..73c67b1 > --- /dev/null > +++ b/Documentation/devicetree/bindings/leds/leds-mt6360.yaml > @@ -0,0 +1,159 @@ > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) > +%YAML 1.2 > +--- > +$id: http://devicetree.org/schemas/leds/leds-mt6360.yaml# > +$schema: http://devicetree.org/meta-schemas/core.yaml# > + > +title: LED driver for MT6360 PMIC from MediaTek Integrated. > + > +maintainers: > + - Gene Chen <gene_chen@richtek.com> > + > +description: | > + This module is part of the MT6360 MFD device. > + see Documentation/devicetree/bindings/mfd/mt6360.yaml > + Add MT6360 LED driver include 2-channel Flash LED with torch/strobe mode, > + and 4-channel RGB LED support Register/Flash/Breath Mode > + > +properties: > + compatible: > + const: mediatek,mt6360-led > + > + "#address-cells": > + const: 1 > + > + "#size-cells": > + const: 0 > + > +patternProperties: > + "(^led@[0-5]$|led)": "^(multi-)?led@[0-5]$": > + type: object > + $ref: common.yaml# > + description: > + Properties for a single LED. > + > + properties: > + reg: > + description: Index of the LED. > + enum: > + - 0 # LED output ISINK1 > + - 1 # LED output ISINK2 > + - 2 # LED output ISINK3 > + - 3 # LED output ISINKML > + - 4 # LED output FLASH1 > + - 5 # LED output FLASH2 > + > +unevaluatedProperties: false > + > +required: > + - compatible > + - "#address-cells" > + - "#size-cells" > + > +additionalProperties: false > + > +examples: > + - | > + #include <dt-bindings/leds/common.h> > + led-controller { > + compatible = "mediatek,mt6360-led"; > + #address-cells = <1>; > + #size-cells = <0>; > + > + multi-led@0 { > + reg = <0>; > + function = LED_FUNCTION_INDICATOR; > + color = <LED_COLOR_ID_RGB>; > + led-max-microamp = <24000>; > + #address-cells = <1>; > + #size-cells = <0>; > + led@0 { > + reg = <0>; > + color = <LED_COLOR_ID_RED>; > + }; > + led@1 { > + reg = <1>; > + color = <LED_COLOR_ID_GREEN>; > + }; > + led@2 { > + reg = <2>; > + color = <LED_COLOR_ID_BLUE>; > + }; > + }; > + led@3 { > + reg = <3>; > + function = LED_FUNCTION_MOONLIGHT; > + color = <LED_COLOR_ID_WHITE>; > + led-max-microamp = <150000>; > + }; > + led@4 { > + reg = <4>; > + function = LED_FUNCTION_FLASH; > + color = <LED_COLOR_ID_WHITE>; > + function-enumerator = <1>; > + led-max-microamp = <200000>; > + flash-max-microamp = <500000>; > + flash-max-timeout-us = <1024000>; > + }; > + led@5 { > + reg = <5>; > + function = LED_FUNCTION_FLASH; > + color = <LED_COLOR_ID_WHITE>; > + function-enumerator = <2>; > + led-max-microamp = <200000>; > + flash-max-microamp = <500000>; > + flash-max-timeout-us = <1024000>; > + }; > + }; > + > + - | > + > + led-controller { > + compatible = "mediatek,mt6360-led"; > + #address-cells = <1>; > + #size-cells = <0>; > + > + led@0 { > + reg = <0>; > + function = LED_FUNCTION_INDICATOR; > + color = <LED_COLOR_ID_RED>; > + led-max-microamp = <24000>; > + }; > + led@1 { > + reg = <1>; > + function = LED_FUNCTION_INDICATOR; > + color = <LED_COLOR_ID_GREEN>; > + led-max-microamp = <24000>; > + }; > + led@2 { > + reg = <2>; > + function = LED_FUNCTION_INDICATOR; > + color = <LED_COLOR_ID_BLUE>; > + led-max-microamp = <24000>; > + }; > + led@3 { > + reg = <3>; > + function = LED_FUNCTION_MOONLIGHT; > + color = <LED_COLOR_ID_WHITE>; > + led-max-microamp = <150000>; > + }; > + led@4 { > + reg = <4>; > + function = LED_FUNCTION_FLASH; > + color = <LED_COLOR_ID_WHITE>; > + function-enumerator = <1>; > + led-max-microamp = <200000>; > + flash-max-microamp = <500000>; > + flash-max-timeout-us = <1024000>; > + }; > + led@5 { > + reg = <5>; > + function = LED_FUNCTION_FLASH; > + color = <LED_COLOR_ID_WHITE>; > + function-enumerator = <2>; > + led-max-microamp = <200000>; > + flash-max-microamp = <500000>; > + flash-max-timeout-us = <1024000>; > + }; > + }; > +... > -- > 2.7.4 >