From: Mauro Carvalho Chehab <mchehab@redhat.com>
To: stefan.ringel@arcor.de
Cc: linux-media@vger.kernel.org, dheitmueller@kernellabs.com
Subject: Re: [PATCH 09/11] zl10353: tm6000: bugfix reading problems with tm6000 i2c host
Date: Thu, 18 Feb 2010 18:20:11 -0200 [thread overview]
Message-ID: <4B7DA0FB.5010506@redhat.com> (raw)
In-Reply-To: <1266255444-7422-9-git-send-email-stefan.ringel@arcor.de>
stefan.ringel@arcor.de wrote:
> From: Stefan Ringel <stefan.ringel@arcor.de>
>
> Signed-off-by: Stefan Ringel <stefan.ringel@arcor.de>
>
> diff --git a/drivers/media/dvb/frontends/zl10353.c b/drivers/media/dvb/frontends/zl10353.c
> index 8c61271..9716d7e 100644
> --- a/drivers/media/dvb/frontends/zl10353.c
> +++ b/drivers/media/dvb/frontends/zl10353.c
> @@ -74,7 +74,7 @@ static int zl10353_write(struct dvb_frontend *fe, u8 *ibuf, int ilen)
> return 0;
> }
>
> -static int zl10353_read_register(struct zl10353_state *state, u8 reg)
> +static int zl10353_read1_register(struct zl10353_state *state, u8 reg)
> {
> int ret;
> u8 b0[1] = { reg };
> @@ -97,6 +97,41 @@ static int zl10353_read_register(struct zl10353_state *state, u8 reg)
> return b1[0];
> }
>
> +static int zl10353_read2_register(struct zl10353_state *state, u8 reg)
> +{
> + int ret;
> + u8 b0[1] = { reg - 1 };
> + u8 b1[1] = { 0 };
> + struct i2c_msg msg[2] = { { .addr = state->config.demod_address,
> + .flags = 0,
> + .buf = b0, .len = 1 },
> + { .addr = state->config.demod_address,
> + .flags = I2C_M_RD,
> + .buf = b1, .len = 2 } };
> +
> + ret = i2c_transfer(state->i2c, msg, 2);
> +
> + if (ret != 2) {
> + printk("%s: readreg error (reg=%d, ret==%i)\n",
> + __func__, reg, ret);
> + return ret;
> + }
> +
> + return b1[1];
> +}
This patch doesn't look correct to me. The size of the zl10353 read register doesn't
change when it is used with tm6000. The solution should be at tm6000-i2c, basically
using the same REQ for 2 bytes when only 1 byte is being read.
Cheers,
Mauro
next prev parent reply other threads:[~2010-02-18 20:20 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-15 17:37 [PATCH 01/11] xc2028: tm6000: bugfix firmware xc3028L-v36.fw used with Zarlink and DTV78 or DTV8 no shift stefan.ringel
2010-02-15 17:37 ` [PATCH 02/11] tm6000: add i2c bus id for tm6000 stefan.ringel
2010-02-15 17:37 ` [PATCH 03/11] tm6000: add additional init register stefan.ringel
2010-02-15 17:37 ` [PATCH 04/11] tm6000: add different tuner reset for terratec stefan.ringel
2010-02-15 17:37 ` [PATCH 05/11] tm6000: add card setup for terratec cinergy hybrid stefan.ringel
2010-02-15 17:37 ` [PATCH 06/11] tm6000: reset the numbers of feeds to 8 stefan.ringel
2010-02-15 17:37 ` [PATCH 07/11] tm6000: add i2c send recv functions stefan.ringel
2010-02-15 17:37 ` [PATCH 08/11] tm6000: special request for all tuner stefan.ringel
2010-02-15 17:37 ` [PATCH 09/11] zl10353: tm6000: bugfix reading problems with tm6000 i2c host stefan.ringel
2010-02-15 17:37 ` [PATCH 10/11] tm6000: remove hack.c hack.h, switch to zl10353 module stefan.ringel
2010-02-15 17:37 ` [PATCH 11/11] tm6000: change version to 0.0.2 stefan.ringel
2010-02-18 20:20 ` Mauro Carvalho Chehab [this message]
2010-02-18 20:28 ` [PATCH 07/11] tm6000: add i2c send recv functions Mauro Carvalho Chehab
2010-02-15 18:36 ` [PATCH 01/11] xc2028: tm6000: bugfix firmware xc3028L-v36.fw used with Zarlink and DTV78 or DTV8 no shift Devin Heitmueller
2010-02-15 19:19 ` Stefan Ringel
2010-02-15 20:29 ` Stefan Ringel
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=4B7DA0FB.5010506@redhat.com \
--to=mchehab@redhat.com \
--cc=dheitmueller@kernellabs.com \
--cc=linux-media@vger.kernel.org \
--cc=stefan.ringel@arcor.de \
/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