Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[media] tvp5150: Fix breakage for serial usage

changeset 460b6c0831cb ("tvp5150: Add s_stream subdev operation
support") broke for em28xx-based devices with uses tvp5150. On those
devices, touching the TVP5150_MISC_CTL register causes em28xx to stop
streaming.

I suspect that it uses the 27 MHz clock provided by tvp5150 to feed
em28xx. So, change the logic to do nothing on s_stream if the tvp5150 is
not set up to work with V4L2_MBUS_PARALLEL.

Tested with Hauppauge WinTV USB 2 model 42012 Rev. C186
(USB ID: 2040:4200).

Cc: Javier Martinez Canillas <javier@osg.samsung.com>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>

+4 -5
+4 -5
drivers/media/i2c/tvp5150.c
··· 975 975 static int tvp5150_s_stream(struct v4l2_subdev *sd, int enable) 976 976 { 977 977 struct tvp5150 *decoder = to_tvp5150(sd); 978 - /* Output format: 8-bit ITU-R BT.656 with embedded syncs */ 979 - int val = 0x09; 980 978 981 979 /* Output format: 8-bit 4:2:2 YUV with discrete sync */ 982 - if (decoder->mbus_type == V4L2_MBUS_PARALLEL) 983 - val = 0x0d; 980 + if (decoder->mbus_type != V4L2_MBUS_PARALLEL) 981 + return 0; 984 982 985 983 /* Initializes TVP5150 to its default values */ 986 984 /* # set PCLK (27MHz) */ 987 985 tvp5150_write(sd, TVP5150_CONF_SHARED_PIN, 0x00); 988 986 987 + /* Output format: 8-bit ITU-R BT.656 with embedded syncs */ 989 988 if (enable) 990 - tvp5150_write(sd, TVP5150_MISC_CTL, val); 989 + tvp5150_write(sd, TVP5150_MISC_CTL, 0x09); 991 990 else 992 991 tvp5150_write(sd, TVP5150_MISC_CTL, 0x00); 993 992