Home
last modified time | relevance | path

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

12345678910

/drivers/leds/
Dleds-bd2802.c73 struct led_state led[2]; member
108 static inline int bd2802_is_rgb_off(struct bd2802_led *led, enum led_ids id, in bd2802_is_rgb_off() argument
113 return !led->led[id].r; in bd2802_is_rgb_off()
115 return !led->led[id].g; in bd2802_is_rgb_off()
117 return !led->led[id].b; in bd2802_is_rgb_off()
119 dev_err(&led->client->dev, "%s: Invalid color\n", __func__); in bd2802_is_rgb_off()
124 static inline int bd2802_is_led_off(struct bd2802_led *led, enum led_ids id) in bd2802_is_led_off() argument
126 if (led->led[id].r || led->led[id].g || led->led[id].b) in bd2802_is_led_off()
132 static inline int bd2802_is_all_off(struct bd2802_led *led) in bd2802_is_all_off() argument
137 if (!bd2802_is_led_off(led, i)) in bd2802_is_all_off()
[all …]
Dleds-lm3692x.c146 static int lm3692x_fault_check(struct lm3692x_led *led) in lm3692x_fault_check() argument
151 ret = regmap_read(led->regmap, LM3692X_FAULT_FLAGS, &read_buf); in lm3692x_fault_check()
156 dev_err(&led->client->dev, "Detected a fault 0x%X\n", read_buf); in lm3692x_fault_check()
161 regmap_read(led->regmap, LM3692X_FAULT_FLAGS, &read_buf); in lm3692x_fault_check()
163 dev_err(&led->client->dev, "Second read of fault flags 0x%X\n", in lm3692x_fault_check()
169 static int lm3692x_leds_enable(struct lm3692x_led *led) in lm3692x_leds_enable() argument
174 if (led->enabled) in lm3692x_leds_enable()
177 if (led->regulator) { in lm3692x_leds_enable()
178 ret = regulator_enable(led->regulator); in lm3692x_leds_enable()
180 dev_err(&led->client->dev, in lm3692x_leds_enable()
[all …]
Dleds-lm3601x.c135 static int lm3601x_read_faults(struct lm3601x_led *led) in lm3601x_read_faults() argument
140 ret = regmap_read(led->regmap, LM3601X_FLAGS_REG, &flags_val); in lm3601x_read_faults()
144 led->last_flag = 0; in lm3601x_read_faults()
147 led->last_flag |= LED_FAULT_OVER_VOLTAGE; in lm3601x_read_faults()
150 led->last_flag |= LED_FAULT_OVER_TEMPERATURE; in lm3601x_read_faults()
153 led->last_flag |= LED_FAULT_SHORT_CIRCUIT; in lm3601x_read_faults()
156 led->last_flag |= LED_FAULT_OVER_CURRENT; in lm3601x_read_faults()
159 led->last_flag |= LED_FAULT_UNDER_VOLTAGE; in lm3601x_read_faults()
162 led->last_flag |= LED_FAULT_INPUT_VOLTAGE; in lm3601x_read_faults()
165 led->last_flag |= LED_FAULT_LED_OVER_TEMPERATURE; in lm3601x_read_faults()
[all …]
Dleds-cpcap.c62 struct led_classdev led; member
81 static int cpcap_led_set_power(struct cpcap_led *led, bool status) in cpcap_led_set_power() argument
85 if (status == led->powered) in cpcap_led_set_power()
89 err = regulator_enable(led->vdd); in cpcap_led_set_power()
91 err = regulator_disable(led->vdd); in cpcap_led_set_power()
94 dev_err(led->dev, "regulator failure: %d", err); in cpcap_led_set_power()
98 led->powered = status; in cpcap_led_set_power()
105 struct cpcap_led *led = container_of(ledc, struct cpcap_led, led); in cpcap_led_set() local
109 mutex_lock(&led->update_lock); in cpcap_led_set()
112 err = cpcap_led_set_power(led, true); in cpcap_led_set()
[all …]
Dleds-wm8350.c88 static int wm8350_led_enable(struct wm8350_led *led) in wm8350_led_enable() argument
92 if (led->enabled) in wm8350_led_enable()
95 ret = regulator_enable(led->isink); in wm8350_led_enable()
97 dev_err(led->cdev.dev, "Failed to enable ISINK: %d\n", ret); in wm8350_led_enable()
101 ret = regulator_enable(led->dcdc); in wm8350_led_enable()
103 dev_err(led->cdev.dev, "Failed to enable DCDC: %d\n", ret); in wm8350_led_enable()
104 regulator_disable(led->isink); in wm8350_led_enable()
108 led->enabled = 1; in wm8350_led_enable()
113 static int wm8350_led_disable(struct wm8350_led *led) in wm8350_led_disable() argument
117 if (!led->enabled) in wm8350_led_disable()
[all …]
Dleds-aat1290.c96 static void aat1290_as2cwire_write(struct aat1290_led *led, int addr, int value) in aat1290_as2cwire_write() argument
100 gpiod_direction_output(led->gpio_fl_en, 0); in aat1290_as2cwire_write()
101 gpiod_direction_output(led->gpio_en_set, 0); in aat1290_as2cwire_write()
108 gpiod_direction_output(led->gpio_en_set, 0); in aat1290_as2cwire_write()
110 gpiod_direction_output(led->gpio_en_set, 1); in aat1290_as2cwire_write()
118 gpiod_direction_output(led->gpio_en_set, 0); in aat1290_as2cwire_write()
120 gpiod_direction_output(led->gpio_en_set, 1); in aat1290_as2cwire_write()
126 static void aat1290_set_flash_safety_timer(struct aat1290_led *led, in aat1290_set_flash_safety_timer() argument
129 struct led_classdev_flash *fled_cdev = &led->fled_cdev; in aat1290_set_flash_safety_timer()
134 aat1290_as2cwire_write(led, AAT1290_FLASH_SAFETY_TIMER_ADDR, in aat1290_set_flash_safety_timer()
[all …]
Dleds-ktd2692.c95 static void ktd2692_expresswire_start(struct ktd2692_context *led) in ktd2692_expresswire_start() argument
97 gpiod_direction_output(led->ctrl_gpio, KTD2692_HIGH); in ktd2692_expresswire_start()
101 static void ktd2692_expresswire_reset(struct ktd2692_context *led) in ktd2692_expresswire_reset() argument
103 gpiod_direction_output(led->ctrl_gpio, KTD2692_LOW); in ktd2692_expresswire_reset()
107 static void ktd2692_expresswire_end(struct ktd2692_context *led) in ktd2692_expresswire_end() argument
109 gpiod_direction_output(led->ctrl_gpio, KTD2692_LOW); in ktd2692_expresswire_end()
111 gpiod_direction_output(led->ctrl_gpio, KTD2692_HIGH); in ktd2692_expresswire_end()
115 static void ktd2692_expresswire_set_bit(struct ktd2692_context *led, bool bit) in ktd2692_expresswire_set_bit() argument
134 gpiod_direction_output(led->ctrl_gpio, KTD2692_LOW); in ktd2692_expresswire_set_bit()
136 gpiod_direction_output(led->ctrl_gpio, KTD2692_HIGH); in ktd2692_expresswire_set_bit()
[all …]
Dleds-lp8860.c140 static int lp8860_unlock_eeprom(struct lp8860_led *led, int lock) in lp8860_unlock_eeprom() argument
144 mutex_lock(&led->lock); in lp8860_unlock_eeprom()
147 ret = regmap_write(led->regmap, in lp8860_unlock_eeprom()
151 dev_err(&led->client->dev, "EEPROM Unlock failed\n"); in lp8860_unlock_eeprom()
155 ret = regmap_write(led->regmap, in lp8860_unlock_eeprom()
159 dev_err(&led->client->dev, "EEPROM Unlock failed\n"); in lp8860_unlock_eeprom()
162 ret = regmap_write(led->regmap, in lp8860_unlock_eeprom()
166 dev_err(&led->client->dev, "EEPROM Unlock failed\n"); in lp8860_unlock_eeprom()
170 ret = regmap_write(led->regmap, in lp8860_unlock_eeprom()
176 mutex_unlock(&led->lock); in lp8860_unlock_eeprom()
[all …]
Dleds-max8997.c47 static void max8997_led_set_mode(struct max8997_led *led, in max8997_led_set_mode() argument
51 struct i2c_client *client = led->iodev->i2c; in max8997_led_set_mode()
57 val = led->id ? in max8997_led_set_mode()
59 led->cdev.max_brightness = MAX8997_LED_FLASH_MAX_BRIGHTNESS; in max8997_led_set_mode()
63 val = led->id ? in max8997_led_set_mode()
65 led->cdev.max_brightness = MAX8997_LED_MOVIE_MAX_BRIGHTNESS; in max8997_led_set_mode()
70 val = led->id ? in max8997_led_set_mode()
72 led->cdev.max_brightness = MAX8997_LED_FLASH_MAX_BRIGHTNESS; in max8997_led_set_mode()
77 val = led->id ? in max8997_led_set_mode()
79 led->cdev.max_brightness = MAX8997_LED_MOVIE_MAX_BRIGHTNESS; in max8997_led_set_mode()
[all …]
Dleds-ns2.c56 static int ns2_led_get_mode(struct ns2_led *led, enum ns2_led_modes *mode) in ns2_led_get_mode() argument
62 cmd_level = gpiod_get_value_cansleep(led->cmd); in ns2_led_get_mode()
63 slow_level = gpiod_get_value_cansleep(led->slow); in ns2_led_get_mode()
65 for (i = 0; i < led->num_modes; i++) { in ns2_led_get_mode()
66 if (cmd_level == led->modval[i].cmd_level && in ns2_led_get_mode()
67 slow_level == led->modval[i].slow_level) { in ns2_led_get_mode()
68 *mode = led->modval[i].mode; in ns2_led_get_mode()
76 static void ns2_led_set_mode(struct ns2_led *led, enum ns2_led_modes mode) in ns2_led_set_mode() argument
81 for (i = 0; i < led->num_modes; i++) in ns2_led_set_mode()
82 if (mode == led->modval[i].mode) in ns2_led_set_mode()
[all …]
Dleds-lm3533.c59 static inline int lm3533_led_get_ctrlbank_id(struct lm3533_led *led) in lm3533_led_get_ctrlbank_id() argument
61 return led->id + 2; in lm3533_led_get_ctrlbank_id()
64 static inline u8 lm3533_led_get_lv_reg(struct lm3533_led *led, u8 base) in lm3533_led_get_lv_reg() argument
66 return base + led->id; in lm3533_led_get_lv_reg()
69 static inline u8 lm3533_led_get_pattern(struct lm3533_led *led) in lm3533_led_get_pattern() argument
71 return led->id; in lm3533_led_get_pattern()
74 static inline u8 lm3533_led_get_pattern_reg(struct lm3533_led *led, in lm3533_led_get_pattern_reg() argument
77 return base + lm3533_led_get_pattern(led) * LM3533_REG_PATTERN_STEP; in lm3533_led_get_pattern_reg()
80 static int lm3533_led_pattern_enable(struct lm3533_led *led, int enable) in lm3533_led_pattern_enable() argument
88 dev_dbg(led->cdev.dev, "%s - %d\n", __func__, enable); in lm3533_led_pattern_enable()
[all …]
Dleds-max77693.c140 static inline bool max77693_fled_used(struct max77693_led_device *led, in max77693_fled_used() argument
145 return led->fled_mask & fled_bit; in max77693_fled_used()
148 static int max77693_set_mode_reg(struct max77693_led_device *led, u8 mode) in max77693_set_mode_reg() argument
150 struct regmap *rmap = led->regmap; in max77693_set_mode_reg()
180 static int max77693_add_mode(struct max77693_led_device *led, u8 mode) in max77693_add_mode() argument
185 if (led->iout_joint) in max77693_add_mode()
196 led->mode_flags &= (~MODE_TORCH(i) & ~MODE_FLASH(i)); in max77693_add_mode()
198 new_mode_flags = mode | led->mode_flags; in max77693_add_mode()
199 new_mode_flags &= led->allowed_modes; in max77693_add_mode()
201 if (new_mode_flags ^ led->mode_flags) in max77693_add_mode()
[all …]
Dleds-regulator.c58 static void regulator_led_enable(struct regulator_led *led) in regulator_led_enable() argument
62 if (led->enabled) in regulator_led_enable()
65 ret = regulator_enable(led->vcc); in regulator_led_enable()
67 dev_err(led->cdev.dev, "Failed to enable vcc: %d\n", ret); in regulator_led_enable()
71 led->enabled = 1; in regulator_led_enable()
74 static void regulator_led_disable(struct regulator_led *led) in regulator_led_disable() argument
78 if (!led->enabled) in regulator_led_disable()
81 ret = regulator_disable(led->vcc); in regulator_led_disable()
83 dev_err(led->cdev.dev, "Failed to disable vcc: %d\n", ret); in regulator_led_disable()
87 led->enabled = 0; in regulator_led_disable()
[all …]
Dleds-lm3697.c116 struct lm3697_led *led = container_of(led_cdev, struct lm3697_led, in lm3697_brightness_set() local
118 int ctrl_en_val = (1 << led->control_bank); in lm3697_brightness_set()
119 struct device *dev = led->priv->dev; in lm3697_brightness_set()
122 mutex_lock(&led->priv->lock); in lm3697_brightness_set()
125 ret = regmap_update_bits(led->priv->regmap, LM3697_CTRL_ENABLE, in lm3697_brightness_set()
132 led->enabled = LED_OFF; in lm3697_brightness_set()
134 ret = ti_lmu_common_set_brightness(&led->lmu_data, brt_val); in lm3697_brightness_set()
140 if (!led->enabled) { in lm3697_brightness_set()
141 ret = regmap_update_bits(led->priv->regmap, in lm3697_brightness_set()
149 led->enabled = brt_val; in lm3697_brightness_set()
[all …]
Dleds-el15203000.c85 static int el15203000_cmd(struct el15203000_led *led, u8 brightness) in el15203000_cmd() argument
91 mutex_lock(&led->priv->lock); in el15203000_cmd()
93 dev_dbg(led->priv->dev, "Set brightness of 0x%02x(%c) to 0x%02x(%c)", in el15203000_cmd()
94 led->reg, led->reg, brightness, brightness); in el15203000_cmd()
97 if (time_after(led->priv->delay, jiffies)) { in el15203000_cmd()
98 dev_dbg(led->priv->dev, "Wait %luus to sync", in el15203000_cmd()
105 cmd[0] = led->reg; in el15203000_cmd()
113 ret = spi_write(led->priv->spi, &cmd[i], sizeof(cmd[i])); in el15203000_cmd()
115 dev_err(led->priv->dev, in el15203000_cmd()
121 led->priv->delay = jiffies + usecs_to_jiffies(EL_FW_DELAY_USEC); in el15203000_cmd()
[all …]
Dleds-bcm6328.c110 static void bcm6328_led_mode(struct bcm6328_led *led, unsigned long value) in bcm6328_led_mode() argument
115 shift = bcm6328_pin2shift(led->pin); in bcm6328_led_mode()
117 mode = led->mem + BCM6328_REG_MODE_HI; in bcm6328_led_mode()
119 mode = led->mem + BCM6328_REG_MODE_LO; in bcm6328_led_mode()
130 struct bcm6328_led *led = in bcm6328_led_set() local
134 spin_lock_irqsave(led->lock, flags); in bcm6328_led_set()
137 led->blink_leds[0] &= ~BIT(led->pin); in bcm6328_led_set()
138 led->blink_leds[1] &= ~BIT(led->pin); in bcm6328_led_set()
141 if ((led->active_low && value == LED_OFF) || in bcm6328_led_set()
142 (!led->active_low && value != LED_OFF)) in bcm6328_led_set()
[all …]
Dleds-wm831x-status.c38 static void wm831x_status_set(struct wm831x_status *led) in wm831x_status_set() argument
42 mutex_lock(&led->mutex); in wm831x_status_set()
44 led->reg_val &= ~(WM831X_LED_SRC_MASK | WM831X_LED_MODE_MASK | in wm831x_status_set()
47 spin_lock_irqsave(&led->value_lock, flags); in wm831x_status_set()
49 led->reg_val |= led->src << WM831X_LED_SRC_SHIFT; in wm831x_status_set()
50 if (led->blink) { in wm831x_status_set()
51 led->reg_val |= 2 << WM831X_LED_MODE_SHIFT; in wm831x_status_set()
52 led->reg_val |= led->blink_time << WM831X_LED_DUR_SHIFT; in wm831x_status_set()
53 led->reg_val |= led->blink_cyc; in wm831x_status_set()
55 if (led->brightness != LED_OFF) in wm831x_status_set()
[all …]
Dleds-spi-byte.c68 struct spi_byte_led *led = container_of(dev, struct spi_byte_led, ldev); in spi_byte_brightness_set_blocking() local
72 value = (u8) brightness + led->cdef->off_value; in spi_byte_brightness_set_blocking()
74 mutex_lock(&led->mutex); in spi_byte_brightness_set_blocking()
75 ret = spi_write(led->spi, &value, sizeof(value)); in spi_byte_brightness_set_blocking()
76 mutex_unlock(&led->mutex); in spi_byte_brightness_set_blocking()
85 struct spi_byte_led *led; in spi_byte_probe() local
96 led = devm_kzalloc(dev, sizeof(*led), GFP_KERNEL); in spi_byte_probe()
97 if (!led) in spi_byte_probe()
101 strlcpy(led->name, name, sizeof(led->name)); in spi_byte_probe()
102 led->spi = spi; in spi_byte_probe()
[all …]
Dleds-an30259a.c84 struct an30259a_led *led; in an30259a_brightness_set() local
88 led = container_of(cdev, struct an30259a_led, cdev); in an30259a_brightness_set()
89 mutex_lock(&led->chip->mutex); in an30259a_brightness_set()
91 ret = regmap_read(led->chip->regmap, AN30259A_REG_LED_ON, &led_on); in an30259a_brightness_set()
97 led_on &= ~AN30259A_LED_EN(led->num); in an30259a_brightness_set()
98 led_on &= ~AN30259A_LED_SLOPE(led->num); in an30259a_brightness_set()
99 led->sloping = false; in an30259a_brightness_set()
102 led_on |= AN30259A_LED_EN(led->num); in an30259a_brightness_set()
103 if (led->sloping) in an30259a_brightness_set()
104 led_on |= AN30259A_LED_SLOPE(led->num); in an30259a_brightness_set()
[all …]
Dleds-pm8058.c31 struct pm8058_led *led; in pm8058_led_set() local
36 led = container_of(cled, struct pm8058_led, cdev); in pm8058_led_set()
37 switch (led->ledtype) { in pm8058_led_set()
51 ret = regmap_update_bits(led->map, led->reg, mask, val); in pm8058_led_set()
58 struct pm8058_led *led; in pm8058_led_get() local
62 led = container_of(cled, struct pm8058_led, cdev); in pm8058_led_get()
64 ret = regmap_read(led->map, led->reg, &val); in pm8058_led_get()
70 switch (led->ledtype) { in pm8058_led_get()
92 struct pm8058_led *led; in pm8058_led_probe() local
99 led = devm_kzalloc(dev, sizeof(*led), GFP_KERNEL); in pm8058_led_probe()
[all …]
Dleds-mt6323.c104 struct mt6323_led *led[MT6323_MAX_LEDS]; member
110 struct mt6323_led *led = container_of(cdev, struct mt6323_led, cdev); in mt6323_led_hw_brightness() local
111 struct mt6323_leds *leds = led->parent; in mt6323_led_hw_brightness()
127 ret = regmap_update_bits(regmap, MT6323_ISINK_CON2(led->id), in mt6323_led_hw_brightness()
134 struct mt6323_led *led = container_of(cdev, struct mt6323_led, cdev); in mt6323_led_hw_off() local
135 struct mt6323_leds *leds = led->parent; in mt6323_led_hw_off()
140 status = MT6323_ISINK_CH_EN(led->id); in mt6323_led_hw_off()
142 MT6323_ISINK_CH_EN_MASK(led->id), ~status); in mt6323_led_hw_off()
148 MT6323_RG_ISINK_CK_PDN_MASK(led->id), in mt6323_led_hw_off()
149 MT6323_RG_ISINK_CK_PDN(led->id)); in mt6323_led_hw_off()
[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.c48 struct b43_led *led) in b43_led_update() argument
53 if (!led->wl) in b43_led_update()
62 turn_on = atomic_read(&led->state) != LED_OFF; in b43_led_update()
65 if (turn_on == led->hw_state) in b43_led_update()
67 led->hw_state = turn_on; in b43_led_update()
70 b43_led_turn_on(dev, led->index, led->activelow); in b43_led_update()
72 b43_led_turn_off(dev, led->index, led->activelow); in b43_led_update()
99 struct b43_led *led = container_of(led_dev, struct b43_led, led_dev); in b43_led_brightness_set() local
100 struct b43_wl *wl = led->wl; in b43_led_brightness_set()
103 atomic_set(&led->state, brightness); in b43_led_brightness_set()
[all …]
/drivers/hid/
Dhid-gt683r.c65 struct gt683r_led *led = hid_get_drvdata(hdev); in gt683r_brightness_set() local
68 if (led_cdev == &led->led_devs[i]) in gt683r_brightness_set()
73 led->brightnesses[i] = brightness; in gt683r_brightness_set()
74 schedule_work(&led->work); in gt683r_brightness_set()
84 struct gt683r_led *led = hid_get_drvdata(hdev); in mode_show() local
86 if (led->mode == GT683R_LED_NORMAL) in mode_show()
88 else if (led->mode == GT683R_LED_AUDIO) in mode_show()
102 struct gt683r_led *led = hid_get_drvdata(hdev); in mode_store() local
108 mutex_lock(&led->lock); in mode_store()
111 led->mode = GT683R_LED_NORMAL; in mode_store()
[all …]
Dhid-picolcd_leds.c37 if (!data->led[0]) in picolcd_leds_set()
64 if (led_cdev != data->led[i]) in picolcd_led_set_brightness()
89 if (led_cdev == data->led[i]) { in picolcd_led_get_brightness()
99 struct led_classdev *led; in picolcd_init_leds() local
113 led = kzalloc(sizeof(struct led_classdev)+name_sz, GFP_KERNEL); in picolcd_init_leds()
114 if (!led) { in picolcd_init_leds()
119 name = (void *)(&led[1]); in picolcd_init_leds()
121 led->name = name; in picolcd_init_leds()
122 led->brightness = 0; in picolcd_init_leds()
123 led->max_brightness = 1; in picolcd_init_leds()
[all …]

12345678910