Lines Matching refs:t
36 #define TRIGGER_WARN_ONCE(t, exp) \ argument
37 WARN_ONCE(t->state != exp, "trigger '%s' state transist error: %d in %s()\n", \
38 t->name, t->state, __func__)
40 static inline bool trigger_is_available(struct trigger *t) in trigger_is_available() argument
42 return t->state >= 0; in trigger_is_available()
45 static inline bool trigger_is_error(struct trigger *t) in trigger_is_error() argument
47 return t->state <= TRIGGER_ERROR; in trigger_is_error()
50 static inline void trigger_on(struct trigger *t) in trigger_on() argument
52 TRIGGER_WARN_ONCE(t, TRIGGER_OFF); in trigger_on()
53 t->state = TRIGGER_ON; in trigger_on()
56 static inline void trigger_ready(struct trigger *t) in trigger_ready() argument
58 if (!trigger_is_available(t)) in trigger_ready()
60 t->state = TRIGGER_READY; in trigger_ready()
63 static inline void trigger_hit(struct trigger *t) in trigger_hit() argument
65 if (!trigger_is_available(t)) in trigger_hit()
67 TRIGGER_WARN_ONCE(t, TRIGGER_READY); in trigger_hit()
68 t->state = TRIGGER_HIT; in trigger_hit()
71 static inline void trigger_off(struct trigger *t) in trigger_off() argument
73 if (!trigger_is_available(t)) in trigger_off()
75 t->state = TRIGGER_OFF; in trigger_off()
78 static inline void trigger_error(struct trigger *t) in trigger_error() argument
80 t->state = TRIGGER_ERROR; in trigger_error()
83 static inline bool trigger_is_ready(struct trigger *t) in trigger_is_ready() argument
85 return t->state == TRIGGER_READY; in trigger_is_ready()
88 static inline bool trigger_is_hit(struct trigger *t) in trigger_is_hit() argument
90 return t->state == TRIGGER_HIT; in trigger_is_hit()