Lines Matching +full:led +full:- +full:active +full:- +full:low
1 // SPDX-License-Identifier: GPL-2.0
52 bool active; member
84 return leds->priv->base + SC27XX_LEDS_OFFSET * leds->line; in sc27xx_led_get_offset()
90 u32 ctrl_base = leds->priv->base + SC27XX_LEDS_CTRL; in sc27xx_led_enable()
91 u8 ctrl_shift = SC27XX_CTRL_SHIFT * leds->line; in sc27xx_led_enable()
92 struct regmap *regmap = leds->priv->regmap; in sc27xx_led_enable()
109 struct regmap *regmap = leds->priv->regmap; in sc27xx_led_disable()
110 u32 ctrl_base = leds->priv->base + SC27XX_LEDS_CTRL; in sc27xx_led_disable()
111 u8 ctrl_shift = SC27XX_CTRL_SHIFT * leds->line; in sc27xx_led_disable()
122 mutex_lock(&leds->priv->lock); in sc27xx_led_set()
129 mutex_unlock(&leds->priv->lock); in sc27xx_led_set()
140 offset = v - SC27XX_DELTA_T_MIN; in sc27xx_led_clamp_align_delta_t()
149 struct regmap *regmap = leds->priv->regmap; in sc27xx_led_pattern_clear()
151 u32 ctrl_base = leds->priv->base + SC27XX_LEDS_CTRL; in sc27xx_led_pattern_clear()
152 u8 ctrl_shift = SC27XX_CTRL_SHIFT * leds->line; in sc27xx_led_pattern_clear()
155 mutex_lock(&leds->priv->lock); in sc27xx_led_pattern_clear()
157 /* Reset the rise, high, fall and low time to zero. */ in sc27xx_led_pattern_clear()
164 ldev->brightness = LED_OFF; in sc27xx_led_pattern_clear()
166 mutex_unlock(&leds->priv->lock); in sc27xx_led_pattern_clear()
177 u32 ctrl_base = leds->priv->base + SC27XX_LEDS_CTRL; in sc27xx_led_pattern_set()
178 u8 ctrl_shift = SC27XX_CTRL_SHIFT * leds->line; in sc27xx_led_pattern_set()
179 struct regmap *regmap = leds->priv->regmap; in sc27xx_led_pattern_set()
184 * time and low time to enable the breathing mode. in sc27xx_led_pattern_set()
187 return -EINVAL; in sc27xx_led_pattern_set()
189 mutex_lock(&leds->priv->lock); in sc27xx_led_pattern_set()
228 /* Enable the LED breathing mode */ in sc27xx_led_pattern_set()
233 ldev->brightness = pattern[1].brightness; in sc27xx_led_pattern_set()
236 mutex_unlock(&leds->priv->lock); in sc27xx_led_pattern_set()
245 err = sc27xx_led_init(priv->regmap); in sc27xx_led_register()
250 struct sc27xx_led *led = &priv->leds[i]; in sc27xx_led_register() local
253 if (!led->active) in sc27xx_led_register()
256 led->line = i; in sc27xx_led_register()
257 led->priv = priv; in sc27xx_led_register()
258 led->ldev.brightness_set_blocking = sc27xx_led_set; in sc27xx_led_register()
259 led->ldev.pattern_set = sc27xx_led_pattern_set; in sc27xx_led_register()
260 led->ldev.pattern_clear = sc27xx_led_pattern_clear; in sc27xx_led_register()
261 led->ldev.default_trigger = "pattern"; in sc27xx_led_register()
263 init_data.fwnode = led->fwnode; in sc27xx_led_register()
267 err = devm_led_classdev_register_ext(dev, &led->ldev, in sc27xx_led_register()
278 struct device *dev = &pdev->dev; in sc27xx_led_probe()
286 return -EINVAL; in sc27xx_led_probe()
296 return -ENOMEM; in sc27xx_led_probe()
299 priv->base = base; in sc27xx_led_probe()
300 priv->regmap = dev_get_regmap(dev->parent, NULL); in sc27xx_led_probe()
301 if (!priv->regmap) { in sc27xx_led_probe()
302 err = -ENODEV; in sc27xx_led_probe()
312 if (reg >= SC27XX_LEDS_MAX || priv->leds[reg].active) in sc27xx_led_probe()
313 return -EINVAL; in sc27xx_led_probe()
315 priv->leds[reg].fwnode = of_fwnode_handle(child); in sc27xx_led_probe()
316 priv->leds[reg].active = true; in sc27xx_led_probe()
319 mutex_init(&priv->lock); in sc27xx_led_probe()
323 mutex_destroy(&priv->lock); in sc27xx_led_probe()
332 mutex_destroy(&priv->lock); in sc27xx_led_remove()
336 { .compatible = "sprd,sc2731-bltc", },
343 .name = "sprd-bltc",