Skip to content

Commit

Permalink
Merge tag 'leds-5.13-rc1' of git://git.kernel.org/pub/scm/linux/kerne…
Browse files Browse the repository at this point in the history
…l/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
  • Loading branch information
Linus Torvalds committed May 3, 2021
2 parents a7efd19 + 23a7004 commit d835ff6
Show file tree
Hide file tree
Showing 12 changed files with 525 additions and 28 deletions.
57 changes: 57 additions & 0 deletions Documentation/devicetree/bindings/leds/leds-rt4505.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# 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>;
};
};
};
7 changes: 3 additions & 4 deletions drivers/leds/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ config LEDS_CLASS
tristate "LED Class Support"
help
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
tristate "LED Flash Class Support"
Expand Down Expand Up @@ -928,13 +928,12 @@ config LEDS_ACER_A500
This option enables support for the Power Button LED of
Acer Iconia Tab A500.

source "drivers/leds/blink/Kconfig"

comment "Flash and Torch LED drivers"
source "drivers/leds/flash/Kconfig"

comment "LED Triggers"
source "drivers/leds/trigger/Kconfig"

comment "LED Blink"
source "drivers/leds/blink/Kconfig"

endif # NEW_LEDS
2 changes: 1 addition & 1 deletion drivers/leds/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -110,4 +110,4 @@ obj-$(CONFIG_LEDS_CLASS_FLASH) += flash/
obj-$(CONFIG_LEDS_TRIGGERS) += trigger/

# LED Blink
obj-$(CONFIG_LEDS_BLINK) += blink/
obj-y += blink/
33 changes: 15 additions & 18 deletions drivers/leds/blink/Kconfig
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
menuconfig LEDS_BLINK
bool "LED Blink support"
depends on LEDS_CLASS
help
This option enables blink support for the leds class.
If unsure, say Y.
config LEDS_LGM
tristate "LED support for LGM SoC series"
depends on X86 || COMPILE_TEST
depends on GPIOLIB && LEDS_CLASS && MFD_SYSCON && OF
help
This option enables support for LEDs connected to GPIO lines on
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
tristate "LED support for Intel LGM SoC series"
depends on LEDS_CLASS
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
Say 'Y' here if you are working on LGM SoC based platform. Otherwise,
say 'N'. To compile this driver as a module, choose M here: the module
will be called leds-lgm-sso.
2 changes: 1 addition & 1 deletion drivers/leds/blink/Makefile
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# SPDX-License-Identifier: GPL-2.0
obj-$(CONFIG_LEDS_BLINK_LGM) += leds-lgm-sso.o
obj-$(CONFIG_LEDS_LGM) += leds-lgm-sso.o
2 changes: 1 addition & 1 deletion drivers/leds/blink/leds-lgm-sso.c
Original file line number Diff line number Diff line change
Expand Up @@ -793,7 +793,7 @@ static int intel_sso_led_probe(struct platform_device *pdev)

ret = clk_prepare_enable(priv->gclk);
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;
}

Expand Down
11 changes: 11 additions & 0 deletions drivers/leds/flash/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,17 @@

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
tristate "LED support for Richtek RT8515 flash/torch LED"
depends on GPIOLIB
Expand Down
1 change: 1 addition & 0 deletions drivers/leds/flash/Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# SPDX-License-Identifier: GPL-2.0

obj-$(CONFIG_LEDS_RT4505) += leds-rt4505.o
obj-$(CONFIG_LEDS_RT8515) += leds-rt8515.o
Loading

0 comments on commit d835ff6

Please sign in to comment.