media: mtk-vpu: change return type for ipi handler
Change the return type of the ipi_handler. Some IPI handler will
return some value that will be interpreted by the VPU/VCU.
Signed-off-by: Fabien Parent <fparent@baylibre.com>
diff --git a/drivers/media/platform/mtk-mdp/mtk_mdp_vpu.c b/drivers/media/platform/mtk-mdp/mtk_mdp_vpu.c
index 317ea67..bff7b24 100644
--- a/drivers/media/platform/mtk-mdp/mtk_mdp_vpu.c
+++ b/drivers/media/platform/mtk-mdp/mtk_mdp_vpu.c
@@ -44,7 +44,7 @@
}
}
-static void mtk_mdp_vpu_ipi_handler(void *data, unsigned int len, void *priv)
+static int mtk_mdp_vpu_ipi_handler(void *data, unsigned int len, void *priv)
{
unsigned int msg_id = *(unsigned int *)data;
struct mdp_ipi_comm_ack *msg = (struct mdp_ipi_comm_ack *)data;
@@ -74,6 +74,8 @@
mtk_mdp_dbg(0, "[%d]:msg 0x%x, failure:%d", ctx->id,
msg_id, vpu->failure);
}
+
+ return 0;
}
int mtk_mdp_vpu_register(struct platform_device *pdev)
diff --git a/drivers/media/platform/mtk-vcodec/vdec_vpu_if.c b/drivers/media/platform/mtk-vcodec/vdec_vpu_if.c
index 1abd14e..7d00857 100644
--- a/drivers/media/platform/mtk-vcodec/vdec_vpu_if.c
+++ b/drivers/media/platform/mtk-vcodec/vdec_vpu_if.c
@@ -36,7 +36,7 @@
* This function runs in interrupt context and it means there's an IPI MSG
* from VPU.
*/
-void vpu_dec_ipi_handler(void *data, unsigned int len, void *priv)
+int vpu_dec_ipi_handler(void *data, unsigned int len, void *priv)
{
struct vdec_vpu_ipi_ack *msg = data;
struct vdec_vpu_inst *vpu = (struct vdec_vpu_inst *)
@@ -65,6 +65,8 @@
mtk_vcodec_debug(vpu, "- id=%X", msg->msg_id);
vpu->failure = msg->status;
vpu->signaled = 1;
+
+ return 0;
}
static int vcodec_vpu_send_msg(struct vdec_vpu_inst *vpu, void *msg, int len)
diff --git a/drivers/media/platform/mtk-vcodec/vdec_vpu_if.h b/drivers/media/platform/mtk-vcodec/vdec_vpu_if.h
index cd37bb2..b2a0c07 100644
--- a/drivers/media/platform/mtk-vcodec/vdec_vpu_if.h
+++ b/drivers/media/platform/mtk-vcodec/vdec_vpu_if.h
@@ -91,6 +91,6 @@
* @len : length of ipi message
* @priv: callback private data which is passed by decoder when register.
*/
-void vpu_dec_ipi_handler(void *data, unsigned int len, void *priv);
+int vpu_dec_ipi_handler(void *data, unsigned int len, void *priv);
#endif
diff --git a/drivers/media/platform/mtk-vcodec/venc_vpu_if.c b/drivers/media/platform/mtk-vcodec/venc_vpu_if.c
index 0d882ac..fb85ba5 100644
--- a/drivers/media/platform/mtk-vcodec/venc_vpu_if.c
+++ b/drivers/media/platform/mtk-vcodec/venc_vpu_if.c
@@ -34,7 +34,7 @@
vpu->is_key_frm = msg->is_key_frm;
}
-static void vpu_enc_ipi_handler(void *data, unsigned int len, void *priv)
+static int vpu_enc_ipi_handler(void *data, unsigned int len, void *priv)
{
struct venc_vpu_ipi_msg_common *msg = data;
struct venc_vpu_inst *vpu =
@@ -63,6 +63,8 @@
vpu->failure = (msg->status != VENC_IPI_MSG_STATUS_OK);
mtk_vcodec_debug_leave(vpu);
+
+ return 0;
}
static int vpu_enc_send_msg(struct venc_vpu_inst *vpu, void *msg,
diff --git a/drivers/media/platform/mtk-vpu/mtk_vcu.c b/drivers/media/platform/mtk-vpu/mtk_vcu.c
index 06d08c2..ee03d3c 100644
--- a/drivers/media/platform/mtk-vpu/mtk_vcu.c
+++ b/drivers/media/platform/mtk-vpu/mtk_vcu.c
@@ -514,7 +514,7 @@
return 0;
}
-static void vcu_init_ipi_handler(void *data, unsigned int len, void *priv)
+static int vcu_init_ipi_handler(void *data, unsigned int len, void *priv)
{
struct mtk_vcu *vcu = (struct mtk_vcu *)priv;
struct vcu_run *run = (struct vcu_run *)data;
@@ -541,6 +541,7 @@
dev_dbg(vcu->dev, "[VCU] fw ver: %s\n", vcu->run.fw_ver);
dev_dbg(vcu->dev, "[VCU] dec cap: %x\n", vcu->run.dec_capability);
dev_dbg(vcu->dev, "[VCU] enc cap: %x\n", vcu->run.enc_capability);
+ return 0;
}
static int mtk_vcu_open(struct inode *inode, struct file *file)
diff --git a/drivers/media/platform/mtk-vpu/mtk_vpu.c b/drivers/media/platform/mtk-vpu/mtk_vpu.c
index aecb52c..02da0ce 100644
--- a/drivers/media/platform/mtk-vpu/mtk_vpu.c
+++ b/drivers/media/platform/mtk-vpu/mtk_vpu.c
@@ -603,7 +603,7 @@
return ret;
}
-static void vpu_init_ipi_handler(void *data, unsigned int len, void *priv)
+static int vpu_init_ipi_handler(void *data, unsigned int len, void *priv)
{
struct mtk_vpu *vpu = (struct mtk_vpu *)priv;
struct vpu_run *run = (struct vpu_run *)data;
@@ -613,6 +613,8 @@
vpu->run.dec_capability = run->dec_capability;
vpu->run.enc_capability = run->enc_capability;
wake_up_interruptible(&vpu->run.wq);
+
+ return 0;
}
#ifdef CONFIG_DEBUG_FS
diff --git a/drivers/media/platform/mtk-vpu/mtk_vpu.h b/drivers/media/platform/mtk-vpu/mtk_vpu.h
index 29c60c4..c973e6e 100644
--- a/drivers/media/platform/mtk-vpu/mtk_vpu.h
+++ b/drivers/media/platform/mtk-vpu/mtk_vpu.h
@@ -23,7 +23,7 @@
* VPU interfaces with other blocks by share memory and interrupt.
**/
-typedef void (*ipi_handler_t) (void *data,
+typedef int (*ipi_handler_t) (void *data,
unsigned int len,
void *priv);