Home
last modified time | relevance | path

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

12345678

/linux-2.6.39/drivers/leds/
Dleds-bd2802.c77 struct led_state led[2]; member
112 static inline int bd2802_is_rgb_off(struct bd2802_led *led, enum led_ids id, in bd2802_is_rgb_off() argument
117 return !led->led[id].r; in bd2802_is_rgb_off()
119 return !led->led[id].g; in bd2802_is_rgb_off()
121 return !led->led[id].b; in bd2802_is_rgb_off()
123 dev_err(&led->client->dev, "%s: Invalid color\n", __func__); in bd2802_is_rgb_off()
128 static inline int bd2802_is_led_off(struct bd2802_led *led, enum led_ids id) in bd2802_is_led_off() argument
130 if (led->led[id].r || led->led[id].g || led->led[id].b) in bd2802_is_led_off()
136 static inline int bd2802_is_all_off(struct bd2802_led *led) in bd2802_is_all_off() argument
141 if (!bd2802_is_led_off(led, i)) in bd2802_is_all_off()
[all …]
Dleds-wm8350.c92 static void 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()
115 static void wm8350_led_disable(struct wm8350_led *led) in wm8350_led_disable() argument
119 if (!led->enabled) in wm8350_led_disable()
[all …]
Dleds-regulator.c65 static void regulator_led_enable(struct regulator_led *led) in regulator_led_enable() argument
69 if (led->enabled) in regulator_led_enable()
72 ret = regulator_enable(led->vcc); in regulator_led_enable()
74 dev_err(led->cdev.dev, "Failed to enable vcc: %d\n", ret); in regulator_led_enable()
78 led->enabled = 1; in regulator_led_enable()
81 static void regulator_led_disable(struct regulator_led *led) in regulator_led_disable() argument
85 if (!led->enabled) in regulator_led_disable()
88 ret = regulator_disable(led->vcc); in regulator_led_disable()
90 dev_err(led->cdev.dev, "Failed to disable vcc: %d\n", ret); in regulator_led_disable()
94 led->enabled = 0; in regulator_led_disable()
[all …]
Dleds-da903x.c49 struct da903x_led *led = container_of(work, struct da903x_led, work); in da903x_led_work() local
53 switch (led->id) { in da903x_led_work()
59 offset = DA9030_LED_OFFSET(led->id); in da903x_led_work()
60 val = led->flags & ~0x87; in da903x_led_work()
61 val |= (led->new_brightness) ? 0x80 : 0; /* EN bit */ in da903x_led_work()
62 val |= (0x7 - (led->new_brightness >> 5)) & 0x7; /* PWM<2:0> */ in da903x_led_work()
63 da903x_write(led->master, DA9030_LED1_CONTROL + offset, val); in da903x_led_work()
66 val = led->flags & ~0x80; in da903x_led_work()
67 val |= (led->new_brightness) ? 0x80 : 0; /* EN bit */ in da903x_led_work()
68 da903x_write(led->master, DA9030_MISC_CONTROL_A, val); in da903x_led_work()
[all …]
Dleds-wm831x-status.c45 struct wm831x_status *led = container_of(work, struct wm831x_status, in wm831x_status_work() local
49 mutex_lock(&led->mutex); in wm831x_status_work()
51 led->reg_val &= ~(WM831X_LED_SRC_MASK | WM831X_LED_MODE_MASK | in wm831x_status_work()
54 spin_lock_irqsave(&led->value_lock, flags); in wm831x_status_work()
56 led->reg_val |= led->src << WM831X_LED_SRC_SHIFT; in wm831x_status_work()
57 if (led->blink) { in wm831x_status_work()
58 led->reg_val |= 2 << WM831X_LED_MODE_SHIFT; in wm831x_status_work()
59 led->reg_val |= led->blink_time << WM831X_LED_DUR_SHIFT; in wm831x_status_work()
60 led->reg_val |= led->blink_cyc; in wm831x_status_work()
62 if (led->brightness != LED_OFF) in wm831x_status_work()
[all …]
Dledtrig-gpio.c23 struct led_classdev *led; member
33 struct led_classdev *led = _led; in gpio_trig_irq() local
34 struct gpio_trig_data *gpio_data = led->trigger_data; in gpio_trig_irq()
57 led_set_brightness(gpio_data->led, in gpio_trig_work()
60 led_set_brightness(gpio_data->led, LED_FULL); in gpio_trig_work()
62 led_set_brightness(gpio_data->led, LED_OFF); in gpio_trig_work()
69 struct led_classdev *led = dev_get_drvdata(dev); in gpio_trig_brightness_show() local
70 struct gpio_trig_data *gpio_data = led->trigger_data; in gpio_trig_brightness_show()
78 struct led_classdev *led = dev_get_drvdata(dev); in gpio_trig_brightness_store() local
79 struct gpio_trig_data *gpio_data = led->trigger_data; in gpio_trig_brightness_store()
[all …]
Dleds-dac124s085.c43 struct dac124s085_led *led = container_of(work, struct dac124s085_led, in dac124s085_led_work() local
47 mutex_lock(&led->mutex); in dac124s085_led_work()
48 word = cpu_to_le16(((led->id) << 14) | REG_WRITE_UPDATE | in dac124s085_led_work()
49 (led->brightness & 0xfff)); in dac124s085_led_work()
50 spi_write(led->spi, (const u8 *)&word, sizeof(word)); in dac124s085_led_work()
51 mutex_unlock(&led->mutex); in dac124s085_led_work()
57 struct dac124s085_led *led = container_of(ldev, struct dac124s085_led, in dac124s085_set_brightness() local
60 spin_lock(&led->lock); in dac124s085_set_brightness()
61 led->brightness = brightness; in dac124s085_set_brightness()
62 schedule_work(&led->work); in dac124s085_set_brightness()
[all …]
Dleds-lp3944.c173 static int lp3944_led_set(struct lp3944_led_data *led, u8 status) in lp3944_led_set() argument
175 struct lp3944_data *data = i2c_get_clientdata(led->client); in lp3944_led_set()
176 u8 id = led->id; in lp3944_led_set()
181 dev_dbg(&led->client->dev, "%s: %s, status before normalization:%d\n", in lp3944_led_set()
182 __func__, led->ldev.name, status); in lp3944_led_set()
208 if (led->type == LP3944_LED_TYPE_LED_INVERTED && status < 2) in lp3944_led_set()
212 lp3944_reg_read(led->client, reg, &val); in lp3944_led_set()
217 dev_dbg(&led->client->dev, "%s: %s, reg:%d id:%d status:%d val:%#x\n", in lp3944_led_set()
218 __func__, led->ldev.name, reg, id, status, val); in lp3944_led_set()
221 err = lp3944_reg_write(led->client, reg, val); in lp3944_led_set()
[all …]
Dleds-atmel-pwm.c26 struct pwmled *led; in pwmled_brightness() local
29 led = container_of(cdev, struct pwmled, cdev); in pwmled_brightness()
30 pwm_channel_writel(&led->pwmc, PWM_CUPD, led->mult * (unsigned) b); in pwmled_brightness()
53 struct pwmled *led = leds + i; in pwmled_probe() local
57 led->cdev.name = dat->name; in pwmled_probe()
58 led->cdev.brightness = LED_OFF; in pwmled_probe()
59 led->cdev.brightness_set = pwmled_brightness; in pwmled_probe()
60 led->cdev.default_trigger = dat->default_trigger; in pwmled_probe()
62 led->active_low = dat->active_low; in pwmled_probe()
64 status = pwm_channel_alloc(dat->gpio, &led->pwmc); in pwmled_probe()
[all …]
Dledtrig-backlight.c25 struct led_classdev *led; member
37 struct led_classdev *led = n->led; in fb_notifier_callback() local
48 n->brightness = led->brightness; in fb_notifier_callback()
49 led_set_brightness(led, LED_OFF); in fb_notifier_callback()
51 led_set_brightness(led, n->brightness); in fb_notifier_callback()
65 struct led_classdev *led = dev_get_drvdata(dev); in bl_trig_invert_show() local
66 struct bl_trig_notifier *n = led->trigger_data; in bl_trig_invert_show()
74 struct led_classdev *led = dev_get_drvdata(dev); in bl_trig_invert_store() local
75 struct bl_trig_notifier *n = led->trigger_data; in bl_trig_invert_store()
90 led_set_brightness(led, LED_OFF); in bl_trig_invert_store()
[all …]
Dleds-pca9532.c26 #define LED_REG(led) ((led>>2)+PCA9532_REG_LS0) argument
27 #define LED_NUM(led) (led & 0x3) argument
105 static void pca9532_setled(struct pca9532_led *led) in pca9532_setled() argument
107 struct i2c_client *client = led->client; in pca9532_setled()
112 reg = i2c_smbus_read_byte_data(client, LED_REG(led->id)); in pca9532_setled()
114 reg = reg & ~(0x3<<LED_NUM(led->id)*2); in pca9532_setled()
116 reg = reg | (led->state << LED_NUM(led->id)*2); in pca9532_setled()
117 i2c_smbus_write_byte_data(client, LED_REG(led->id), reg); in pca9532_setled()
125 struct pca9532_led *led = ldev_to_led(led_cdev); in pca9532_set_brightness() local
128 led->state = PCA9532_OFF; in pca9532_set_brightness()
[all …]
Dleds-88pm860x.c120 struct pm860x_led *led; in pm860x_led_work() local
125 led = container_of(work, struct pm860x_led, work); in pm860x_led_work()
126 chip = led->chip; in pm860x_led_work()
127 mutex_lock(&led->lock); in pm860x_led_work()
128 if ((led->current_brightness == 0) && led->brightness) { in pm860x_led_work()
129 if (led->iset) { in pm860x_led_work()
130 pm860x_set_bits(led->i2c, __led_off(led->port), in pm860x_led_work()
131 LED_CURRENT_MASK, led->iset); in pm860x_led_work()
133 pm860x_set_bits(led->i2c, __blink_off(led->port), in pm860x_led_work()
135 mask = __blink_ctl_mask(led->port); in pm860x_led_work()
[all …]
Dleds-adp5520.c36 struct adp5520_led *led = container_of(work, struct adp5520_led, work); in adp5520_led_work() local
37 adp5520_write(led->master, ADP5520_LED1_CURRENT + led->id - 1, in adp5520_led_work()
38 led->new_brightness >> 2); in adp5520_led_work()
44 struct adp5520_led *led; in adp5520_led_set() local
46 led = container_of(led_cdev, struct adp5520_led, cdev); in adp5520_led_set()
47 led->new_brightness = value; in adp5520_led_set()
48 schedule_work(&led->work); in adp5520_led_set()
51 static int adp5520_led_setup(struct adp5520_led *led) in adp5520_led_setup() argument
53 struct device *dev = led->master; in adp5520_led_setup()
54 int flags = led->flags; in adp5520_led_setup()
[all …]
Dleds-s3c24xx.c45 struct s3c24xx_gpio_led *led = to_gpio(led_cdev); in s3c24xx_led_set() local
46 struct s3c24xx_led_platdata *pd = led->pdata; in s3c24xx_led_set()
62 struct s3c24xx_gpio_led *led = pdev_to_gpio(dev); in s3c24xx_led_remove() local
64 led_classdev_unregister(&led->cdev); in s3c24xx_led_remove()
65 kfree(led); in s3c24xx_led_remove()
73 struct s3c24xx_gpio_led *led; in s3c24xx_led_probe() local
76 led = kzalloc(sizeof(struct s3c24xx_gpio_led), GFP_KERNEL); in s3c24xx_led_probe()
77 if (led == NULL) { in s3c24xx_led_probe()
82 platform_set_drvdata(dev, led); in s3c24xx_led_probe()
84 led->cdev.brightness_set = s3c24xx_led_set; in s3c24xx_led_probe()
[all …]
Dleds-mc13783.c75 struct mc13783_led *led = container_of(work, struct mc13783_led, work); in mc13783_led_work() local
81 switch (led->id) { in mc13783_led_work()
85 value = (led->new_brightness >> 4) << MC13783_LED_C2_MD_P; in mc13783_led_work()
90 value = (led->new_brightness >> 4) << MC13783_LED_C2_AD_P; in mc13783_led_work()
95 value = (led->new_brightness >> 4) << MC13783_LED_C2_KP_P; in mc13783_led_work()
106 off = led->id - MC13783_LED_R1; in mc13783_led_work()
110 value = (led->new_brightness >> 3) << shift; in mc13783_led_work()
115 mc13783_lock(led->master); in mc13783_led_work()
117 mc13783_reg_rmw(led->master, reg, mask, value); in mc13783_led_work()
119 mc13783_unlock(led->master); in mc13783_led_work()
[all …]
/linux-2.6.39/drivers/net/wireless/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 …]
/linux-2.6.39/drivers/net/wireless/rt2x00/
Drt2x00leds.c34 struct rt2x00_led *led = &rt2x00dev->led_qual; in rt2x00leds_led_quality() local
37 if ((led->type != LED_TYPE_QUALITY) || !(led->flags & LED_REGISTERED)) in rt2x00leds_led_quality()
69 if (brightness != led->led_dev.brightness) { in rt2x00leds_led_quality()
70 led->led_dev.brightness_set(&led->led_dev, brightness); in rt2x00leds_led_quality()
71 led->led_dev.brightness = brightness; in rt2x00leds_led_quality()
75 static void rt2x00led_led_simple(struct rt2x00_led *led, bool enabled) in rt2x00led_led_simple() argument
79 if (!(led->flags & LED_REGISTERED)) in rt2x00led_led_simple()
82 led->led_dev.brightness_set(&led->led_dev, brightness); in rt2x00led_led_simple()
83 led->led_dev.brightness = brightness; in rt2x00led_led_simple()
105 struct rt2x00_led *led, in rt2x00leds_register_led() argument
[all …]
/linux-2.6.39/drivers/usb/misc/
Dusbled.c46 static void change_color(struct usb_led *led) in change_color() argument
53 dev_err(&led->udev->dev, "out of memory\n"); in change_color()
57 switch (led->type) { in change_color()
61 if (led->blue) in change_color()
63 if (led->red) in change_color()
65 if (led->green) in change_color()
67 dev_dbg(&led->udev->dev, in change_color()
69 led->blue, led->red, led->green, color); in change_color()
71 retval = usb_control_msg(led->udev, in change_color()
72 usb_sndctrlpipe(led->udev, 0), in change_color()
[all …]
/linux-2.6.39/arch/arm/plat-versatile/
Dleds.c51 struct versatile_led *led = container_of(cdev, in versatile_led_set() local
56 reg |= led->mask; in versatile_led_set()
58 reg &= ~led->mask; in versatile_led_set()
64 struct versatile_led *led = container_of(cdev, in versatile_led_get() local
68 return (reg & led->mask) ? LED_FULL : LED_OFF; in versatile_led_get()
78 struct versatile_led *led; in versatile_leds_init() local
80 led = kzalloc(sizeof(*led), GFP_KERNEL); in versatile_leds_init()
81 if (!led) in versatile_leds_init()
84 led->cdev.name = versatile_leds[i].name; in versatile_leds_init()
85 led->cdev.brightness_set = versatile_led_set; in versatile_leds_init()
[all …]
/linux-2.6.39/drivers/net/wireless/b43legacy/
Dleds.c72 struct b43legacy_led *led = container_of(led_dev, struct b43legacy_led, in b43legacy_led_brightness_set() local
74 struct b43legacy_wldev *dev = led->dev; in b43legacy_led_brightness_set()
83 b43legacy_led_turn_off(dev, led->index, led->activelow); in b43legacy_led_brightness_set()
85 b43legacy_led_turn_on(dev, led->index, led->activelow); in b43legacy_led_brightness_set()
89 struct b43legacy_led *led, in b43legacy_register_led() argument
97 if (led->dev) in b43legacy_register_led()
101 led->dev = dev; in b43legacy_register_led()
102 led->index = led_index; in b43legacy_register_led()
103 led->activelow = activelow; in b43legacy_register_led()
104 strncpy(led->name, name, sizeof(led->name)); in b43legacy_register_led()
[all …]
/linux-2.6.39/drivers/net/wireless/rtl818x/rtl8187/
Dleds.c33 struct rtl8187_led *led = &priv->led_tx; in led_turn_on() local
40 if (!led->dev) in led_turn_on()
43 switch (led->ledpin) { in led_turn_on()
71 struct rtl8187_led *led = &priv->led_tx; in led_turn_off() local
78 if (!led->dev) in led_turn_off()
81 switch (led->ledpin) { in led_turn_off()
105 struct rtl8187_led *led = container_of(led_dev, struct rtl8187_led, in rtl8187_led_brightness_set() local
107 struct ieee80211_hw *hw = led->dev; in rtl8187_led_brightness_set()
114 if (led->is_radio) { in rtl8187_led_brightness_set()
135 struct rtl8187_led *led, const char *name, in rtl8187_register_led() argument
[all …]
/linux-2.6.39/drivers/net/wireless/ath/ath5k/
Dled.c115 struct ath5k_led *led = container_of(led_dev, struct ath5k_led, in ath5k_led_brightness_set() local
119 ath5k_led_off(led->sc); in ath5k_led_brightness_set()
121 ath5k_led_on(led->sc); in ath5k_led_brightness_set()
125 ath5k_register_led(struct ath5k_softc *sc, struct ath5k_led *led, in ath5k_register_led() argument
130 led->sc = sc; in ath5k_register_led()
131 strncpy(led->name, name, sizeof(led->name)); in ath5k_register_led()
132 led->led_dev.name = led->name; in ath5k_register_led()
133 led->led_dev.default_trigger = trigger; in ath5k_register_led()
134 led->led_dev.brightness_set = ath5k_led_brightness_set; in ath5k_register_led()
136 err = led_classdev_register(sc->dev, &led->led_dev); in ath5k_register_led()
[all …]
/linux-2.6.39/drivers/net/wireless/p54/
Dled.c71 struct p54_led_dev *led = container_of(led_dev, struct p54_led_dev, in p54_led_brightness_set() local
73 struct ieee80211_hw *dev = led->hw_dev; in p54_led_brightness_set()
79 if ((brightness) && (led->registered)) { in p54_led_brightness_set()
80 led->toggled++; in p54_led_brightness_set()
89 struct p54_led_dev *led = &priv->leds[led_index]; in p54_register_led() local
92 if (led->registered) in p54_register_led()
95 snprintf(led->name, sizeof(led->name), "p54-%s::%s", in p54_register_led()
97 led->hw_dev = priv->hw; in p54_register_led()
98 led->index = led_index; in p54_register_led()
99 led->led_dev.name = led->name; in p54_register_led()
[all …]
/linux-2.6.39/arch/arm/mach-ks8695/
Dleds.c20 static inline void ks8695_led_on(unsigned int led) in ks8695_led_on() argument
22 gpio_set_value(led, 0); in ks8695_led_on()
25 static inline void ks8695_led_off(unsigned int led) in ks8695_led_off() argument
27 gpio_set_value(led, 1); in ks8695_led_off()
30 static inline void ks8695_led_toggle(unsigned int led) in ks8695_led_toggle() argument
32 unsigned long is_off = gpio_get_value(led); in ks8695_led_toggle()
34 ks8695_led_on(led); in ks8695_led_toggle()
36 ks8695_led_off(led); in ks8695_led_toggle()
/linux-2.6.39/drivers/net/wireless/iwlegacy/
Diwl-led.c129 ret = priv->cfg->ops->led->cmd(priv, &led_cmd); in iwl_legacy_led_cmd()
140 struct iwl_priv *priv = container_of(led_cdev, struct iwl_priv, led); in iwl_legacy_led_brightness_set()
153 struct iwl_priv *priv = container_of(led_cdev, struct iwl_priv, led); in iwl_legacy_led_blink_set()
166 priv->led.name = kasprintf(GFP_KERNEL, "%s-led", in iwl_legacy_leds_init()
168 priv->led.brightness_set = iwl_legacy_led_brightness_set; in iwl_legacy_leds_init()
169 priv->led.blink_set = iwl_legacy_led_blink_set; in iwl_legacy_leds_init()
170 priv->led.max_brightness = 1; in iwl_legacy_leds_init()
177 priv->led.default_trigger = in iwl_legacy_leds_init()
183 priv->led.default_trigger = in iwl_legacy_leds_init()
188 ret = led_classdev_register(&priv->pci_dev->dev, &priv->led); in iwl_legacy_leds_init()
[all …]

12345678