Commit e4bc1588 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull LED updates from Lee Jones:
 "Removed Drivers:
   - HTC ASIC3 LED

  New Functionality:
   - Provide generic led_get() which can be used by both DT and !DT
     platforms

  Fix-ups:
   - Convert a bunch of I2C subsystem users to the new probing API
   - Explicitly provide missing include files
   - Make use of led_init_default_state_get() and rid the custom
     variants
   - Use simplified fwnode_device_is_compatible() API
   - Provide some Device Tree additions / adaptions
   - Fix some trivial spelling issues

  Bug Fixes:
   - Prevent device refcount leak during led_put() and of_led_get()
   - Clear previous data from temporary led_pwm structure before
     processing next child
   - Fix Clang's warning about incompatible function types when using
     devm_add_action*()"

* tag 'leds-next-6.3' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/leds: (41 commits)
  leds: Remove ide-disk trigger
  dt-bindings: leds: Add disk write/read and usb-host/usb-gadget
  Documentation: leds: Correct spelling
  dt-bindings: leds: Document Bluetooth and WLAN triggers
  leds: Remove asic3 driver
  leds: simatic-ipc-leds-gpio: Make sure we have the GPIO providing driver
  leds: tca6507: Convert to use fwnode_device_is_compatible()
  leds: syscon: Get rid of custom led_init_default_state_get()
  leds: pm8058: Get rid of custom led_init_default_state_get()
  leds: pca955x: Get rid of custom led_init_default_state_get()
  leds: mt6360: Get rid of custom led_init_default_state_get()
  leds: mt6323: Get rid of custom led_init_default_state_get()
  leds: bcm6358: Get rid of custom led_init_default_state_get()
  leds: bcm6328: Get rid of custom led_init_default_state_get()
  leds: an30259a: Get rid of custom led_init_default_state_get()
  leds: Move led_init_default_state_get() to the global header
  leds: Add missing includes and forward declarations in leds.h
  leds: is31fl319x: Wrap mutex_destroy() for devm_add_action_or_rest()
  leds: turris-omnia: Convert to i2c's .probe_new()
  leds: tlc591xx: Convert to i2c's .probe_new()
  ...
parents 025cf4dc 056f65c3
Loading
Loading
Loading
Loading
+10 −5
Original line number Diff line number Diff line
@@ -90,17 +90,22 @@ properties:
          - heartbeat
            # LED indicates disk activity
          - disk-activity
            # LED indicates IDE disk activity (deprecated), in new implementations
            # use "disk-activity"
          - ide-disk
          - disk-read
          - disk-write
            # LED flashes at a fixed, configurable rate
          - timer
            # LED alters the brightness for the specified duration with one software
            # timer (requires "led-pattern" property)
          - pattern
        # LED is triggered by SD/MMC activity
      - pattern: "^mmc[0-9]+$"
          - usb-gadget
          - usb-host
      - pattern: "^cpu[0-9]*$"
      - pattern: "^hci[0-9]+-power$"
        # LED is triggered by Bluetooth activity
      - pattern: "^mmc[0-9]+$"
        # LED is triggered by SD/MMC activity
      - pattern: "^phy[0-9]+tx$"
        # LED is triggered by WLAN activity

  led-pattern:
    description: |
+2 −2
Original line number Diff line number Diff line
@@ -34,7 +34,7 @@ Specify a hardware pattern for a Qualcomm LPG LED.

