NVIDIA: SAUCE: v4l2-core: Add sync op to subdev_core_ops
BugLink: https://bugs.launchpad.net/bugs/2072591 If multiple sub devices need to be synchronized w.r.t one sub device state, then this op can be used. For example in camera system, configuring focuser position and sensor capture have to be synchronized when the ROI for focuser ends. Writing focus position on improper boundary causes unexpected output. Also, add the macro V4L2_EVENT_SRC_ERROR for use in vi4_fops.c http://nvbugs/200602400 Signed-off-by: Frank Chen <frankc@nvidia.com> Tested-by: Abhilash G <abhilashg@nvidia.com> Reviewed-by: Abhilash G <abhilashg@nvidia.com> Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Acked-by: Jacob Martin <jacob.martin@canonical.com> Acked-by: Noah Wager <noah.wager@canonical.com> Signed-off-by: Noah Wager <noah.wager@canonical.com>
This commit is contained in:
@@ -138,6 +138,10 @@ struct v4l2_subdev_io_pin_config {
|
||||
u8 strength;
|
||||
};
|
||||
|
||||
#define V4L2_SYNC_EVENT_SUBDEV_ERROR_RECOVER (1 << 2)
|
||||
#define V4L2_SYNC_EVENT_FOCUS_POS (1 << 0)
|
||||
#define V4L2_SYNC_EVENT_IRIS_POS (1 << 1)
|
||||
|
||||
/**
|
||||
* struct v4l2_subdev_core_ops - Define core ops callbacks for subdevs
|
||||
*
|
||||
@@ -191,6 +195,12 @@ struct v4l2_subdev_io_pin_config {
|
||||
* for it to be warned when the value of a control changes.
|
||||
*
|
||||
* @unsubscribe_event: remove event subscription from the control framework.
|
||||
* @sync: some sub devices can only make certain changes at certain times.
|
||||
* For example, a sensor can change the focus only during the blanking period.
|
||||
* This callback can be used to perform these changes when a certain event occurs.
|
||||
* A master device (usually the bridge driver) will call this callback with the
|
||||
* event(s) that occurred and the sub device checks the event mask for the event(s)
|
||||
* on which they have to synchronize their pending changes.
|
||||
*/
|
||||
struct v4l2_subdev_core_ops {
|
||||
int (*log_status)(struct v4l2_subdev *sd);
|
||||
@@ -217,6 +227,7 @@ struct v4l2_subdev_core_ops {
|
||||
struct v4l2_event_subscription *sub);
|
||||
int (*unsubscribe_event)(struct v4l2_subdev *sd, struct v4l2_fh *fh,
|
||||
struct v4l2_event_subscription *sub);
|
||||
int (*sync)(struct v4l2_subdev *sd, unsigned int sync_events);
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -2502,6 +2502,7 @@ struct v4l2_event_frame_sync {
|
||||
};
|
||||
|
||||
#define V4L2_EVENT_SRC_CH_RESOLUTION (1 << 0)
|
||||
#define V4L2_EVENT_SRC_ERROR (1 << 1)
|
||||
|
||||
struct v4l2_event_src_change {
|
||||
__u32 changes;
|
||||
|
||||
Reference in New Issue
Block a user