Commit d835ff6c authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'leds-5.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/pavel/linux-leds

Pull LED updates from Pavel Machek:
 "Nothing too exciting here, just some fixes"

* tag 'leds-5.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/pavel/linux-leds:
  leds: pca9532: Assign gpio base dynamically
  leds: trigger: pattern: Switch to using the new API kobj_to_dev()
  leds: LEDS_BLINK_LGM should depend on X86
  leds: lgm: Fix spelling mistake "prepate" -> "prepare"
  MAINTAINERS: Remove Dan Murphy's bouncing email
  leds-lm3642: convert comma to semicolon
  leds: rt4505: Add support for Richtek RT4505 flash LED controller
  leds: rt4505: Add DT binding document for Richtek RT4505
  leds: Kconfig: LEDS_CLASS is usually selected.
  leds: lgm: Improve Kconfig help
  leds: lgm: fix gpiolib dependency
parents a7efd197 23a70045
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/leds/leds-rt4505.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Richtek RT4505 Single Channel LED Driver
maintainers:
- ChiYuan Huang <cy_huang@richtek.com>
description: |
The RT4505 is a flash LED driver that can support up to 375mA and 1.5A for
torch and flash mode, respectively.
The data sheet can be found at:
https://www.richtek.com/assets/product_file/RT4505/DS4505-02.pdf
properties:
compatible:
const: richtek,rt4505
reg:
description: I2C slave address of the controller.
maxItems: 1
led:
type: object
$ref: common.yaml#
required:
- compatible
- reg
additionalProperties: false
examples:
- |
#include <dt-bindings/leds/common.h>
i2c0 {
#address-cells = <1>;
#size-cells = <0>;
led-controller@63 {
compatible = "richtek,rt4505";
reg = <0x63>;
rt4505_flash: led {
function = LED_FUNCTION_FLASH;
color = <LED_COLOR_ID_WHITE>;
led-max-microamp = <375000>;
flash-max-microamp = <1500000>;
flash-max-timeout-us = <800000>;
};
};
};
...@@ -18,7 +18,7 @@ config LEDS_CLASS ...@@ -18,7 +18,7 @@ config LEDS_CLASS
tristate "LED Class Support" tristate "LED Class Support"
help help
This option enables the LED sysfs class in /sys/class/leds. You'll This option enables the LED sysfs class in /sys/class/leds. You'll
need this to do anything useful with LEDs. If unsure, say N. need this to do anything useful with LEDs. If unsure, say Y.
config LEDS_CLASS_FLASH config LEDS_CLASS_FLASH
tristate "LED Flash Class Support" tristate "LED Flash Class Support"
...@@ -928,13 +928,12 @@ config LEDS_ACER_A500 ...@@ -928,13 +928,12 @@ config LEDS_ACER_A500
This option enables support for the Power Button LED of This option enables support for the Power Button LED of
Acer Iconia Tab A500. Acer Iconia Tab A500.
source "drivers/leds/blink/Kconfig"
comment "Flash and Torch LED drivers" comment "Flash and Torch LED drivers"
source "drivers/leds/flash/Kconfig" source "drivers/leds/flash/Kconfig"
comment "LED Triggers" comment "LED Triggers"
source "drivers/leds/trigger/Kconfig" source "drivers/leds/trigger/Kconfig"
comment "LED Blink"
source "drivers/leds/blink/Kconfig"
endif # NEW_LEDS endif # NEW_LEDS
...@@ -110,4 +110,4 @@ obj-$(CONFIG_LEDS_CLASS_FLASH) += flash/ ...@@ -110,4 +110,4 @@ obj-$(CONFIG_LEDS_CLASS_FLASH) += flash/
obj-$(CONFIG_LEDS_TRIGGERS) += trigger/ obj-$(CONFIG_LEDS_TRIGGERS) += trigger/
# LED Blink # LED Blink
obj-$(CONFIG_LEDS_BLINK) += blink/ obj-y += blink/
menuconfig LEDS_BLINK config LEDS_LGM
bool "LED Blink support" tristate "LED support for LGM SoC series"
depends on LEDS_CLASS depends on X86 || COMPILE_TEST
depends on GPIOLIB && LEDS_CLASS && MFD_SYSCON && OF
help help
This option enables blink support for the leds class. This option enables support for LEDs connected to GPIO lines on
If unsure, say Y. Lightning Mountain (LGM) SoC. Lightning Mountain is a AnyWAN
gateway-on-a-chip SoC to be shipped on mid and high end home
gateways and routers.
if LEDS_BLINK These LEDs are driven by a Serial Shift Output (SSO) controller.
The driver supports hardware blinking and the LEDs can be configured
to be triggered by software/CPU or by hardware.
config LEDS_BLINK_LGM Say 'Y' here if you are working on LGM SoC based platform. Otherwise,
tristate "LED support for Intel LGM SoC series" say 'N'. To compile this driver as a module, choose M here: the module
depends on LEDS_CLASS will be called leds-lgm-sso.
depends on MFD_SYSCON
depends on OF
help
Parallel to serial conversion, which is also called SSO controller,
can drive external shift register for LED outputs.
This enables LED support for Serial Shift Output controller(SSO).
endif # LEDS_BLINK
# SPDX-License-Identifier: GPL-2.0 # SPDX-License-Identifier: GPL-2.0
obj-$(CONFIG_LEDS_BLINK_LGM) += leds-lgm-sso.o obj-$(CONFIG_LEDS_LGM) += leds-lgm-sso.o
...@@ -793,7 +793,7 @@ static int intel_sso_led_probe(struct platform_device *pdev) ...@@ -793,7 +793,7 @@ static int intel_sso_led_probe(struct platform_device *pdev)
ret = clk_prepare_enable(priv->gclk); ret = clk_prepare_enable(priv->gclk);
if (ret) { if (ret) {
dev_err(dev, "Failed to prepate/enable sso gate clock!\n"); dev_err(dev, "Failed to prepare/enable sso gate clock!\n");
return ret; return ret;
} }
......
...@@ -2,6 +2,17 @@ ...@@ -2,6 +2,17 @@
if LEDS_CLASS_FLASH if LEDS_CLASS_FLASH
config LEDS_RT4505
tristate "LED support for RT4505 flashlight controller"
depends on I2C && OF
depends on V4L2_FLASH_LED_CLASS || !V4L2_FLASH_LED_CLASS
select REGMAP_I2C
help
This option enables support for the RT4505 flash LED controller.
RT4505 includes torch and flash functions with programmable current.
And it's commonly used to compensate the illuminance for the camera
inside the mobile product like as phones or tablets.
config LEDS_RT8515 config LEDS_RT8515
tristate "LED support for Richtek RT8515 flash/torch LED" tristate "LED support for Richtek RT8515 flash/torch LED"
depends on GPIOLIB depends on GPIOLIB
......
# SPDX-License-Identifier: GPL-2.0 # SPDX-License-Identifier: GPL-2.0
obj-$(CONFIG_LEDS_RT4505) += leds-rt4505.o
obj-$(CONFIG_LEDS_RT8515) += leds-rt8515.o obj-$(CONFIG_LEDS_RT8515) += leds-rt8515.o
This diff is collapsed.
...@@ -339,7 +339,7 @@ static int lm3642_probe(struct i2c_client *client, ...@@ -339,7 +339,7 @@ static int lm3642_probe(struct i2c_client *client,
chip->cdev_flash.max_brightness = 16; chip->cdev_flash.max_brightness = 16;
chip->cdev_flash.brightness_set_blocking = lm3642_strobe_brightness_set; chip->cdev_flash.brightness_set_blocking = lm3642_strobe_brightness_set;
chip->cdev_flash.default_trigger = "flash"; chip->cdev_flash.default_trigger = "flash";
chip->cdev_flash.groups = lm3642_flash_groups, chip->cdev_flash.groups = lm3642_flash_groups;
err = led_classdev_register(&client->dev, &chip->cdev_flash); err = led_classdev_register(&client->dev, &chip->cdev_flash);
if (err < 0) { if (err < 0) {
dev_err(chip->dev, "failed to register flash\n"); dev_err(chip->dev, "failed to register flash\n");
...@@ -351,7 +351,7 @@ static int lm3642_probe(struct i2c_client *client, ...@@ -351,7 +351,7 @@ static int lm3642_probe(struct i2c_client *client,
chip->cdev_torch.max_brightness = 8; chip->cdev_torch.max_brightness = 8;
chip->cdev_torch.brightness_set_blocking = lm3642_torch_brightness_set; chip->cdev_torch.brightness_set_blocking = lm3642_torch_brightness_set;
chip->cdev_torch.default_trigger = "torch"; chip->cdev_torch.default_trigger = "torch";
chip->cdev_torch.groups = lm3642_torch_groups, chip->cdev_torch.groups = lm3642_torch_groups;
err = led_classdev_register(&client->dev, &chip->cdev_torch); err = led_classdev_register(&client->dev, &chip->cdev_torch);
if (err < 0) { if (err < 0) {
dev_err(chip->dev, "failed to register torch\n"); dev_err(chip->dev, "failed to register torch\n");
......
...@@ -480,6 +480,8 @@ pca9532_of_populate_pdata(struct device *dev, struct device_node *np) ...@@ -480,6 +480,8 @@ pca9532_of_populate_pdata(struct device *dev, struct device_node *np)
if (!pdata) if (!pdata)
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
pdata->gpio_base = -1;
of_property_read_u8_array(np, "nxp,pwm", &pdata->pwm[0], of_property_read_u8_array(np, "nxp,pwm", &pdata->pwm[0],
ARRAY_SIZE(pdata->pwm)); ARRAY_SIZE(pdata->pwm));
of_property_read_u8_array(np, "nxp,psc", &pdata->psc[0], of_property_read_u8_array(np, "nxp,psc", &pdata->psc[0],
......
...@@ -333,7 +333,7 @@ static DEVICE_ATTR_RW(hw_pattern); ...@@ -333,7 +333,7 @@ static DEVICE_ATTR_RW(hw_pattern);
static umode_t pattern_trig_attrs_mode(struct kobject *kobj, static umode_t pattern_trig_attrs_mode(struct kobject *kobj,
struct attribute *attr, int index) struct attribute *attr, int index)
{ {
struct device *dev = container_of(kobj, struct device, kobj); struct device *dev = kobj_to_dev(kobj);
struct led_classdev *led_cdev = dev_get_drvdata(dev); struct led_classdev *led_cdev = dev_get_drvdata(dev);
if (attr == &dev_attr_repeat.attr || attr == &dev_attr_pattern.attr) if (attr == &dev_attr_repeat.attr || attr == &dev_attr_pattern.attr)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment