• Home
  • Raw
  • Download

Lines Matching refs:trig

39 	struct led_trigger *trig;  in led_trigger_store()  local
55 list_for_each_entry(trig, &trigger_list, next_trig) { in led_trigger_store()
56 if (!strcmp(trigger_name, trig->name)) { in led_trigger_store()
58 led_trigger_set(led_cdev, trig); in led_trigger_store()
75 struct led_trigger *trig; in led_trigger_show() local
86 list_for_each_entry(trig, &trigger_list, next_trig) { in led_trigger_show()
88 trig->name)) in led_trigger_show()
89 len += sprintf(buf+len, "[%s] ", trig->name); in led_trigger_show()
91 len += sprintf(buf+len, "%s ", trig->name); in led_trigger_show()
102 void led_trigger_set(struct led_classdev *led_cdev, struct led_trigger *trig) in led_trigger_set() argument
109 name = trig ? trig->name : "none"; in led_trigger_set()
125 if (trig) { in led_trigger_set()
126 write_lock_irqsave(&trig->leddev_list_lock, flags); in led_trigger_set()
127 list_add_tail(&led_cdev->trig_list, &trig->led_cdevs); in led_trigger_set()
128 write_unlock_irqrestore(&trig->leddev_list_lock, flags); in led_trigger_set()
129 led_cdev->trigger = trig; in led_trigger_set()
130 if (trig->activate) in led_trigger_set()
131 trig->activate(led_cdev); in led_trigger_set()
153 struct led_trigger *trig; in led_trigger_set_default() local
160 list_for_each_entry(trig, &trigger_list, next_trig) { in led_trigger_set_default()
161 if (!strcmp(led_cdev->default_trigger, trig->name)) in led_trigger_set_default()
162 led_trigger_set(led_cdev, trig); in led_trigger_set_default()
169 void led_trigger_rename_static(const char *name, struct led_trigger *trig) in led_trigger_rename_static() argument
172 BUG_ON(name == trig->name); in led_trigger_rename_static()
177 strcpy((char *)trig->name, name); in led_trigger_rename_static()
184 int led_trigger_register(struct led_trigger *trig) in led_trigger_register() argument
189 rwlock_init(&trig->leddev_list_lock); in led_trigger_register()
190 INIT_LIST_HEAD(&trig->led_cdevs); in led_trigger_register()
195 if (!strcmp(_trig->name, trig->name)) { in led_trigger_register()
201 list_add_tail(&trig->next_trig, &trigger_list); in led_trigger_register()
209 !strcmp(led_cdev->default_trigger, trig->name)) in led_trigger_register()
210 led_trigger_set(led_cdev, trig); in led_trigger_register()
219 void led_trigger_unregister(struct led_trigger *trig) in led_trigger_unregister() argument
225 list_del(&trig->next_trig); in led_trigger_unregister()
232 if (led_cdev->trigger == trig) in led_trigger_unregister()
242 void led_trigger_event(struct led_trigger *trig, in led_trigger_event() argument
247 if (!trig) in led_trigger_event()
250 read_lock(&trig->leddev_list_lock); in led_trigger_event()
251 list_for_each(entry, &trig->led_cdevs) { in led_trigger_event()
257 read_unlock(&trig->leddev_list_lock); in led_trigger_event()
261 static void led_trigger_blink_setup(struct led_trigger *trig, in led_trigger_blink_setup() argument
269 if (!trig) in led_trigger_blink_setup()
272 read_lock(&trig->leddev_list_lock); in led_trigger_blink_setup()
273 list_for_each(entry, &trig->led_cdevs) { in led_trigger_blink_setup()
283 read_unlock(&trig->leddev_list_lock); in led_trigger_blink_setup()
286 void led_trigger_blink(struct led_trigger *trig, in led_trigger_blink() argument
290 led_trigger_blink_setup(trig, delay_on, delay_off, 0, 0); in led_trigger_blink()
294 void led_trigger_blink_oneshot(struct led_trigger *trig, in led_trigger_blink_oneshot() argument
299 led_trigger_blink_setup(trig, delay_on, delay_off, 1, invert); in led_trigger_blink_oneshot()
305 struct led_trigger *trig; in led_trigger_register_simple() local
308 trig = kzalloc(sizeof(struct led_trigger), GFP_KERNEL); in led_trigger_register_simple()
310 if (trig) { in led_trigger_register_simple()
311 trig->name = name; in led_trigger_register_simple()
312 err = led_trigger_register(trig); in led_trigger_register_simple()
314 kfree(trig); in led_trigger_register_simple()
315 trig = NULL; in led_trigger_register_simple()
323 *tp = trig; in led_trigger_register_simple()
327 void led_trigger_unregister_simple(struct led_trigger *trig) in led_trigger_unregister_simple() argument
329 if (trig) in led_trigger_unregister_simple()
330 led_trigger_unregister(trig); in led_trigger_unregister_simple()
331 kfree(trig); in led_trigger_unregister_simple()