]> git.openfabrics.org - ~shefty/rdma-dev.git/commit
[media] v4l2-core: tvnorms may be 0 for a given input, handle that case
authorHans Verkuil <hans.verkuil@cisco.com>
Fri, 14 Sep 2012 09:45:43 +0000 (06:45 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Wed, 26 Sep 2012 12:48:59 +0000 (09:48 -0300)
commita5338190efc7cfa8c99a6856342a77d21c9a05cf
treee7eb5dd17262a01a9986e6184447cd8e70fea47b
parent663dc7f3a02712e22ef81f4c7b7b1caecceb8e4f
[media] v4l2-core: tvnorms may be 0 for a given input, handle that case

Currently the core code looks at tvnorms to see whether ENUMSTD
or G_PARM should be enabled. This is not a good check for drivers
that support the STD API on one input and the DV Timings API on another.
In that case tvnorms may be 0.
Instead check whether s_std is present (for ENUMSTD) or whether g_std or
current_norm is present for g_parm.
Also, in the enumstd core function return ENODATA if tvnorms is 0,
because in that case the current input does not support the STD API
and ENUMSTD should return ENODATA for that.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Reviewed-by: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/v4l2-core/v4l2-dev.c
drivers/media/v4l2-core/v4l2-ioctl.c