diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/media/v4l2-device.h | 3 | ||||
-rw-r--r-- | include/media/v4l2-subdev.h | 5 |
2 files changed, 8 insertions, 0 deletions
diff --git a/include/media/v4l2-device.h b/include/media/v4l2-device.h index 5d7146dc2913..3d8e96f6ceb3 100644 --- a/include/media/v4l2-device.h +++ b/include/media/v4l2-device.h | |||
@@ -44,6 +44,9 @@ struct v4l2_device { | |||
44 | spinlock_t lock; | 44 | spinlock_t lock; |
45 | /* unique device name, by default the driver name + bus ID */ | 45 | /* unique device name, by default the driver name + bus ID */ |
46 | char name[V4L2_DEVICE_NAME_SIZE]; | 46 | char name[V4L2_DEVICE_NAME_SIZE]; |
47 | /* notify callback called by some sub-devices. */ | ||
48 | void (*notify)(struct v4l2_subdev *sd, | ||
49 | unsigned int notification, void *arg); | ||
47 | }; | 50 | }; |
48 | 51 | ||
49 | /* Initialize v4l2_dev and make dev->driver_data point to v4l2_dev. | 52 | /* Initialize v4l2_dev and make dev->driver_data point to v4l2_dev. |
diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h index 05b69652e6c4..1b97a2c33a73 100644 --- a/include/media/v4l2-subdev.h +++ b/include/media/v4l2-subdev.h | |||
@@ -191,4 +191,9 @@ static inline void v4l2_subdev_init(struct v4l2_subdev *sd, | |||
191 | (!(sd) ? -ENODEV : (((sd) && (sd)->ops->o && (sd)->ops->o->f) ? \ | 191 | (!(sd) ? -ENODEV : (((sd) && (sd)->ops->o && (sd)->ops->o->f) ? \ |
192 | (sd)->ops->o->f((sd) , ##args) : -ENOIOCTLCMD)) | 192 | (sd)->ops->o->f((sd) , ##args) : -ENOIOCTLCMD)) |
193 | 193 | ||
194 | /* Send a notification to v4l2_device. */ | ||
195 | #define v4l2_subdev_notify(sd, notification, arg) \ | ||
196 | ((!(sd) || !(sd)->v4l2_dev || !(sd)->v4l2_dev->notify) ? -ENODEV : \ | ||
197 | (sd)->v4l2_dev->notify((sd), (notification), (arg))) | ||
198 | |||
194 | #endif | 199 | #endif |