media: staging: media: zoran: setup videocodec header for debugging macros
authorIan Cowan <ian@linux.cowan.aero>
Fri, 6 May 2022 05:28:19 +0000 (06:28 +0100)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Mon, 20 Jun 2022 09:30:29 +0000 (10:30 +0100)
This adds inline functions in the videocodec header file to convert the
videocodec and videocodec_master structs to their respective contained
zoran struct. This will be used to pass the zoran struct to the
zrdev_XXX() macros defined in the zoran header.

In the zoran header, the new include is added to ensure all variables
can be completely defined with the zoran and videocodec includes where
they are located.

Signed-off-by: Ian Cowan <ian@linux.cowan.aero>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
drivers/staging/media/zoran/videocodec.h
drivers/staging/media/zoran/zoran.h

index 9dea348fee404b43a5d58cd1532c5d75d1f78bdb..5e6057edd33902b3c22dc2302933df8f51d8871b 100644 (file)
@@ -307,4 +307,19 @@ extern int videocodec_unregister(const struct videocodec *);
 
 int videocodec_debugfs_show(struct seq_file *m);
 
+#include "zoran.h"
+static inline struct zoran *videocodec_master_to_zoran(struct videocodec_master *master)
+{
+       struct zoran *zr = master->data;
+
+       return zr;
+}
+
+static inline struct zoran *videocodec_to_zoran(struct videocodec *codec)
+{
+       struct videocodec_master *master = codec->master_data;
+
+       return videocodec_master_to_zoran(master);
+}
+
 #endif                         /*ifndef __LINUX_VIDEOCODEC_H */
index 33ee10211543846347ad48085d2ab9c3250c0995..05227e5298f6088f43c8cc40c5880e577b0936c1 100644 (file)
@@ -20,6 +20,7 @@
 
 #include <linux/debugfs.h>
 #include <linux/pci.h>
+#include <linux/i2c-algo-bit.h>
 #include <media/v4l2-device.h>
 #include <media/v4l2-ctrls.h>
 #include <media/videobuf2-core.h>