Skip to content

Commit 11a7b03

Browse files
committed
Merge tag 'leds-next-6.14' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/leds
Pull LED updates from Lee Jones: - Allow struct bin_attribute instances to be placed in read-only memory for enhanced protection - Fix a memory leak in the cht-wcove driver by using devm_led_classdev_register() - Fix an OF node reference leak in the netxbig driver - Ensure PWM is disabled properly in pwm-multicolor suspend - Add support for Texas Instruments LP8864, LP8864S, LP8866 LED-backlight drivers - Add support for STMicroelectronics's LED1202 12-channel LED driver - Convert LP8860 bindings to YAML format - Add bindings for the TI LP8864/LP8866 LED drivers - Add LED1202 LED controller bindings - Fix path to color definitions in leds-class-multicolor.yaml - Add pm660l compatible to qcom,spmi-flash-led bindings - Extend cznic,turris-omnia-leds binding with interrupts property - Add documentation for the STMicroelectronics LED1202 driver - Add entry for AAEON UP board FPGA drivers in MAINTAINERS - Fix a wrong format specifier in the ledtrig-activity driver - Fix a bug in the lp8860 driver where only half of the EEPROM was written * tag 'leds-next-6.14' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/leds: (28 commits) leds: triggers: Constify 'struct bin_attribute' leds: cht-wcove: Use devm_led_classdev_register() to avoid memory leak leds: lp8864: Add support for Texas Instruments LP8864, LP8864S, LP8866 LED-backlights dt-bindings: leds: Convert LP8860 into YAML format leds: Add LED1202 I2C driver dt-bindings: leds: Add LED1202 LED Controller Documentation:leds: Add leds-st1202.rst leds: pwm-multicolor: Disable PWM when going to suspend leds: netxbig: Fix an OF node reference leak in netxbig_leds_get_of_pdata() turris-omnia-mcu-interface.h: Move macro definitions outside of enums MAINTAINERS: Add entry for AAEON UP board FPGA drivers leds: Add AAEON UP board LED driver leds: trigger: netdev: Check offload ability on interface up leds: turris-omnia: Use uppercase first letter in all comments leds: turris-omnia: Use dev_err_probe() where appropriate leds: turris-omnia: Inform about missing LED gamma correction feature in the MCU driver platform: cznic: turris-omnia-mcu: Inform about missing LED panel brightness change interrupt feature leds: turris-omnia: Notify sysfs on MCU global LEDs brightness change leds: turris-omnia: Document driver private structures dt-bindings: leds: cznic,turris-omnia-leds: Allow interrupts property ...
2 parents 909fd2b + daefd7f commit 11a7b03

23 files changed

+903
-365
lines changed

Documentation/devicetree/bindings/leds/cznic,turris-omnia-leds.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@ properties:
2323
description: I2C slave address of the microcontroller.
2424
maxItems: 1
2525

26+
interrupts:
27+
description:
28+
Specifier for the global LED brightness changed by front button press
29+
interrupt.
30+
maxItems: 1
31+
2632
"#address-cells":
2733
const: 1
2834

