Lines Matching refs:sema
69 static inline uint32_t vote_count_inc(struct hw_sema_t *sema, enum cmd_source id) in vote_count_inc() argument
71 if (sema->vote[id] < UINT32_MAX) { in vote_count_inc()
72 sema->vote[id]++; in vote_count_inc()
73 return sema->vote[id]; in vote_count_inc()
76 ERROR(TAG "%s:id:%u:source_id:%u overflow\n", __func__, sema->id, id); in vote_count_inc()
80 static inline uint32_t vote_count_dec(struct hw_sema_t *sema, enum cmd_source id) in vote_count_dec() argument
82 if (sema->vote[id] > 0) { in vote_count_dec()
83 sema->vote[id]--; in vote_count_dec()
84 return sema->vote[id]; in vote_count_dec()
87 ERROR(TAG "%s:id:%u:source_id:%u underflow\n", __func__, sema->id, id); in vote_count_dec()
91 static inline uint32_t vote_count(struct hw_sema_t *sema) in vote_count() argument
96 count += sema->vote[i]; in vote_count()
115 static int mm_pm_get_if_in_use(struct hw_sema_t *sema, enum cmd_source id) in mm_pm_get_if_in_use() argument
122 count = vote_count(sema); in mm_pm_get_if_in_use()
124 __func__, sema->id, id, sema->vote[id], count, ret); in mm_pm_get_if_in_use()
130 static int mm_pm_put(struct hw_sema_t *sema, enum cmd_source id) in mm_pm_put() argument
137 count = vote_count(sema); in mm_pm_put()
139 __func__, sema->id, id, sema->vote[id], count, ret); in mm_pm_put()