aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/dvb-usb/dib0700_devices.c
diff options
context:
space:
mode:
authorPatrick Boettcher <pboettcher@dibcom.fr>2006-10-17 17:28:14 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2006-12-10 05:51:00 -0500
commit69ea31e7debdefcf1412e8d590ae9bd90cf9253f (patch)
tree7c50602aed2953c92ce8b636d0e8141febb52ef5 /drivers/media/dvb/dvb-usb/dib0700_devices.c
parent3cc2e4c3a137075ee66e2d4ce95a95ba153bd7b9 (diff)
V4L/DVB (4766): Add working dib7000m-module
First working version of the dib7000m-driver. This commit also makes the Hauppauge NOVA-T Stick working. Signed-off-by: Francois Kanounnikoff <fkanounnikoff@dibcom.fr> Signed-off-by: Patrick Boettcher <pboettcher@dibcom.fr> 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.c95
1 files changed, 82 insertions, 13 deletions
diff --git a/drivers/media/dvb/dvb-usb/dib0700_devices.c b/drivers/media/dvb/dvb-usb/dib0700_devices.c
index b4e339df72e5..305dd35a1021 100644
--- a/drivers/media/dvb/dvb-usb/dib0700_devices.c
+++ b/drivers/media/dvb/dvb-usb/dib0700_devices.c
@@ -96,29 +96,97 @@ static int bristol_tuner_attach(struct dvb_usb_adapter *adap)
96} 96}
97 97
98/* STK7700P: Hauppauge Nova-T Stick, AVerMedia Volar */ 98/* STK7700P: Hauppauge Nova-T Stick, AVerMedia Volar */
99/* 99static struct dibx000_agc_config stk7700p_dib7000m_agc_config = {
100static struct mt2060_config stk7000p_mt2060_config = { 100 BAND_UHF | BAND_VHF, // band_caps
101 0x60 101
102 /* P_agc_use_sd_mod1=0, P_agc_use_sd_mod2=0, P_agc_freq_pwm_div=5, P_agc_inv_pwm1=0, P_agc_inv_pwm2=0,
103 * P_agc_inh_dc_rv_est=0, P_agc_time_est=3, P_agc_freeze=0, P_agc_nb_est=2, P_agc_write=0 */
104 (0 << 15) | (0 << 14) | (5 << 11) | (0 << 10) | (0 << 9) | (0 << 8) | (3 << 5) | (0 << 4) | (2 << 1) | (0 << 0), // setup
105
106 712, // inv_gain
107 41, // time_stabiliz
108
109 0, // alpha_level
110 118, // thlock
111
112 0, // wbd_inv
113 4095, // wbd_ref
114 0, // wbd_sel
115 0, // wbd_alpha
116
117 42598, // agc1_max
118 17694, // agc1_min
119 45875, // agc2_max
120 2621, // agc2_min
121 0, // agc1_pt1
122 76, // agc1_pt2
123 139, // agc1_pt3
124 52, // agc1_slope1
125 59, // agc1_slope2
126 107, // agc2_pt1
127 172, // agc2_pt2
128 57, // agc2_slope1
129 70, // agc2_slope2
130
131 21, // alpha_mant
132 25, // alpha_exp
133 28, // beta_mant
134 48, // beta_exp
135
136 1, // perform_agc_softsplit
137 { 0, // split_min
138 107, // split_max
139 51800, // global_split_min
140 24700 // global_split_max
141 },
142};
143
144static struct dibx000_bandwidth_config stk7700p_dib7000m_mt2060_config = {
145 60000, 30000, // internal, sampling
146 1, 8, 3, 1, 0, // pll_cfg: prediv, ratio, range, reset, bypass
147 0, 0, 1, 1, 0, // misc: refdiv, bypclk_div, IO_CLK_en_core, ADClkSrc, modulo
148 (3 << 14) | (1 << 12) | (524 << 0), // sad_cfg: refsel, sel, freq_15k
149 60258167, // ifreq
150 20452225, // timf
151};
152
153static struct dib7000m_config stk7700p_dib7000m_config = {
154 .dvbt_mode = 1,
155 .output_mpeg2_in_188_bytes = 1,
156 .quartz_direct = 1,
157
158 .agc_config_count = 1,
159 .agc = &stk7700p_dib7000m_agc_config,
160 .bw = &stk7700p_dib7000m_mt2060_config,
161
162 .gpio_dir = DIB7000M_GPIO_DEFAULT_DIRECTIONS,
163 .gpio_val = DIB7000M_GPIO_DEFAULT_VALUES,
164 .gpio_pwm_pos = DIB7000M_GPIO_DEFAULT_PWM_POS,
102}; 165};
103*/
104 166
105static int stk7700p_frontend_attach(struct dvb_usb_adapter *adap) 167static int stk7700p_frontend_attach(struct dvb_usb_adapter *adap)
106{ 168{
169 struct dib0700_state *st = adap->dev->priv;
107 /* unless there is no real power management in DVB - we leave the device on GPIO6 */ 170 /* unless there is no real power management in DVB - we leave the device on GPIO6 */
108 dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 0); msleep(10); 171 dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 0); msleep(10);
109 dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1); msleep(10); 172 dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1); msleep(10);
110 dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1); msleep(10);
111 dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0); msleep(10); 173 dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0); msleep(10);
174 dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1); msleep(10);
112 175
113// adap->fe = dib7000m_attach(&adap->dev->i2c_adap, &stk7700p_dib7000m_config, 18); 176 st->mt2060_if1[0] = 1220;
114 return 0; 177 return (adap->fe = dvb_attach(dib7000m_attach, &adap->dev->i2c_adap, 18, &stk7700p_dib7000m_config)) == NULL ? -ENODEV : 0;
115} 178}
116 179
180static struct mt2060_config stk7700p_mt2060_config = {
181 0x60
182};
183
117static int stk7700p_tuner_attach(struct dvb_usb_adapter *adap) 184static int stk7700p_tuner_attach(struct dvb_usb_adapter *adap)
118{ 185{
119// tun_i2c = dib7000m_get_tuner_i2c_master(adap->fe, 1); 186 struct dib0700_state *st = adap->dev->priv;
120// return mt2060_attach(adap->fe, tun_i2c, &stk3000p_mt2060_config, if1); 187 struct i2c_adapter *tun_i2c = dib7000m_get_i2c_master(adap->fe, DIBX000_I2C_INTERFACE_TUNER, 1);
121 return 0; 188 return dvb_attach(mt2060_attach,adap->fe, tun_i2c, &stk7700p_mt2060_config,
189 st->mt2060_if1[0]) == NULL ? -ENODEV : 0;
122} 190}
123 191
124struct usb_device_id dib0700_usb_id_table[] = { 192struct usb_device_id dib0700_usb_id_table[] = {
@@ -127,6 +195,7 @@ struct usb_device_id dib0700_usb_id_table[] = {
127 { USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_HAUPPAUGE_NOVA_T_500_2) }, 195 { USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_HAUPPAUGE_NOVA_T_500_2) },
128 { USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_HAUPPAUGE_NOVA_T_STICK) }, 196 { USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_HAUPPAUGE_NOVA_T_STICK) },
129 { USB_DEVICE(USB_VID_AVERMEDIA, USB_PID_AVERMEDIA_VOLAR) }, 197 { USB_DEVICE(USB_VID_AVERMEDIA, USB_PID_AVERMEDIA_VOLAR) },
198 { USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_STK7700P_PC) },
130 { } /* Terminating entry */ 199 { } /* Terminating entry */
131}; 200};
132MODULE_DEVICE_TABLE(usb, dib0700_usb_id_table); 201MODULE_DEVICE_TABLE(usb, dib0700_usb_id_table);
@@ -171,7 +240,7 @@ struct dvb_usb_device_properties dib0700_devices[] = {
171 .num_device_descs = 3, 240 .num_device_descs = 3,
172 .devices = { 241 .devices = {
173 { "DiBcom STK7700P reference design", 242 { "DiBcom STK7700P reference design",
174 { &dib0700_usb_id_table[0], NULL }, 243 { &dib0700_usb_id_table[0], &dib0700_usb_id_table[5] },
175 { NULL }, 244 { NULL },
176 }, 245 },
177 { "Hauppauge Nova-T Stick", 246 { "Hauppauge Nova-T Stick",