Skip to content

Commit e4bc158

Browse files
committed
Merge tag 'leds-next-6.3' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/leds
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() ...
2 parents 025cf4d + 056f65c commit e4bc158

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+193
-441
lines changed

Documentation/devicetree/bindings/leds/common.yaml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,17 +90,22 @@ properties:
9090
- heartbeat
9191
# LED indicates disk activity
9292
- disk-activity
93-
# LED indicates IDE disk activity (deprecated), in new implementations
94-
# use "disk-activity"
95-
- ide-disk
93+
- disk-read
94+
- disk-write
9695
# LED flashes at a fixed, configurable rate
9796
- timer
9897
# LED alters the brightness for the specified duration with one software
9998
# timer (requires "led-pattern" property)
10099
- pattern
101-
# LED is triggered by SD/MMC activity
102-
- pattern: "^mmc[0-9]+$"
100+
- usb-gadget
101+
- usb-host
103102
- pattern: "^cpu[0-9]*$"
103+
- pattern: "^hci[0-9]+-power$"
104+
# LED is triggered by Bluetooth activity
105+
- pattern: "^mmc[0-9]+$"
106+
# LED is triggered by SD/MMC activity
107+
- pattern: "^phy[0-9]+tx$"
108+
# LED is triggered by WLAN activity
104109

105110
led-pattern:
106111
description: |

Documentation/leds/leds-qcom-lpg.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Specify a hardware pattern for a Qualcomm LPG LED.
3434

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

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

7272
In order to save space in the shared lookup table the LPG supports "ping-pong"

drivers/leds/Kconfig

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -623,17 +623,6 @@ config LEDS_NETXBIG
623623
and 5Big Network v2 boards. The LEDs are wired to a CPLD and are
624624
controlled through a GPIO extension bus.
625625

626-
config LEDS_ASIC3
627-
bool "LED support for the HTC ASIC3"
628-
depends on LEDS_CLASS=y
629-
depends on MFD_ASIC3
630-
default y
631-
help
632-
This option enables support for the LEDs on the HTC ASIC3. The HTC
633-
ASIC3 LED GPIOs are inputs, not outputs, thus the leds-gpio driver
634-
cannot be used. This driver supports hardware blinking with an on+off
635-
period from 62ms to 125s. Say Y to enable LEDs on the HP iPAQ hx4700.
636-
637626
config LEDS_TCA6507
638627
tristate "LED Support for TCA6507 I2C chip"
639628
depends on LEDS_CLASS && I2C

drivers/leds/Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ obj-$(CONFIG_LEDS_ADP5520) += leds-adp5520.o
1414
obj-$(CONFIG_LEDS_AN30259A) += leds-an30259a.o
1515
obj-$(CONFIG_LEDS_APU) += leds-apu.o
1616
obj-$(CONFIG_LEDS_ARIEL) += leds-ariel.o
17-
obj-$(CONFIG_LEDS_ASIC3) += leds-asic3.o
1817
obj-$(CONFIG_LEDS_AW2013) += leds-aw2013.o
1918
obj-$(CONFIG_LEDS_BCM6328) += leds-bcm6328.o
2019
obj-$(CONFIG_LEDS_BCM6358) += leds-bcm6358.o

drivers/leds/flash/leds-mt6360.c

