public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mchehab@redhat.com>
To: Andy Walls <awalls@md.metrocast.net>
Cc: Linux Media Mailing List <linux-media@vger.kernel.org>
Subject: Re: [PATCH 1/4] [media] tuner-core: remove usage of DIGITAL_TV
Date: Wed, 16 Feb 2011 11:47:17 -0200	[thread overview]
Message-ID: <4D5BD565.60604@redhat.com> (raw)
In-Reply-To: <1297860929.2086.3.camel@morgan.silverblock.net>

Em 16-02-2011 10:55, Andy Walls escreveu:
> On Tue, 2011-02-15 at 17:48 -0200, Mauro Carvalho Chehab wrote:
>> Em 15-02-2011 15:25, Andy Walls escreveu:
>>> Mauro Carvalho Chehab <mchehab@redhat.com> wrote:
>>>
>>>> tuner-core has no business to do with digital TV. So, don't use
>>>> T_DIGITAL_TV on it, as it has no code to distinguish between
>>>> them, and nobody fills T_DIGITAL_TV right.
>>>>
>>>> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
>>>>
> 
>>>> diff --git a/drivers/media/video/tuner-core.c
>>>> b/drivers/media/video/tuner-core.c
>>>> index dcf03fa..5e1437c 100644
>>>> --- a/drivers/media/video/tuner-core.c
>>>> +++ b/drivers/media/video/tuner-core.c
> 
>>>> @@ -596,7 +595,7 @@ static int tuner_probe(struct i2c_client *client,
>>>> 	   first found TV tuner. */
>>>> 	tuner_lookup(t->i2c->adapter, &radio, &tv);
>>>> 	if (tv == NULL) {
>>>> -		t->mode_mask = T_ANALOG_TV | T_DIGITAL_TV;
>>>> +		t->mode_mask = T_ANALOG_TV;
>>>> 		if (radio == NULL)
>>>> 			t->mode_mask |= T_RADIO;
>>>> 		tuner_dbg("Setting mode_mask to 0x%02x\n", t->mode_mask);
>>>> @@ -607,18 +606,15 @@ register_client:
>>>> 	/* Sets a default mode */
>>>> 	if (t->mode_mask & T_ANALOG_TV)
>>>> 		t->mode = V4L2_TUNER_ANALOG_TV;
>>>> -	else if (t->mode_mask & T_RADIO)
>>>> -		t->mode = V4L2_TUNER_RADIO;
>>>> 	else
>>>> -		t->mode = V4L2_TUNER_DIGITAL_TV;
>>>> +		t->mode = V4L2_TUNER_RADIO;
>                             ^^^^^^^^^^^^^^^^^^^^^
> Mauro,
> 
> Here's where I saw a default being changed from DIGITAL_TV to RADIO.
> Maybe it doesn't matter?

Currently, there are just two mode_mask's: T_ANALOG_TV and T_RADIO. If it is not one, it is
the other ;)

Well, in a matter of fact, I didn't drop T_DIGITAL_TV yet, just because it is used internally
inside one driver, for its internal usage only:

$ git grep T_DIGITAL_TV include/media
include/media/tuner.h:    T_DIGITAL_TV    = 1 << V4L2_TUNER_DIGITAL_TV,

$ git grep -B1 T_DIGITAL_TV drivers/media/ 
drivers/media/common/tuners/tuner-xc2028.c-       return generic_set_freq(fe, p->frequency,
drivers/media/common/tuners/tuner-xc2028.c:                               T_DIGITAL_TV, type, 0, demod);

As you see, the changes are simple, and the usage is pure internally:

drivers/media/common/tuners/tuner-xc2028.c:static int generic_set_freq(struct dvb_frontend *fe, u32 freq /* in HZ */,
drivers/media/common/tuners/tuner-xc2028.c-                           enum tuner_mode new_mode,
--
drivers/media/common/tuners/tuner-xc2028.c:               return generic_set_freq(fe, (625l * p->frequency) / 10,
drivers/media/common/tuners/tuner-xc2028.c-                               T_RADIO, type, 0, 0);
--
drivers/media/common/tuners/tuner-xc2028.c:       return generic_set_freq(fe, 62500l * p->frequency,
drivers/media/common/tuners/tuner-xc2028.c-                               T_ANALOG_TV, type, p->std, 0);
--
drivers/media/common/tuners/tuner-xc2028.c:       return generic_set_freq(fe, p->frequency,
drivers/media/common/tuners/tuner-xc2028.c-                               T_DIGITAL_TV, type, 0, demod);

I'll write a patch removing the latest usage of it (basically, replacing them by V4L2_TUNER_*).

Of course, tests are more than welcome to be sure that those changes didn't cause any regression.

Cheers,
Mauro

  reply	other threads:[~2011-02-16 13:47 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <cover.1297776328.git.mchehab@redhat.com>
2011-02-15 13:33 ` [PATCH 1/4] [media] tuner-core: remove usage of DIGITAL_TV Mauro Carvalho Chehab
2011-02-15 17:25   ` Andy Walls
2011-02-15 19:48     ` Mauro Carvalho Chehab
2011-02-16 12:55       ` Andy Walls
2011-02-16 13:47         ` Mauro Carvalho Chehab [this message]
2011-02-15 13:33 ` [PATCH 2/4] [media] tuner-core: Improve function documentation Mauro Carvalho Chehab
2011-02-15 13:33 ` [PATCH 3/4] [media] tuner-core: Rearrange some functions to better document Mauro Carvalho Chehab
2011-02-15 13:33 ` [PATCH 4/4] [media] tuner-core: Don't touch at standby during tuner_lookup Mauro Carvalho Chehab

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4D5BD565.60604@redhat.com \
    --to=mchehab@redhat.com \
    --cc=awalls@md.metrocast.net \
    --cc=linux-media@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox