Mailing List archive

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

[linux-dvb] Re: mt352 and SkyStar2 (FlexCop IIB) oddities



BStiddien@XentoniX.net wrote:
Hello,
I'm currently stuck on making the mt352 driver work with my TechniSat AirStar2 DVB-T card.
That card uses the mt352 chip with some Samsung tuner.
I came across this forum when I googled a bit:
http://pvrguide.no-ip.com/bbs-old/viewtopic.php?t=3413
This TechniSat card uses the same tuner as mentioned in the post (TDTC9251DH01C),
I've went through the whole mt352 module and compared everything with the design manual of the mt352 (e.g. I checked the whole mt352_set_parameters function to check if the module provides correct data with the tuner), but I simply don't know if those tuner-dependent variables work with the Samsung tuner (don't think so after my investigations).
My question now is: Did you get any information (emailing Samsung or so) for this tuner?

Also, I found some oddities when looking at the mt352 driver.
The TechniSat AirStar2 uses a FlexCop IIB b2c2 chip that works with the SkyStar2 module, but in the linuxtv cvs-tree the skystar2.c has the following check in master_xfer:
if ((msgs[i].addr != 0x0e) && (msgs[i].addr != 0x0f) && (msgs[i].addr != 0x68) && (msgs[i].addr != 0x61))
but the I2C address of the mt352 is/defaults to 0x0f, which causes the whole module to fail transferring any I2C messages.
Adding 0x0f to that if solves this error.
This is not an error, the "if" line is to prevent other frontends than mt312 and stv0299 from accessing the flexcop i2c bus. 0x0e is for the mt312/vp310, 0x68/0x61 are for the stv0299. For every new frontend its i2c address has to be added to the "if". This is also noted in a comment just above the line.


Another oddity - in master_xfer too - is the following:
// read command
if ((num == 2) && (msgs[0].flags == 0) && (msgs[1].flags == I2C_M_RD) && (msgs[0].buf != NULL) && (msgs[1].buf != NULL))

In mt352.c the read command is contains the following:
struct i2c_msg msg [] = { { .addr = I2C_MT352_ADDR,
.flags = I2C_M_NOSTART,
.buf = b0, .len = 1 },
{ .addr = I2C_MT352_ADDR,
.flags = I2C_M_RD,
.buf = b1, .len = 1 } };

as I2C_M_NOSTART isn't defined as 0 every read_register command will fail too.
Changing I2C_M_NOSTART to 0 solves the problem and the module can read the mt352 registers successfully.
This line serves the purpose to get the i2c communication right. The i2c implementation of the flexcop is a little odd -- in principle every operation is allowed, but it is limited to a single byte read/write at once. Search the list for details, I had some communication with Augusto about that around January this year. Thus one has to parse the incoming i2c message and "replex" it into the format the flexcop can cope with. Comparing against 0 is a little unclean, IMHO it should rather be I2C_M_RD, then you'd have to add an || msgs[0].flags == I2C_M_NOSTART
otherwise it could break the SkyStar 2 support.

Looking forward to hear some comments/explanations or so.
Hope that helps,

Niklas





Home | Main Index | Thread Index