On Sun, Sep 27, 2009 at 12:35:00PM -0400, Michael Krufky wrote:
> On Sun, Sep 27, 2009 at 12:25 PM, Michael Krufky <mkru...@kernellabs.com> 
> wrote:
> 
> On a second thought, I see that my above patch loses some precision
> ...  this is even better:
> 
> diff -r f52640ced9e8 linux/drivers/media/common/tuners/tda18271-fe.c
> --- a/linux/drivers/media/common/tuners/tda18271-fe.c Tue Sep 15
> 01:25:35 2009 -0400
> +++ b/linux/drivers/media/common/tuners/tda18271-fe.c Sun Sep 27
> 12:33:20 2009 -0400
> @@ -1001,12 +1001,12 @@
>       struct tda18271_std_map_item *map;
>       char *mode;
>       int ret;
> -     u32 freq = params->frequency * 62500;
> +     u32 freq = params->frequency * 125 *
> +             ((params->mode == V4L2_TUNER_RADIO) ? 1 : 1000) / 2;
> 
>       priv->mode = TDA18271_ANALOG;
> 
>       if (params->mode == V4L2_TUNER_RADIO) {
> -             freq = freq / 1000;
>               map = &std_map->fm_radio;
>               mode = "fm";
>       } else if (params->std & V4L2_STD_MN) {
> 
> Cheers,
> 
> Mike

Much better!

Btw. It seems that the tuner is capable of tuning in 1000 Hz steps, is
there a reason why we are using 62500 Hz steps?

Regards,
Henk
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to