/drivers/leds/ |
D | leds-bd2802.c | 73 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 …]
|
D | leds-lm3692x.c | 145 static int lm3692x_fault_check(struct lm3692x_led *led) in lm3692x_fault_check() argument 150 ret = regmap_read(led->regmap, LM3692X_FAULT_FLAGS, &read_buf); in lm3692x_fault_check() 155 dev_err(&led->client->dev, "Detected a fault 0x%X\n", read_buf); in lm3692x_fault_check() 160 regmap_read(led->regmap, LM3692X_FAULT_FLAGS, &read_buf); in lm3692x_fault_check() 162 dev_err(&led->client->dev, "Second read of fault flags 0x%X\n", in lm3692x_fault_check() 168 static int lm3692x_leds_enable(struct lm3692x_led *led) in lm3692x_leds_enable() argument 173 if (led->enabled) in lm3692x_leds_enable() 176 if (led->regulator) { in lm3692x_leds_enable() 177 ret = regulator_enable(led->regulator); in lm3692x_leds_enable() 179 dev_err(&led->client->dev, in lm3692x_leds_enable() [all …]
|
D | leds-cpcap.c | 62 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 …]
|
D | leds-wm8350.c | 88 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 …]
|
D | leds-lp8860.c | 140 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 …]
|
D | leds-max8997.c | 47 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 …]
|
D | leds-ns2.c | 56 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 …]
|
D | leds-lm3533.c | 59 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 …]
|
D | leds-lm3697.c | 125 struct lm3697_led *led = container_of(led_cdev, struct lm3697_led, in lm3697_brightness_set() local 127 int ctrl_en_val = (1 << led->control_bank); in lm3697_brightness_set() 128 struct device *dev = led->priv->dev; in lm3697_brightness_set() 131 mutex_lock(&led->priv->lock); in lm3697_brightness_set() 134 ret = regmap_update_bits(led->priv->regmap, LM3697_CTRL_ENABLE, in lm3697_brightness_set() 141 led->enabled = LED_OFF; in lm3697_brightness_set() 143 ret = ti_lmu_common_set_brightness(&led->lmu_data, brt_val); in lm3697_brightness_set() 149 if (!led->enabled) { in lm3697_brightness_set() 150 ret = regmap_update_bits(led->priv->regmap, in lm3697_brightness_set() 158 led->enabled = brt_val; in lm3697_brightness_set() [all …]
|
D | leds-el15203000.c | 88 static int el15203000_cmd(struct el15203000_led *led, u8 brightness) in el15203000_cmd() argument 94 mutex_lock(&led->priv->lock); in el15203000_cmd() 96 dev_dbg(led->priv->dev, "Set brightness of 0x%02x(%c) to 0x%02x(%c)", in el15203000_cmd() 97 led->reg, led->reg, brightness, brightness); in el15203000_cmd() 100 if (time_after(led->priv->delay, jiffies)) { in el15203000_cmd() 101 dev_dbg(led->priv->dev, "Wait %luus to sync", in el15203000_cmd() 108 cmd[0] = led->reg; in el15203000_cmd() 116 ret = spi_write(led->priv->spi, &cmd[i], sizeof(cmd[i])); in el15203000_cmd() 118 dev_err(led->priv->dev, in el15203000_cmd() 124 led->priv->delay = jiffies + usecs_to_jiffies(EL_FW_DELAY_USEC); in el15203000_cmd() [all …]
|
D | leds-regulator.c | 59 static void regulator_led_enable(struct regulator_led *led) in regulator_led_enable() argument 63 if (led->enabled) in regulator_led_enable() 66 ret = regulator_enable(led->vcc); in regulator_led_enable() 68 dev_err(led->cdev.dev, "Failed to enable vcc: %d\n", ret); in regulator_led_enable() 72 led->enabled = 1; in regulator_led_enable() 75 static void regulator_led_disable(struct regulator_led *led) in regulator_led_disable() argument 79 if (!led->enabled) in regulator_led_disable() 82 ret = regulator_disable(led->vcc); in regulator_led_disable() 84 dev_err(led->cdev.dev, "Failed to disable vcc: %d\n", ret); in regulator_led_disable() 88 led->enabled = 0; in regulator_led_disable() [all …]
|
D | leds-bcm6328.c | 110 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 …]
|
D | leds-wm831x-status.c | 38 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 …]
|
D | leds-spi-byte.c | 68 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 …]
|
D | leds-tca6507.c | 261 static void set_select(struct tca6507_chip *tca, int led, int val) in set_select() argument 263 int mask = (1 << led); in set_select() 364 static void led_release(struct tca6507_led *led) in led_release() argument 367 struct tca6507_chip *tca = led->chip; in led_release() 368 if (led->bank >= 0) { in led_release() 369 struct bank *b = tca->bank + led->bank; in led_release() 370 if (led->blink) in led_release() 374 led->blink = 0; in led_release() 375 led->bank = -1; in led_release() 378 static int led_prepare(struct tca6507_led *led) in led_prepare() argument [all …]
|
D | leds-an30259a.c | 84 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 …]
|
D | leds-pca963x.c | 117 static int pca963x_brightness(struct pca963x_led *led, in pca963x_brightness() argument 120 struct i2c_client *client = led->chip->client; in pca963x_brightness() 121 struct pca963x_chipdef *chipdef = led->chip->chipdef; in pca963x_brightness() 126 ledout_addr = chipdef->ledout_base + (led->led_num / 4); in pca963x_brightness() 127 shift = 2 * (led->led_num % 4); in pca963x_brightness() 133 if (led->blinking) { in pca963x_brightness() 137 led->led_num, in pca963x_brightness() 147 led->blinking = false; in pca963x_brightness() 152 led->led_num, in pca963x_brightness() 157 if (led->blinking) in pca963x_brightness() [all …]
|
/drivers/leds/flash/ |
D | leds-lm3601x.c | 135 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 …]
|
D | leds-aat1290.c | 96 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 …]
|
D | leds-ktd2692.c | 95 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 …]
|
D | leds-max77693.c | 140 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 …]
|
D | leds-mt6360.c | 105 struct mt6360_led *led = container_of(mccdev, struct mt6360_led, mc); in mt6360_mc_brightness_set() local 106 struct mt6360_priv *priv = led->priv; in mt6360_mc_brightness_set() 139 struct mt6360_led *led = container_of(lcdev, struct mt6360_led, isnk); in mt6360_isnk_brightness_set() local 140 struct mt6360_priv *priv = led->priv; in mt6360_isnk_brightness_set() 141 u32 enable_mask = MT6360_ISNK_ENMASK(led->led_no); in mt6360_isnk_brightness_set() 142 u32 val = level ? MT6360_ISNK_ENMASK(led->led_no) : 0; in mt6360_isnk_brightness_set() 147 ret = regmap_update_bits(priv->regmap, MT6360_REG_ISNK(led->led_no), in mt6360_isnk_brightness_set() 163 struct mt6360_led *led = in mt6360_torch_brightness_set() local 165 struct mt6360_priv *priv = led->priv; in mt6360_torch_brightness_set() 166 u32 enable_mask = MT6360_TORCHEN_MASK | MT6360_FLCSEN_MASK(led->led_no); in mt6360_torch_brightness_set() [all …]
|
/drivers/gpu/drm/nouveau/ |
D | nouveau_led.c | 37 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/ |
D | leds.c | 48 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/ |
D | hid-gt683r.c | 65 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 …]
|