diff options
author | Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> | 2015-11-02 21:27:51 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2016-09-09 10:20:09 -0400 |
commit | 68429f50ab60074e58b98010103fcc5bac4afd54 (patch) | |
tree | 79238fd7fd84b0d20692ef653c735c0fe22dfc57 /include/media | |
parent | dc3cdbc9d4dc22948d7f934789ee71baba55bc82 (diff) |
[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.h | 16 |
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 { | |||
49 | }; | 49 | }; |
50 | 50 | ||
51 | /** | 51 | /** |
52 | * struct media_device_ops - Media device operations | ||
53 | * @link_notify: Link state change notification callback. This callback is | ||
54 | * called with the graph_mutex held. | ||
55 | */ | ||
56 | struct media_device_ops { | ||
57 | int (*link_notify)(struct media_link *link, u32 flags, | ||
58 | unsigned int notification); | ||
59 | }; | ||
60 | |||
61 | /** | ||
52 | * struct media_device - Media device | 62 | * struct media_device - Media device |
53 | * @dev: Parent device | 63 | * @dev: Parent device |
54 | * @devnode: Media device node | 64 | * @devnode: Media device node |
@@ -80,8 +90,7 @@ struct media_entity_notify { | |||
80 | * @enable_source: Enable Source Handler function pointer | 90 | * @enable_source: Enable Source Handler function pointer |
81 | * @disable_source: Disable Source Handler function pointer | 91 | * @disable_source: Disable Source Handler function pointer |
82 | * | 92 | * |
83 | * @link_notify: Link state change notification callback. This callback is | 93 | * @ops: Operation handler callbacks |
84 | * called with the graph_mutex held. | ||
85 | * | 94 | * |
86 | * This structure represents an abstract high-level media device. It allows easy | 95 | * This structure represents an abstract high-level media device. It allows easy |
87 | * access to entities and provides basic media device-level support. The | 96 | * access to entities and provides basic media device-level support. The |
@@ -150,8 +159,7 @@ struct media_device { | |||
150 | struct media_pipeline *pipe); | 159 | struct media_pipeline *pipe); |
151 | void (*disable_source)(struct media_entity *entity); | 160 | void (*disable_source)(struct media_entity *entity); |
152 | 161 | ||
153 | int (*link_notify)(struct media_link *link, u32 flags, | 162 | const struct media_device_ops *ops; |
154 | unsigned int notification); | ||
155 | }; | 163 | }; |
156 | 164 | ||
157 | /* We don't need to include pci.h or usb.h here */ | 165 | /* We don't need to include pci.h or usb.h here */ |