Lines Matching full:led

5   LED control
48 struct b43_led *led) in b43_led_update() argument
53 if (!led->wl) in b43_led_update()
58 /* The led->state read is racy, but we don't care. In case we raced 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()
95 /* Callback from the LED subsystem. */
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()
108 static int b43_register_led(struct b43_wldev *dev, struct b43_led *led, in b43_register_led() argument
114 if (led->wl) in b43_register_led()
118 led->wl = dev->wl; in b43_register_led()
119 led->index = led_index; in b43_register_led()
120 led->activelow = activelow; in b43_register_led()
121 strscpy(led->name, name, sizeof(led->name)); in b43_register_led()
122 atomic_set(&led->state, 0); in b43_register_led()
124 led->led_dev.name = led->name; in b43_register_led()
125 led->led_dev.default_trigger = default_trigger; in b43_register_led()
126 led->led_dev.brightness_set = b43_led_brightness_set; in b43_register_led()
128 err = led_classdev_register(dev->dev->dev, &led->led_dev); in b43_register_led()
131 led->wl = NULL; in b43_register_led()
138 static void b43_unregister_led(struct b43_led *led) in b43_unregister_led() argument
140 if (!led->wl) in b43_unregister_led()
142 led_classdev_unregister(&led->led_dev); in b43_unregister_led()
143 led->wl = NULL; in b43_unregister_led()
154 /* Map the b43 specific LED behaviour value to the in b43_map_led()
155 * generic LED triggers. */ in b43_map_led()
213 /* There is no LED information in the SPROM in b43_led_get_sprominfo()
214 * for this LED. Hardcode it here. */ in b43_led_get_sprominfo()
240 /* keep LED disabled if no mapping is defined */ in b43_led_get_sprominfo()
251 struct b43_led *led; in b43_leds_init() local
256 /* Sync the RF-kill LED state (if we have one) with radio and switch states. */ in b43_leds_init()
257 led = &dev->wl->leds.led_radio; in b43_leds_init()
258 if (led->wl) { in b43_leds_init()
260 b43_led_turn_on(dev, led->index, led->activelow); in b43_leds_init()
261 led->hw_state = true; in b43_leds_init()
262 atomic_set(&led->state, 1); in b43_leds_init()
264 b43_led_turn_off(dev, led->index, led->activelow); in b43_leds_init()
265 led->hw_state = false; in b43_leds_init()
266 atomic_set(&led->state, 0); in b43_leds_init()
271 led = &dev->wl->leds.led_tx; in b43_leds_init()
272 if (led->wl) { in b43_leds_init()
273 b43_led_turn_off(dev, led->index, led->activelow); in b43_leds_init()
274 led->hw_state = false; in b43_leds_init()
275 atomic_set(&led->state, 0); in b43_leds_init()
277 led = &dev->wl->leds.led_rx; in b43_leds_init()
278 if (led->wl) { in b43_leds_init()
279 b43_led_turn_off(dev, led->index, led->activelow); in b43_leds_init()
280 led->hw_state = false; in b43_leds_init()
281 atomic_set(&led->state, 0); in b43_leds_init()
283 led = &dev->wl->leds.led_assoc; in b43_leds_init()
284 if (led->wl) { in b43_leds_init()
285 b43_led_turn_off(dev, led->index, led->activelow); in b43_leds_init()
286 led->hw_state = false; in b43_leds_init()
287 atomic_set(&led->state, 0); in b43_leds_init()
290 /* Initialize other LED states. */ in b43_leds_init()
335 /* Register the LEDs to the LED subsystem. */ in b43_leds_register()