Lines Matching refs:gpio_data

27 	struct gpio_trig_data *gpio_data = led_get_trigger_data(led);  in gpio_trig_irq()  local
30 tmp = gpiod_get_value_cansleep(gpio_data->gpiod); in gpio_trig_irq()
32 if (gpio_data->desired_brightness) in gpio_trig_irq()
33 led_set_brightness_nosleep(gpio_data->led, in gpio_trig_irq()
34 gpio_data->desired_brightness); in gpio_trig_irq()
36 led_set_brightness_nosleep(gpio_data->led, LED_FULL); in gpio_trig_irq()
38 led_set_brightness_nosleep(gpio_data->led, LED_OFF); in gpio_trig_irq()
47 struct gpio_trig_data *gpio_data = led_trigger_get_drvdata(dev); in desired_brightness_show() local
49 return sysfs_emit(buf, "%u\n", gpio_data->desired_brightness); in desired_brightness_show()
55 struct gpio_trig_data *gpio_data = led_trigger_get_drvdata(dev); in desired_brightness_store() local
63 gpio_data->desired_brightness = desired_brightness; in desired_brightness_store()
77 struct gpio_trig_data *gpio_data; in gpio_trig_activate() local
81 gpio_data = kzalloc(sizeof(*gpio_data), GFP_KERNEL); in gpio_trig_activate()
82 if (!gpio_data) in gpio_trig_activate()
89 gpio_data->gpiod = gpiod_get_optional(dev, "trigger-sources", GPIOD_IN); in gpio_trig_activate()
90 if (IS_ERR(gpio_data->gpiod)) { in gpio_trig_activate()
91 ret = PTR_ERR(gpio_data->gpiod); in gpio_trig_activate()
92 kfree(gpio_data); in gpio_trig_activate()
95 if (!gpio_data->gpiod) { in gpio_trig_activate()
97 kfree(gpio_data); in gpio_trig_activate()
101 gpiod_set_consumer_name(gpio_data->gpiod, "led-trigger"); in gpio_trig_activate()
103 gpio_data->led = led; in gpio_trig_activate()
104 led_set_trigger_data(led, gpio_data); in gpio_trig_activate()
106 ret = request_threaded_irq(gpiod_to_irq(gpio_data->gpiod), NULL, gpio_trig_irq, in gpio_trig_activate()
111 gpiod_put(gpio_data->gpiod); in gpio_trig_activate()
112 kfree(gpio_data); in gpio_trig_activate()
124 struct gpio_trig_data *gpio_data = led_get_trigger_data(led); in gpio_trig_deactivate() local
126 free_irq(gpiod_to_irq(gpio_data->gpiod), led); in gpio_trig_deactivate()
127 gpiod_put(gpio_data->gpiod); in gpio_trig_deactivate()
128 kfree(gpio_data); in gpio_trig_deactivate()