All of lore.kernel.org
 help / color / mirror / Atom feed
From: Antti Palosaari <crope@iki.fi>
To: Jose Alberto Reguero <jareguero@telefonica.net>
Cc: Mauro Carvalho Chehab <mchehab@redhat.com>,
	linux-media@vger.kernel.org,
	Michael Krufky <mkrufky@kernellabs.com>,
	Guy Martin <gmsoft@tuxicoman.be>
Subject: Re: [PATCH] add support for the dvb-t part of CT-3650 v3
Date: Sat, 23 Jul 2011 13:37:53 +0300	[thread overview]
Message-ID: <4E2AA481.4030103@iki.fi> (raw)
In-Reply-To: <201107231221.10705.jareguero@telefonica.net>

On 07/23/2011 01:21 PM, Jose Alberto Reguero wrote:
> On Sábado, 23 de Julio de 2011 11:42:58 Antti Palosaari escribió:
>> On 07/23/2011 11:26 AM, Jose Alberto Reguero wrote:

>>> The problem is in i2c read in tda827x_probe_version. Without the fix
>>> sometimes, when changing the code the tuner is detected as  tda827xo
>>> instead of tda827xa. That is because the variable where i2c read should
>>> store the value is initialized, and sometimes it works.
>>
>> struct i2c_msg msg = { .addr = priv->i2c_addr, .flags = I2C_M_RD,
>> 			       .buf =&data, .len = 1 };
>>
>> rc = tuner_transfer(fe,&msg, 1);
>>
>> :-( Could you read what I write. It is a little bit annoying to find out
>>
>> everything for you. You just answer every time something like it does
>> not work and I should always find out what's problem.
>>
>> As I pointed out read will never work since I2C adapter supports only
>> read done in WRITE+READ combination. Driver uses read which is single
>> READ without write.
>>
>> You should implement new read. You can look example from af9015 or other
>> drivers using tda827x
>>
>> This have been never worked thus I Cc Guy Martin who have added DVB-C
>> support for that device.
>>
>>
>> regards
>> Antti
>
> I don't understand you. I think that you don' see the fix, but the old code.
> Old code:
>
> read = i+1<   num&&   (msg[i+1].flags&   I2C_M_RD);
>
> Fix:
>
> read1 = i+1<  num&&  (msg[i+1].flags&  I2C_M_RD); for the tda10023 and tda10048
> read2 = msg[i].flags&  I2C_M_RD; for the tda827x
>
> Jose Alberto

First of all I must apologize of blaming you about that I2C adapter, 
sorry, I should going to shame now. It was me who doesn't read your 
changes as should :/

Your changes are logically OK and implements correctly single reading as 
needed. Some comments still;
* consider renaming read1 and read2 for example write_read and read
* obuf[1] contains WRITE len. your code sets that now as READ len. 
Probably it should be 0 always in single write since no bytes written.
* remove useless checks from end of the "if (foo) if (foo)";
if (read1 || read2) {
	if (read1) {
[...]
	} else if (read2)

If you store some variables at the beginning, olen, ilen, obuf, ibuf, 
you can increase i++ for write+read and rest of the code in function can 
be same (no more if read or write + read). But maybe it is safe to keep 
closer original than change such much.


regards
Antti
-- 
http://palosaari.fi/

  reply	other threads:[~2011-07-23 10:37 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <201106070205.08118.jareguero@telefonica.net>
     [not found] ` <201107070057.06317.jareguero@telefonica.net>
2011-07-13 12:41   ` [PATCH] add support for the dvb-t part of CT-3650 v2 Mauro Carvalho Chehab
2011-07-14 20:00     ` [PATCH] add support for the dvb-t part of CT-3650 v3 Jose Alberto Reguero
2011-07-18 20:28       ` Antti Palosaari
2011-07-18 21:31         ` Michael Krufky
     [not found]         ` <201107190100.16802.jareguero@telefonica.net>
2011-07-18 23:44           ` Antti Palosaari
2011-07-19  8:25             ` Jose Alberto Reguero
2011-07-19 23:07               ` Antti Palosaari
2011-07-22 11:32                 ` Antti Palosaari
2011-07-22 16:02                   ` Jose Alberto Reguero
2011-07-22 16:08                     ` Antti Palosaari
2011-07-22 16:25                       ` Jose Alberto Reguero
2011-07-22 16:46                         ` Antti Palosaari
     [not found]                           ` <201107222012.20711.jareguero@telefonica.net>
2011-07-22 21:49                             ` Jose Alberto Reguero
2011-07-22 22:23                               ` Antti Palosaari
2011-07-23  8:26                                 ` Jose Alberto Reguero
2011-07-23  9:42                                   ` Antti Palosaari
2011-07-23 10:21                                     ` Jose Alberto Reguero
2011-07-23 10:37                                       ` Antti Palosaari [this message]
2011-07-23 15:41                                         ` Jose Alberto Reguero
2011-07-23 17:47                                           ` Antti Palosaari
2011-07-23 21:45                                             ` Jose Alberto Reguero
2011-07-27 19:22                                               ` Antti Palosaari
2011-07-28 19:25                                                 ` Jose Alberto Reguero
2011-08-02 19:21                                                   ` Jose Alberto Reguero
2011-08-08 10:35                                                     ` Jose Alberto Reguero
2011-08-08 21:44                                                       ` Antti Palosaari
2011-08-09 19:45                                                         ` Jose Alberto Reguero
2011-07-16 11:38     ` [PATCH] improve recection with limits frecuenies and tda827x Jose Alberto Reguero

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=4E2AA481.4030103@iki.fi \
    --to=crope@iki.fi \
    --cc=gmsoft@tuxicoman.be \
    --cc=jareguero@telefonica.net \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.