Lines Matching +full:1 +full:mb

22 #define API_CACHE	 (1 << 0)	/* Allow the command to be stored in the cache */
23 #define API_RESULT (1 << 1) /* Allow 1 second for this cmd to end */
24 #define API_FAST_RESULT (3 << 1) /* Allow 0.1 second for this cmd to end */
25 #define API_DMA (1 << 3) /* DMA mailbox, has special handling */
26 #define API_HIGH_VOL (1 << 5) /* High volume command (i.e. called during encoding or decoding) */
27 #define API_NO_WAIT_MB (1 << 4) /* Command may not wait for a free mailbox */
28 #define API_NO_WAIT_RES (1 << 5) /* Command may not wait for the result */
29 #define API_NO_POLL (1 << 6) /* Avoid pointless polling */
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()
139 return 1; in try_mailbox()
149 int i, mb; in get_mailbox() local
156 max_mbox = 1; in get_mailbox()
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
215 IVTV_ERR("Invalid MB call: cmd = 0x%02x, args = %d\n", cmd, args); in ivtv_api_call()
220 IVTV_DEBUG_HI_MB("MB Call: %s\n", api_info[cmd].name); in ivtv_api_call()
223 IVTV_DEBUG_MB("MB Call: %s\n", api_info[cmd].name); in ivtv_api_call()
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()
299 mdelay(1); in ivtv_api_call()
301 ivtv_msleep_timeout(1, 0); 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()