diff mbox

[RFCv1,3/7] tuner-core: fix g_frequency support.

Message ID 0d7f8cae6d252df04dbbcc6515507a9f7e00b895.1307798213.git.hans.verkuil@cisco.com (mailing list archive)
State RFC
Headers show

Commit Message

Hans Verkuil June 11, 2011, 1:34 p.m. UTC
From: Hans Verkuil <hans.verkuil@cisco.com>

VIDIOC_G_FREQUENCY should not check the tuner type, instead that is
something the driver fill in.

Since apps will often leave the type at 0, the 'supported_mode' call
will return false and the frequency never gets filled in.

Remove this check.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
---
 drivers/media/video/tuner-core.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

Comments

Mauro Carvalho Chehab June 11, 2011, 1:44 p.m. UTC | #1
Em 11-06-2011 10:34, Hans Verkuil escreveu:
> From: Hans Verkuil <hans.verkuil@cisco.com>
> 
> VIDIOC_G_FREQUENCY should not check the tuner type, instead that is
> something the driver fill in.
> 
> Since apps will often leave the type at 0, the 'supported_mode' call
> will return false and the frequency never gets filled in.
> 
> Remove this check.

This patch is wrong, as it breaks support for devices with multiple
tuners (e. g. a tea5767 for radio and another tuner for TV).

> 
> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
> ---
>  drivers/media/video/tuner-core.c |    2 --
>  1 files changed, 0 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/media/video/tuner-core.c b/drivers/media/video/tuner-core.c
> index ee43e0a..4d8dcea 100644
> --- a/drivers/media/video/tuner-core.c
> +++ b/drivers/media/video/tuner-core.c
> @@ -1132,8 +1132,6 @@ static int tuner_g_frequency(struct v4l2_subdev *sd, struct v4l2_frequency *f)
>  	struct tuner *t = to_tuner(sd);
>  	struct dvb_tuner_ops *fe_tuner_ops = &t->fe.ops.tuner_ops;
>  
> -	if (!supported_mode(t, f->type))
> -		return 0;
>  	f->type = t->mode;
>  	if (fe_tuner_ops->get_frequency && !t->standby) {
>  		u32 abs_freq;

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Hans Verkuil June 11, 2011, 1:53 p.m. UTC | #2
On Saturday, June 11, 2011 15:44:43 Mauro Carvalho Chehab wrote:
> Em 11-06-2011 10:34, Hans Verkuil escreveu:
> > From: Hans Verkuil <hans.verkuil@cisco.com>
> > 
> > VIDIOC_G_FREQUENCY should not check the tuner type, instead that is
> > something the driver fill in.
> > 
> > Since apps will often leave the type at 0, the 'supported_mode' call
> > will return false and the frequency never gets filled in.
> > 
> > Remove this check.
> 
> This patch is wrong, as it breaks support for devices with multiple
> tuners (e. g. a tea5767 for radio and another tuner for TV).

Thanks for catching this, I had it right in an earlier version, but it
got lost somewhere along the way.

What should happen is that this should be added at the beginning:

if (t->standby)
	return 0;

Ditto for g_tuner. If the current mode is not supported, standby is set to
true.

Regards,

	Hans

> 
> > 
> > Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
> > ---
> >  drivers/media/video/tuner-core.c |    2 --
> >  1 files changed, 0 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/media/video/tuner-core.c b/drivers/media/video/tuner-core.c
> > index ee43e0a..4d8dcea 100644
> > --- a/drivers/media/video/tuner-core.c
> > +++ b/drivers/media/video/tuner-core.c
> > @@ -1132,8 +1132,6 @@ static int tuner_g_frequency(struct v4l2_subdev *sd, struct v4l2_frequency *f)
> >  	struct tuner *t = to_tuner(sd);
> >  	struct dvb_tuner_ops *fe_tuner_ops = &t->fe.ops.tuner_ops;
> >  
> > -	if (!supported_mode(t, f->type))
> > -		return 0;
> >  	f->type = t->mode;
> >  	if (fe_tuner_ops->get_frequency && !t->standby) {
> >  		u32 abs_freq;
> 
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/media/video/tuner-core.c b/drivers/media/video/tuner-core.c
index ee43e0a..4d8dcea 100644
--- a/drivers/media/video/tuner-core.c
+++ b/drivers/media/video/tuner-core.c
@@ -1132,8 +1132,6 @@  static int tuner_g_frequency(struct v4l2_subdev *sd, struct v4l2_frequency *f)
 	struct tuner *t = to_tuner(sd);
 	struct dvb_tuner_ops *fe_tuner_ops = &t->fe.ops.tuner_ops;
 
-	if (!supported_mode(t, f->type))
-		return 0;
 	f->type = t->mode;
 	if (fe_tuner_ops->get_frequency && !t->standby) {
 		u32 abs_freq;