18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-or-later */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci    interrupt handling
48c2ecf20Sopenharmony_ci    Copyright (C) 2003-2004  Kevin Thayer <nufan_wfk at yahoo.com>
58c2ecf20Sopenharmony_ci    Copyright (C) 2004  Chris Kennedy <c@groovy.org>
68c2ecf20Sopenharmony_ci    Copyright (C) 2005-2007  Hans Verkuil <hverkuil@xs4all.nl>
78c2ecf20Sopenharmony_ci
88c2ecf20Sopenharmony_ci */
98c2ecf20Sopenharmony_ci
108c2ecf20Sopenharmony_ci#ifndef IVTV_IRQ_H
118c2ecf20Sopenharmony_ci#define IVTV_IRQ_H
128c2ecf20Sopenharmony_ci
138c2ecf20Sopenharmony_ci#define IVTV_IRQ_ENC_START_CAP		BIT(31)
148c2ecf20Sopenharmony_ci#define IVTV_IRQ_ENC_EOS		BIT(30)
158c2ecf20Sopenharmony_ci#define IVTV_IRQ_ENC_VBI_CAP		BIT(29)
168c2ecf20Sopenharmony_ci#define IVTV_IRQ_ENC_VIM_RST		BIT(28)
178c2ecf20Sopenharmony_ci#define IVTV_IRQ_ENC_DMA_COMPLETE	BIT(27)
188c2ecf20Sopenharmony_ci#define IVTV_IRQ_ENC_PIO_COMPLETE	BIT(25)
198c2ecf20Sopenharmony_ci#define IVTV_IRQ_DEC_AUD_MODE_CHG	BIT(24)
208c2ecf20Sopenharmony_ci#define IVTV_IRQ_DEC_DATA_REQ		BIT(22)
218c2ecf20Sopenharmony_ci#define IVTV_IRQ_DEC_DMA_COMPLETE	BIT(20)
228c2ecf20Sopenharmony_ci#define IVTV_IRQ_DEC_VBI_RE_INSERT	BIT(19)
238c2ecf20Sopenharmony_ci#define IVTV_IRQ_DMA_ERR		BIT(18)
248c2ecf20Sopenharmony_ci#define IVTV_IRQ_DMA_WRITE		BIT(17)
258c2ecf20Sopenharmony_ci#define IVTV_IRQ_DMA_READ		BIT(16)
268c2ecf20Sopenharmony_ci#define IVTV_IRQ_DEC_VSYNC		BIT(10)
278c2ecf20Sopenharmony_ci
288c2ecf20Sopenharmony_ci/* IRQ Masks */
298c2ecf20Sopenharmony_ci#define IVTV_IRQ_MASK_INIT (IVTV_IRQ_DMA_ERR|IVTV_IRQ_ENC_DMA_COMPLETE|\
308c2ecf20Sopenharmony_ci		IVTV_IRQ_DMA_READ|IVTV_IRQ_ENC_PIO_COMPLETE)
318c2ecf20Sopenharmony_ci
328c2ecf20Sopenharmony_ci#define IVTV_IRQ_MASK_CAPTURE (IVTV_IRQ_ENC_START_CAP | IVTV_IRQ_ENC_EOS)
338c2ecf20Sopenharmony_ci#define IVTV_IRQ_MASK_DECODE  (IVTV_IRQ_DEC_DATA_REQ|IVTV_IRQ_DEC_AUD_MODE_CHG)
348c2ecf20Sopenharmony_ci
358c2ecf20Sopenharmony_ciirqreturn_t ivtv_irq_handler(int irq, void *dev_id);
368c2ecf20Sopenharmony_ci
378c2ecf20Sopenharmony_civoid ivtv_irq_work_handler(struct kthread_work *work);
388c2ecf20Sopenharmony_civoid ivtv_dma_stream_dec_prepare(struct ivtv_stream *s, u32 offset, int lock);
398c2ecf20Sopenharmony_civoid ivtv_unfinished_dma(struct timer_list *t);
408c2ecf20Sopenharmony_ci
418c2ecf20Sopenharmony_ci#endif
42