aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/dvb-usb/dib0700_devices.c
diff options
context:
space:
mode:
authorPatrick Boettcher <pb@linuxtv.org>2006-09-19 11:51:40 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2006-10-03 14:12:36 -0400
commit6958effedb0dc709966c22e7fd0e8210b5401b84 (patch)
treee9a0d9768b1a5e53c6667309d946cb6c3204e3c0 /drivers/media/dvb/dvb-usb/dib0700_devices.c
parentb7f54910ce018f93a74211136be46c09cefd80e2 (diff)
V4L/DVB (4648): Hauppauge Nova-T 500 support added
This changeset finalizes the support of the Hauppauge Nova-T 500 (Dual DVB-T). It adds correct AGC setting for the 3000P, correct firmware download state detection. Additionally it fixes the mt2060-driver to be able to be used with dvb_attach. Signed-off-by: Patrick Boettcher <pb@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/dvb/dvb-usb/dib0700_devices.c')
-rw-r--r--drivers/media/dvb/dvb-usb/dib0700_devices.c38
1 files changed, 23 insertions, 15 deletions
diff --git a/drivers/media/dvb/dvb-usb/dib0700_devices.c b/drivers/media/dvb/dvb-usb/dib0700_devices.c
index 74d98dfb5ae7..da177e745e5e 100644
--- a/drivers/media/dvb/dvb-usb/dib0700_devices.c
+++ b/drivers/media/dvb/dvb-usb/dib0700_devices.c
@@ -25,24 +25,24 @@ static struct mt2060_config bristol_mt2060_config[2] = {
25 25
26static struct dibx000_agc_config bristol_dib3000p_mt2060_agc_config = { 26static struct dibx000_agc_config bristol_dib3000p_mt2060_agc_config = {
27 .band_caps = BAND_VHF | BAND_UHF, 27 .band_caps = BAND_VHF | BAND_UHF,
28 .setup = (0 << 15) | (0 << 14) | (1 << 13) | (1 << 12) | (29 << 0), 28 .setup = (0 << 15) | (0 << 14) | (0 << 13) | (0 << 12) | (29 << 0),
29 29
30 .agc1_max = 48497, 30 .agc1_max = 42598,
31 .agc1_min = 23593, 31 .agc1_min = 17694,
32 .agc2_max = 46531, 32 .agc2_max = 45875,
33 .agc2_min = 24904, 33 .agc2_min = 0,
34 34
35 .agc1_pt1 = 0x65, 35 .agc1_pt1 = 0,
36 .agc1_pt2 = 0x69, 36 .agc1_pt2 = 59,
37 37
38 .agc1_slope1 = 0x51, 38 .agc1_slope1 = 0,
39 .agc1_slope2 = 0x27, 39 .agc1_slope2 = 69,
40 40
41 .agc2_pt1 = 0, 41 .agc2_pt1 = 0,
42 .agc2_pt2 = 0x33, 42 .agc2_pt2 = 59,
43 43
44 .agc2_slope1 = 0x35, 44 .agc2_slope1 = 111,
45 .agc2_slope2 = 0x37, 45 .agc2_slope2 = 28,
46}; 46};
47 47
48static struct dib3000mc_config bristol_dib3000mc_config[2] = { 48static struct dib3000mc_config bristol_dib3000mc_config[2] = {
@@ -60,25 +60,31 @@ static struct dib3000mc_config bristol_dib3000mc_config[2] = {
60 60
61static int bristol_frontend_attach(struct dvb_usb_adapter *adap) 61static int bristol_frontend_attach(struct dvb_usb_adapter *adap)
62{ 62{
63 struct dib0700_state *st = adap->dev->priv;
63 if (adap->id == 0) { 64 if (adap->id == 0) {
64 dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 0); msleep(10); 65 dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 0); msleep(10);
65 dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1); msleep(10); 66 dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1); msleep(10);
66 dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0); msleep(10); 67 dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0); msleep(10);
67 dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1); msleep(10); 68 dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1); msleep(10);
68 69
70 dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 1); msleep(10); // LNA
71
69 if (dib3000mc_i2c_enumeration(&adap->dev->i2c_adap, 2, DEFAULT_DIB3000P_I2C_ADDRESS, bristol_dib3000mc_config) != 0) { 72 if (dib3000mc_i2c_enumeration(&adap->dev->i2c_adap, 2, DEFAULT_DIB3000P_I2C_ADDRESS, bristol_dib3000mc_config) != 0) {
70 dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 0); msleep(10); 73 dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 0); msleep(10);
71 return -ENODEV; 74 return -ENODEV;
72 } 75 }
73 } 76 }
74 return (adap->fe = dvb_attach(dib3000mc_attach, &adap->dev->i2c_adap, 10 + adap->id, &bristol_dib3000mc_config[adap->id])) == NULL ? -ENODEV : 0; 77 st->mt2060_if1[adap->id] = 1220;
78 return (adap->fe = dvb_attach(dib3000mc_attach, &adap->dev->i2c_adap,
79 (10 + adap->id) << 1, &bristol_dib3000mc_config[adap->id])) == NULL ? -ENODEV : 0;
75} 80}
76 81
77static int bristol_tuner_attach(struct dvb_usb_adapter *adap) 82static int bristol_tuner_attach(struct dvb_usb_adapter *adap)
78{ 83{
79 struct dib0700_state *st = adap->dev->priv; 84 struct dib0700_state *st = adap->dev->priv;
80 struct i2c_adapter *tun_i2c = dib3000mc_get_tuner_i2c_master(adap->fe, 1); 85 struct i2c_adapter *tun_i2c = dib3000mc_get_tuner_i2c_master(adap->fe, 1);
81 return mt2060_attach(adap->fe, tun_i2c, &bristol_mt2060_config[adap->id], st->mt2060_if1[adap->id]); 86 return dvb_attach(mt2060_attach,adap->fe, tun_i2c, &bristol_mt2060_config[adap->id],
87 st->mt2060_if1[adap->id]) == NULL ? -ENODEV : 0;
82} 88}
83 89
84/* STK7700P: Hauppauge Nova-T Stick, AVerMedia Volar */ 90/* STK7700P: Hauppauge Nova-T Stick, AVerMedia Volar */
@@ -119,8 +125,10 @@ MODULE_DEVICE_TABLE(usb, dib0700_usb_id_table);
119 .usb_ctrl = DEVICE_SPECIFIC, \ 125 .usb_ctrl = DEVICE_SPECIFIC, \
120 .firmware = "dvb-usb-dib0700-01.fw", \ 126 .firmware = "dvb-usb-dib0700-01.fw", \
121 .download_firmware = dib0700_download_firmware, \ 127 .download_firmware = dib0700_download_firmware, \
128 .no_reconnect = 1, \
122 .size_of_priv = sizeof(struct dib0700_state), \ 129 .size_of_priv = sizeof(struct dib0700_state), \
123 .i2c_algo = &dib0700_i2c_algo 130 .i2c_algo = &dib0700_i2c_algo, \
131 .identify_state = dib0700_identify_state
124 132
125#define DIB0700_DEFAULT_STREAMING_CONFIG(ep) \ 133#define DIB0700_DEFAULT_STREAMING_CONFIG(ep) \
126 .streaming_ctrl = dib0700_streaming_ctrl, \ 134 .streaming_ctrl = dib0700_streaming_ctrl, \