Lines Matching full:leds

3  * CZ.NIC's Turris Omnia LEDs driver
13 #include "leds.h"
57 struct omnia_led leds[]; member
144 struct omnia_leds *leds = dev_get_drvdata(cdev->dev->parent); in omnia_led_brightness_set_blocking() local
148 mutex_lock(&leds->lock); in omnia_led_brightness_set_blocking()
166 err = omnia_led_send_color_cmd(leds->client, led); in omnia_led_brightness_set_blocking()
179 err = omnia_cmd_write_u8(leds->client, CMD_LED_STATE, state); in omnia_led_brightness_set_blocking()
184 mutex_unlock(&leds->lock); in omnia_led_brightness_set_blocking()
194 struct omnia_leds *leds = dev_get_drvdata(cdev->dev->parent); in omnia_hwtrig_activate() local
198 mutex_lock(&leds->lock); in omnia_hwtrig_activate()
209 err = omnia_led_send_color_cmd(leds->client, led); in omnia_hwtrig_activate()
214 err = omnia_cmd_write_u8(leds->client, CMD_LED_MODE, in omnia_hwtrig_activate()
220 mutex_unlock(&leds->lock); in omnia_hwtrig_activate()
227 struct omnia_leds *leds = dev_get_drvdata(cdev->dev->parent); in omnia_hwtrig_deactivate() local
231 mutex_lock(&leds->lock); in omnia_hwtrig_deactivate()
236 err = omnia_cmd_write_u8(leds->client, CMD_LED_MODE, in omnia_hwtrig_deactivate()
240 mutex_unlock(&leds->lock); in omnia_hwtrig_deactivate()
342 * can be used to control the intensity of all the LEDs at once, so that if they
388 struct omnia_leds *leds = i2c_get_clientdata(client); in gamma_correction_show() local
391 if (leds->has_gamma_correction) { in gamma_correction_show()
407 struct omnia_leds *leds = i2c_get_clientdata(client); in gamma_correction_store() local
411 if (!leds->has_gamma_correction) in gamma_correction_store()
456 struct omnia_leds *leds; in omnia_leds_probe() local
462 dev_err(dev, "LEDs are not defined in device tree!\n"); in omnia_leds_probe()
465 dev_err(dev, "Too many LEDs defined in device tree!\n"); in omnia_leds_probe()
469 leds = devm_kzalloc(dev, struct_size(leds, leds, count), GFP_KERNEL); in omnia_leds_probe()
470 if (!leds) in omnia_leds_probe()
473 leds->client = client; in omnia_leds_probe()
474 i2c_set_clientdata(client, leds); in omnia_leds_probe()
483 leds->has_gamma_correction = ret & FEAT_LED_GAMMA_CORRECTION; in omnia_leds_probe()
484 if (!leds->has_gamma_correction) { in omnia_leds_probe()
491 mutex_init(&leds->lock); in omnia_leds_probe()
499 led = &leds->leds[0]; in omnia_leds_probe()
515 /* put all LEDs into default (HW triggered) mode */ in omnia_leds_remove()
519 /* set all LEDs color to [255, 255, 255] */ in omnia_leds_remove()
530 { .compatible = "cznic,turris-omnia-leds", },
546 .name = "leds-turris-omnia",
555 MODULE_DESCRIPTION("CZ.NIC's Turris Omnia LEDs");