From: Hans Verkuil Date: Wed, 29 May 2013 13:18:55 +0000 (-0300) Subject: [media] bt819: fix querystd X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=ddc7f72a3d4049653114647069f8044de5f2499d;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git [media] bt819: fix querystd Return V4L2_STD_UNKNOWN if no signal is detected. Otherwise AND the standard mask with the detected standards. Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/i2c/bt819.c b/drivers/media/i2c/bt819.c index ae1eac01bbc7..369cf6ff88f7 100644 --- a/drivers/media/i2c/bt819.c +++ b/drivers/media/i2c/bt819.c @@ -215,15 +215,17 @@ static int bt819_status(struct v4l2_subdev *sd, u32 *pstatus, v4l2_std_id *pstd) struct bt819 *decoder = to_bt819(sd); int status = bt819_read(decoder, 0x00); int res = V4L2_IN_ST_NO_SIGNAL; - v4l2_std_id std; + v4l2_std_id std = pstd ? *pstd : V4L2_STD_ALL; if ((status & 0x80)) res = 0; + else + std = V4L2_STD_UNKNOWN; if ((status & 0x10)) - std = V4L2_STD_PAL; + std &= V4L2_STD_PAL; else - std = V4L2_STD_NTSC; + std &= V4L2_STD_NTSC; if (pstd) *pstd = std; if (pstatus)