Lines Matching +full:trigger +full:- +full:name

1 /* SPDX-License-Identifier: GPL-2.0 */
8 * Use trigger to model operations which need to be executed when
14 * OFF--> ON --> READY --(hit)--> HIT
21 * a trigger. is_hit means the event already happen; is_ready means the
22 * trigger is waiting for the event.
25 struct trigger { struct
27 TRIGGER_ERROR = -2,
28 TRIGGER_OFF = -1,
33 const char *name; member
37 WARN_ONCE(t->state != exp, "trigger '%s' state transist error: %d in %s()\n", \ argument
38 t->name, t->state, __func__)
40 static inline bool trigger_is_available(struct trigger *t) in trigger_is_available()
42 return t->state >= 0; in trigger_is_available()
45 static inline bool trigger_is_error(struct trigger *t) in trigger_is_error()
47 return t->state <= TRIGGER_ERROR; in trigger_is_error()
50 static inline void trigger_on(struct trigger *t) in trigger_on()
53 t->state = TRIGGER_ON; in trigger_on()
56 static inline void trigger_ready(struct trigger *t) in trigger_ready()
60 t->state = TRIGGER_READY; in trigger_ready()
63 static inline void trigger_hit(struct trigger *t) in trigger_hit()
68 t->state = TRIGGER_HIT; in trigger_hit()
71 static inline void trigger_off(struct trigger *t) in trigger_off()
75 t->state = TRIGGER_OFF; in trigger_off()
78 static inline void trigger_error(struct trigger *t) in trigger_error()
80 t->state = TRIGGER_ERROR; in trigger_error()
83 static inline bool trigger_is_ready(struct trigger *t) in trigger_is_ready()
85 return t->state == TRIGGER_READY; in trigger_is_ready()
88 static inline bool trigger_is_hit(struct trigger *t) in trigger_is_hit()
90 return t->state == TRIGGER_HIT; in trigger_is_hit()
94 struct trigger n = {.state = TRIGGER_OFF, .name = #n}