The pattern is a series of brightness and hold-time pairs, with the hold-time
expressed in milliseconds. The hold time is a property of the pattern and must
therefor be identical for each element in the pattern (except for the pauses
therefore be identical for each element in the pattern (except for the pauses
described below). As the LPG hardware is not able to perform the linear
transitions expected by the leds-trigger-pattern format, each entry in the
pattern must be followed a zero-length entry of the same brightness.
@@ -66,7 +66,7 @@ Low-pause pattern::
        +----------------------------->
        0    5   10   15  20   25   time (100ms)

Similarily, the last entry can be stretched by using a higher hold-time on the
Similarly, the last entry can be stretched by using a higher hold-time on the
last entry.

In order to save space in the shared lookup table the LPG supports "ping-pong"
+0 −11
Original line number Diff line number Diff line
@@ -623,17 +623,6 @@ config LEDS_NETXBIG
	  and 5Big Network v2 boards. The LEDs are wired to a CPLD and are
	  controlled through a GPIO extension bus.

config LEDS_ASIC3
	bool "LED support for the HTC ASIC3"
	depends on LEDS_CLASS=y
	depends on MFD_ASIC3
	default y
	help
	  This option enables support for the LEDs on the HTC ASIC3. The HTC
	  ASIC3 LED GPIOs are inputs, not outputs, thus the leds-gpio driver
	  cannot be used. This driver supports hardware blinking with an on+off
	  period from 62ms to 125s. Say Y to enable LEDs on the HP iPAQ hx4700.

config LEDS_TCA6507
	tristate "LED Support for TCA6507 I2C chip"
	depends on LEDS_CLASS && I2C
+0 −1
Original line number Diff line number Diff line
@@ -14,7 +14,6 @@ obj-$(CONFIG_LEDS_ADP5520) += leds-adp5520.o
obj-$(CONFIG_LEDS_AN30259A)		+= leds-an30259a.o
obj-$(CONFIG_LEDS_APU)			+= leds-apu.o
obj-$(CONFIG_LEDS_ARIEL)		+= leds-ariel.o
obj-$(CONFIG_LEDS_ASIC3)		+= leds-asic3.o
obj-$(CONFIG_LEDS_AW2013)		+= leds-aw2013.o
obj-$(CONFIG_LEDS_BCM6328)		+= leds-bcm6328.o
obj-$(CONFIG_LEDS_BCM6358)		+= leds-bcm6358.o
+6 −32
Original line number Diff line number Diff line
@@ -71,10 +71,6 @@ enum {
#define MT6360_STRBTO_STEPUS		32000
#define MT6360_STRBTO_MAXUS		2432000

#define STATE_OFF			0
#define STATE_KEEP			1
#define STATE_ON			2

struct mt6360_led {
	union {
		struct led_classdev isnk;
@@ -84,7 +80,7 @@ struct mt6360_led {
	struct v4l2_flash *v4l2_flash;
	struct mt6360_priv *priv;
	u32 led_no;
	u32 default_state;
	enum led_default_state default_state;
};

struct mt6360_priv {
@@ -405,10 +401,10 @@ static int mt6360_isnk_init_default_state(struct mt6360_led *led)
		level = LED_OFF;

	switch (led->default_state) {
	case STATE_ON:
	case LEDS_DEFSTATE_ON:
		led->isnk.brightness = led->isnk.max_brightness;
		break;
	case STATE_KEEP:
	case LEDS_DEFSTATE_KEEP:
		led->isnk.brightness = min(level, led->isnk.max_brightness);
		break;
	default:
@@ -443,10 +439,10 @@ static int mt6360_flash_init_default_state(struct mt6360_led *led)
		level = LED_OFF;

	switch (led->default_state) {
	case STATE_ON:
	case LEDS_DEFSTATE_ON:
		flash->led_cdev.brightness = flash->led_cdev.max_brightness;
		break;
	case STATE_KEEP:
	case LEDS_DEFSTATE_KEEP:
		flash->led_cdev.brightness =
			min(level, flash->led_cdev.max_brightness);
		break;
@@ -760,25 +756,6 @@ static int mt6360_init_flash_properties(struct mt6360_led *led,
	return 0;
}

static int mt6360_init_common_properties(struct mt6360_led *led,
					 struct led_init_data *init_data)
{
	const char *const states[] = { "off", "keep", "on" };
	const char *str;
	int ret;

	if (!fwnode_property_read_string(init_data->fwnode,
					 "default-state", &str)) {
		ret = match_string(states, ARRAY_SIZE(states), str);
		if (ret < 0)
			ret = STATE_OFF;

		led->default_state = ret;
	}

	return 0;
}

static void mt6360_v4l2_flash_release(struct mt6360_priv *priv)
{
	int i;
@@ -852,10 +829,7 @@ static int mt6360_led_probe(struct platform_device *pdev)

		led->led_no = reg;
		led->priv = priv;

		ret = mt6360_init_common_properties(led, &init_data);
		if (ret)
			goto out_flash_release;
		led->default_state = led_init_default_state_get(child);

		if (reg == MT6360_VIRTUAL_MULTICOLOR ||
		    reg <= MT6360_LED_ISNKML)
Loading