Commit 18cb6503 authored by Axel Lin's avatar Axel Lin Committed by Mauro Carvalho Chehab

[media] tvp7002: Don't update device->streaming if write to register fails

This ensures device->streaming has correct status.
Signed-off-by: default avatarAxel Lin <axel.lin@ingics.com>
Acked-by: default avatarLad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
parent a0ffe4c0
...@@ -775,25 +775,20 @@ static int tvp7002_enum_mbus_fmt(struct v4l2_subdev *sd, unsigned index, ...@@ -775,25 +775,20 @@ static int tvp7002_enum_mbus_fmt(struct v4l2_subdev *sd, unsigned index,
static int tvp7002_s_stream(struct v4l2_subdev *sd, int enable) static int tvp7002_s_stream(struct v4l2_subdev *sd, int enable)
{ {
struct tvp7002 *device = to_tvp7002(sd); struct tvp7002 *device = to_tvp7002(sd);
int error = 0; int error;
if (device->streaming == enable) if (device->streaming == enable)
return 0; return 0;
if (enable) { /* low impedance: on, high impedance: off */
/* Set output state on (low impedance means stream on) */ error = tvp7002_write(sd, TVP7002_MISC_CTL_2, enable ? 0x00 : 0x03);
error = tvp7002_write(sd, TVP7002_MISC_CTL_2, 0x00); if (error) {
device->streaming = enable; v4l2_dbg(1, debug, sd, "Fail to set streaming\n");
} else { return error;
/* Set output state off (high impedance means stream off) */
error = tvp7002_write(sd, TVP7002_MISC_CTL_2, 0x03);
if (error)
v4l2_dbg(1, debug, sd, "Unable to stop streaming\n");
device->streaming = enable;
} }
return error; device->streaming = enable;
return 0;
} }
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment