162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-or-later */
262306a36Sopenharmony_ci/*
362306a36Sopenharmony_ci    interrupt handling
462306a36Sopenharmony_ci    Copyright (C) 2003-2004  Kevin Thayer <nufan_wfk at yahoo.com>
562306a36Sopenharmony_ci    Copyright (C) 2004  Chris Kennedy <c@groovy.org>
662306a36Sopenharmony_ci    Copyright (C) 2005-2007  Hans Verkuil <hverkuil@xs4all.nl>
762306a36Sopenharmony_ci
862306a36Sopenharmony_ci */
962306a36Sopenharmony_ci
1062306a36Sopenharmony_ci#ifndef IVTV_IRQ_H
1162306a36Sopenharmony_ci#define IVTV_IRQ_H
1262306a36Sopenharmony_ci
1362306a36Sopenharmony_ci#define IVTV_IRQ_ENC_START_CAP		BIT(31)
1462306a36Sopenharmony_ci#define IVTV_IRQ_ENC_EOS		BIT(30)
1562306a36Sopenharmony_ci#define IVTV_IRQ_ENC_VBI_CAP		BIT(29)
1662306a36Sopenharmony_ci#define IVTV_IRQ_ENC_VIM_RST		BIT(28)
1762306a36Sopenharmony_ci#define IVTV_IRQ_ENC_DMA_COMPLETE	BIT(27)
1862306a36Sopenharmony_ci#define IVTV_IRQ_ENC_PIO_COMPLETE	BIT(25)
1962306a36Sopenharmony_ci#define IVTV_IRQ_DEC_AUD_MODE_CHG	BIT(24)
2062306a36Sopenharmony_ci#define IVTV_IRQ_DEC_DATA_REQ		BIT(22)
2162306a36Sopenharmony_ci#define IVTV_IRQ_DEC_DMA_COMPLETE	BIT(20)
2262306a36Sopenharmony_ci#define IVTV_IRQ_DEC_VBI_RE_INSERT	BIT(19)
2362306a36Sopenharmony_ci#define IVTV_IRQ_DMA_ERR		BIT(18)
2462306a36Sopenharmony_ci#define IVTV_IRQ_DMA_WRITE		BIT(17)
2562306a36Sopenharmony_ci#define IVTV_IRQ_DMA_READ		BIT(16)
2662306a36Sopenharmony_ci#define IVTV_IRQ_DEC_VSYNC		BIT(10)
2762306a36Sopenharmony_ci
2862306a36Sopenharmony_ci/* IRQ Masks */
2962306a36Sopenharmony_ci#define IVTV_IRQ_MASK_INIT (IVTV_IRQ_DMA_ERR|IVTV_IRQ_ENC_DMA_COMPLETE|\
3062306a36Sopenharmony_ci		IVTV_IRQ_DMA_READ|IVTV_IRQ_ENC_PIO_COMPLETE)
3162306a36Sopenharmony_ci
3262306a36Sopenharmony_ci#define IVTV_IRQ_MASK_CAPTURE (IVTV_IRQ_ENC_START_CAP | IVTV_IRQ_ENC_EOS)
3362306a36Sopenharmony_ci#define IVTV_IRQ_MASK_DECODE  (IVTV_IRQ_DEC_DATA_REQ|IVTV_IRQ_DEC_AUD_MODE_CHG)
3462306a36Sopenharmony_ci
3562306a36Sopenharmony_ciirqreturn_t ivtv_irq_handler(int irq, void *dev_id);
3662306a36Sopenharmony_ci
3762306a36Sopenharmony_civoid ivtv_irq_work_handler(struct kthread_work *work);
3862306a36Sopenharmony_civoid ivtv_dma_stream_dec_prepare(struct ivtv_stream *s, u32 offset, int lock);
3962306a36Sopenharmony_civoid ivtv_unfinished_dma(struct timer_list *t);
4062306a36Sopenharmony_ci
4162306a36Sopenharmony_ci#endif
42