public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mchehab@infradead.org>
To: Stefan Ringel <stefan.ringel@arcor.de>
Cc: Devin Heitmueller <dheitmueller@kernellabs.com>,
	linux-media@vger.kernel.org
Subject: Re: [PATCH 14/15] - zl10353
Date: Thu, 04 Feb 2010 22:06:58 -0200	[thread overview]
Message-ID: <4B6B6122.9090704@infradead.org> (raw)
In-Reply-To: <4B6B3824.8040705@arcor.de>

Stefan Ringel wrote:
> Am 04.02.2010 03:43, schrieb Mauro Carvalho Chehab:
>> Stefan Ringel wrote:
>>   
>>> Am 03.02.2010 21:49, schrieb Devin Heitmueller:
>>>     
>>>> On Wed, Feb 3, 2010 at 3:38 PM, Stefan Ringel <stefan.ringel@arcor.de> wrote:
>>>>   
>>>>       
>>>>> signed-off-by: Stefan Ringel <stefan.ringel@arcor.de>
>>>>>
>>>>> --- a/drivers/media/dvb/frontends/zl10353.h
>>>>> +++ b/drivers/media/dvb/frontends/zl10353.h
>>>>> @@ -45,6 +45,8 @@ struct zl10353_config
>>>>>        /* clock control registers (0x51-0x54) */
>>>>>        u8 clock_ctl_1;  /* default: 0x46 */
>>>>>        u8 pll_0;        /* default: 0x15 */
>>>>> +
>>>>> +       int tm6000:1;
>>>>>  };
>>>>>     
>>>>>         
>>>> Why is this being submitted as its own patch?  It is code that is not
>>>> used by *anything*.  If you really did require a new field in the
>>>> zl10353 config, that field should be added in the same patch as
>>>> whatever requires it.
>>>>
>>>> Devin
>>>>
>>>>
>>>>       
>> Hi Stefan,
>>
>> Due to the problem with your emailer, most of the patches failed:
>>
>> 2/15 3/15 4/15 5/15 6/15 7/15 2/15 (the second one 8th in the sequence)
>> 9/15 11/15 12/15 13/15 and 15/15.
>>
>> In brief, only two patches applied: the 1/15 and a patch also called 2/15
>> (I suspect it is the 10th patch).
>>
>> So, after reading our comments, reading README.patches and applying the 
>> Asaulted-patches extension to your thunderbird, please resubmit the patches.
>>  
>>   
>>> Actually doesn't work zl10353 with tm6010, it have a little different
>>> between a few registers, so I think that I use it.
>>>
>>> for example:
>>> zl10353 use 0x64 , but not mine (0x63)
>>> register 0x5f is 0x17 not 0x13
>>> register 0x5e is 0x40 not 0x00 for auto
>>> and tuner go is 0x70 not 0x71
>>>
>>> the other register are ok. I have no idea how I can set it.
>>>     
>> I agree with Devin that the patch 14/15 shouldn't be applied as-is.
>>
>> I have no idea why zl10353 needs a different setup, but you don't need
>> to add an extra parameter to identify the bridge driver. There's a field
>> at struct i2c_client that can be used: i2c_adapter->id.
>>
>> This is already initialized with I2C_HW_B_TM6000 (although it currently
>> uses a fake value).
>>
>> It is still ugly to do some specific initialization like this, but, when
>> we have no other glue, due to the lack of datasheets, this is a better
>> alternative than adding an extra fake parameter at the config struct.
>>
>> All you need is some code like:
>>
>>
>> diff --git a/linux/drivers/media/dvb/frontends/zl10353.c b/linux/drivers/media/dvb/frontends/zl10353.c
>> --- a/linux/drivers/media/dvb/frontends/zl10353.c
>> +++ b/linux/drivers/media/dvb/frontends/zl10353.c
>> @@ -597,6 +597,10 @@ static int zl10353_init(struct dvb_front
>>  	    zl10353_read_register(state, 0x51) != zl10353_reset_attach[2]) {
>>  		rc = zl10353_write(fe, zl10353_reset_attach,
>>  				   sizeof(zl10353_reset_attach));
>> +
>> +		if (state->i2c->id == I2C_HW_B_TM6000) {
>> +			/* Do special init needed by tm6000 driver */
>> +		}
>>  #if 1
>>  		if (debug_regs)
>>  			zl10353_dump_regs(fe);
>> diff --git a/linux/drivers/staging/tm6000/tm6000-i2c.c b/linux/drivers/staging/tm6000/tm6000-i2c.c
>> --- a/linux/drivers/staging/tm6000/tm6000-i2c.c
>> +++ b/linux/drivers/staging/tm6000/tm6000-i2c.c
>> @@ -33,8 +33,6 @@
>>  #include "tuner-xc2028.h"
>>  
>>  
>> -/*FIXME: Hack to avoid needing to patch i2c-id.h */
>> -#define I2C_HW_B_TM6000 I2C_HW_B_EM28XX
>>  /* ----------------------------------------------------------- */
>>  
>>  static unsigned int i2c_debug = 0;
>> diff --git a/linux/include/linux/i2c-id.h b/linux/include/linux/i2c-id.h
>> --- a/linux/include/linux/i2c-id.h
>> +++ b/linux/include/linux/i2c-id.h
>> @@ -42,6 +42,7 @@
>>  #define I2C_HW_B_AU0828		0x010023 /* auvitek au0828 usb bridge */
>>  #define I2C_HW_B_CX231XX	0x010024 /* Conexant CX231XX USB based cards */
>>  #define I2C_HW_B_HDPVR		0x010025 /* Hauppauge HD PVR */
>> +#define I2C_HW_B_TM6000		0x010026 /* TM5600/6000/6010 video bridge */
>>  
>>  /* --- SGI adapters							*/
>>  #define I2C_HW_SGI_VINO		0x160000
>>   
> init is ok, but it has only one additional register 0x55 (value 0x40) 
> reset after second. I think it can work without this additional once.
> The different is in function "set_parameters".


Ok. Well, just add the logic to check for the bridge at the place it is needed, and
only if it won't work otherwise. I would love to have the datasheet to check for
the values, but unfortunately I don't have it. Anyway, after having it working, someone
may help to figure out why the changes are needed and provide a better approach.

-

A side note:

due to the backport code that you've added on your patches, I suspect that you just
copied the files from the -hg to -git. You shouldn't do it, since we remove all backport
stuff at -git, by running the gentree.pl script, found at v4l/scripts/gentree.pl.

-- 

Cheers,
Mauro

  reply	other threads:[~2010-02-05  0:07 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-01 20:20 [PATCH] - tm6000 DVB support Stefan Ringel
2010-02-01 20:35 ` Stefan Ringel
2010-02-01 20:52   ` Devin Heitmueller
2010-02-01 21:23     ` Stefan Ringel
2010-02-01 21:44       ` Devin Heitmueller
2010-02-01 22:00         ` Stefan Ringel
2010-02-01 23:05           ` Mauro Carvalho Chehab
2010-02-02 16:14             ` Stefan Ringel
2010-02-02 16:44               ` Mauro Carvalho Chehab
2010-02-02 17:38                 ` Stefan Ringel
2010-02-02 20:05                   ` Mauro Carvalho Chehab
2010-02-01 22:52   ` Mauro Carvalho Chehab
2010-02-02 17:24     ` Stefan Ringel
2010-02-02 20:03       ` Mauro Carvalho Chehab
2010-02-02 20:19         ` Stefan Ringel
2010-02-02 20:30           ` Mauro Carvalho Chehab
2010-02-02 20:42         ` Stefan Ringel
2010-02-02 20:52           ` Mauro Carvalho Chehab
2010-02-02 21:11             ` Stefan Ringel
2010-02-03 20:10               ` [PATCH 1/15] - tm6000 build hunk Stefan Ringel
2010-02-03 20:13                 ` [PATCH 2/15] - tm6000 add Terratec Cinergy Hybrid XE Stefan Ringel
2010-02-03 20:15                   ` [PATCH 3/15] - tm6000 bugfix hunk in init_dev Stefan Ringel
2010-02-03 20:22                     ` Mauro Carvalho Chehab
2010-02-03 20:16                   ` [PATCH 4/15] - tm6000.h Stefan Ringel
2010-02-03 20:25                     ` Mauro Carvalho Chehab
2010-02-03 20:50                       ` Stefan Ringel
2010-02-03 20:58                         ` Devin Heitmueller
2010-02-03 21:31                         ` Mauro Carvalho Chehab
2010-02-03 20:18                   ` [PATCH 5/15] - tm6000 bugfix i2c transfer Stefan Ringel
2010-02-03 20:18                   ` [PATCH 2/15] - tm6000 add Terratec Cinergy Hybrid XE Mauro Carvalho Chehab
2010-02-03 20:20                   ` [PATCH 6/15] - tm6000 bugfix usb transfer in DVB mode Stefan Ringel
2010-02-03 20:22                   ` [PATCH 7/15] - tm6000 Stefan Ringel
2010-02-03 20:23                   ` [PATCH 2/15] - tm6000 bugfix Stefan Ringel
2010-02-03 20:25                   ` [PATCH 9/15] - tm6000 analog digital switch Stefan Ringel
2010-02-03 20:40                     ` Mauro Carvalho Chehab
2010-02-03 20:55                       ` Stefan Ringel
2010-02-03 21:21                         ` Mauro Carvalho Chehab
2010-02-03 20:27                   ` [PATCH 2/15] - tm6000 add digital init for tm6010 Stefan Ringel
2010-02-03 20:29                   ` [PATCH 11/15] - tm6000 add " Stefan Ringel
2010-02-03 20:31                   ` [PATCH 12/15] - tm6000 bugfix tuner reset time and tuner param Stefan Ringel
2010-02-03 20:52                     ` Devin Heitmueller
2010-02-03 21:15                       ` Stefan Ringel
2010-02-03 20:36                   ` [PATCH 13/15] - xc2028 bugfix for firmware 3.6 -> Zarlink use without shift in DTV8 or DTV78 Stefan Ringel
2010-02-03 20:45                     ` Devin Heitmueller
2010-02-03 20:38                   ` [PATCH 14/15] - zl10353 Stefan Ringel
2010-02-03 20:49                     ` Devin Heitmueller
2010-02-03 21:07                       ` Stefan Ringel
2010-02-04  2:43                         ` Mauro Carvalho Chehab
2010-02-04 21:12                           ` Stefan Ringel
2010-02-05  0:06                             ` Mauro Carvalho Chehab [this message]
2010-02-03 20:40                   ` [PATCH 15/15] - tm6000 hack with different demodulator parameter Stefan Ringel
2010-02-03 20:47                     ` Devin Heitmueller
2010-02-03 20:16                 ` [PATCH 1/15] - tm6000 build hunk Mauro Carvalho Chehab
2010-02-03 20:17                 ` Devin Heitmueller
2010-02-03 21:48                 ` 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=4B6B6122.9090704@infradead.org \
    --to=mchehab@infradead.org \
    --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