summaryrefslogtreecommitdiff
path: root/drivers/staging/media/hantro/hantro.h
diff options
context:
space:
mode:
authorPhilipp Zabel <p.zabel@pengutronix.de>2019-06-12 05:39:09 -0400
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>2019-06-12 10:39:18 -0400
commit4d20d087db46ee58e2d00d494c34f3dcd4218c78 (patch)
treedd75212c4aae99ccd29d5cb70b0df30198bef234 /drivers/staging/media/hantro/hantro.h
parent0fd7ada14eefa99921fc24666ac93ca6931c09f0 (diff)
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 <p.zabel@pengutronix.de> Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to 'drivers/staging/media/hantro/hantro.h')
-rw-r--r--drivers/staging/media/hantro/hantro.h19
1 files changed, 15 insertions, 4 deletions
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
@@ -45,6 +45,17 @@ struct hantro_codec_ops;
#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
*
* @enc_offset: Offset from VPU base to encoder registers.
@@ -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;
};