path: root/drivers/media/platform/sti/delta/delta-v4l2.c
diff options
authorHugues Fruchet <hugues.fruchet@st.com>2017-02-02 12:59:50 -0200
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2017-02-08 10:03:49 -0200
commit91c83f395fbe7c89eca46ad2d5bde49f4f8de2c4 (patch)
treebbaf771cc11a93457f5492bc6eb57fa4d9d13f81 /drivers/media/platform/sti/delta/delta-v4l2.c
parentc502e583506ec94cee780c080fff7b4e9ef6ef61 (diff)
[media] st-delta: rpmsg ipc support
IPC (Inter Process Communication) support for communication with DELTA coprocessor firmware using rpmsg kernel framework. Based on 4 services open/set_stream/decode/close and their associated rpmsg messages. The messages structures are duplicated on both host and firmware side and are packed (use only of 32 bits size fields in messages structures to ensure packing). Each service is synchronous; service returns only when firmware acknowledges the associated command message. Due to significant parameters size exchanged from host to copro, parameters are not inserted in rpmsg messages. Instead, parameters are stored in physical memory shared between host and coprocessor. Memory is non-cacheable, so no special operation is required to ensure memory coherency on host and on coprocessor side. Multi-instance support and re-entrance are ensured using host_hdl and copro_hdl in message header exchanged between both host and coprocessor. This avoids to manage tables on both sides to get back the running context of each instance. Acked-by: Peter Griffin <peter.griffin@linaro.org> Signed-off-by: Hugues Fruchet <hugues.fruchet@st.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media/platform/sti/delta/delta-v4l2.c')
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/media/platform/sti/delta/delta-v4l2.c b/drivers/media/platform/sti/delta/delta-v4l2.c
index e65a3a327724..237a938a9e6b 100644
--- a/drivers/media/platform/sti/delta/delta-v4l2.c
+++ b/drivers/media/platform/sti/delta/delta-v4l2.c
@@ -17,6 +17,7 @@
#include <media/videobuf2-dma-contig.h>
#include "delta.h"
+#include "delta-ipc.h"
#define DELTA_NAME "st-delta"
@@ -1703,6 +1704,14 @@ static int delta_probe(struct platform_device *pdev)
+ /* init firmware ipc channel */
+ ret = delta_ipc_init(delta);
+ if (ret) {
+ dev_err(delta->dev, "%s failed to initialize firmware ipc channel\n",
+ goto err;
+ }
/* register all available decoders */
@@ -1747,6 +1756,8 @@ static int delta_remove(struct platform_device *pdev)
struct delta_dev *delta = platform_get_drvdata(pdev);
+ delta_ipc_exit(delta);