public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: tvboxspy <malcolmpriestley@gmail.com>
To: Antti Palosaari <crope@iki.fi>
Cc: linux-media <linux-media@vger.kernel.org>,
	Michael Krufky <mkrufky@kernellabs.com>,
	Mauro Carvalho Chehab <mchehab@redhat.com>,
	Jean Delvare <khali@linux-fr.org>
Subject: Re: [RFC 2/2] tda18218: use generic dvb_wr_regs()
Date: Wed, 09 Nov 2011 22:06:55 +0000	[thread overview]
Message-ID: <4EBAF97F.4000105@test.com> (raw)
In-Reply-To: <4EB9C272.2010607@iki.fi>

On 08/11/11 23:59, Antti Palosaari wrote:
> Signed-off-by: Antti Palosaari <crope@iki.fi>
> ---
> drivers/media/common/tuners/tda18218.c | 69 +++++---------------------
> drivers/media/common/tuners/tda18218_priv.h | 3 +
> 2 files changed, 17 insertions(+), 55 deletions(-)
>
> diff --git a/drivers/media/common/tuners/tda18218.c
> b/drivers/media/common/tuners/tda18218.c
> index aacfe23..fef5560f 100644
> --- a/drivers/media/common/tuners/tda18218.c
> +++ b/drivers/media/common/tuners/tda18218.c
> @@ -25,46 +25,6 @@ static int debug;
> module_param(debug, int, 0644);
> MODULE_PARM_DESC(debug, "Turn on/off debugging (default:off).");
>
> -/* write multiple registers */
> -static int tda18218_wr_regs(struct tda18218_priv *priv, u8 reg, u8
> *val, u8 len)
> -{
> - int ret = 0;
> - u8 buf[1+len], quotient, remainder, i, msg_len, msg_len_max;
> - struct i2c_msg msg[1] = {
> - {
> - .addr = priv->cfg->i2c_address,
> - .flags = 0,
> - .buf = buf,
> - }
> - };
> -
> - msg_len_max = priv->cfg->i2c_wr_max - 1;
> - quotient = len / msg_len_max;
> - remainder = len % msg_len_max;
> - msg_len = msg_len_max;
> - for (i = 0; (i <= quotient && remainder); i++) {
> - if (i == quotient) /* set len of the last msg */
> - msg_len = remainder;
> -
> - msg[0].len = msg_len + 1;
> - buf[0] = reg + i * msg_len_max;
> - memcpy(&buf[1], &val[i * msg_len_max], msg_len);
> -
> - ret = i2c_transfer(priv->i2c, msg, 1);
> - if (ret != 1)
> - break;
> - }

The only thing I am not sure is whether devices such as af9013 are 
keeping their gate control continuously open through the write 
operations and not timing out.

This applies to tda18218, mxl5005s and other tuners, which have 
multipliable writes with no gate control between the writes, only at the 
start and end of the sequence.

Afatech seem to imply that full gate control is required on all I2C 
read/write operations.

With other devices such as stv0288 do close their gate after a stop 
condition.

Regards


Malcolm

  reply	other threads:[~2011-11-09 22:07 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-08 23:59 [RFC 2/2] tda18218: use generic dvb_wr_regs() Antti Palosaari
2011-11-09 22:06 ` tvboxspy [this message]
2011-11-09 22:18   ` Antti Palosaari
2011-11-09 23:01   ` Antti Palosaari
2011-11-10  8:20     ` Jean Delvare

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=4EBAF97F.4000105@test.com \
    --to=malcolmpriestley@gmail.com \
    --cc=crope@iki.fi \
    --cc=khali@linux-fr.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@redhat.com \
    --cc=mkrufky@kernellabs.com \
    /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