Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f2730756 authored by Laurent Pinchart's avatar Laurent Pinchart Committed by Mauro Carvalho Chehab
Browse files

[media] ov772x: Don't access the device in the g_mbus_fmt operation



The g_mbus_fmt operation only needs to return the current mbus frame
format and doesn't need to configure the hardware to do so. Fix it to
avoid requiring the chip to be powered on when calling the operation.

Signed-off-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: default avatarGuennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent f9859839
Loading
Loading
Loading
Loading
+2 −6
Original line number Diff line number Diff line
@@ -880,15 +880,11 @@ static int ov772x_cropcap(struct v4l2_subdev *sd, struct v4l2_cropcap *a)
static int ov772x_g_fmt(struct v4l2_subdev *sd,
			struct v4l2_mbus_framefmt *mf)
{
	struct i2c_client *client = v4l2_get_subdevdata(sd);
	struct ov772x_priv *priv = container_of(sd, struct ov772x_priv, subdev);

	if (!priv->win || !priv->cfmt) {
		u32 width = VGA_WIDTH, height = VGA_HEIGHT;
		int ret = ov772x_set_params(client, &width, &height,
					    V4L2_MBUS_FMT_YUYV8_2X8);
		if (ret < 0)
			return ret;
		priv->cfmt = &ov772x_cfmts[0];
		priv->win = ov772x_select_win(VGA_WIDTH, VGA_HEIGHT);
	}

	mf->width	= priv->win->width;