Skip to content

Commit 29bd2d2

Browse files
committed
Merge branch 'for-rc-5.11' of git://git.kernel.org/pub/scm/linux/kernel/git/pavel/linux-leds
Pull LED fixes from Pavel Machek: "This pull is due to 'leds: trigger: fix potential deadlock with libata' -- people find the warn annoying. It also contains new driver and two trivial fixes" * 'for-rc-5.11' of git://git.kernel.org/pub/scm/linux/kernel/git/pavel/linux-leds: leds: rt8515: Add Richtek RT8515 LED driver dt-bindings: leds: Add DT binding for Richtek RT8515 leds: trigger: fix potential deadlock with libata leds: leds-ariel: convert comma to semicolon leds: leds-lm3533: convert comma to semicolon
2 parents c178fae + e1c6edc commit 29bd2d2

9 files changed

Lines changed: 542 additions & 8 deletions

File tree

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/leds/richtek,rt8515.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Richtek RT8515 1.5A dual channel LED driver
8+
9+
maintainers:
10+
- Linus Walleij <linus.walleij@linaro.org>
11+
12+
description: |
13+
The Richtek RT8515 is a dual channel (two mode) LED driver that
14+
supports driving a white LED in flash or torch mode. The maximum
15+
current for each mode is defined in hardware using two resistors
16+
RFS and RTS.
17+
18+
properties:
19+
compatible:
20+
const: richtek,rt8515
21+
22+
enf-gpios:
23+
maxItems: 1
24+
description: A connection to the 'ENF' (enable flash) pin.
25+
26+
ent-gpios:
27+
maxItems: 1
28+
description: A connection to the 'ENT' (enable torch) pin.
29+
30+
richtek,rfs-ohms:
31+
minimum: 7680
32+
maximum: 367000
33+
description: The resistance value of the RFS resistor. This
34+
resistors limits the maximum flash current. This must be set
35+
for the property flash-max-microamp to work, the RFS resistor
36+
defines the range of the dimmer setting (brightness) of the
37+
flash LED.
38+
39+
richtek,rts-ohms:
40+
minimum: 7680
41+
maximum: 367000
42+
description: The resistance value of the RTS resistor. This
43+
resistors limits the maximum torch current. This must be set
44+
for the property torch-max-microamp to work, the RTS resistor
45+
defines the range of the dimmer setting (brightness) of the
46+
torch LED.
47+
48+
led:
49+
type: object
50+
$ref: common.yaml#
51+
properties:
52+
function: true
53+
color: true
54+
flash-max-timeout-us: true
55+
56+
flash-max-microamp:
57+
maximum: 700000
58+
description: The maximum current for flash mode
59+
is hardwired to the component using the RFS resistor to
60+
ground. The maximum hardware current setting is calculated
61+
according to the formula Imax = 5500 / RFS. The lowest
62+
allowed resistance value is 7.86 kOhm giving an absolute
63+
maximum current of 700mA. By setting this attribute in
64+
the device tree, you can further restrict the maximum
65+
current below the hardware limit. This requires the RFS
66+
to be defined as it defines the maximum range.
67+
68+
led-max-microamp:
69+
maximum: 700000
70+
description: The maximum current for torch mode
71+
is hardwired to the component using the RTS resistor to
72+
ground. The maximum hardware current setting is calculated
73+
according to the formula Imax = 5500 / RTS. The lowest
74+
allowed resistance value is 7.86 kOhm giving an absolute
75+
maximum current of 700mA. By setting this attribute in
76+
the device tree, you can further restrict the maximum
77+
current below the hardware limit. This requires the RTS
78+
to be defined as it defines the maximum range.
79+
80+
additionalProperties: false
81+
82+
required:
83+
- compatible
84+
- ent-gpios
85+
- enf-gpios
86+
- led
87+
88+
additionalProperties: false
89+
90+
examples:
91+
- |
92+
#include <dt-bindings/gpio/gpio.h>
93+
#include <dt-bindings/leds/common.h>
94+
95+
led-controller {
96+
compatible = "richtek,rt8515";
97+
enf-gpios = <&gpio4 12 GPIO_ACTIVE_HIGH>;
98+
ent-gpios = <&gpio4 13 GPIO_ACTIVE_HIGH>;
99+
richtek,rfs-ohms = <16000>;
100+
richtek,rts-ohms = <100000>;
101+
102+
led {
103+
function = LED_FUNCTION_FLASH;
104+
color = <LED_COLOR_ID_WHITE>;
105+
flash-max-timeout-us = <250000>;
106+
flash-max-microamp = <150000>;
107+
led-max-microamp = <25000>;
108+
};
109+
};
110+
111+
...

drivers/leds/Kconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -928,6 +928,9 @@ config LEDS_ACER_A500
928928
This option enables support for the Power Button LED of
929929
Acer Iconia Tab A500.
930930

931+
comment "Flash and Torch LED drivers"
932+
source "drivers/leds/flash/Kconfig"
933+
931934
comment "LED Triggers"
932935
source "drivers/leds/trigger/Kconfig"
933936

drivers/leds/Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,5 +103,8 @@ obj-$(CONFIG_LEDS_SPI_BYTE) += leds-spi-byte.o
103103
# LED Userspace Drivers
104104
obj-$(CONFIG_LEDS_USER) += uleds.o
105105

106+
# Flash and Torch LED Drivers
107+
obj-$(CONFIG_LEDS_CLASS_FLASH) += flash/
108+
106109
# LED Triggers
107110
obj-$(CONFIG_LEDS_TRIGGERS) += trigger/

drivers/leds/flash/Kconfig

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# SPDX-License-Identifier: GPL-2.0
2+
3+
if LEDS_CLASS_FLASH
4+
5+
config LEDS_RT8515
6+
tristate "LED support for Richtek RT8515 flash/torch LED"
7+
depends on GPIOLIB
8+
help
9+
This option enables support for the Richtek RT8515 flash
10+
and torch LEDs found on some mobile phones.
11+
12+
To compile this driver as a module, choose M here: the module
13+
will be called leds-rt8515.
14+
15+
endif # LEDS_CLASS_FLASH

drivers/leds/flash/Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# SPDX-License-Identifier: GPL-2.0
2+
3+
obj-$(CONFIG_LEDS_RT8515) += leds-rt8515.o

0 commit comments

Comments
 (0)