[linux-dvb] [PATCH] Nebula DVB-T with MT352 Frontend

David Johnson dj at david-web.co.uk
Fri Aug 5 16:14:55 CEST 2005

On Thursday 04 August 2005 14:03, Johannes Stezenbach wrote:
> For the Nebula it may be that simple, but in the general case there
> might be more work to do (e.g. first make sure the demod is not
> in sleep state, need to probe PLL seperately etc.). Every time
> there's a new Nebula version the code needs updateing and gets more
> complex...

Mainly as an exercise for myself, I've coded this up.
So instead of trying to attach each frontend in turn, we attempt to read a 
register on the nxt6000. Basically if the i2c read succeeds, we know that 
we've got the nxt6000 frontend, otherwise it's the mt352. This also isn't a 
terribly clean way of doing it, but it's how Nebula do it.

As I say, this was mainly an exercise for myself to see if I could implement 
it successfully, so I won't be too upset if you decide it isn't worth doing.

Here's the code (hopefully it won't get too messed up by my MUA):

int i2cret;
u8 b0[] = { 0x00 };
u8 b1[] = { 0 };
struct i2c_msg msgs[] = {
  {.addr = 0x14,.flags = 0,.buf = b0,.len = 1},
  {.addr = 0x14,.flags = I2C_M_RD,.buf = b1,.len = 1}

i2cret = i2c_transfer(card->i2c_adapter, msgs, 2);

dprintk ("dvb_bt8xx: i2c read got value %d, function returned %d\n", b1[0], 

if (b1[0] == 0x0b) {
  /* Old Nebula (marked (c)2003 on high profile pci card) has nxt6000 demod */
  card->fe = nxt6000_attach(&vp3021_alps_tded4_config, card->i2c_adapter);
  dprintk ("dvb_bt8xx: an nxt6000 was detected on your digitv card\n");
} else {
  /* New Nebula (marked (c)2005 on low profile pci card) has mt352 demod */
  card->fe = mt352_attach(&digitv_alps_tded4_config, card->i2c_adapter);
  dprintk ("dvb_bt8xx: an mt352 was detected on your digitv card\n");

if (card->fe == NULL)
  dprintk ("dvb_bt8xx: a supported frontend was not found on your digitv 

I don't have an nxt6000-based card to test with, but the code compiles cleanly 
and succeeds in reading a value from the mt352 if I change the I2C address.

If you think doing this detection is worthwhile, I'll create a patch and get 
somebody to test it with an nxt6000, otherwise I'll create a patch to remove 
the comment from the code and stop bothering you :-)


More information about the linux-dvb mailing list