Skip to content

Commit d9b5941

Browse files
committed
Merge tag 'leds-5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/pavel/linux-leds
Pull LED updates from Pavel Machek: "Nothing major is happening here" * tag 'leds-5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/pavel/linux-leds: leds: lp55xx: initialise output direction from dts ARM: dts: omap3-n900: Fix lp5523 for multi color leds: ktd2692: Drop calling dev_of_node() in ktd2692_parse_dt leds: lgm-sso: Get rid of duplicate of_node assignment leds: tca6507: Get rid of duplicate of_node assignment leds: leds-fsg: Drop FSG3 LED driver leds: lp50xx: remove unused variable dt-bindings: leds: Replace moonlight with indicator in mt6360 example leds: led-core: Update fwnode with device_set_node leds: tca6507: use swap() to make code cleaner leds: Add mt6360 driver dt-bindings: leds: Add bindings for MT6360 LED
2 parents 4eb766f + 9e87a8d commit d9b5941

File tree

14 files changed

+1130
-225
lines changed

14 files changed

+1130
-225
lines changed
Lines changed: 159 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,159 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/leds/leds-mt6360.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: LED driver for MT6360 PMIC from MediaTek Integrated.
8+
9+
maintainers:
10+
- Gene Chen <gene_chen@richtek.com>
11+
12+
description: |
13+
This module is part of the MT6360 MFD device.
14+
see Documentation/devicetree/bindings/mfd/mt6360.yaml
15+
Add MT6360 LED driver include 2-channel Flash LED with torch/strobe mode,
16+
and 4-channel RGB LED support Register/Flash/Breath Mode
17+
18+
properties:
19+
compatible:
20+
const: mediatek,mt6360-led
21+
22+
"#address-cells":
23+
const: 1
24+
25+
"#size-cells":
26+
const: 0
27+
28+
patternProperties:
29+
"^(multi-)?led@[0-5]$":
30+
type: object
31+
$ref: common.yaml#
32+
description:
33+
Properties for a single LED.
34+
35+
properties:
36+
reg:
37+
description: Index of the LED.
38+
enum:
39+
- 0 # LED output ISINK1
40+
- 1 # LED output ISINK2
41+
- 2 # LED output ISINK3
42+
- 3 # LED output ISINKML
43+
- 4 # LED output FLASH1
44+
- 5 # LED output FLASH2
45+
46+
unevaluatedProperties: false
47+
48+
required:
49+
- compatible
50+
- "#address-cells"
51+
- "#size-cells"
52+
53+
additionalProperties: false
54+
55+
examples:
56+
- |
57+
#include <dt-bindings/leds/common.h>
58+
led-controller {
59+
compatible = "mediatek,mt6360-led";
60+
#address-cells = <1>;
61+
#size-cells = <0>;
62+
63+
multi-led@0 {
64+
reg = <0>;
65+
function = LED_FUNCTION_INDICATOR;
66+
color = <LED_COLOR_ID_RGB>;
67+
led-max-microamp = <24000>;
68+
#address-cells = <1>;
69+
#size-cells = <0>;
70+
led@0 {
71+
reg = <0>;
72+
color = <LED_COLOR_ID_RED>;
73+
};
74+
led@1 {
75+
reg = <1>;
76+
color = <LED_COLOR_ID_GREEN>;
77+
};
78+
led@2 {
79+
reg = <2>;
80+
color = <LED_COLOR_ID_BLUE>;
81+
};
82+
};
83+
led@3 {
84+
reg = <3>;
85+
function = LED_FUNCTION_INDICATOR;
86+
color = <LED_COLOR_ID_WHITE>;
87+
led-max-microamp = <150000>;
88+
};
89+
led@4 {
90+
reg = <4>;
91+
function = LED_FUNCTION_FLASH;
92+
color = <LED_COLOR_ID_WHITE>;
93+
function-enumerator = <1>;
94+
led-max-microamp = <200000>;
95+
flash-max-microamp = <500000>;
96+
flash-max-timeout-us = <1024000>;
97+
};
98+
led@5 {
99+
reg = <5>;
100+
function = LED_FUNCTION_FLASH;
101+
color = <LED_COLOR_ID_WHITE>;
102+
function-enumerator = <2>;
103+
led-max-microamp = <200000>;
104+
flash-max-microamp = <500000>;
105+
flash-max-timeout-us = <1024000>;
106+
};
107+
};
108+
109+
- |
110+
111+
led-controller {
112+
compatible = "mediatek,mt6360-led";
113+
#address-cells = <1>;
114+
#size-cells = <0>;
115+
116+
led@0 {
117+
reg = <0>;
118+
function = LED_FUNCTION_INDICATOR;
119+
color = <LED_COLOR_ID_RED>;
120+
led-max-microamp = <24000>;
121+
};
122+
led@1 {
123+
reg = <1>;
124+
function = LED_FUNCTION_INDICATOR;
125+
color = <LED_COLOR_ID_GREEN>;
126+
led-max-microamp = <24000>;
127+
};
128+
led@2 {
129+
reg = <2>;
130+
function = LED_FUNCTION_INDICATOR;
131+
color = <LED_COLOR_ID_BLUE>;
132+
led-max-microamp = <24000>;
133+
};
134+
led@3 {
135+
reg = <3>;
136+
function = LED_FUNCTION_INDICATOR;
137+
color = <LED_COLOR_ID_WHITE>;
138+
led-max-microamp = <150000>;
139+
};
140+
led@4 {
141+
reg = <4>;
142+
function = LED_FUNCTION_FLASH;
143+
color = <LED_COLOR_ID_WHITE>;
144+
function-enumerator = <1>;
145+
led-max-microamp = <200000>;
146+
flash-max-microamp = <500000>;
147+
flash-max-timeout-us = <1024000>;
148+
};
149+
led@5 {
150+
reg = <5>;
151+
function = LED_FUNCTION_FLASH;
152+
color = <LED_COLOR_ID_WHITE>;
153+
function-enumerator = <2>;
154+
led-max-microamp = <200000>;
155+
flash-max-microamp = <500000>;
156+
flash-max-timeout-us = <1024000>;
157+
};
158+
};
159+
...

