Re: [PATCH 1/2] media: dvb: convert tuner_info frequencies to Hz

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Em Thu, 5 Jul 2018 21:16:06 +0200
Michael Büsch <m@xxxxxxx> escreveu:

> On Wed,  4 Jul 2018 23:46:56 -0300
> Mauro Carvalho Chehab <mchehab+samsung@xxxxxxxxxx> wrote:
> 
> > diff --git a/drivers/media/tuners/fc0011.c b/drivers/media/tuners/fc0011.c
> > index 145407dee3db..a983899c6b0b 100644
> > --- a/drivers/media/tuners/fc0011.c
> > +++ b/drivers/media/tuners/fc0011.c
> > @@ -472,10 +472,10 @@ static int fc0011_get_bandwidth(struct dvb_frontend *fe, u32 *bandwidth)
> >  
> >  static const struct dvb_tuner_ops fc0011_tuner_ops = {
> >  	.info = {
> > -		.name		= "Fitipower FC0011",
> > +		.name		  = "Fitipower FC0011",
> >  
> > -		.frequency_min	= 45000000,
> > -		.frequency_max	= 1000000000,
> > +		.frequency_min_hz =   45 * MHz,
> > +		.frequency_max_hz = 1000 * MHz,
> >  	},
> >  
> >  	.release		= fc0011_release,  
> 
> Acked-by: Michael Büsch <m@xxxxxxx>
> 
> What about a GHz definition for 1000 * MHz?

Not sure if it would be worth. The main goal of using the multiplier
macros it so make easier to recognize values. Reading up to 4-5
digits is usually easy for humans.

In particular, my main goal is to make it easier to check if the
values for each driver is OK for me, while writing the patch,
and for reviewers to check if the values make sense.

Also, almost all DVB-T and DVB-C drivers use a max frequency around 
850 MHz, and almost all DVB-S uses 2150 MHz. On both cases, it
is better to write the values in MHz.

So, the only case where GHZ would be used, in practice would be
on two drivers:

$ git grep "1000 \* MHz"
drivers/media/tuners/fc0011.c:          .frequency_max_hz = 1000 * MHz,
drivers/media/tuners/mc44s803.c:                .frequency_max_hz  = 1000 * MHz,

Thanks,
Mauro




[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux