Lines Matching refs:activity_data
22 struct activity_data { struct
34 struct activity_data *activity_data = from_timer(activity_data, t, in led_activity_function() argument
36 struct led_classdev *led_cdev = activity_data->led_cdev; in led_activity_function()
78 diff_boot = (curr_boot - activity_data->last_boot) >> 16; in led_activity_function()
79 diff_used = (curr_used - activity_data->last_used) >> 16; in led_activity_function()
80 activity_data->last_boot = curr_boot; in led_activity_function()
81 activity_data->last_used = curr_used; in led_activity_function()
125 activity_data->time_left -= 100; in led_activity_function()
126 if (activity_data->time_left <= 0) { in led_activity_function()
127 activity_data->time_left = 0; in led_activity_function()
128 activity_data->state = !activity_data->state; in led_activity_function()
130 (activity_data->state ^ activity_data->invert) ? in led_activity_function()
137 delay = activity_data->state ? in led_activity_function()
141 delay = activity_data->state ? in led_activity_function()
146 if (!activity_data->time_left || delay <= activity_data->time_left) in led_activity_function()
147 activity_data->time_left = delay; in led_activity_function()
149 delay = min_t(int, activity_data->time_left, 100); in led_activity_function()
150 mod_timer(&activity_data->timer, jiffies + msecs_to_jiffies(delay)); in led_activity_function()
156 struct activity_data *activity_data = led_trigger_get_drvdata(dev); in led_invert_show() local
158 return sprintf(buf, "%u\n", activity_data->invert); in led_invert_show()
165 struct activity_data *activity_data = led_trigger_get_drvdata(dev); in led_invert_store() local
173 activity_data->invert = !!state; in led_invert_store()
188 struct activity_data *activity_data; in activity_activate() local
190 activity_data = kzalloc(sizeof(*activity_data), GFP_KERNEL); in activity_activate()
191 if (!activity_data) in activity_activate()
194 led_set_trigger_data(led_cdev, activity_data); in activity_activate()
196 activity_data->led_cdev = led_cdev; in activity_activate()
197 timer_setup(&activity_data->timer, led_activity_function, 0); in activity_activate()
200 led_activity_function(&activity_data->timer); in activity_activate()
208 struct activity_data *activity_data = led_get_trigger_data(led_cdev); in activity_deactivate() local
210 del_timer_sync(&activity_data->timer); in activity_deactivate()
211 kfree(activity_data); in activity_deactivate()