lkml.org 
[lkml]   [2010]   [Oct]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: DVB: af9015 defunct [was: mmotm 2010-10-20-15-01 uploaded]
Em 22-10-2010 12:06, Jiri Slaby escreveu:
> On 10/22/2010 03:56 PM, Mauro Carvalho Chehab wrote:
>> --- a/drivers/media/dvb/dvb-usb/af9015.c
>> +++ b/drivers/media/dvb/dvb-usb/af9015.c
>> @@ -1144,7 +1144,7 @@ static struct qt1010_config af9015_qt1010_config = {
>>
>> static struct tda18271_config af9015_tda18271_config = {
>> .gate = TDA18271_GATE_DIGITAL,
>> - .small_i2c = 1,
>> + .small_i2c = TDA18271_16_BYTE_CHUNK_INIT;,
>
> No, it doesn't help (note the i2c line which prints the small_i2c entry):
> dvb-usb: found a 'Leadtek WinFast DTV Dongle Gold' in cold state, will
> try to load a firmware
> dvb-usb: downloading firmware from file 'dvb-usb-af9015.fw'
> dvb-usb: found a 'Leadtek WinFast DTV Dongle Gold' in warm state.
> dvb-usb: will pass the complete MPEG2 transport stream to the software
> demuxer.
> DVB: registering new adapter (Leadtek WinFast DTV Dongle Gold)
> af9013: firmware version:4.95.0.0
> DVB: registering adapter 0 frontend 0 (Afatech AF9013 DVB-T)...
> af9015_tuner_attach: i2c 16
> tda18271 16-00c0: creating new instance
> TDA18271HD/C2 detected @ 16-00c0
> af9015: command failed:1

> tda18271_write_regs: [16-00c0|M] ERROR: idx = 0x0, len = 39,
> i2c_transfer returned: -1

Hmm...

int tda18271_write_regs(struct dvb_frontend *fe, int idx, int len)
{
...
switch (priv->small_i2c) {
case TDA18271_03_BYTE_CHUNK_INIT:
max = 3;
break;
case TDA18271_08_BYTE_CHUNK_INIT:
max = 8;
break;
case TDA18271_16_BYTE_CHUNK_INIT:
max = 16;
break;
case TDA18271_39_BYTE_CHUNK_INIT:
default:
max = 39;
}


with small_i2c = 1, the driver will not restrict the maximum length size.

It's weird that the patch didn't fix it. Are you sure that reverting this
patch is enough to make the driver work?

Please test this one.

It will properly log the size of the message the driver tried to use, and will
reduce the max number of bytes per I2C transfer to 8.

Cheers,
Mauro

---

Fix tda18271 usage with af9015

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>

diff --git a/drivers/media/common/tuners/tda18271-common.c b/drivers/media/common/tuners/tda18271-common.c
index 195b30e..5466d47 100644
--- a/drivers/media/common/tuners/tda18271-common.c
+++ b/drivers/media/common/tuners/tda18271-common.c
@@ -237,7 +237,7 @@ int tda18271_write_regs(struct dvb_frontend *fe, int idx, int len)

if (ret != 1)
tda_err("ERROR: idx = 0x%x, len = %d, "
- "i2c_transfer returned: %d\n", idx, len, ret);
+ "i2c_transfer returned: %d\n", idx, max, ret);

return (ret == 1 ? 0 : ret);
}
diff --git a/drivers/media/dvb/dvb-usb/af9015.c b/drivers/media/dvb/dvb-usb/af9015.c
index 3ef19a8..e3c9bb5 100644
--- a/drivers/media/dvb/dvb-usb/af9015.c
+++ b/drivers/media/dvb/dvb-usb/af9015.c
@@ -1131,7 +1131,7 @@ static struct qt1010_config af9015_qt1010_config = {

static struct tda18271_config af9015_tda18271_config = {
.gate = TDA18271_GATE_DIGITAL,
- .small_i2c = 1,
+ .small_i2c = TDA18271_08_BYTE_CHUNK_INIT,
};

static struct mxl5005s_config af9015_mxl5003_config = {



\
 
 \ /
  Last update: 2010-10-27 18:15    [W:0.136 / U:0.044 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site