Home
last modified time | relevance | path

Searched refs:led (Results 1 – 25 of 212) sorted by relevance

123456789

/drivers/leds/
Dleds-bd2802.c76 struct led_state led[2]; member
111 static inline int bd2802_is_rgb_off(struct bd2802_led *led, enum led_ids id, in bd2802_is_rgb_off() argument
116 return !led->led[id].r; in bd2802_is_rgb_off()
118 return !led->led[id].g; in bd2802_is_rgb_off()
120 return !led->led[id].b; in bd2802_is_rgb_off()
122 dev_err(&led->client->dev, "%s: Invalid color\n", __func__); in bd2802_is_rgb_off()
127 static inline int bd2802_is_led_off(struct bd2802_led *led, enum led_ids id) in bd2802_is_led_off() argument
129 if (led->led[id].r || led->led[id].g || led->led[id].b) in bd2802_is_led_off()
135 static inline int bd2802_is_all_off(struct bd2802_led *led) in bd2802_is_all_off() argument
140 if (!bd2802_is_led_off(led, i)) in bd2802_is_all_off()
[all …]
Dleds-cpcap.c70 struct led_classdev led; member
89 static int cpcap_led_set_power(struct cpcap_led *led, bool status) in cpcap_led_set_power() argument
93 if (status == led->powered) in cpcap_led_set_power()
97 err = regulator_enable(led->vdd); in cpcap_led_set_power()
99 err = regulator_disable(led->vdd); in cpcap_led_set_power()
102 dev_err(led->dev, "regulator failure: %d", err); in cpcap_led_set_power()
106 led->powered = status; in cpcap_led_set_power()
113 struct cpcap_led *led = container_of(ledc, struct cpcap_led, led); in cpcap_led_set() local
117 mutex_lock(&led->update_lock); in cpcap_led_set()
120 err = cpcap_led_set_power(led, true); in cpcap_led_set()
[all …]
Dleds-wm8350.c92 static int wm8350_led_enable(struct wm8350_led *led) in wm8350_led_enable() argument
96 if (led->enabled) in wm8350_led_enable()
99 ret = regulator_enable(led->isink); in wm8350_led_enable()
101 dev_err(led->cdev.dev, "Failed to enable ISINK: %d\n", ret); in wm8350_led_enable()
105 ret = regulator_enable(led->dcdc); in wm8350_led_enable()
107 dev_err(led->cdev.dev, "Failed to enable DCDC: %d\n", ret); in wm8350_led_enable()
108 regulator_disable(led->isink); in wm8350_led_enable()
112 led->enabled = 1; in wm8350_led_enable()
117 static int wm8350_led_disable(struct wm8350_led *led) in wm8350_led_disable() argument
121 if (!led->enabled) in wm8350_led_disable()
[all …]
Dleds-aat1290.c98 static void aat1290_as2cwire_write(struct aat1290_led *led, int addr, int value) in aat1290_as2cwire_write() argument
102 gpiod_direction_output(led->gpio_fl_en, 0); in aat1290_as2cwire_write()
103 gpiod_direction_output(led->gpio_en_set, 0); in aat1290_as2cwire_write()
110 gpiod_direction_output(led->gpio_en_set, 0); in aat1290_as2cwire_write()
112 gpiod_direction_output(led->gpio_en_set, 1); in aat1290_as2cwire_write()
120 gpiod_direction_output(led->gpio_en_set, 0); in aat1290_as2cwire_write()
122 gpiod_direction_output(led->gpio_en_set, 1); in aat1290_as2cwire_write()
128 static void aat1290_set_flash_safety_timer(struct aat1290_led *led, in aat1290_set_flash_safety_timer() argument
131 struct led_classdev_flash *fled_cdev = &led->fled_cdev; in aat1290_set_flash_safety_timer()
136 aat1290_as2cwire_write(led, AAT1290_FLASH_SAFETY_TIMER_ADDR, in aat1290_set_flash_safety_timer()
[all …]
Dleds-ktd2692.c98 static void ktd2692_expresswire_start(struct ktd2692_context *led) in ktd2692_expresswire_start() argument
100 gpiod_direction_output(led->ctrl_gpio, KTD2692_HIGH); in ktd2692_expresswire_start()
104 static void ktd2692_expresswire_reset(struct ktd2692_context *led) in ktd2692_expresswire_reset() argument
106 gpiod_direction_output(led->ctrl_gpio, KTD2692_LOW); in ktd2692_expresswire_reset()
110 static void ktd2692_expresswire_end(struct ktd2692_context *led) in ktd2692_expresswire_end() argument
112 gpiod_direction_output(led->ctrl_gpio, KTD2692_LOW); in ktd2692_expresswire_end()
114 gpiod_direction_output(led->ctrl_gpio, KTD2692_HIGH); in ktd2692_expresswire_end()
118 static void ktd2692_expresswire_set_bit(struct ktd2692_context *led, bool bit) in ktd2692_expresswire_set_bit() argument
137 gpiod_direction_output(led->ctrl_gpio, KTD2692_LOW); in ktd2692_expresswire_set_bit()
139 gpiod_direction_output(led->ctrl_gpio, KTD2692_HIGH); in ktd2692_expresswire_set_bit()
[all …]
Dleds-max8997.c51 static void max8997_led_set_mode(struct max8997_led *led, in max8997_led_set_mode() argument
55 struct i2c_client *client = led->iodev->i2c; in max8997_led_set_mode()
61 val = led->id ? in max8997_led_set_mode()
63 led->cdev.max_brightness = MAX8997_LED_FLASH_MAX_BRIGHTNESS; in max8997_led_set_mode()
67 val = led->id ? in max8997_led_set_mode()
69 led->cdev.max_brightness = MAX8997_LED_MOVIE_MAX_BRIGHTNESS; in max8997_led_set_mode()
74 val = led->id ? in max8997_led_set_mode()
76 led->cdev.max_brightness = MAX8997_LED_FLASH_MAX_BRIGHTNESS; in max8997_led_set_mode()
81 val = led->id ? in max8997_led_set_mode()
83 led->cdev.max_brightness = MAX8997_LED_MOVIE_MAX_BRIGHTNESS; in max8997_led_set_mode()
[all …]
Dleds-lp8860.c146 static int lp8860_unlock_eeprom(struct lp8860_led *led, int lock) in lp8860_unlock_eeprom() argument
150 mutex_lock(&led->lock); in lp8860_unlock_eeprom()
153 ret = regmap_write(led->regmap, in lp8860_unlock_eeprom()
157 dev_err(&led->client->dev, "EEPROM Unlock failed\n"); in lp8860_unlock_eeprom()
161 ret = regmap_write(led->regmap, in lp8860_unlock_eeprom()
165 dev_err(&led->client->dev, "EEPROM Unlock failed\n"); in lp8860_unlock_eeprom()
168 ret = regmap_write(led->regmap, in lp8860_unlock_eeprom()
172 dev_err(&led->client->dev, "EEPROM Unlock failed\n"); in lp8860_unlock_eeprom()
176 ret = regmap_write(led->regmap, in lp8860_unlock_eeprom()
182 mutex_unlock(&led->lock); in lp8860_unlock_eeprom()
[all …]
Dleds-max77693.c143 static inline bool max77693_fled_used(struct max77693_led_device *led, in max77693_fled_used() argument
148 return led->fled_mask & fled_bit; in max77693_fled_used()
151 static int max77693_set_mode_reg(struct max77693_led_device *led, u8 mode) in max77693_set_mode_reg() argument
153 struct regmap *rmap = led->regmap; in max77693_set_mode_reg()
183 static int max77693_add_mode(struct max77693_led_device *led, u8 mode) in max77693_add_mode() argument
188 if (led->iout_joint) in max77693_add_mode()
199 led->mode_flags &= (~MODE_TORCH(i) & ~MODE_FLASH(i)); in max77693_add_mode()
201 new_mode_flags = mode | led->mode_flags; in max77693_add_mode()
202 new_mode_flags &= led->allowed_modes; in max77693_add_mode()
204 if (new_mode_flags ^ led->mode_flags) in max77693_add_mode()
[all …]
Dleds-regulator.c62 static void regulator_led_enable(struct regulator_led *led) in regulator_led_enable() argument
66 if (led->enabled) in regulator_led_enable()
69 ret = regulator_enable(led->vcc); in regulator_led_enable()
71 dev_err(led->cdev.dev, "Failed to enable vcc: %d\n", ret); in regulator_led_enable()
75 led->enabled = 1; in regulator_led_enable()
78 static void regulator_led_disable(struct regulator_led *led) in regulator_led_disable() argument
82 if (!led->enabled) in regulator_led_disable()
85 ret = regulator_disable(led->vcc); in regulator_led_disable()
87 dev_err(led->cdev.dev, "Failed to disable vcc: %d\n", ret); in regulator_led_disable()
91 led->enabled = 0; in regulator_led_disable()
[all …]
Dleds-lm3533.c63 static inline int lm3533_led_get_ctrlbank_id(struct lm3533_led *led) in lm3533_led_get_ctrlbank_id() argument
65 return led->id + 2; in lm3533_led_get_ctrlbank_id()
68 static inline u8 lm3533_led_get_lv_reg(struct lm3533_led *led, u8 base) in lm3533_led_get_lv_reg() argument
70 return base + led->id; in lm3533_led_get_lv_reg()
73 static inline u8 lm3533_led_get_pattern(struct lm3533_led *led) in lm3533_led_get_pattern() argument
75 return led->id; in lm3533_led_get_pattern()
78 static inline u8 lm3533_led_get_pattern_reg(struct lm3533_led *led, in lm3533_led_get_pattern_reg() argument
81 return base + lm3533_led_get_pattern(led) * LM3533_REG_PATTERN_STEP; in lm3533_led_get_pattern_reg()
84 static int lm3533_led_pattern_enable(struct lm3533_led *led, int enable) in lm3533_led_pattern_enable() argument
92 dev_dbg(led->cdev.dev, "%s - %d\n", __func__, enable); in lm3533_led_pattern_enable()
[all …]
Dleds-wm831x-status.c42 static void wm831x_status_set(struct wm831x_status *led) in wm831x_status_set() argument
46 mutex_lock(&led->mutex); in wm831x_status_set()
48 led->reg_val &= ~(WM831X_LED_SRC_MASK | WM831X_LED_MODE_MASK | in wm831x_status_set()
51 spin_lock_irqsave(&led->value_lock, flags); in wm831x_status_set()
53 led->reg_val |= led->src << WM831X_LED_SRC_SHIFT; in wm831x_status_set()
54 if (led->blink) { in wm831x_status_set()
55 led->reg_val |= 2 << WM831X_LED_MODE_SHIFT; in wm831x_status_set()
56 led->reg_val |= led->blink_time << WM831X_LED_DUR_SHIFT; in wm831x_status_set()
57 led->reg_val |= led->blink_cyc; in wm831x_status_set()
59 if (led->brightness != LED_OFF) in wm831x_status_set()
[all …]
Dleds-pm8058.c39 struct pm8058_led *led; in pm8058_led_set() local
44 led = container_of(cled, struct pm8058_led, cdev); in pm8058_led_set()
45 switch (led->ledtype) { in pm8058_led_set()
59 ret = regmap_update_bits(led->map, led->reg, mask, val); in pm8058_led_set()
66 struct pm8058_led *led; in pm8058_led_get() local
70 led = container_of(cled, struct pm8058_led, cdev); in pm8058_led_get()
72 ret = regmap_read(led->map, led->reg, &val); in pm8058_led_get()
78 switch (led->ledtype) { in pm8058_led_get()
98 struct pm8058_led *led; in pm8058_led_probe() local
105 led = devm_kzalloc(&pdev->dev, sizeof(*led), GFP_KERNEL); in pm8058_led_probe()
[all …]
Dleds-mt6323.c113 struct mt6323_led *led[MT6323_MAX_LEDS]; member
119 struct mt6323_led *led = container_of(cdev, struct mt6323_led, cdev); in mt6323_led_hw_brightness() local
120 struct mt6323_leds *leds = led->parent; in mt6323_led_hw_brightness()
136 ret = regmap_update_bits(regmap, MT6323_ISINK_CON2(led->id), in mt6323_led_hw_brightness()
143 struct mt6323_led *led = container_of(cdev, struct mt6323_led, cdev); in mt6323_led_hw_off() local
144 struct mt6323_leds *leds = led->parent; in mt6323_led_hw_off()
149 status = MT6323_ISINK_CH_EN(led->id); in mt6323_led_hw_off()
151 MT6323_ISINK_CH_EN_MASK(led->id), ~status); in mt6323_led_hw_off()
157 MT6323_RG_ISINK_CK_PDN_MASK(led->id), in mt6323_led_hw_off()
158 MT6323_RG_ISINK_CK_PDN(led->id)); in mt6323_led_hw_off()
[all …]
Dleds-bcm6358.c82 struct bcm6358_led *led = in bcm6358_led_set() local
86 spin_lock_irqsave(led->lock, flags); in bcm6358_led_set()
87 bcm6358_led_busy(led->mem); in bcm6358_led_set()
88 val = bcm6358_led_read(led->mem + BCM6358_REG_MODE); in bcm6358_led_set()
89 if ((led->active_low && value == LED_OFF) || in bcm6358_led_set()
90 (!led->active_low && value != LED_OFF)) in bcm6358_led_set()
91 val |= BIT(led->pin); in bcm6358_led_set()
93 val &= ~(BIT(led->pin)); in bcm6358_led_set()
94 bcm6358_led_write(led->mem + BCM6358_REG_MODE, val); in bcm6358_led_set()
95 spin_unlock_irqrestore(led->lock, flags); in bcm6358_led_set()
[all …]
Dleds-bcm6328.c109 static void bcm6328_led_mode(struct bcm6328_led *led, unsigned long value) in bcm6328_led_mode() argument
114 shift = bcm6328_pin2shift(led->pin); in bcm6328_led_mode()
116 mode = led->mem + BCM6328_REG_MODE_HI; in bcm6328_led_mode()
118 mode = led->mem + BCM6328_REG_MODE_LO; in bcm6328_led_mode()
129 struct bcm6328_led *led = in bcm6328_led_set() local
133 spin_lock_irqsave(led->lock, flags); in bcm6328_led_set()
134 *(led->blink_leds) &= ~BIT(led->pin); in bcm6328_led_set()
135 if ((led->active_low && value == LED_OFF) || in bcm6328_led_set()
136 (!led->active_low && value != LED_OFF)) in bcm6328_led_set()
137 bcm6328_led_mode(led, BCM6328_LED_MODE_ON); in bcm6328_led_set()
[all …]
Dleds-tca6507.c272 static void set_select(struct tca6507_chip *tca, int led, int val) in set_select() argument
274 int mask = (1 << led); in set_select()
375 static void led_release(struct tca6507_led *led) in led_release() argument
378 struct tca6507_chip *tca = led->chip; in led_release()
379 if (led->bank >= 0) { in led_release()
380 struct bank *b = tca->bank + led->bank; in led_release()
381 if (led->blink) in led_release()
385 led->blink = 0; in led_release()
386 led->bank = -1; in led_release()
389 static int led_prepare(struct tca6507_led *led) in led_prepare() argument
[all …]
Dleds-88pm860x.c73 struct pm860x_led *led = container_of(cdev, struct pm860x_led, cdev); in pm860x_led_set() local
78 chip = led->chip; in pm860x_led_set()
79 mutex_lock(&led->lock); in pm860x_led_set()
80 led->brightness = value >> 3; in pm860x_led_set()
82 if ((led->current_brightness == 0) && led->brightness) { in pm860x_led_set()
83 led_power_set(chip, led->port, 1); in pm860x_led_set()
84 if (led->iset) { in pm860x_led_set()
85 pm860x_set_bits(led->i2c, led->reg_control, in pm860x_led_set()
86 LED_CURRENT_MASK, led->iset); in pm860x_led_set()
88 pm860x_set_bits(led->i2c, led->reg_blink, in pm860x_led_set()
[all …]
/drivers/gpu/drm/nouveau/
Dnouveau_led.c37 nouveau_led_get_brightness(struct led_classdev *led) in nouveau_led_get_brightness() argument
39 struct drm_device *drm_dev = container_of(led, struct nouveau_led, led)->dev; in nouveau_led_get_brightness()
54 nouveau_led_set_brightness(struct led_classdev *led, enum led_brightness value) in nouveau_led_set_brightness() argument
56 struct drm_device *drm_dev = container_of(led, struct nouveau_led, led)->dev; in nouveau_led_set_brightness()
92 drm->led = kzalloc(sizeof(*drm->led), GFP_KERNEL); in nouveau_led_init()
93 if (!drm->led) in nouveau_led_init()
95 drm->led->dev = dev; in nouveau_led_init()
97 drm->led->led.name = "nvidia-logo"; in nouveau_led_init()
98 drm->led->led.max_brightness = 255; in nouveau_led_init()
99 drm->led->led.brightness_get = nouveau_led_get_brightness; in nouveau_led_init()
[all …]
/drivers/net/wireless/broadcom/b43/
Dleds.c61 struct b43_led *led) in b43_led_update() argument
66 if (!led->wl) in b43_led_update()
75 turn_on = atomic_read(&led->state) != LED_OFF; in b43_led_update()
78 if (turn_on == led->hw_state) in b43_led_update()
80 led->hw_state = turn_on; in b43_led_update()
83 b43_led_turn_on(dev, led->index, led->activelow); in b43_led_update()
85 b43_led_turn_off(dev, led->index, led->activelow); in b43_led_update()
112 struct b43_led *led = container_of(led_dev, struct b43_led, led_dev); in b43_led_brightness_set() local
113 struct b43_wl *wl = led->wl; in b43_led_brightness_set()
116 atomic_set(&led->state, brightness); in b43_led_brightness_set()
[all …]
/drivers/hid/
Dhid-gt683r.c74 struct gt683r_led *led = hid_get_drvdata(hdev); in gt683r_brightness_set() local
77 if (led_cdev == &led->led_devs[i]) in gt683r_brightness_set()
82 led->brightnesses[i] = brightness; in gt683r_brightness_set()
83 schedule_work(&led->work); in gt683r_brightness_set()
93 struct gt683r_led *led = hid_get_drvdata(hdev); in mode_show() local
95 if (led->mode == GT683R_LED_NORMAL) in mode_show()
97 else if (led->mode == GT683R_LED_AUDIO) in mode_show()
111 struct gt683r_led *led = hid_get_drvdata(hdev); in mode_store() local
117 mutex_lock(&led->lock); in mode_store()
120 led->mode = GT683R_LED_NORMAL; in mode_store()
[all …]
Dhid-picolcd_leds.c47 if (!data->led[0]) in picolcd_leds_set()
74 if (led_cdev != data->led[i]) in picolcd_led_set_brightness()
99 if (led_cdev == data->led[i]) { in picolcd_led_get_brightness()
109 struct led_classdev *led; in picolcd_init_leds() local
123 led = kzalloc(sizeof(struct led_classdev)+name_sz, GFP_KERNEL); in picolcd_init_leds()
124 if (!led) { in picolcd_init_leds()
129 name = (void *)(&led[1]); in picolcd_init_leds()
131 led->name = name; in picolcd_init_leds()
132 led->brightness = 0; in picolcd_init_leds()
133 led->max_brightness = 1; in picolcd_init_leds()
[all …]
Dhid-steelseries.c26 struct led_classdev *led[SRWS1_NUMBER_LEDS + 1]; member
190 if (led_cdev != drv_data->led[i]) in steelseries_srws1_led_set_brightness()
220 if (led_cdev == drv_data->led[i]) { in steelseries_srws1_led_get_brightness()
232 struct led_classdev *led; in steelseries_srws1_probe() local
265 drv_data->led[i] = NULL; in steelseries_srws1_probe()
272 led = kzalloc(sizeof(struct led_classdev)+name_sz, GFP_KERNEL); in steelseries_srws1_probe()
273 if (!led) { in steelseries_srws1_probe()
278 name = (void *)(&led[1]); in steelseries_srws1_probe()
280 led->name = name; in steelseries_srws1_probe()
281 led->brightness = 0; in steelseries_srws1_probe()
[all …]
/drivers/leds/trigger/
Dledtrig-gpio.c22 struct led_classdev *led; member
31 struct led_classdev *led = _led; in gpio_trig_irq() local
32 struct gpio_trig_data *gpio_data = led->trigger_data; in gpio_trig_irq()
41 led_set_brightness_nosleep(gpio_data->led, in gpio_trig_irq()
44 led_set_brightness_nosleep(gpio_data->led, LED_FULL); in gpio_trig_irq()
46 led_set_brightness_nosleep(gpio_data->led, LED_OFF); in gpio_trig_irq()
55 struct led_classdev *led = dev_get_drvdata(dev); in gpio_trig_brightness_show() local
56 struct gpio_trig_data *gpio_data = led->trigger_data; in gpio_trig_brightness_show()
64 struct led_classdev *led = dev_get_drvdata(dev); in gpio_trig_brightness_store() local
65 struct gpio_trig_data *gpio_data = led->trigger_data; in gpio_trig_brightness_store()
[all …]
Dledtrig-backlight.c25 struct led_classdev *led; member
37 struct led_classdev *led = n->led; in fb_notifier_callback() local
53 n->brightness = led->brightness; in fb_notifier_callback()
54 led_set_brightness_nosleep(led, LED_OFF); in fb_notifier_callback()
56 led_set_brightness_nosleep(led, n->brightness); in fb_notifier_callback()
67 struct led_classdev *led = dev_get_drvdata(dev); in bl_trig_invert_show() local
68 struct bl_trig_notifier *n = led->trigger_data; in bl_trig_invert_show()
76 struct led_classdev *led = dev_get_drvdata(dev); in bl_trig_invert_store() local
77 struct bl_trig_notifier *n = led->trigger_data; in bl_trig_invert_store()
92 led_set_brightness_nosleep(led, LED_OFF); in bl_trig_invert_store()
[all …]
/drivers/net/wireless/ralink/rt2x00/
Drt2x00leds.c32 struct rt2x00_led *led = &rt2x00dev->led_qual; in rt2x00leds_led_quality() local
35 if ((led->type != LED_TYPE_QUALITY) || !(led->flags & LED_REGISTERED)) in rt2x00leds_led_quality()
67 if (brightness != led->led_dev.brightness) { in rt2x00leds_led_quality()
68 led->led_dev.brightness_set(&led->led_dev, brightness); in rt2x00leds_led_quality()
69 led->led_dev.brightness = brightness; in rt2x00leds_led_quality()
73 static void rt2x00led_led_simple(struct rt2x00_led *led, bool enabled) in rt2x00led_led_simple() argument
77 if (!(led->flags & LED_REGISTERED)) in rt2x00led_led_simple()
80 led->led_dev.brightness_set(&led->led_dev, brightness); in rt2x00led_led_simple()
81 led->led_dev.brightness = brightness; in rt2x00led_led_simple()
103 struct rt2x00_led *led, in rt2x00leds_register_led() argument
[all …]

123456789