v4l2_event_queue:
static int bridge_event_queue(struct cam_sensor_ctrl_t * s_ctrl)
{
struct v4l2_event event;
struct cam_req_mgr_message msg;
int rc = 0;
memset(&event, 0, sizeof(struct v4l2_event));
event.id = V4L_EVENT_CAM_REQ_MGR_SENSOR_LOCK;
event.type = CAM_SENSOR_EVENT_TYPE;
memset(&msg, 0, sizeof(msg));
msg.session_hdl = s_ctrl->bridge_intf.session_hdl;
msg.u.err_msg.error_type = s_ctrl->mask;
msg.u.err_msg.request_id = s_ctrl->sensordata->slave_info.sensor_slave_addr;
msg.u.err_msg.link_hdl= s_ctrl->bridge_intf.link_hdl;
msg.u.err_msg.sensorname_ptr = (uintptr_t)(s_ctrl->sensordata->sensorname);
memcpy(&event.u.data[0], &msg,
sizeof(struct cam_req_mgr_message));
v4l2_event_queue(s_ctrl->v4l2_dev_str.sd.devnode, &event);
return rc;
}
ops:
static struct v4l2_subdev_core_ops cam_sensor_subdev_core_ops = {
.ioctl = cam_sensor_subdev_ioctl,
#ifdef CONFIG_COMPAT
.compat_ioctl32 = cam_sensor_init_subdev_do_ioctl,
#endif
.s_power = cam_sensor_power,
.subscribe_event = cam_sensor_subdev_subscribe_event,
.unsubscribe_event = cam_sensor_subdev_unsubscribe_event,
};
static int cam_sensor_subdev_subscribe_event(struct v4l2_subdev *sd,
struct v4l2_fh *fh,
struct v4l2_event_subscription *sub)
{
return v4l2_event_subscribe(fh, sub, CAM_SUBDEVICE_EVENT_MAX, NULL);
}
static int cam_sensor_subdev_unsubscribe_event(struct v4l2_subdev *sd,
struct v4l2_fh *fh,
struct v4l2_event_subscription *sub)
{
return v4l2_event_unsubscribe(fh, sub);
}