diff options
author | Andrew de Quincy <devnull@localhost> | 2004-01-29 20:41:01 +0000 |
---|---|---|
committer | Andrew de Quincy <devnull@localhost> | 2004-01-29 20:41:01 +0000 |
commit | 7a578435efe06c799ac4c866f7d23fb36cd40c00 (patch) | |
tree | 6c13dd40664567439c1f3cf215e57fe5cca86223 /linux/drivers/media | |
parent | 72205bf38600a53dd2acb6b7815c5249008850fa (diff) | |
download | mediapointer-dvb-s2-7a578435efe06c799ac4c866f7d23fb36cd40c00.tar.gz mediapointer-dvb-s2-7a578435efe06c799ac4c866f7d23fb36cd40c00.tar.bz2 |
Fixed i2c code to detect nearly all errors
Added "V 2.1" to prevent warning message on driver load
Some printks turned into dprintks
Diffstat (limited to 'linux/drivers/media')
-rw-r--r-- | linux/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/linux/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c b/linux/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c index 3b0387440..a77a6df69 100644 --- a/linux/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c +++ b/linux/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c @@ -40,12 +40,12 @@ so the best way is maybe to keep TTUSB_HWSECTIONS undef'd and just parse TS data. USB bandwith will be a problem when having large datastreams, especially for dvb-net, but hey, that's not my problem. - + TTUSB_DISEQC, TTUSB_TONE: let the STC do the diseqc/tone stuff. this isn't supported at least with my TTUSB, so let it undef'd unless you want to implement another frontend. never tested. - + DEBUG: define it to > 3 for really hardcore debugging. you probably don't want this unless the device doesn't load at all. > 2 for bandwidth statistics. @@ -224,6 +224,9 @@ static int ttusb_i2c_msg(struct ttusb *ttusb, err = ttusb_result(ttusb, b, 0x20); + /* check if the i2c transaction was successful */ + if ((snd_len != b[5]) || (rcv_len != b[6])) return -EREMOTEIO; + if (rcv_len > 0) { if (err || b[0] != 0x55 || b[1] != id) { @@ -274,7 +277,7 @@ static int ttusb_i2c_xfer(struct dvb_i2c_bus *i2c, const struct i2c_msg msg[], snd_buf, snd_len, rcv_buf, rcv_len); if (err < rcv_len) { - printk("%s: i == %i\n", __FUNCTION__, i); + dprintk("%s: i == %i\n", __FUNCTION__, i); break; } @@ -433,7 +436,8 @@ static int ttusb_init_controller(struct ttusb *ttusb) get_version[7], get_version[8]); if (memcmp(get_version + 4, "V 0.0", 5) && - memcmp(get_version + 4, "V 1.1", 5)) { + memcmp(get_version + 4, "V 1.1", 5) && + memcmp(get_version + 4, "V 2.1", 5)) { printk ("%s: unknown STC version %c%c%c%c%c, please report!\n", __FUNCTION__, get_version[4], get_version[5], @@ -949,7 +953,7 @@ static int ttusb_start_feed(struct dvb_demux_feed *dvbdmxfeed) struct ttusb *ttusb = (struct ttusb *) dvbdmxfeed->demux; struct ttusb_channel *channel; - printk("ttusb_start_feed\n"); + dprintk("ttusb_start_feed\n"); switch (dvbdmxfeed->type) { case DMX_TYPE_TS: @@ -1234,7 +1238,7 @@ static void ttusb_disconnect(struct usb_interface *intf) static struct usb_device_id ttusb_table[] = { {USB_DEVICE(0xb48, 0x1003)}, {USB_DEVICE(0xb48, 0x1004)}, /* to be confirmed ???? */ - {USB_DEVICE(0xb48, 0x1005)}, /* to be confirmed ???? */ + {USB_DEVICE(0xb48, 0x1005)}, {} }; |