Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[linux-dvb] Re: Terratec Cinergy 1200 DVB-C Card supported?



Markus Schulz schrieb:
In my last post something was wrong.
No tuner will be found.
I've forgot to set an correct return value for probe method.

Okay, the tuner will now be detected. (type = 0) (i'm also use the inittab from the 2.4er code)

probe_tuner code now is:(converted code from 2.4er modul)
****************************************
static int
test_tuner(struct i2c_adapter *i2c, long demod_addr, u8 addr)
{
u8 buf[1]={ 0x00 };
struct i2c_msg msg={.addr=addr, .flags=I2C_M_RD, .buf=buf, .len=1};
u8 buf1[2] = { 0x0f, tda10021_inittab[0x0f]|0x80 };
u8 buf2[2] = { 0x0f, tda10021_inittab[0x0f] & 0x7f };
struct i2c_msg msg_pre = {.addr=demod_addr, .flags=0, .buf=buf1, .len=2};
struct i2c_msg msg_post = {.addr=demod_addr, .flags=0, .buf=buf2, .len=2};

i2c_transfer(i2c, &msg_pre, 1);
if (i2c_transfer(i2c, &msg, 1)!=1)
return -1;

i2c_transfer(i2c, &msg_post, 1);
return 0;
}

static long probe_tuner(struct i2c_adapter *i2c, long demod_addr)
{
int type=0;
u8 addr;
for(addr=0x60;addr<0x64;addr++,type++)
{
if(!test_tuner(i2c, demod_addr, addr))
{
printk("tda10021: tuner type %d found\n", type);
return type;
}
}
printk("tda10021: no valid tuner type found\n");
return -1;
}

now i'm converting the set_frequency code.
it seems to me that every i2c transfer must be begin with an initial register set before and reset after the call.(taken from 2.4er code)

Markus




Home | Main Index | Thread Index