[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20220506052819.192151-1-ian@linux.cowan.aero>
Date: Fri, 6 May 2022 01:28:19 -0400
From: Ian Cowan <ian@...ux.cowan.aero>
To: Corentin Labbe <clabbe@...libre.com>
Cc: Mauro Carvalho Chehab <mchehab@...nel.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
mjpeg-users@...ts.sourceforge.net, linux-media@...r.kernel.org,
linux-staging@...ts.linux.dev, linux-kernel@...r.kernel.org,
Ian Cowan <ian@...ux.cowan.aero>
Subject: [PATCH v3 2/4] staging: media: zoran: setup videocodec header for debugging macros
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@...ux.cowan.aero>
---
drivers/staging/media/zoran/videocodec.h | 15 +++++++++++++++
drivers/staging/media/zoran/zoran.h | 1 +
2 files changed, 16 insertions(+)
diff --git a/drivers/staging/media/zoran/videocodec.h b/drivers/staging/media/zoran/videocodec.h
index 9dea348fee40..5e6057edd339 100644
--- a/drivers/staging/media/zoran/videocodec.h
+++ b/drivers/staging/media/zoran/videocodec.h
@@ -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 */
diff --git a/drivers/staging/media/zoran/zoran.h b/drivers/staging/media/zoran/zoran.h
index 4f7f71d8e93c..2a8635d08b73 100644
--- a/drivers/staging/media/zoran/zoran.h
+++ b/drivers/staging/media/zoran/zoran.h
@@ -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>
--
2.35.1
Powered by blists - more mailing lists