diff options
| -rw-r--r-- | drivers/media/dvb/dvb-usb/dib0700_devices.c | 32 |
1 files changed, 27 insertions, 5 deletions
diff --git a/drivers/media/dvb/dvb-usb/dib0700_devices.c b/drivers/media/dvb/dvb-usb/dib0700_devices.c index 36d29f9d2f68..ffecb6ed8190 100644 --- a/drivers/media/dvb/dvb-usb/dib0700_devices.c +++ b/drivers/media/dvb/dvb-usb/dib0700_devices.c | |||
| @@ -94,12 +94,28 @@ static int bristol_frontend_attach(struct dvb_usb_adapter *adap) | |||
| 94 | (10 + adap->id) << 1, &bristol_dib3000mc_config[adap->id])) == NULL ? -ENODEV : 0; | 94 | (10 + adap->id) << 1, &bristol_dib3000mc_config[adap->id])) == NULL ? -ENODEV : 0; |
| 95 | } | 95 | } |
| 96 | 96 | ||
| 97 | int eeprom_read(struct i2c_adapter *adap,u8 adrs,u8 *pval) | ||
| 98 | { | ||
| 99 | struct i2c_msg msg[2] = { | ||
| 100 | { .addr = 0x50, .flags = 0, .buf = &adrs, .len = 1 }, | ||
| 101 | { .addr = 0x50, .flags = I2C_M_RD, .buf = pval, .len = 1 }, | ||
| 102 | }; | ||
| 103 | if (i2c_transfer(adap, msg, 2) != 2) return -EREMOTEIO; | ||
| 104 | return 0; | ||
| 105 | } | ||
| 106 | |||
| 97 | static int bristol_tuner_attach(struct dvb_usb_adapter *adap) | 107 | static int bristol_tuner_attach(struct dvb_usb_adapter *adap) |
| 98 | { | 108 | { |
| 99 | struct dib0700_state *st = adap->dev->priv; | 109 | struct i2c_adapter *prim_i2c = &adap->dev->i2c_adap; |
| 100 | struct i2c_adapter *tun_i2c = dib3000mc_get_tuner_i2c_master(adap->fe, 1); | 110 | struct i2c_adapter *tun_i2c = dib3000mc_get_tuner_i2c_master(adap->fe, 1); |
| 101 | return dvb_attach(mt2060_attach,adap->fe, tun_i2c, &bristol_mt2060_config[adap->id], | 111 | s8 a; |
| 102 | st->mt2060_if1[adap->id]) == NULL ? -ENODEV : 0; | 112 | int if1=1220; |
| 113 | if (adap->dev->udev->descriptor.idVendor == USB_VID_HAUPPAUGE && | ||
| 114 | adap->dev->udev->descriptor.idProduct == USB_PID_HAUPPAUGE_NOVA_T_500_2) { | ||
| 115 | if (!eeprom_read(prim_i2c,0x59 + adap->id,&a)) if1=1220+a; | ||
| 116 | } | ||
| 117 | return dvb_attach(mt2060_attach,adap->fe, tun_i2c,&bristol_mt2060_config[adap->id], | ||
| 118 | if1) == NULL ? -ENODEV : 0; | ||
| 103 | } | 119 | } |
| 104 | 120 | ||
| 105 | /* STK7700D: Pinnacle/Terratec/Hauppauge Dual DVB-T Diversity */ | 121 | /* STK7700D: Pinnacle/Terratec/Hauppauge Dual DVB-T Diversity */ |
| @@ -628,16 +644,22 @@ static struct mt2060_config stk7700p_mt2060_config = { | |||
| 628 | 644 | ||
| 629 | static int stk7700p_tuner_attach(struct dvb_usb_adapter *adap) | 645 | static int stk7700p_tuner_attach(struct dvb_usb_adapter *adap) |
| 630 | { | 646 | { |
| 647 | struct i2c_adapter *prim_i2c = &adap->dev->i2c_adap; | ||
| 631 | struct dib0700_state *st = adap->dev->priv; | 648 | struct dib0700_state *st = adap->dev->priv; |
| 632 | struct i2c_adapter *tun_i2c; | 649 | struct i2c_adapter *tun_i2c; |
| 633 | 650 | s8 a; | |
| 651 | int if1=1220; | ||
| 652 | if (adap->dev->udev->descriptor.idVendor == USB_VID_HAUPPAUGE && | ||
| 653 | adap->dev->udev->descriptor.idProduct == USB_PID_HAUPPAUGE_NOVA_T_STICK) { | ||
| 654 | if (!eeprom_read(prim_i2c,0x58,&a)) if1=1220+a; | ||
| 655 | } | ||
| 634 | if (st->is_dib7000pc) | 656 | if (st->is_dib7000pc) |
| 635 | tun_i2c = dib7000p_get_i2c_master(adap->fe, DIBX000_I2C_INTERFACE_TUNER, 1); | 657 | tun_i2c = dib7000p_get_i2c_master(adap->fe, DIBX000_I2C_INTERFACE_TUNER, 1); |
| 636 | else | 658 | else |
| 637 | tun_i2c = dib7000m_get_i2c_master(adap->fe, DIBX000_I2C_INTERFACE_TUNER, 1); | 659 | tun_i2c = dib7000m_get_i2c_master(adap->fe, DIBX000_I2C_INTERFACE_TUNER, 1); |
| 638 | 660 | ||
| 639 | return dvb_attach(mt2060_attach, adap->fe, tun_i2c, &stk7700p_mt2060_config, | 661 | return dvb_attach(mt2060_attach, adap->fe, tun_i2c, &stk7700p_mt2060_config, |
| 640 | st->mt2060_if1[0]) == NULL ? -ENODEV : 0; | 662 | if1) == NULL ? -ENODEV : 0; |
| 641 | } | 663 | } |
| 642 | 664 | ||
| 643 | /* DIB7070 generic */ | 665 | /* DIB7070 generic */ |
