Lines Matching refs:led_dat
36 struct gpio_led_data *led_dat =
39 if (led_dat->blinking) {
40 led_dat->platform_gpio_blink_set(led_dat->gpio,
41 led_dat->new_level,
43 led_dat->blinking = 0;
45 gpio_set_value_cansleep(led_dat->gpio, led_dat->new_level);
51 struct gpio_led_data *led_dat =
60 if (led_dat->active_low)
67 if (led_dat->can_sleep) {
68 led_dat->new_level = level;
69 schedule_work(&led_dat->work);
71 if (led_dat->blinking) {
72 led_dat->platform_gpio_blink_set(led_dat->gpio, level,
74 led_dat->blinking = 0;
76 gpio_set_value(led_dat->gpio, level);
83 struct gpio_led_data *led_dat =
86 led_dat->blinking = 1;
87 return led_dat->platform_gpio_blink_set(led_dat->gpio, GPIO_LED_BLINK,
92 struct gpio_led_data *led_dat, struct device *parent,
97 led_dat->gpio = -1;
110 led_dat->cdev.name = template->name;
111 led_dat->cdev.default_trigger = template->default_trigger;
112 led_dat->gpio = template->gpio;
113 led_dat->can_sleep = gpio_cansleep(template->gpio);
114 led_dat->active_low = template->active_low;
115 led_dat->blinking = 0;
117 led_dat->platform_gpio_blink_set = blink_set;
118 led_dat->cdev.blink_set = gpio_blink_set;
120 led_dat->cdev.brightness_set = gpio_led_set;
122 state = !!gpio_get_value(led_dat->gpio) ^ led_dat->active_low;
125 led_dat->cdev.brightness = state ? LED_FULL : LED_OFF;
127 led_dat->cdev.flags |= LED_CORE_SUSPENDRESUME;
129 ret = gpio_direction_output(led_dat->gpio, led_dat->active_low ^ state);
133 INIT_WORK(&led_dat->work, gpio_led_work);
135 ret = led_classdev_register(parent, &led_dat->cdev);
141 gpio_free(led_dat->gpio);