[media] media-device: split media initialization and registration
[deliverable/linux.git] / include / media / media-device.h
index ebc2f3a239eb09a6298d057ddf66185d921acf13..e01bbc427fcd92f6b0f3f1f4795024fe1ebba9cd 100644 (file)
@@ -337,6 +337,32 @@ struct media_device {
 /* media_devnode to media_device */
 #define to_media_device(node) container_of(node, struct media_device, devnode)
 
+/**
+ * media_device_init() - Initializes a media device element
+ *
+ * @mdev:      pointer to struct &media_device
+ *
+ * This function initializes the media device prior to its registration.
+ * The media device initialization and registration is split in two functions
+ * to avoid race conditions and make the media device available to user-space
+ * before the media graph has been completed.
+ *
+ * So drivers need to first initialize the media device, register any entity
+ * within the media device, create pad to pad links and then finally register
+ * the media device by calling media_device_register() as a final step.
+ */
+void media_device_init(struct media_device *mdev);
+
+/**
+ * media_device_cleanup() - Cleanups a media device element
+ *
+ * @mdev:      pointer to struct &media_device
+ *
+ * This function that will destroy the graph_mutex that is
+ * initialized in media_device_init().
+ */
+void media_device_cleanup(struct media_device *mdev);
+
 /**
  * __media_device_register() - Registers a media device element
  *
This page took 0.035507 seconds and 5 git commands to generate.