leds: mt6360: Add LED driver for MT6360
Subsystems (3)
v15 cover leds: mt6360: Add LED driver for MT6360
This patch series add MT6360 LED support contains driver and binding document
Gene Chen (2)
dt-bindings: leds: Add bindings for MT6360 LED
leds: mt6360: Add LED driver for MT6360
Documentation/devicetree/bindings/leds/leds-mt6360.yaml | 159 ++ drivers/leds/flash/Kconfig | 13 drivers/leds/flash/Makefile | 1 drivers/leds/flash/leds-mt6360.c | 910 ++++++++++++++++ 4 files changed, 1083 insertions(+)
changelogs between v1 & v2
- add led driver with mfd
changelogs between v2 & v3
- independent add led driver
- add dt-binding document
- refactor macros definition for easy to debug
- parse device tree by fwnode
- use devm*ext to register led class device
changelogs between v3 & v4
- fix binding document description
- use GENMASK and add unit postfix to definition
- isink register led class device
changelogs between v4 & v5
- change rgb isink to multicolor control
- add binding reference to mfd yaml
changelogs between v5 & v6
- Use DT to decide RGB LED is multicolor device or indicator device only
changelogs between v6 & v7
- Add binding multicolor device sample code
- Add flash ops mutex lock
- Remove V4L2 init with indicator device
changelogs between v7 & v8
- Add mutex for led fault get ops
- Fix flash and multicolor no-ops return 0
- Add LED_FUNCTION_MOONLIGHT
changelogs between v8 & v9
- reuse api in flash and multicolor header
changelogs between v9 & v10
- add comment for reuse registration functions in flash and multicolor
changelogs between v10 & v11
- match dt-binding reg property comment to the functionality name
- remove exist patch in linux-next
- dicide multicolor channel by color definitiion
changelogs between v11 & v12
- Fix print size_t by %zu
- Fix dt-binding name regular experssion
changelogs between v12 & v13
- Fix kbuild test rebot build error
changelogs between v13 & v14
- Move driver to flash folder
- Remove LED FUNCTION MOONLIGHT
- Keep 80 char per line
changelogs between v14 & v15
- Add ack in commit message
PATCH v15 1/2 dt-bindings: leds: Add bindings for MT6360 LED
From: Gene Chen <[email protected]>
Add bindings document for LED support on MT6360 PMIC
--- .../devicetree/bindings/leds/leds-mt6360.yaml | 159 ++++++++++++++++++ 1 file changed, 159 insertions(+) create mode 100644 Documentation/devicetree/bindings/leds/leds-mt6360.yaml
Documentation/devicetree/bindings/leds/leds-mt6360.yaml new file +159 -0
@@ -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 <[email protected]> + +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: + "^(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_INDICATOR; + 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>; + }; + }; +...
Signature · 1 line
2.25.1
PATCH v15 2/2 leds: mt6360: Add LED driver for MT6360
In reply to Gene ChenFrom: Gene Chen <[email protected]>
Add MT6360 LED driver include 2-channel Flash LED with torch/strobe mode, 3-channel RGB LED support Register/Flash/Breath Mode, and 1-channel for moonlight LED.
--- drivers/leds/flash/Kconfig | 13 + drivers/leds/flash/Makefile | 1 + drivers/leds/flash/leds-mt6360.c | 910 +++++++++++++++++++++++++++++++ 3 files changed, 924 insertions(+) create mode 100644 drivers/leds/flash/leds-mt6360.c
drivers/leds/flash/Kconfig +13 -0
@@ -2,6 +2,19 @@ if LEDS_CLASS_FLASH +config LEDS_MT6360 + tristate "LED Support for Mediatek MT6360 PMIC" + depends on LEDS_CLASS && OF + depends on LEDS_CLASS_FLASH || !LEDS_CLASS_FLASH + depends on LEDS_CLASS_MULTICOLOR || !LEDS_CLASS_MULTICOLOR + depends on V4L2_FLASH_LED_CLASS || !V4L2_FLASH_LED_CLASS + depends on MFD_MT6360 + help + This option enables support for dual Flash LED drivers found on + Mediatek MT6360 PMIC. + Independent current sources supply for each flash LED support torch + and strobe mode. + config LEDS_RT4505 tristate "LED support for RT4505 flashlight controller" depends on I2C && OF
drivers/leds/flash/Makefile +1 -0
@@ -1,4 +1,5 @@ # SPDX-License-Identifier: GPL-2.0 +obj-$(CONFIG_LEDS_MT6360) += leds-mt6360.o obj-$(CONFIG_LEDS_RT4505) += leds-rt4505.o obj-$(CONFIG_LEDS_RT8515) += leds-rt8515.o
drivers/leds/flash/leds-mt6360.c new file +910 -0
910 lines not on this page · raw message
Signature · 1 line
2.25.1
Pavel Machek
AppliedQuoted 8 lines · Gene Chen
From: Gene Chen <[email protected]>
Add MT6360 LED driver include 2-channel Flash LED with torch/strobe mode, 3-channel RGB LED support Register/Flash/Breath Mode, and 1-channel for moonlight LED.
Signed-off-by Gene Chen <[email protected]>Acked-by Jacek Anaszewski <[email protected]>
Thanks, applied.
Pavel
Signature · 1 line
http://www.livejournal.com/~pavelmachek
Rob Herring
maintainerQuoted 4 lines · Pavel Machek
Quoted 2 lines · Gene Chen
From: Gene Chen <[email protected]>
Quoted 8 lines
Quoted 6 lines
Add MT6360 LED driver include 2-channel Flash LED with torch/strobe mode, 3-channel RGB LED support Register/Flash/Breath Mode, and 1-channel for moonlight LED.
Signed-off-by Gene Chen <[email protected]>Acked-by Jacek Anaszewski <[email protected]>Thanks, applied.
Now linux-next is broken:
Error: Documentation/devicetree/bindings/leds/leds-mt6360.example.dts:114.24-25 syntax error
FATAL ERROR: Unable to parse input tree
make[1]: *** [scripts/Makefile.lib:385:Documentation/devicetree/bindings/leds/leds-mt6360.example.dt.yaml] Error 1
I may have reviewed this, but the last 2 versions didn't go to DT list and no checks ran.
Rob
Gene Chen <[email protected]> 於 2021年7月16日 週五 下午4:33寫道:
Quoted 64 lines
This patch series add MT6360 LED support contains driver and binding document
Gene Chen (2)
dt-bindings: leds: Add bindings for MT6360 LED
leds: mt6360: Add LED driver for MT6360Documentation/devicetree/bindings/leds/leds-mt6360.yaml | 159 ++ drivers/leds/flash/Kconfig | 13 drivers/leds/flash/Makefile | 1 drivers/leds/flash/leds-mt6360.c | 910 ++++++++++++++++ 4 files changed, 1083 insertions(+)changelogs between v1 & v2
- add led driver with mfdchangelogs between v2 & v3
- independent add led driver
- add dt-binding document
- refactor macros definition for easy to debug
- parse device tree by fwnode
- use devm*ext to register led class devicechangelogs between v3 & v4
- fix binding document description
- use GENMASK and add unit postfix to definition
- isink register led class devicechangelogs between v4 & v5
- change rgb isink to multicolor control
- add binding reference to mfd yamlchangelogs between v5 & v6
- Use DT to decide RGB LED is multicolor device or indicator device onlychangelogs between v6 & v7
- Add binding multicolor device sample code
- Add flash ops mutex lock
- Remove V4L2 init with indicator devicechangelogs between v7 & v8
- Add mutex for led fault get ops
- Fix flash and multicolor no-ops return 0
- AddLED_FUNCTION_MOONLIGHTchangelogs between v8 & v9
- reuse api in flash and multicolor headerchangelogs between v9 & v10
- add comment for reuse registration functions in flash and multicolorchangelogs between v10 & v11
- match dt-binding reg property comment to the functionality name
- remove exist patch in linux-next
- dicide multicolor channel by color definitiionchangelogs between v11 & v12
- Fix printsize_tby %zu
- Fix dt-binding name regular experssionchangelogs between v12 & v13
- Fix kbuild test rebot build error
Quoted 8 lines
changelogs between v13 & v14
- Move driver to flash folder
- Remove LED FUNCTION MOONLIGHT
- Keep 80 char per linechangelogs between v14 & v15
- Add ack in commit message
Dear Reviewers,
Please let me know if any concern.
Thanks.
Pavel,
Quoted 14 lines · Gene Chen
Gene Chen <[email protected]> 於 2021年7月16日 週五 下午4:33寫道:
Quoted 13 lines
This patch series add MT6360 LED support contains driver and binding document
Gene Chen (2)
dt-bindings: leds: Add bindings for MT6360 LED
leds: mt6360: Add LED driver for MT6360Documentation/devicetree/bindings/leds/leds-mt6360.yaml | 159 ++ drivers/leds/flash/Kconfig | 13 drivers/leds/flash/Makefile | 1 drivers/leds/flash/leds-mt6360.c | 910 ++++++++++++++++ 4 files changed, 1083 insertions(+)
Do you see Gene's emails or maybe they land somehow in your spam folder? It's been four months since last version addressing your remarks.
Signature · 2 lines
Best regards, Jacek Anaszewski