@@ -56,6 +62,7 @@ additionalProperties: false
5662
examples:
5763
- |
5864
65+
#include <dt-bindings/interrupt-controller/irq.h>
5966
#include <dt-bindings/leds/common.h>
6067
6168
i2c {
@@ -65,6 +72,7 @@ examples:
6572
led-controller@2b {
6673
compatible = "cznic,turris-omnia-leds";
6774
reg = <0x2b>;
75+
interrupts-extended = <&mcu 11 IRQ_TYPE_NONE>;
6876
#address-cells = <1>;
6977
#size-cells = <0>;
7078

Documentation/devicetree/bindings/leds/leds-class-multicolor.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ properties:
2727
description: |
2828
For multicolor LED support this property should be defined as either
2929
LED_COLOR_ID_RGB or LED_COLOR_ID_MULTI which can be found in
30-
include/linux/leds/common.h.
30+
include/dt-bindings/leds/common.h.
3131
enum: [ 8, 9 ]
3232

3333
required:

Documentation/devicetree/bindings/leds/leds-lp8860.txt

Lines changed: 0 additions & 50 deletions
This file was deleted.

Documentation/devicetree/bindings/leds/qcom,spmi-flash-led.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ properties:
2323
items:
2424
- enum:
2525
- qcom,pm6150l-flash-led
26+
- qcom,pm660l-flash-led
2627
- qcom,pm8150c-flash-led
2728
- qcom,pm8150l-flash-led
2829
- qcom,pm8350c-flash-led
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/leds/ti,lp8860.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Texas Instruments - lp8860 4-Channel LED Driver
8+
9+
maintainers:
10+
- Andrew Davis <[email protected]>
11+
12+
description: |
13+
The LP8860-Q1 is an high-efficiency LED driver with boost controller.
14+
It has 4 high-precision current sinks that can be controlled by a PWM input
15+
signal, a SPI/I2C master, or both.
16+
17+
For more product information please see the link below:
18+
https://www.ti.com/product/lp8860-q1
19+
20+
properties:
21+
compatible:
22+
const: ti,lp8860
23+
24+
reg:
25+
maxItems: 1
26+
description: I2C slave address
27+
28+
"#address-cells":
29+
const: 1
30+
31+
"#size-cells":
32+
const: 0
33+
34+
enable-gpios:
35+
maxItems: 1
36+
description: GPIO pin to enable (active high) / disable the device
37+
38+
vled-supply:
39+
description: LED supply
40+
41+
patternProperties:
42+
"^led(@[0-3])?$":
43+
type: object
44+
$ref: common.yaml#
45+
unevaluatedProperties: false
46+
47+
properties:
48+
reg:
49+
description:
50+
Index of the LED.
51+
maxItems: 1
52+
53+
function: true
54+
color: true
55+
label: true
56+
linux,default-trigger: true
57+
58+
required:
59+
- compatible
60+
- reg
61+
62+
additionalProperties: false
63+
64+
examples:
65+
- |
66+
#include <dt-bindings/gpio/gpio.h>
67+
#include <dt-bindings/leds/common.h>
68+
69+
i2c {
70+
#address-cells = <1>;
71+
#size-cells = <0>;
72+
73+
led-controller@2d {
74+
compatible = "ti,lp8860";
75+
#address-cells = <1>;
76+
#size-cells = <0>;
77+
reg = <0x2d>;
78+
enable-gpios = <&gpio1 28 GPIO_ACTIVE_HIGH>;
79+
vled-supply = <&vbatt>;
80+
81+
led@0 {
82+
reg = <0>;
83+
function = LED_FUNCTION_BACKLIGHT;
84+
color = <LED_COLOR_ID_WHITE>;
85+
linux,default-trigger = "backlight";
86+
};
87+
};
88+
};
89+
90+
...

MAINTAINERS

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,14 @@ W: http://www.adaptec.com/
185185
F: Documentation/scsi/aacraid.rst
186186
F: drivers/scsi/aacraid/
187187

188+
AAEON UPBOARD FPGA MFD DRIVER
189+
M: Thomas Richard <[email protected]>
190+
S: Maintained
191+
F: drivers/leds/leds-upboard.c
192+
F: drivers/mfd/upboard-fpga.c
193+
F: drivers/pinctrl/pinctrl-upboard.c
194+
F: include/linux/mfd/upboard-fpga.h
195+
188196
AB8500 BATTERY AND CHARGER DRIVERS
189197
M: Linus Walleij <[email protected]>
190198
F: Documentation/devicetree/bindings/power/supply/*ab8500*
@@ -23293,6 +23301,13 @@ S: Supported
2329323301
F: Documentation/devicetree/bindings/iio/dac/ti,dac7612.yaml
2329423302
F: drivers/iio/dac/ti-dac7612.c
2329523303

23304+
TEXAS INSTRUMENTS' LB8864 LED BACKLIGHT DRIVER
23305+
M: Alexander Sverdlin <[email protected]>
23306+
23307+
S: Maintained
23308+
F: Documentation/devicetree/bindings/leds/backlight/ti,lp8864.yaml
23309+
F: drivers/leds/leds-lp8864.c
23310+
2329623311
TEXAS INSTRUMENTS' SYSTEM CONTROL INTERFACE (TISCI) PROTOCOL DRIVER
2329723312
M: Nishanth Menon <[email protected]>
2329823313
M: Tero Kristo <[email protected]>

drivers/leds/Kconfig

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,8 @@ config LEDS_TURRIS_OMNIA
217217
depends on I2C
218218
depends on MACH_ARMADA_38X || COMPILE_TEST
219219
depends on OF
220+
depends on TURRIS_OMNIA_MCU
221+
depends on TURRIS_OMNIA_MCU_GPIO
220222
select LEDS_TRIGGERS
221223
help
222224
This option enables basic support for the LEDs found on the front
@@ -511,6 +513,18 @@ config LEDS_LP8860
511513
on the LP8860 4 channel LED driver using the I2C communication
512514
bus.
513515

516+
config LEDS_LP8864
517+
tristate "LED support for the TI LP8864/LP8866 4/6 channel LED drivers"
518+
depends on LEDS_CLASS && I2C && OF
519+
select REGMAP_I2C
520+
help
521+
If you say yes here you get support for the TI LP8864-Q1,
522+
LP8864S-Q1, LP8866-Q1, LP8866S-Q1 4/6 channel LED backlight
523+
drivers with I2C interface.
524+
525+
To compile this driver as a module, choose M here: the
526+
module will be called leds-lp8864.
527+
514528
config LEDS_CLEVO_MAIL
515529
tristate "Mail LED on Clevo notebook"
516530
depends on LEDS_CLASS && BROKEN
@@ -826,6 +840,15 @@ config LEDS_SC27XX_BLTC
826840
This driver can also be built as a module. If so the module will be
827841
called leds-sc27xx-bltc.
828842

843+
config LEDS_UPBOARD
844+
tristate "LED support for the UP board"
845+
depends on LEDS_CLASS && MFD_UPBOARD_FPGA
846+
help
847+
This option enables support for the UP board LEDs.
848+
849+
This driver can also be built as a module. If so the module will be
850+
called leds-upboard.
851+
829852
comment "LED driver for blink(1) USB RGB LED is under Special HID drivers (HID_THINGM)"
830853

831854
config LEDS_BLINKM

drivers/leds/Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ obj-$(CONFIG_LEDS_LP55XX_COMMON) += leds-lp55xx-common.o
5757
obj-$(CONFIG_LEDS_LP8501) += leds-lp8501.o
5858
obj-$(CONFIG_LEDS_LP8788) += leds-lp8788.o
5959
obj-$(CONFIG_LEDS_LP8860) += leds-lp8860.o
60+
obj-$(CONFIG_LEDS_LP8864) += leds-lp8864.o
6061
obj-$(CONFIG_LEDS_LT3593) += leds-lt3593.o
6162
obj-$(CONFIG_LEDS_MAX5970) += leds-max5970.o
6263
obj-$(CONFIG_LEDS_MAX77650) += leds-max77650.o
@@ -82,6 +83,7 @@ obj-$(CONFIG_LEDS_PWM) += leds-pwm.o
8283
obj-$(CONFIG_LEDS_QNAP_MCU) += leds-qnap-mcu.o
8384
obj-$(CONFIG_LEDS_REGULATOR) += leds-regulator.o
8485
obj-$(CONFIG_LEDS_SC27XX_BLTC) += leds-sc27xx-bltc.o
86+
obj-$(CONFIG_LEDS_ST1202) += leds-st1202.o
8587
obj-$(CONFIG_LEDS_SUN50I_A100) += leds-sun50i-a100.o
8688
obj-$(CONFIG_LEDS_SUNFIRE) += leds-sunfire.o
8789
obj-$(CONFIG_LEDS_SYSCON) += leds-syscon.o
@@ -90,6 +92,7 @@ obj-$(CONFIG_LEDS_TI_LMU_COMMON) += leds-ti-lmu-common.o
9092
obj-$(CONFIG_LEDS_TLC591XX) += leds-tlc591xx.o
9193
obj-$(CONFIG_LEDS_TPS6105X) += leds-tps6105x.o
9294
obj-$(CONFIG_LEDS_TURRIS_OMNIA) += leds-turris-omnia.o
95+
obj-$(CONFIG_LEDS_UPBOARD) += leds-upboard.o
9396
obj-$(CONFIG_LEDS_WM831X_STATUS) += leds-wm831x-status.o
9497
obj-$(CONFIG_LEDS_WM8350) += leds-wm8350.o
9598
obj-$(CONFIG_LEDS_WRAP) += leds-wrap.o

drivers/leds/led-class.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,13 @@ static ssize_t max_brightness_show(struct device *dev,
8585
static DEVICE_ATTR_RO(max_brightness);
8686

8787
#ifdef CONFIG_LEDS_TRIGGERS
88-
static BIN_ATTR(trigger, 0644, led_trigger_read, led_trigger_write, 0);
89-
static struct bin_attribute *led_trigger_bin_attrs[] = {
88+
static const BIN_ATTR(trigger, 0644, led_trigger_read, led_trigger_write, 0);
89+
static const struct bin_attribute *const led_trigger_bin_attrs[] = {
9090
&bin_attr_trigger,
9191
NULL,
9292
};
9393
static const struct attribute_group led_trigger_group = {
94-
.bin_attrs = led_trigger_bin_attrs,
94+
.bin_attrs_new = led_trigger_bin_attrs,
9595
};
9696
#endif
9797

drivers/leds/led-triggers.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ trigger_relevant(struct led_classdev *led_cdev, struct led_trigger *trig)
3434
}
3535

3636
ssize_t led_trigger_write(struct file *filp, struct kobject *kobj,
37-
struct bin_attribute *bin_attr, char *buf,
37+
const struct bin_attribute *bin_attr, char *buf,
3838
loff_t pos, size_t count)
3939
{
4040
struct device *dev = kobj_to_dev(kobj);
@@ -123,7 +123,7 @@ static int led_trigger_format(char *buf, size_t size,
123123
* copy it.
124124
*/
125125
ssize_t led_trigger_read(struct file *filp, struct kobject *kobj,
126-
struct bin_attribute *attr, char *buf,
126+
const struct bin_attribute *attr, char *buf,
127127
loff_t pos, size_t count)
128128
{
129129
struct device *dev = kobj_to_dev(kobj);

drivers/leds/leds-cht-wcove.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ static int cht_wc_leds_probe(struct platform_device *pdev)
394394
led->cdev.pattern_clear = cht_wc_leds_pattern_clear;
395395
led->cdev.max_brightness = 255;
396396

397-
ret = led_classdev_register(&pdev->dev, &led->cdev);
397+
ret = devm_led_classdev_register(&pdev->dev, &led->cdev);
398398
if (ret < 0)
399399
return ret;
400400
}
@@ -406,10 +406,6 @@ static int cht_wc_leds_probe(struct platform_device *pdev)
406406
static void cht_wc_leds_remove(struct platform_device *pdev)
407407
{
408408
struct cht_wc_leds *leds = platform_get_drvdata(pdev);
409-
int i;
410-
411-
for (i = 0; i < CHT_WC_LED_COUNT; i++)
412-
led_classdev_unregister(&leds->leds[i].cdev);
413409

414410
/* Restore LED1 regs if hw-control was active else leave LED1 off */
415411
if (!(leds->led1_initial_regs.ctrl & CHT_WC_LED1_SWCTL))

drivers/leds/leds-lp8860.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ static int lp8860_init(struct lp8860_led *led)
265265
goto out;
266266
}
267267

268-
reg_count = ARRAY_SIZE(lp8860_eeprom_disp_regs) / sizeof(lp8860_eeprom_disp_regs[0]);
268+
reg_count = ARRAY_SIZE(lp8860_eeprom_disp_regs);
269269
for (i = 0; i < reg_count; i++) {
270270
ret = regmap_write(led->eeprom_regmap,
271271
lp8860_eeprom_disp_regs[i].reg,

0 commit comments

Comments
 (0)