Lines changed: 6 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,6 @@ enum {
7171
#define MT6360_STRBTO_STEPUS 32000
7272
#define MT6360_STRBTO_MAXUS 2432000
7373

74-
#define STATE_OFF 0
75-
#define STATE_KEEP 1
76-
#define STATE_ON 2
77-
7874
struct mt6360_led {
7975
union {
8076
struct led_classdev isnk;
@@ -84,7 +80,7 @@ struct mt6360_led {
8480
struct v4l2_flash *v4l2_flash;
8581
struct mt6360_priv *priv;
8682
u32 led_no;
87-
u32 default_state;
83+
enum led_default_state default_state;
8884
};
8985

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

407403
switch (led->default_state) {
408-
case STATE_ON:
404+
case LEDS_DEFSTATE_ON:
409405
led->isnk.brightness = led->isnk.max_brightness;
410406
break;
411-
case STATE_KEEP:
407+
case LEDS_DEFSTATE_KEEP:
412408
led->isnk.brightness = min(level, led->isnk.max_brightness);
413409
break;
414410
default:
@@ -443,10 +439,10 @@ static int mt6360_flash_init_default_state(struct mt6360_led *led)
443439
level = LED_OFF;
444440

445441
switch (led->default_state) {
446-
case STATE_ON:
442+
case LEDS_DEFSTATE_ON:
447443
flash->led_cdev.brightness = flash->led_cdev.max_brightness;
448444
break;
449-
case STATE_KEEP:
445+
case LEDS_DEFSTATE_KEEP:
450446
flash->led_cdev.brightness =
451447
min(level, flash->led_cdev.max_brightness);
452448
break;
@@ -760,25 +756,6 @@ static int mt6360_init_flash_properties(struct mt6360_led *led,
760756
return 0;
761757
}
762758

763-
static int mt6360_init_common_properties(struct mt6360_led *led,
764-
struct led_init_data *init_data)
765-
{
766-
const char *const states[] = { "off", "keep", "on" };
767-
const char *str;
768-
int ret;
769-
770-
if (!fwnode_property_read_string(init_data->fwnode,
771-
"default-state", &str)) {
772-
ret = match_string(states, ARRAY_SIZE(states), str);
773-
if (ret < 0)
774-
ret = STATE_OFF;
775-
776-
led->default_state = ret;
777-
}
778-
779-
return 0;
780-
}
781-
782759
static void mt6360_v4l2_flash_release(struct mt6360_priv *priv)
783760
{
784761
int i;
@@ -852,10 +829,7 @@ static int mt6360_led_probe(struct platform_device *pdev)
852829

853830
led->led_no = reg;
854831
led->priv = priv;
855-
856-
ret = mt6360_init_common_properties(led, &init_data);
857-
if (ret)
858-
goto out_flash_release;
832+
led->default_state = led_init_default_state_get(child);
859833

860834
if (reg == MT6360_VIRTUAL_MULTICOLOR ||
861835
reg <= MT6360_LED_ISNKML)

drivers/leds/led-class.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,7 @@ struct led_classdev *of_led_get(struct device_node *np, int index)
253253

254254
led_dev = class_find_device_by_of_node(leds_class, led_node);
255255
of_node_put(led_node);
256+
put_device(led_dev);
256257

257258
return led_module_get(led_dev);
258259
}

drivers/leds/leds-an30259a.c

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -55,18 +55,14 @@
5555

5656
#define AN30259A_NAME "an30259a"
5757

58-
#define STATE_OFF 0
59-
#define STATE_KEEP 1
60-
#define STATE_ON 2
61-
6258
struct an30259a;
6359

6460
struct an30259a_led {
6561
struct an30259a *chip;
6662
struct fwnode_handle *fwnode;
6763
struct led_classdev cdev;
6864
u32 num;
69-
u32 default_state;
65+
enum led_default_state default_state;
7066
bool sloping;
7167
};
7268

@@ -205,7 +201,6 @@ static int an30259a_dt_init(struct i2c_client *client,
205201
struct device_node *np = dev_of_node(&client->dev), *child;
206202
int count, ret;
207203
int i = 0;
208-
const char *str;
209204
struct an30259a_led *led;
210205

211206
count = of_get_available_child_count(np);
@@ -228,15 +223,7 @@ static int an30259a_dt_init(struct i2c_client *client,
228223
led->num = source;
229224
led->chip = chip;
230225
led->fwnode = of_fwnode_handle(child);
231-
232-
if (!of_property_read_string(child, "default-state", &str)) {
233-
if (!strcmp(str, "on"))
234-
led->default_state = STATE_ON;
235-
else if (!strcmp(str, "keep"))
236-
led->default_state = STATE_KEEP;
237-
else
238-
led->default_state = STATE_OFF;
239-
}
226+
led->default_state = led_init_default_state_get(led->fwnode);
240227

241228
i++;
242229
}
@@ -261,10 +248,10 @@ static void an30259a_init_default_state(struct an30259a_led *led)
261248
int led_on, err;
262249

263250
switch (led->default_state) {
264-
case STATE_ON:
251+
case LEDS_DEFSTATE_ON:
265252
led->cdev.brightness = LED_FULL;
266253
break;
267-
case STATE_KEEP:
254+
case LEDS_DEFSTATE_KEEP:
268255
err = regmap_read(chip->regmap, AN30259A_REG_LED_ON, &led_on);
269256
if (err)
270257
break;

drivers/leds/leds-asic3.c

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

0 commit comments

Comments
 (0)