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
159 struct omnia_leds *leds = i2c_get_clientdata(client); in brightness_show() local
162 mutex_lock(&leds->lock); in brightness_show()
164 mutex_unlock(&leds->lock); in brightness_show()
176 struct omnia_leds *leds = i2c_get_clientdata(client); in brightness_store() local
186 mutex_lock(&leds->lock); in brightness_store()
189 mutex_unlock(&leds->lock); in brightness_store()
209 struct omnia_leds *leds; in omnia_leds_probe() local
215 dev_err(dev, "LEDs are not defined in device tree!\n"); in omnia_leds_probe()
218 dev_err(dev, "Too many LEDs defined in device tree!\n"); in omnia_leds_probe()
222 leds = devm_kzalloc(dev, struct_size(leds, leds, count), GFP_KERNEL); in omnia_leds_probe()
223 if (!leds) in omnia_leds_probe()
226 leds->client = client; in omnia_leds_probe()
227 i2c_set_clientdata(client, leds); in omnia_leds_probe()
229 mutex_init(&leds->lock); in omnia_leds_probe()
231 led = &leds->leds[0]; in omnia_leds_probe()
249 /* put all LEDs into default (HW triggered) mode */ in omnia_leds_remove()
253 /* set all LEDs color to [255, 255, 255] */ in omnia_leds_remove()
264 { .compatible = "cznic,turris-omnia-leds", },
279 .name = "leds-turris-omnia",
288 MODULE_DESCRIPTION("CZ.NIC's Turris Omnia LEDs");