aboutsummaryrefslogtreecommitdiffstats
path: root/include/media
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>2015-11-03 00:27:51 -0200
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2016-09-09 11:20:09 -0300
commit68429f50ab60074e58b98010103fcc5bac4afd54 (patch)
tree79238fd7fd84b0d20692ef653c735c0fe22dfc57 /include/media
parent[media] smiapp: Add support for 14 and 16 bits per sample depths (diff)
downloadlinux-dev-68429f50ab60074e58b98010103fcc5bac4afd54.tar.xz
linux-dev-68429f50ab60074e58b98010103fcc5bac4afd54.zip
[media] media: Move media_device link_notify operation to an ops structure
This will allow adding new operations without increasing the media_device structure size for drivers that don't implement any media device operation. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'include/media')
-rw-r--r--include/media/media-device.h16
1 files changed, 12 insertions, 4 deletions
diff --git a/include/media/media-device.h b/include/media/media-device.h
index 481dd6c672cb..ef93e21335df 100644
--- a/include/media/media-device.h
+++ b/include/media/media-device.h
@@ -49,6 +49,16 @@ struct media_entity_notify {
};
/**
+ * struct media_device_ops - Media device operations
+ * @link_notify: Link state change notification callback. This callback is
+ * called with the graph_mutex held.
+ */
+struct media_device_ops {
+ int (*link_notify)(struct media_link *link, u32 flags,
+ unsigned int notification);
+};
+
+/**
* struct media_device - Media device
* @dev: Parent device
* @devnode: Media device node
@@ -80,8 +90,7 @@ struct media_entity_notify {
* @enable_source: Enable Source Handler function pointer
* @disable_source: Disable Source Handler function pointer
*
- * @link_notify: Link state change notification callback. This callback is
- * called with the graph_mutex held.
+ * @ops: Operation handler callbacks
*
* This structure represents an abstract high-level media device. It allows easy
* access to entities and provides basic media device-level support. The
@@ -150,8 +159,7 @@ struct media_device {
struct media_pipeline *pipe);
void (*disable_source)(struct media_entity *entity);
- int (*link_notify)(struct media_link *link, u32 flags,
- unsigned int notification);
+ const struct media_device_ops *ops;
};
/* We don't need to include pci.h or usb.h here */