Lines Matching refs:timer_data
40 struct timer_trig_data *timer_data = led_cdev->trigger_data;
44 if (!timer_data->delay_on || !timer_data->delay_off) {
52 brightness = timer_data->brightness_on;
53 delay = timer_data->delay_on;
58 timer_data->brightness_on = brightness;
60 delay = timer_data->delay_off;
65 mod_timer(&timer_data->timer, jiffies + msecs_to_jiffies(delay));
72 struct timer_trig_data *timer_data = led_cdev->trigger_data;
74 return sprintf(buf, "%lu\n", timer_data->delay_on);
81 struct timer_trig_data *timer_data = led_cdev->trigger_data;
91 if (timer_data->delay_on != state) {
93 timer_data->delay_on = state;
96 del_timer_sync(&timer_data->timer);
101 &timer_data->delay_on, &timer_data->delay_off)) {
103 mod_timer(&timer_data->timer, jiffies + 1);
116 struct timer_trig_data *timer_data = led_cdev->trigger_data;
118 return sprintf(buf, "%lu\n", timer_data->delay_off);
125 struct timer_trig_data *timer_data = led_cdev->trigger_data;
135 if (timer_data->delay_off != state) {
137 timer_data->delay_off = state;
140 del_timer_sync(&timer_data->timer);
145 &timer_data->delay_on, &timer_data->delay_off)) {
147 mod_timer(&timer_data->timer, jiffies + 1);
161 struct timer_trig_data *timer_data;
164 timer_data = kzalloc(sizeof(struct timer_trig_data), GFP_KERNEL);
165 if (!timer_data)
168 timer_data->brightness_on = led_get_brightness(led_cdev);
169 if (timer_data->brightness_on == LED_OFF)
170 timer_data->brightness_on = led_cdev->max_brightness;
171 led_cdev->trigger_data = timer_data;
173 init_timer(&timer_data->timer);
174 timer_data->timer.function = led_timer_function;
175 timer_data->timer.data = (unsigned long) led_cdev;
189 &timer_data->delay_on, &timer_data->delay_off);
197 kfree(timer_data);
202 struct timer_trig_data *timer_data = led_cdev->trigger_data;
205 if (timer_data) {
208 del_timer_sync(&timer_data->timer);
209 kfree(timer_data);