From 4d20d087db46ee58e2d00d494c34f3dcd4218c78 Mon Sep 17 00:00:00 2001 From: Philipp Zabel Date: Wed, 12 Jun 2019 05:39:09 -0400 Subject: media: hantro: make irq names configurable The i.MX8MQ bindings will use different IRQ names ("g1" instead of "vdpu", and "g2"), so make them configurable. This also allows to register more than two IRQs, which will be required for i.MX8MM support later (it will add "h1" instead of "vepu"). Signed-off-by: Philipp Zabel Reviewed-by: Boris Brezillon Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- drivers/staging/media/hantro/hantro.h | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'drivers/staging/media/hantro/hantro.h') diff --git a/drivers/staging/media/hantro/hantro.h b/drivers/staging/media/hantro/hantro.h index 296b9ffad547..d041d36a0805 100644 --- a/drivers/staging/media/hantro/hantro.h +++ b/drivers/staging/media/hantro/hantro.h @@ -44,6 +44,17 @@ struct hantro_codec_ops; #define HANTRO_MPEG2_DECODER BIT(16) #define HANTRO_DECODERS 0xffff0000 +/** + * struct hantro_irq - irq handler and name + * + * @name: irq name for device tree lookup + * @handler: interrupt handler + */ +struct hantro_irq { + const char *name; + irqreturn_t (*handler)(int irq, void *priv); +}; + /** * struct hantro_variant - information about VPU hardware variant * @@ -57,8 +68,8 @@ struct hantro_codec_ops; * @codec_ops: Codec ops. * @init: Initialize hardware. * @runtime_resume: reenable hardware after power gating - * @vepu_irq: encoder interrupt handler - * @vdpu_irq: decoder interrupt handler + * @irqs: array of irq names and interrupt handlers + * @num_irqs: number of irqs in the array * @clk_names: array of clock names * @num_clocks: number of clocks in the array */ @@ -73,8 +84,8 @@ struct hantro_variant { const struct hantro_codec_ops *codec_ops; int (*init)(struct hantro_dev *vpu); int (*runtime_resume)(struct hantro_dev *vpu); - irqreturn_t (*vepu_irq)(int irq, void *priv); - irqreturn_t (*vdpu_irq)(int irq, void *priv); + const struct hantro_irq *irqs; + int num_irqs; const char *clk_names[HANTRO_MAX_CLOCKS]; int num_clocks; }; -- cgit