• Home
  • Raw
  • Download

Lines Matching full:leds

3  * CZ.NIC's Turris Omnia LEDs driver
13 #include "leds.h"
49 struct omnia_led leds[]; member
56 struct omnia_leds *leds = dev_get_drvdata(cdev->dev->parent); in omnia_led_brightness_set_blocking() local
61 mutex_lock(&leds->lock); in omnia_led_brightness_set_blocking()
75 ret = i2c_smbus_write_byte_data(leds->client, CMD_LED_STATE, state); in omnia_led_brightness_set_blocking()
77 ret = i2c_master_send(leds->client, buf, 5); in omnia_led_brightness_set_blocking()
79 mutex_unlock(&leds->lock); in omnia_led_brightness_set_blocking()
151 * can be used to control the intensity of all the LEDs at once, so that if they
163 struct omnia_leds *leds = i2c_get_clientdata(client); in brightness_show() local
166 mutex_lock(&leds->lock); in brightness_show()
168 mutex_unlock(&leds->lock); in brightness_show()
180 struct omnia_leds *leds = i2c_get_clientdata(client); in brightness_store() local
190 mutex_lock(&leds->lock); in brightness_store()
192 mutex_unlock(&leds->lock); in brightness_store()
212 struct omnia_leds *leds; in omnia_leds_probe() local
218 dev_err(dev, "LEDs are not defined in device tree!\n"); in omnia_leds_probe()
221 dev_err(dev, "Too many LEDs defined in device tree!\n"); in omnia_leds_probe()
225 leds = devm_kzalloc(dev, struct_size(leds, leds, count), GFP_KERNEL); in omnia_leds_probe()
226 if (!leds) in omnia_leds_probe()
229 leds->client = client; in omnia_leds_probe()
230 i2c_set_clientdata(client, leds); in omnia_leds_probe()
232 mutex_init(&leds->lock); in omnia_leds_probe()
234 led = &leds->leds[0]; in omnia_leds_probe()
255 /* put all LEDs into default (HW triggered) mode */ in omnia_leds_remove()
259 /* set all LEDs color to [255, 255, 255] */ in omnia_leds_remove()
272 { .compatible = "cznic,turris-omnia-leds", },
287 .name = "leds-turris-omnia",
295 MODULE_DESCRIPTION("CZ.NIC's Turris Omnia LEDs");