Skip to content

Commit

Permalink
Merge tag 'leds-next-6.14' of git://git.kernel.org/pub/scm/linux/kern…
Browse files Browse the repository at this point in the history
…el/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
  ...
  • Loading branch information
Linus Torvalds committed Jan 22, 2025
2 parents 909fd2b + daefd7f commit 11a7b03
Show file tree
Hide file tree
Showing 23 changed files with 903 additions and 365 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ properties:
description: I2C slave address of the microcontroller.
maxItems: 1

interrupts:
description:
Specifier for the global LED brightness changed by front button press
interrupt.
maxItems: 1

"#address-cells":
const: 1

Expand Down Expand Up @@ -56,6 +62,7 @@ additionalProperties: false
examples:
- |
#include <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/leds/common.h>
i2c {
Expand All @@ -65,6 +72,7 @@ examples:
led-controller@2b {
compatible = "cznic,turris-omnia-leds";
reg = <0x2b>;
interrupts-extended = <&mcu 11 IRQ_TYPE_NONE>;
#address-cells = <1>;
#size-cells = <0>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ properties:
description: |
For multicolor LED support this property should be defined as either
LED_COLOR_ID_RGB or LED_COLOR_ID_MULTI which can be found in
include/linux/leds/common.h.
include/dt-bindings/leds/common.h.
enum: [ 8, 9 ]

required:
Expand Down
50 changes: 0 additions & 50 deletions Documentation/devicetree/bindings/leds/leds-lp8860.txt

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ properties:
items:
- enum:
- qcom,pm6150l-flash-led
- qcom,pm660l-flash-led
- qcom,pm8150c-flash-led
- qcom,pm8150l-flash-led
- qcom,pm8350c-flash-led
Expand Down
90 changes: 90 additions & 0 deletions Documentation/devicetree/bindings/leds/ti,lp8860.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/leds/ti,lp8860.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Texas Instruments - lp8860 4-Channel LED Driver

maintainers:
- Andrew Davis <afd@ti.com>

description: |
The LP8860-Q1 is an high-efficiency LED driver with boost controller.
It has 4 high-precision current sinks that can be controlled by a PWM input
signal, a SPI/I2C master, or both.
For more product information please see the link below:
https://www.ti.com/product/lp8860-q1
properties:
compatible:
const: ti,lp8860

reg:
maxItems: 1
description: I2C slave address

"#address-cells":
const: 1

"#size-cells":
const: 0

enable-gpios:
maxItems: 1
description: GPIO pin to enable (active high) / disable the device

vled-supply:
description: LED supply

patternProperties:
"^led(@[0-3])?$":
type: object
$ref: common.yaml#
unevaluatedProperties: false

properties:
reg:
description:
Index of the LED.
maxItems: 1

function: true
color: true
label: true
linux,default-trigger: true

required:
- compatible
- reg

additionalProperties: false

examples:
- |
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/leds/common.h>
i2c {
#address-cells = <1>;
#size-cells = <0>;
led-controller@2d {
compatible = "ti,lp8860";
#address-cells = <1>;
#size-cells = <0>;
reg = <0x2d>;
enable-gpios = <&gpio1 28 GPIO_ACTIVE_HIGH>;
vled-supply = <&vbatt>;
led@0 {
reg = <0>;
function = LED_FUNCTION_BACKLIGHT;
color = <LED_COLOR_ID_WHITE>;
linux,default-trigger = "backlight";
};
};
};
...
15 changes: 15 additions & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,14 @@ W: http://www.adaptec.com/
F: Documentation/scsi/aacraid.rst
F: drivers/scsi/aacraid/

AAEON UPBOARD FPGA MFD DRIVER
M: Thomas Richard <thomas.richard@bootlin.com>
S: Maintained
F: drivers/leds/leds-upboard.c
F: drivers/mfd/upboard-fpga.c
F: drivers/pinctrl/pinctrl-upboard.c
F: include/linux/mfd/upboard-fpga.h

AB8500 BATTERY AND CHARGER DRIVERS
M: Linus Walleij <linus.walleij@linaro.org>
F: Documentation/devicetree/bindings/power/supply/*ab8500*
Expand Down Expand Up @@ -23293,6 +23301,13 @@ S: Supported
F: Documentation/devicetree/bindings/iio/dac/ti,dac7612.yaml
F: drivers/iio/dac/ti-dac7612.c

TEXAS INSTRUMENTS' LB8864 LED BACKLIGHT DRIVER
M: Alexander Sverdlin <alexander.sverdlin@siemens.com>
L: linux-leds@vger.kernel.org
S: Maintained
F: Documentation/devicetree/bindings/leds/backlight/ti,lp8864.yaml
F: drivers/leds/leds-lp8864.c

TEXAS INSTRUMENTS' SYSTEM CONTROL INTERFACE (TISCI) PROTOCOL DRIVER
M: Nishanth Menon <nm@ti.com>
M: Tero Kristo <kristo@kernel.org>
Expand Down
23 changes: 23 additions & 0 deletions drivers/leds/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,8 @@ config LEDS_TURRIS_OMNIA
depends on I2C
depends on MACH_ARMADA_38X || COMPILE_TEST
depends on OF
depends on TURRIS_OMNIA_MCU
depends on TURRIS_OMNIA_MCU_GPIO
select LEDS_TRIGGERS
help
This option enables basic support for the LEDs found on the front
Expand Down Expand Up @@ -511,6 +513,18 @@ config LEDS_LP8860
on the LP8860 4 channel LED driver using the I2C communication
bus.

config LEDS_LP8864
tristate "LED support for the TI LP8864/LP8866 4/6 channel LED drivers"
depends on LEDS_CLASS && I2C && OF
select REGMAP_I2C
help
If you say yes here you get support for the TI LP8864-Q1,
LP8864S-Q1, LP8866-Q1, LP8866S-Q1 4/6 channel LED backlight
drivers with I2C interface.

To compile this driver as a module, choose M here: the
module will be called leds-lp8864.

config LEDS_CLEVO_MAIL
tristate "Mail LED on Clevo notebook"
depends on LEDS_CLASS && BROKEN
Expand Down Expand Up @@ -826,6 +840,15 @@ config LEDS_SC27XX_BLTC
This driver can also be built as a module. If so the module will be
called leds-sc27xx-bltc.

config LEDS_UPBOARD
tristate "LED support for the UP board"
depends on LEDS_CLASS && MFD_UPBOARD_FPGA
help
This option enables support for the UP board LEDs.

This driver can also be built as a module. If so the module will be
called leds-upboard.

comment "LED driver for blink(1) USB RGB LED is under Special HID drivers (HID_THINGM)"

config LEDS_BLINKM
Expand Down
3 changes: 3 additions & 0 deletions drivers/leds/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ obj-$(CONFIG_LEDS_LP55XX_COMMON) += leds-lp55xx-common.o
obj-$(CONFIG_LEDS_LP8501) += leds-lp8501.o
obj-$(CONFIG_LEDS_LP8788) += leds-lp8788.o
obj-$(CONFIG_LEDS_LP8860) += leds-lp8860.o
obj-$(CONFIG_LEDS_LP8864) += leds-lp8864.o
obj-$(CONFIG_LEDS_LT3593) += leds-lt3593.o
obj-$(CONFIG_LEDS_MAX5970) += leds-max5970.o
obj-$(CONFIG_LEDS_MAX77650) += leds-max77650.o
Expand All @@ -82,6 +83,7 @@ obj-$(CONFIG_LEDS_PWM) += leds-pwm.o
obj-$(CONFIG_LEDS_QNAP_MCU) += leds-qnap-mcu.o
obj-$(CONFIG_LEDS_REGULATOR) += leds-regulator.o
obj-$(CONFIG_LEDS_SC27XX_BLTC) += leds-sc27xx-bltc.o
obj-$(CONFIG_LEDS_ST1202) += leds-st1202.o
obj-$(CONFIG_LEDS_SUN50I_A100) += leds-sun50i-a100.o
obj-$(CONFIG_LEDS_SUNFIRE) += leds-sunfire.o
obj-$(CONFIG_LEDS_SYSCON) += leds-syscon.o
Expand All @@ -90,6 +92,7 @@ obj-$(CONFIG_LEDS_TI_LMU_COMMON) += leds-ti-lmu-common.o
obj-$(CONFIG_LEDS_TLC591XX) += leds-tlc591xx.o
obj-$(CONFIG_LEDS_TPS6105X) += leds-tps6105x.o
obj-$(CONFIG_LEDS_TURRIS_OMNIA) += leds-turris-omnia.o
obj-$(CONFIG_LEDS_UPBOARD) += leds-upboard.o
obj-$(CONFIG_LEDS_WM831X_STATUS) += leds-wm831x-status.o
obj-$(CONFIG_LEDS_WM8350) += leds-wm8350.o
obj-$(CONFIG_LEDS_WRAP) += leds-wrap.o
Expand Down
6 changes: 3 additions & 3 deletions drivers/leds/led-class.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,13 @@ static ssize_t max_brightness_show(struct device *dev,
static DEVICE_ATTR_RO(max_brightness);

#ifdef CONFIG_LEDS_TRIGGERS
static BIN_ATTR(trigger, 0644, led_trigger_read, led_trigger_write, 0);
static struct bin_attribute *led_trigger_bin_attrs[] = {
static const BIN_ATTR(trigger, 0644, led_trigger_read, led_trigger_write, 0);
static const struct bin_attribute *const led_trigger_bin_attrs[] = {
&bin_attr_trigger,
NULL,
};
static const struct attribute_group led_trigger_group = {
.bin_attrs = led_trigger_bin_attrs,
.bin_attrs_new = led_trigger_bin_attrs,
};
#endif

Expand Down
4 changes: 2 additions & 2 deletions drivers/leds/led-triggers.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ trigger_relevant(struct led_classdev *led_cdev, struct led_trigger *trig)
}

ssize_t led_trigger_write(struct file *filp, struct kobject *kobj,
struct bin_attribute *bin_attr, char *buf,
const struct bin_attribute *bin_attr, char *buf,
loff_t pos, size_t count)
{
struct device *dev = kobj_to_dev(kobj);
Expand Down Expand Up @@ -123,7 +123,7 @@ static int led_trigger_format(char *buf, size_t size,
* copy it.
*/
ssize_t led_trigger_read(struct file *filp, struct kobject *kobj,
struct bin_attribute *attr, char *buf,
const struct bin_attribute *attr, char *buf,
loff_t pos, size_t count)
{
struct device *dev = kobj_to_dev(kobj);
Expand Down
6 changes: 1 addition & 5 deletions drivers/leds/leds-cht-wcove.c
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ static int cht_wc_leds_probe(struct platform_device *pdev)
led->cdev.pattern_clear = cht_wc_leds_pattern_clear;
led->cdev.max_brightness = 255;

ret = led_classdev_register(&pdev->dev, &led->cdev);
ret = devm_led_classdev_register(&pdev->dev, &led->cdev);
if (ret < 0)
return ret;
}
Expand All @@ -406,10 +406,6 @@ static int cht_wc_leds_probe(struct platform_device *pdev)
static void cht_wc_leds_remove(struct platform_device *pdev)
{
struct cht_wc_leds *leds = platform_get_drvdata(pdev);
int i;

for (i = 0; i < CHT_WC_LED_COUNT; i++)
led_classdev_unregister(&leds->leds[i].cdev);

/* Restore LED1 regs if hw-control was active else leave LED1 off */
if (!(leds->led1_initial_regs.ctrl & CHT_WC_LED1_SWCTL))
Expand Down
2 changes: 1 addition & 1 deletion drivers/leds/leds-lp8860.c
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ static int lp8860_init(struct lp8860_led *led)
goto out;
}

reg_count = ARRAY_SIZE(lp8860_eeprom_disp_regs) / sizeof(lp8860_eeprom_disp_regs[0]);
reg_count = ARRAY_SIZE(lp8860_eeprom_disp_regs);
for (i = 0; i < reg_count; i++) {
ret = regmap_write(led->eeprom_regmap,
lp8860_eeprom_disp_regs[i].reg,
Expand Down
Loading

0 comments on commit 11a7b03

Please sign in to comment.