Lines Matching refs:mb
131 static int try_mailbox(struct ivtv *itv, struct ivtv_mailbox_data *mbdata, int mb) in try_mailbox() argument
133 u32 flags = readl(&mbdata->mbox[mb].flags); in try_mailbox()
137 if (is_free && !test_and_set_bit(mb, &mbdata->busy)) { in try_mailbox()
138 write_sync(IVTV_MBOX_DRIVER_BUSY, &mbdata->mbox[mb].flags); in try_mailbox()
149 int i, mb; in get_mailbox() local
160 for (mb = 1; mb <= max_mbox; mb++) in get_mailbox()
161 if (try_mailbox(itv, mbdata, mb)) in get_mailbox()
162 return mb; in get_mailbox()
205 int flags, mb, i; in ivtv_api_call() local
246 mb = i % (mbdata->max_mbox + 1); in ivtv_api_call()
247 if (try_mailbox(itv, mbdata, mb)) { in ivtv_api_call()
248 write_mailbox(&mbdata->mbox[mb], cmd, args, data); in ivtv_api_call()
249 clear_bit(mb, &mbdata->busy); in ivtv_api_call()
253 api_info[cmd].name, mb, readl(&mbdata->mbox[mb].flags)); in ivtv_api_call()
263 mb = get_mailbox(itv, mbdata, flags); in ivtv_api_call()
264 if (mb < 0) { in ivtv_api_call()
269 mbox = &mbdata->mbox[mb]; in ivtv_api_call()
276 clear_bit(mb, &mbdata->busy); in ivtv_api_call()
295 clear_bit(mb, &mbdata->busy); in ivtv_api_call()
311 clear_bit(mb, &mbdata->busy); in ivtv_api_call()
358 void ivtv_api_get_data(struct ivtv_mailbox_data *mbdata, int mb, in ivtv_api_get_data() argument
361 volatile u32 __iomem *p = mbdata->mbox[mb].data; in ivtv_api_get_data()