diff options
| author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2016-12-09 06:47:19 -0500 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-02-01 02:33:10 -0500 |
| commit | 1b8ff91ae545d36337de459c7195f6f369dc776d (patch) | |
| tree | e04e7779dd6e283ec1ef0fb0a6ca851f63102422 /drivers/media | |
| parent | 11e5015ae1d12473f12baa1e8cc66849be019c3a (diff) | |
v4l: tvp5150: Don't override output pinmuxing at stream on/off time
commit 79d6205a3f741c9fb89cfc47dfa0eddb1526726d upstream.
The s_stream() handler incorrectly writes the whole MISC_CTL register to
enable or disable the outputs, overriding the output pinmuxing
configuration. Fix it to only touch the output enable bits.
The CONF_SHARED_PIN register is also written by the same function,
resulting in muxing the INTREQ signal instead of the VBLK/GPCL signal on
the INTREQ/GPCL/VBLK pin. As the driver doesn't support interrupts this
is obviously incorrect, and breaks operation on other devices. Fix it by
removing the write.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/media')
| -rw-r--r-- | drivers/media/i2c/tvp5150.c | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/drivers/media/i2c/tvp5150.c b/drivers/media/i2c/tvp5150.c index e88d2d25b37e..59aa4dafb60b 100644 --- a/drivers/media/i2c/tvp5150.c +++ b/drivers/media/i2c/tvp5150.c | |||
| @@ -1055,22 +1055,27 @@ static const struct media_entity_operations tvp5150_sd_media_ops = { | |||
| 1055 | static int tvp5150_s_stream(struct v4l2_subdev *sd, int enable) | 1055 | static int tvp5150_s_stream(struct v4l2_subdev *sd, int enable) |
| 1056 | { | 1056 | { |
| 1057 | struct tvp5150 *decoder = to_tvp5150(sd); | 1057 | struct tvp5150 *decoder = to_tvp5150(sd); |
| 1058 | /* Output format: 8-bit ITU-R BT.656 with embedded syncs */ | 1058 | int val; |
| 1059 | int val = TVP5150_MISC_CTL_YCBCR_OE | TVP5150_MISC_CTL_CLOCK_OE; | ||
| 1060 | |||
| 1061 | /* Output format: 8-bit 4:2:2 YUV with discrete sync */ | ||
| 1062 | if (decoder->mbus_type == V4L2_MBUS_PARALLEL) | ||
| 1063 | val = TVP5150_MISC_CTL_YCBCR_OE | TVP5150_MISC_CTL_SYNC_OE | ||
| 1064 | | TVP5150_MISC_CTL_CLOCK_OE; | ||
| 1065 | 1059 | ||
| 1066 | /* Initializes TVP5150 to its default values */ | 1060 | /* Enable or disable the video output signals. */ |
| 1067 | /* # set PCLK (27MHz) */ | 1061 | val = tvp5150_read(sd, TVP5150_MISC_CTL); |
| 1068 | tvp5150_write(sd, TVP5150_CONF_SHARED_PIN, 0x00); | 1062 | if (val < 0) |
| 1063 | return val; | ||
| 1064 | |||
| 1065 | val &= ~(TVP5150_MISC_CTL_YCBCR_OE | TVP5150_MISC_CTL_SYNC_OE | | ||
| 1066 | TVP5150_MISC_CTL_CLOCK_OE); | ||
| 1067 | |||
| 1068 | if (enable) { | ||
| 1069 | /* | ||
| 1070 | * Enable the YCbCr and clock outputs. In discrete sync mode | ||
| 1071 | * (non-BT.656) additionally enable the the sync outputs. | ||
| 1072 | */ | ||
| 1073 | val |= TVP5150_MISC_CTL_YCBCR_OE | TVP5150_MISC_CTL_CLOCK_OE; | ||
| 1074 | if (decoder->mbus_type == V4L2_MBUS_PARALLEL) | ||
| 1075 | val |= TVP5150_MISC_CTL_SYNC_OE; | ||
| 1076 | } | ||
| 1069 | 1077 | ||
| 1070 | if (enable) | 1078 | tvp5150_write(sd, TVP5150_MISC_CTL, val); |
| 1071 | tvp5150_write(sd, TVP5150_MISC_CTL, val); | ||
| 1072 | else | ||
| 1073 | tvp5150_write(sd, TVP5150_MISC_CTL, 0x00); | ||
| 1074 | 1079 | ||
| 1075 | return 0; | 1080 | return 0; |
| 1076 | } | 1081 | } |
