Lines Matching full:leds
3 * CZ.NIC's Turris Omnia LEDs driver
13 #include "leds.h"
41 struct omnia_led leds[]; member
48 struct omnia_leds *leds = dev_get_drvdata(cdev->dev->parent); in omnia_led_brightness_set_blocking() local
53 mutex_lock(&leds->lock); in omnia_led_brightness_set_blocking()
67 ret = i2c_smbus_write_byte_data(leds->client, CMD_LED_STATE, state); in omnia_led_brightness_set_blocking()
69 ret = i2c_master_send(leds->client, buf, 5); in omnia_led_brightness_set_blocking()
71 mutex_unlock(&leds->lock); in omnia_led_brightness_set_blocking()
146 * can be used to control the intensity of all the LEDs at once, so that if they
199 struct omnia_leds *leds; in omnia_leds_probe() local
205 dev_err(dev, "LEDs are not defined in device tree!\n"); in omnia_leds_probe()
208 dev_err(dev, "Too many LEDs defined in device tree!\n"); in omnia_leds_probe()
212 leds = devm_kzalloc(dev, struct_size(leds, leds, count), GFP_KERNEL); in omnia_leds_probe()
213 if (!leds) in omnia_leds_probe()
216 leds->client = client; in omnia_leds_probe()
217 i2c_set_clientdata(client, leds); in omnia_leds_probe()
219 mutex_init(&leds->lock); in omnia_leds_probe()
221 led = &leds->leds[0]; in omnia_leds_probe()
239 /* put all LEDs into default (HW triggered) mode */ in omnia_leds_remove()
243 /* set all LEDs color to [255, 255, 255] */ in omnia_leds_remove()
254 { .compatible = "cznic,turris-omnia-leds", },
269 .name = "leds-turris-omnia",
278 MODULE_DESCRIPTION("CZ.NIC's Turris Omnia LEDs");