Lines Matching full:cx
105 static void dump_mb(struct cx18 *cx, struct cx18_mailbox *mb, char *name) in dump_mb() argument
204 static void cx18_mdl_send_to_alsa(struct cx18 *cx, struct cx18_stream *s, in cx18_mdl_send_to_alsa() argument
219 cx->pcm_announce_callback(cx->alsa, buf->buf, in cx18_mdl_send_to_alsa()
227 cx->pcm_announce_callback(cx->alsa, buf->buf, buf->bytesused); in cx18_mdl_send_to_alsa()
231 static void epu_dma_done(struct cx18 *cx, struct cx18_in_work_order *order) in epu_dma_done() argument
242 s = cx18_handle_to_stream(cx, handle); in epu_dma_done()
301 if (cx->pcm_announce_callback != NULL) { in epu_dma_done()
302 cx18_mdl_send_to_alsa(cx, s, mdl); in epu_dma_done()
313 cx18_stream_rotate_idx_mdls(cx); in epu_dma_done()
319 wake_up(&cx->dma_waitq); in epu_dma_done()
324 static void epu_debug(struct cx18 *cx, struct cx18_in_work_order *order) in epu_debug() argument
331 if (!test_bit(CX18_F_I_LOADED_FW, &cx->i_flags) && p && p > str) in epu_debug()
335 static void epu_cmd(struct cx18 *cx, struct cx18_in_work_order *order) in epu_cmd() argument
342 epu_dma_done(cx, order); in epu_cmd()
345 epu_debug(cx, order); in epu_cmd()
364 void free_in_work_order(struct cx18 *cx, struct cx18_in_work_order *order) in free_in_work_order() argument
373 struct cx18 *cx = order->cx; in cx18_in_work_handler() local
374 epu_cmd(cx, order); in cx18_in_work_handler()
375 free_in_work_order(cx, order); in cx18_in_work_handler()
383 static void mb_ack_irq(struct cx18 *cx, struct cx18_in_work_order *order) in mb_ack_irq() argument
391 ack_mb = &cx->scb->apu2epu_mb; in mb_ack_irq()
395 ack_mb = &cx->scb->cpu2epu_mb; in mb_ack_irq()
405 if (req != cx18_readl(cx, &ack_mb->request) || in mb_ack_irq()
406 req == cx18_readl(cx, &ack_mb->ack)) { in mb_ack_irq()
412 cx18_writel(cx, req, &ack_mb->ack); in mb_ack_irq()
413 cx18_write_reg_expect(cx, ack_irq, SW2_INT_SET, ack_irq, ack_irq); in mb_ack_irq()
417 static int epu_dma_done_irq(struct cx18 *cx, struct cx18_in_work_order *order) in epu_dma_done_irq() argument
431 mb_ack_irq(cx, order); in epu_dma_done_irq()
437 cx18_readl(cx, cx->enc_mem + mdl_ack_offset + i); in epu_dma_done_irq()
440 mb_ack_irq(cx, order); in epu_dma_done_irq()
445 int epu_debug_irq(struct cx18 *cx, struct cx18_in_work_order *order) in epu_debug_irq() argument
453 cx18_setup_page(cx, str_offset); in epu_debug_irq()
454 cx18_memcpy_fromio(cx, str, cx->enc_mem + str_offset, 252); in epu_debug_irq()
456 cx18_setup_page(cx, SCB_OFFSET); in epu_debug_irq()
460 mb_ack_irq(cx, order); in epu_debug_irq()
466 int epu_cmd_irq(struct cx18 *cx, struct cx18_in_work_order *order) in epu_cmd_irq() argument
475 ret = epu_dma_done_irq(cx, order); in epu_cmd_irq()
478 ret = epu_debug_irq(cx, order); in epu_cmd_irq()
498 struct cx18_in_work_order *alloc_in_work_order_irq(struct cx18 *cx) in alloc_in_work_order_irq() argument
512 if (atomic_read(&cx->in_work_order[i].pending) == 0) { in alloc_in_work_order_irq()
513 order = &cx->in_work_order[i]; in alloc_in_work_order_irq()
521 void cx18_api_epu_cmd_irq(struct cx18 *cx, int rpu) in cx18_api_epu_cmd_irq() argument
531 mb = &cx->scb->cpu2epu_mb; in cx18_api_epu_cmd_irq()
534 mb = &cx->scb->apu2epu_mb; in cx18_api_epu_cmd_irq()
540 order = alloc_in_work_order_irq(cx); in cx18_api_epu_cmd_irq()
552 (&order_mb->cmd)[i] = cx18_readl(cx, &mb->cmd + i); in cx18_api_epu_cmd_irq()
556 (&order_mb->request)[i] = cx18_readl(cx, &mb->request + i); in cx18_api_epu_cmd_irq()
562 dump_mb(cx, order_mb, "incoming"); in cx18_api_epu_cmd_irq()
570 submit = epu_cmd_irq(cx, order); in cx18_api_epu_cmd_irq()
572 queue_work(cx->in_work_queue, &order->work); in cx18_api_epu_cmd_irq()
581 static int cx18_api_call(struct cx18 *cx, u32 cmd, int args, u32 data[]) in cx18_api_call() argument
612 waitq = &cx->mb_apu_waitq; in cx18_api_call()
613 mb_lock = &cx->epu2apu_mb_lock; in cx18_api_call()
615 mb = &cx->scb->epu2apu_mb; in cx18_api_call()
618 waitq = &cx->mb_cpu_waitq; in cx18_api_call()
619 mb_lock = &cx->epu2cpu_mb_lock; in cx18_api_call()
621 mb = &cx->scb->epu2cpu_mb; in cx18_api_call()
639 req = cx18_readl(cx, &mb->request); in cx18_api_call()
642 (ack = cx18_readl(cx, &mb->ack)) == req, in cx18_api_call()
646 cx18_writel(cx, req, &mb->ack); in cx18_api_call()
656 cx18_writel(cx, cmd, &mb->cmd); in cx18_api_call()
658 cx18_writel(cx, data[i], &mb->args[i]); in cx18_api_call()
659 cx18_writel(cx, 0, &mb->error); in cx18_api_call()
660 cx18_writel(cx, req, &mb->request); in cx18_api_call()
661 cx18_writel(cx, req - 1, &mb->ack); /* ensure ack & req are distinct */ in cx18_api_call()
673 cx18_write_reg_expect(cx, irq, SW1_INT_SET, irq, irq); in cx18_api_call()
676 ack = cx18_readl(cx, &mb->ack); in cx18_api_call()
680 ack = cx18_readl(cx, &mb->ack); in cx18_api_call()
711 data[i] = cx18_readl(cx, &mb->args[i]); in cx18_api_call()
712 err = cx18_readl(cx, &mb->error); in cx18_api_call()
729 int cx18_api(struct cx18 *cx, u32 cmd, int args, u32 data[]) in cx18_api() argument
731 return cx18_api_call(cx, cmd, args, data); in cx18_api()
736 struct cx18 *cx = s->cx; in cx18_set_filter_param() local
740 mode = (cx->filter_mode & 1) ? 2 : (cx->spatial_strength ? 1 : 0); in cx18_set_filter_param()
741 ret = cx18_vapi(cx, CX18_CPU_SET_FILTER_PARAM, 4, in cx18_set_filter_param()
742 s->handle, 1, mode, cx->spatial_strength); in cx18_set_filter_param()
743 mode = (cx->filter_mode & 2) ? 2 : (cx->temporal_strength ? 1 : 0); in cx18_set_filter_param()
744 ret = ret ? ret : cx18_vapi(cx, CX18_CPU_SET_FILTER_PARAM, 4, in cx18_set_filter_param()
745 s->handle, 0, mode, cx->temporal_strength); in cx18_set_filter_param()
746 ret = ret ? ret : cx18_vapi(cx, CX18_CPU_SET_FILTER_PARAM, 4, in cx18_set_filter_param()
747 s->handle, 2, cx->filter_mode >> 2, 0); in cx18_set_filter_param()
755 struct cx18 *cx = s->cx; in cx18_api_func() local
761 return cx18_vapi(cx, CX18_CPU_SET_VIDEO_IN, 6, in cx18_api_func()
764 return cx18_vapi(cx, CX18_CPU_SET_VIDEO_RESOLUTION, 3, in cx18_api_func()
767 return cx18_vapi(cx, CX18_CPU_SET_STREAM_OUTPUT_TYPE, 2, in cx18_api_func()
770 return cx18_vapi(cx, CX18_CPU_SET_ASPECT_RATIO, 2, in cx18_api_func()
774 return cx18_vapi(cx, CX18_CPU_SET_GOP_STRUCTURE, 3, in cx18_api_func()
779 return cx18_vapi(cx, CX18_CPU_SET_AUDIO_PARAMETERS, 2, in cx18_api_func()
782 return cx18_vapi(cx, CX18_CPU_SET_AUDIO_MUTE, 2, in cx18_api_func()
785 return cx18_vapi(cx, CX18_CPU_SET_VIDEO_RATE, 5, in cx18_api_func()
788 return cx18_vapi(cx, CX18_CPU_SET_VIDEO_MUTE, 2, in cx18_api_func()
791 return cx18_vapi(cx, CX18_CPU_SET_SKIP_INPUT_FRAME, 2, in cx18_api_func()
794 return cx18_vapi(cx, CX18_CPU_SET_MISC_PARAMETERS, 4, in cx18_api_func()
797 cx->filter_mode = (data[0] & 3) | (data[1] << 2); in cx18_api_func()
800 cx->spatial_strength = data[0]; in cx18_api_func()
801 cx->temporal_strength = data[1]; in cx18_api_func()
804 return cx18_vapi(cx, CX18_CPU_SET_SPATIAL_FILTER_TYPE, 3, in cx18_api_func()
807 return cx18_vapi(cx, CX18_CPU_SET_MEDIAN_CORING, 5, in cx18_api_func()
814 int cx18_vapi_result(struct cx18 *cx, u32 data[MAX_MB_ARGUMENTS], in cx18_vapi_result() argument
824 return cx18_api(cx, cmd, args, data); in cx18_vapi_result()
827 int cx18_vapi(struct cx18 *cx, u32 cmd, int args, ...) in cx18_vapi() argument
833 if (cx == NULL) { in cx18_vapi()
834 CX18_ERR("cx == NULL (cmd=%x)\n", cmd); in cx18_vapi()
845 return cx18_api(cx, cmd, args, data); in cx18_vapi()