summaryrefslogtreecommitdiffstats
path: root/include/media
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@osg.samsung.com>2016-02-05 13:16:18 -0200
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2016-02-10 07:23:44 -0200
commit7047f2982a223e0ecca480c11a37bd9edf62b65a (patch)
tree9b0db4e7a89f338b3b39e747fa2d70f07da3166b /include/media
parent8bf77f9e7013e46ca08151189357532f027c47e8 (diff)
downloadop-kernel-dev-7047f2982a223e0ecca480c11a37bd9edf62b65a.zip
op-kernel-dev-7047f2982a223e0ecca480c11a37bd9edf62b65a.tar.gz
[media] v4l2-mc: add an ancillary routine for PCI-based MC
Instead of copyping the same code on all PCI devices that would have a media controller, add a core ancillary routine. Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'include/media')
-rw-r--r--include/media/v4l2-mc.h24
1 files changed, 23 insertions, 1 deletions
diff --git a/include/media/v4l2-mc.h b/include/media/v4l2-mc.h
index aed9e9b..6fad972 100644
--- a/include/media/v4l2-mc.h
+++ b/include/media/v4l2-mc.h
@@ -92,6 +92,10 @@ enum demod_pad_index {
DEMOD_NUM_PADS
};
+
+struct pci_dev; /* We don't need to include pci.h here */
+
+#ifdef CONFIG_MEDIA_CONTROLLER
/**
* v4l2_mc_create_media_graph() - create Media Controller links at the graph.
*
@@ -106,11 +110,29 @@ enum demod_pad_index {
* interface centric PC-consumer's hardware, V4L2 subdev centric camera
* hardware should not use this routine, as it will not build the right graph.
*/
-#ifdef CONFIG_MEDIA_CONTROLLER
int v4l2_mc_create_media_graph(struct media_device *mdev);
+
+/**
+ * v4l2_mc_pci_media_device_init() - create and initialize a
+ * struct &media_device from a PCI device.
+ *
+ * @pci_dev: pointer to struct pci_dev
+ * @name: media device name. If %NULL, the routine will use the default
+ * name for the pci device, given by pci_name() macro.
+ */
+struct media_device *v4l2_mc_pci_media_device_init(struct pci_dev *pci_dev,
+ char *name);
+
+
#else
static inline int v4l2_mc_create_media_graph(struct media_device *mdev)
{
return 0;
}
+
+struct media_device *v4l2_mc_pci_media_device_init(struct pci_dev *pci_dev,
+ char *name) {
+ return NULL;
+}
+
#endif
OpenPOWER on IntegriCloud