/* If the requested format is supported, configures the HW to use that format, returns error code if format not supported or HW can't be correctly configured.  */
static int tvp514x_s_fmt_cap(struct v4l2_subdev *sd, struct v4l2_format *f)
/* If the requested format is supported, configures the HW to use that format, returns error code if format not supported or HW can't be correctly configured.  */
static int tvp514x_s_fmt_cap(struct v4l2_subdev *sd, struct v4l2_format *f)
{
	struct tvp514x_decoder *decoder = to_decoder(sd);
	struct v4l2_pix_format *pix;
	int rval;
	if (f == NULL)
		return -EINVAL;
	if (f->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
		return -EINVAL;
	pix = &f->fmt.pix;
	rval = tvp514x_try_fmt_cap(sd, f);
	if (rval)
		return rval;
		decoder->pix = *pix;
	return rval;
}