arch/arm/boot/dts/omap3-n900.dts

Lines changed: 40 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
#include "omap34xx.dtsi"
1010
#include <dt-bindings/input/input.h>
11+
#include <dt-bindings/leds/common.h>
1112

1213
/*
1314
* Default secure signed bootloader (Nokia X-Loader) does not enable L3 firewall
@@ -630,63 +631,92 @@
630631
};
631632

632633
lp5523: lp5523@32 {
634+
#address-cells = <1>;
635+
#size-cells = <0>;
633636
compatible = "national,lp5523";
634637
reg = <0x32>;
635638
clock-mode = /bits/ 8 <0>; /* LP55XX_CLOCK_AUTO */
636-
enable-gpio = <&gpio2 9 GPIO_ACTIVE_HIGH>; /* 41 */
639+
enable-gpios = <&gpio2 9 GPIO_ACTIVE_HIGH>; /* 41 */
637640

638-
chan0 {
641+
led@0 {
642+
reg = <0>;
639643
chan-name = "lp5523:kb1";
640644
led-cur = /bits/ 8 <50>;
641645
max-cur = /bits/ 8 <100>;
646+
color = <LED_COLOR_ID_WHITE>;
647+
function = LED_FUNCTION_KBD_BACKLIGHT;
642648
};
643649

644-
chan1 {
650+
led@1 {
651+
reg = <1>;
645652
chan-name = "lp5523:kb2";
646653
led-cur = /bits/ 8 <50>;
647654
max-cur = /bits/ 8 <100>;
655+
color = <LED_COLOR_ID_WHITE>;
656+
function = LED_FUNCTION_KBD_BACKLIGHT;
648657
};
649658

650-
chan2 {
659+
led@2 {
660+
reg = <2>;
651661
chan-name = "lp5523:kb3";
652662
led-cur = /bits/ 8 <50>;
653663
max-cur = /bits/ 8 <100>;
664+
color = <LED_COLOR_ID_WHITE>;
665+
function = LED_FUNCTION_KBD_BACKLIGHT;
654666
};
655667

656-
chan3 {
668+
led@3 {
669+
reg = <3>;
657670
chan-name = "lp5523:kb4";
658671
led-cur = /bits/ 8 <50>;
659672
max-cur = /bits/ 8 <100>;
673+
color = <LED_COLOR_ID_WHITE>;
674+
function = LED_FUNCTION_KBD_BACKLIGHT;
660675
};
661676

662-
chan4 {
677+
led@4 {
678+
reg = <4>;
663679
chan-name = "lp5523:b";
664680
led-cur = /bits/ 8 <50>;
665681
max-cur = /bits/ 8 <100>;
682+
color = <LED_COLOR_ID_BLUE>;
683+
function = LED_FUNCTION_STATUS;
666684
};
667685

668-
chan5 {
686+
led@5 {
687+
reg = <5>;
669688
chan-name = "lp5523:g";
670689
led-cur = /bits/ 8 <50>;
671690
max-cur = /bits/ 8 <100>;
691+
color = <LED_COLOR_ID_GREEN>;
692+
function = LED_FUNCTION_STATUS;
672693
};
673694

674-
chan6 {
695+
led@6 {
696+
reg = <6>;
675697
chan-name = "lp5523:r";
676698
led-cur = /bits/ 8 <50>;
677699
max-cur = /bits/ 8 <100>;
700+
color = <LED_COLOR_ID_RED>;
701+
function = LED_FUNCTION_STATUS;
678702
};
679703

680-
chan7 {
704+
led@7 {
705+
reg = <7>;
681706
chan-name = "lp5523:kb5";
682707
led-cur = /bits/ 8 <50>;
683708
max-cur = /bits/ 8 <100>;
709+
color = <LED_COLOR_ID_WHITE>;
710+
function = LED_FUNCTION_KBD_BACKLIGHT;
684711
};
685712

686-
chan8 {
713+
led@8 {
714+
reg = <8>;
687715
chan-name = "lp5523:kb6";
688716
led-cur = /bits/ 8 <50>;
689717
max-cur = /bits/ 8 <100>;
718+
color = <LED_COLOR_ID_WHITE>;
719+
function = LED_FUNCTION_KBD_BACKLIGHT;
690720
};
691721
};
692722

drivers/leds/Kconfig

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -260,13 +260,6 @@ config LEDS_NET48XX
260260
This option enables support for the Soekris net4801 and net4826 error
261261
LED.
262262

263-
config LEDS_FSG
264-
tristate "LED Support for the Freecom FSG-3"
265-
depends on LEDS_CLASS
266-
depends on MACH_FSG
267-
help
268-
This option enables support for the LEDs on the Freecom FSG-3.
269-
270263
config LEDS_WRAP
271264
tristate "LED Support for the WRAP series LEDs"
272265
depends on LEDS_CLASS

drivers/leds/Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ obj-$(CONFIG_LEDS_COBALT_RAQ) += leds-cobalt-raq.o
2626
obj-$(CONFIG_LEDS_CPCAP) += leds-cpcap.o
2727
obj-$(CONFIG_LEDS_DA903X) += leds-da903x.o
2828
obj-$(CONFIG_LEDS_DA9052) += leds-da9052.o
29-
obj-$(CONFIG_LEDS_FSG) += leds-fsg.o
3029
obj-$(CONFIG_LEDS_GPIO) += leds-gpio.o
3130
obj-$(CONFIG_LEDS_GPIO_REGISTER) += leds-gpio-register.o
3231
obj-$(CONFIG_LEDS_HP6XX) += leds-hp6xx.o

drivers/leds/blink/leds-lgm-sso.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,6 @@ static int sso_gpio_gc_init(struct device *dev, struct sso_led_priv *priv)
477477
gc->ngpio = priv->gpio.pins;
478478
gc->parent = dev;
479479
gc->owner = THIS_MODULE;
480-
gc->of_node = dev->of_node;
481480

482481
return devm_gpiochip_add_data(dev, gc, priv);
483482
}

drivers/leds/flash/Kconfig

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,19 @@ config LEDS_MAX77693
4848
multifunction device. It has build in control for two leds in flash
4949
and torch mode.
5050

51+
config LEDS_MT6360
52+
tristate "LED Support for Mediatek MT6360 PMIC"
53+
depends on LEDS_CLASS && OF
54+
depends on LEDS_CLASS_FLASH || !LEDS_CLASS_FLASH
55+
depends on LEDS_CLASS_MULTICOLOR || !LEDS_CLASS_MULTICOLOR
56+
depends on V4L2_FLASH_LED_CLASS || !V4L2_FLASH_LED_CLASS
57+
depends on MFD_MT6360
58+
help
59+
This option enables support for dual Flash LED drivers found on
60+
Mediatek MT6360 PMIC.
61+
Independent current sources supply for each flash LED support torch
62+
and strobe mode.
63+
5164
config LEDS_RT4505
5265
tristate "LED support for RT4505 flashlight controller"
5366
depends on I2C && OF

drivers/leds/flash/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# SPDX-License-Identifier: GPL-2.0
22

3+
obj-$(CONFIG_LEDS_MT6360) += leds-mt6360.o
34
obj-$(CONFIG_LEDS_AAT1290) += leds-aat1290.o
45
obj-$(CONFIG_LEDS_AS3645A) += leds-as3645a.o
56
obj-$(CONFIG_LEDS_KTD2692) += leds-ktd2692.o

drivers/leds/flash/leds-ktd2692.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ static int ktd2692_parse_dt(struct ktd2692_context *led, struct device *dev,
274274
struct device_node *child_node;
275275
int ret;
276276

277-
if (!dev_of_node(dev))
277+
if (!np)
278278
return -ENXIO;
279279

280280
led->ctrl_gpio = devm_gpiod_get(dev, "ctrl", GPIOD_ASIS);

0 commit comments

Comments
 (0)