diff options
Diffstat (limited to 'drivers/leds/leds-lm3532.c')
-rw-r--r-- | drivers/leds/leds-lm3532.c | 65 |
1 files changed, 25 insertions, 40 deletions
diff --git a/drivers/leds/leds-lm3532.c b/drivers/leds/leds-lm3532.c index 946ad67eaecb..0bf25bdde02f 100644 --- a/drivers/leds/leds-lm3532.c +++ b/drivers/leds/leds-lm3532.c @@ -96,15 +96,15 @@ /* * struct lm3532_als_data - * @config - value of ALS configuration register - * @als1_imp_sel - value of ALS1 resistor select register - * @als2_imp_sel - value of ALS2 resistor select register - * @als_avrg_time - ALS averaging time - * @als_input_mode - ALS input mode for brightness control - * @als_vmin - Minimum ALS voltage - * @als_vmax - Maximum ALS voltage - * @zone_lo - values of ALS lo ZB(Zone Boundary) registers - * @zone_hi - values of ALS hi ZB(Zone Boundary) registers + * @config: value of ALS configuration register + * @als1_imp_sel: value of ALS1 resistor select register + * @als2_imp_sel: value of ALS2 resistor select register + * @als_avrg_time: ALS averaging time + * @als_input_mode: ALS input mode for brightness control + * @als_vmin: Minimum ALS voltage + * @als_vmax: Maximum ALS voltage + * @zone_lo: values of ALS lo ZB(Zone Boundary) registers + * @zone_hi: values of ALS hi ZB(Zone Boundary) registers */ struct lm3532_als_data { u8 config; @@ -121,15 +121,14 @@ struct lm3532_als_data { /** * struct lm3532_led * @led_dev: led class device - * @priv - Pointer the device data structure - * @control_bank - Control bank the LED is associated to - * @mode - Mode of the LED string - * @ctrl_brt_pointer - Zone target register that controls the sink - * @num_leds - Number of LED strings are supported in this array - * @full_scale_current - The full-scale current setting for the current sink. - * @led_strings - The LED strings supported in this array - * @enabled - Enabled status - * @label - LED label + * @priv: Pointer the device data structure + * @control_bank: Control bank the LED is associated to + * @mode: Mode of the LED string + * @ctrl_brt_pointer: Zone target register that controls the sink + * @num_leds: Number of LED strings are supported in this array + * @full_scale_current: The full-scale current setting for the current sink. + * @led_strings: The LED strings supported in this array + * @enabled: Enabled status */ struct lm3532_led { struct led_classdev led_dev; @@ -142,21 +141,20 @@ struct lm3532_led { int full_scale_current; unsigned int enabled:1; u32 led_strings[LM3532_MAX_CONTROL_BANKS]; - char label[LED_MAX_NAME_SIZE]; }; /** * struct lm3532_data - * @enable_gpio - Hardware enable gpio + * @enable_gpio: Hardware enable gpio * @regulator: regulator * @client: i2c client - * @regmap - Devices register map - * @dev - Pointer to the devices device struct - * @lock - Lock for reading/writing the device - * @als_data - Pointer to the als data struct - * @runtime_ramp_up - Runtime ramp up setting - * @runtime_ramp_down - Runtime ramp down setting - * @leds - Array of LED strings + * @regmap: Devices register map + * @dev: Pointer to the devices device struct + * @lock: Lock for reading/writing the device + * @als_data: Pointer to the als data struct + * @runtime_ramp_up: Runtime ramp up setting + * @runtime_ramp_down: Runtime ramp down setting + * @leds: Array of LED strings */ struct lm3532_data { struct gpio_desc *enable_gpio; @@ -548,7 +546,6 @@ static int lm3532_parse_node(struct lm3532_data *priv) { struct fwnode_handle *child = NULL; struct lm3532_led *led; - const char *name; int control_bank; u32 ramp_time; size_t i = 0; @@ -643,19 +640,7 @@ static int lm3532_parse_node(struct lm3532_data *priv) goto child_out; } - fwnode_property_read_string(child, "linux,default-trigger", - &led->led_dev.default_trigger); - - ret = fwnode_property_read_string(child, "label", &name); - if (ret) - snprintf(led->label, sizeof(led->label), - "%s::", priv->client->name); - else - snprintf(led->label, sizeof(led->label), - "%s:%s", priv->client->name, name); - led->priv = priv; - led->led_dev.name = led->label; led->led_dev.brightness_set_blocking = lm3532_brightness_set; ret = devm_led_classdev_register_ext(priv->dev, &led->led_dev, &idata); |