public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
To: Matthias Schwarzott <zzam@gentoo.org>
Cc: linux-media@vger.kernel.org, crope@iki.fi, xpert-reactos@gmx.de
Subject: Re: [PATCH 07/10] si2165: Fix DVB-T bandwidth default
Date: Thu, 3 Dec 2015 12:15:24 -0200	[thread overview]
Message-ID: <20151203121524.33bd3130@recife.lan> (raw)
In-Reply-To: <1447963442-9764-8-git-send-email-zzam@gentoo.org>

Em Thu, 19 Nov 2015 21:03:59 +0100
Matthias Schwarzott <zzam@gentoo.org> escreveu:


Please, add a description to your patches.

That's said, this patch should be called, instead:

si2165: Fix DVB-T bandwidth auto

DVB auto bandwidth mode (bandwidth_hz == 0) logic was setting
the initial value for dvb_rate to a wrong value. Fix it.

as a zero value here means to let the frontend to auto-detect
the bandwidth. Of course, assuming that si2165 is capable of
doing that.

If si2165 chip or driver doesn't support bandwidth auto-detection, it
should, instead, return -EINVAL.

Are you sure that it will auto-detect the bandwidth if we keep it
as 8MHz?

Regards,
Mauro





> Signed-off-by: Matthias Schwarzott <zzam@gentoo.org>
> ---
>  drivers/media/dvb-frontends/si2165.c | 13 ++++++-------
>  1 file changed, 6 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/media/dvb-frontends/si2165.c b/drivers/media/dvb-frontends/si2165.c
> index 807a3c9..e97b0e6 100644
> --- a/drivers/media/dvb-frontends/si2165.c
> +++ b/drivers/media/dvb-frontends/si2165.c
> @@ -811,19 +811,18 @@ static int si2165_set_frontend(struct dvb_frontend *fe)
>  	u8 val[3];
>  	u32 dvb_rate = 0;
>  	u16 bw10k;
> +	u32 bw_hz = p->bandwidth_hz;
>  
>  	dprintk("%s: called\n", __func__);
>  
>  	if (!state->has_dvbt)
>  		return -EINVAL;
>  
> -	if (p->bandwidth_hz > 0) {
> -		dvb_rate = p->bandwidth_hz * 8 / 7;
> -		bw10k = p->bandwidth_hz / 10000;
> -	} else {
> -		dvb_rate = 8 * 8 / 7;
> -		bw10k = 800;
> -	}
> +	if (bw_hz == 0)
> +		bw_hz = 8000000;
> +
> +	dvb_rate = bw_hz * 8 / 7;
> +	bw10k = bw_hz / 10000;
>  
>  	/* standard = DVB-T */
>  	ret = si2165_writereg8(state, 0x00ec, 0x01);

  reply	other threads:[~2015-12-03 14:15 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-19 20:03 si2165: Add simple DVB-C support Matthias Schwarzott
2015-11-19 20:03 ` [PATCH 01/10] si2165: rename frontend -> fe Matthias Schwarzott
2015-11-19 20:03 ` [PATCH 02/10] si2165: rename si2165_set_parameters to si2165_set_frontend Matthias Schwarzott
2015-11-19 20:03 ` [PATCH 03/10] si2165: create function si2165_write_reg_list for writing register lists Matthias Schwarzott
2015-11-19 20:03 ` [PATCH 04/10] si2165: only write agc registers after reset before start_syncro Matthias Schwarzott
2015-11-19 20:03 ` [PATCH 05/10] si2165: move setting ts config to init Matthias Schwarzott
2015-11-19 20:03 ` [PATCH 06/10] si2165: Simplify si2165_set_if_freq_shift usage Matthias Schwarzott
2015-11-19 20:03 ` [PATCH 07/10] si2165: Fix DVB-T bandwidth default Matthias Schwarzott
2015-12-03 14:15   ` Mauro Carvalho Chehab [this message]
2015-12-03 20:11     ` Matthias Schwarzott
2015-12-03 20:12       ` [PATCH] si2165: Reject DVB-T bandwidth auto mode Matthias Schwarzott
2015-11-19 20:04 ` [PATCH 08/10] si2165: set list of DVB-T registers together Matthias Schwarzott
2015-11-19 20:04 ` [PATCH 09/10] si2165: Prepare si2165_set_frontend for splitting Matthias Schwarzott
2015-11-19 20:04 ` [PATCH 10/10] si2165: Add DVB-C support for HVR-4400/HVR-5500 Matthias Schwarzott

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=20151203121524.33bd3130@recife.lan \
    --to=mchehab@osg.samsung.com \
    --cc=crope@iki.fi \
    --cc=linux-media@vger.kernel.org \
    --cc=xpert-reactos@gmx.de \
    --cc=zzam@gentoo.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