summaryrefslogtreecommitdiffstats
path: root/drivers/staging/media/hantro/imx8m_vpu_hw.c
diff options
context:
space:
mode:
authorEmil Velikov <emil.velikov@collabora.com>2021-04-01 16:43:32 +0200
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>2021-05-19 09:51:40 +0200
commitbbc42ab0da985f538eefe1b470a610624e53829f (patch)
tree5a479c51cd8b1ca44db1659e7d694cee2e3a1bec /drivers/staging/media/hantro/imx8m_vpu_hw.c
parentd72a96b6c053dca29e7b2a94fb700f4960ce9834 (diff)
downloadlinux-bbc42ab0da985f538eefe1b470a610624e53829f.tar.bz2
media: hantro: introduce hantro_g1.c for common API
The Hantro G1 IRQ and reset handling is pretty standard. I was this close to duplicating it, yet again, before reconsidering and refactoring it to a separate file. Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com> Reviewed-by: Ezequiel Garcia <ezequiel@collabora.com> Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Diffstat (limited to 'drivers/staging/media/hantro/imx8m_vpu_hw.c')
-rw-r--r--drivers/staging/media/hantro/imx8m_vpu_hw.c21
1 files changed, 1 insertions, 20 deletions
diff --git a/drivers/staging/media/hantro/imx8m_vpu_hw.c b/drivers/staging/media/hantro/imx8m_vpu_hw.c
index f36c1bd681ba..9eb556460e52 100644
--- a/drivers/staging/media/hantro/imx8m_vpu_hw.c
+++ b/drivers/staging/media/hantro/imx8m_vpu_hw.c
@@ -9,7 +9,6 @@
#include <linux/delay.h>
#include "hantro.h"
-#include "hantro_g1_regs.h"
#define CTRL_SOFT_RESET 0x00
#define RESET_G1 BIT(1)
@@ -129,24 +128,6 @@ static const struct hantro_fmt imx8m_vpu_dec_fmts[] = {
},
};
-static irqreturn_t imx8m_vpu_g1_irq(int irq, void *dev_id)
-{
- struct hantro_dev *vpu = dev_id;
- enum vb2_buffer_state state;
- u32 status;
-
- status = vdpu_read(vpu, G1_REG_INTERRUPT);
- state = (status & G1_REG_INTERRUPT_DEC_RDY_INT) ?
- VB2_BUF_STATE_DONE : VB2_BUF_STATE_ERROR;
-
- vdpu_write(vpu, 0, G1_REG_INTERRUPT);
- vdpu_write(vpu, G1_REG_CONFIG_DEC_CLK_GATE_E, G1_REG_CONFIG);
-
- hantro_irq_done(vpu, state);
-
- return IRQ_HANDLED;
-}
-
static int imx8mq_vpu_hw_init(struct hantro_dev *vpu)
{
vpu->ctrl_base = vpu->reg_bases[vpu->variant->num_regs - 1];
@@ -191,7 +172,7 @@ static const struct hantro_codec_ops imx8mq_vpu_codec_ops[] = {
*/
static const struct hantro_irq imx8mq_irqs[] = {
- { "g1", imx8m_vpu_g1_irq },
+ { "g1", hantro_g1_irq },
{ "g2", NULL /* TODO: imx8m_vpu_g2_irq */ },
};