Exemplo n.º 1
0
/*
 * __resizer_get_format - helper function for getting resizer format
 * @res   : pointer to resizer private structure
 * @pad   : pad number
 * @fh    : V4L2 subdev file handle
 * @which : wanted subdev format
 * return zero
 */
static struct v4l2_mbus_framefmt *
__resizer_get_format(struct isp_res_device *res, struct v4l2_subdev_fh *fh,
		     unsigned int pad, enum v4l2_subdev_format which)
{
	if (which == V4L2_SUBDEV_FORMAT_PROBE)
		return v4l2_subdev_get_probe_format(fh, pad);
	else
		return &res->formats[pad];
}
Exemplo n.º 2
0
static int li3m02cm_get_pad_format(struct v4l2_subdev *subdev,
				   struct v4l2_subdev_fh *fh, unsigned int pad,
				   struct v4l2_mbus_framefmt *fmt,
				   enum v4l2_subdev_format which)
{
	struct v4l2_mbus_framefmt *format;
		
	switch (which) {
	case V4L2_SUBDEV_FORMAT_PROBE:
		format = v4l2_subdev_get_probe_format(fh, pad);
		*fmt = *format;
		break;
	case V4L2_SUBDEV_FORMAT_ACTIVE:
		return mt9t111_get_format(subdev_to_cam(subdev)->mt9t111, fmt);
	default: 
		return -EINVAL;
	}
	return 0;
}