diff options
author | Aapo Tahkola <aet@rasterburn.org> | 2006-09-27 23:47:51 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2007-02-21 10:34:50 -0500 |
commit | e2adbecf72d54515b66f8631813ec49069669d5e (patch) | |
tree | aafc58dd8fd833acd630d3c0977a515d249b0652 /drivers/media/dvb | |
parent | 017cf012570c955c3e1ff025802d7cb46fd1d37b (diff) |
V4L/DVB (5130): M920x: misc updates and fixes
- hardware pid filtering no longer enabled unless in usb 1.x mode
- more responsive rc handling
- some minor bug fixes and code refolding
- m9206_write delay dropped (doesn't seem to be needed)
Signed-off-by: Aapo Tahkola <aet@rasterburn.org>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/dvb')
-rw-r--r-- | drivers/media/dvb/dvb-usb/m920x.c | 213 | ||||
-rw-r--r-- | drivers/media/dvb/dvb-usb/m920x.h | 18 | ||||
-rw-r--r-- | drivers/media/dvb/frontends/qt1010.h | 7 |
3 files changed, 145 insertions, 93 deletions
diff --git a/drivers/media/dvb/dvb-usb/m920x.c b/drivers/media/dvb/dvb-usb/m920x.c index 292805aad69a..197bc29bcb84 100644 --- a/drivers/media/dvb/dvb-usb/m920x.c +++ b/drivers/media/dvb/dvb-usb/m920x.c | |||
@@ -62,23 +62,36 @@ static inline int m9206_write(struct usb_device *udev, u8 request, u16 value, u1 | |||
62 | ret = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), | 62 | ret = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), |
63 | request, USB_TYPE_VENDOR | USB_DIR_OUT, | 63 | request, USB_TYPE_VENDOR | USB_DIR_OUT, |
64 | value, index, NULL, 0, 2000); | 64 | value, index, NULL, 0, 2000); |
65 | msleep(3); | 65 | return ret; |
66 | } | ||
67 | |||
68 | static int m9206_rc_init(struct usb_device *udev) | ||
69 | { | ||
70 | int ret = 0; | ||
71 | |||
72 | /* Remote controller init. */ | ||
73 | if ((ret = m9206_write(udev, M9206_CORE, 0xa8, M9206_RC_INIT2)) != 0) | ||
74 | return ret; | ||
75 | |||
76 | if ((ret = m9206_write(udev, M9206_CORE, 0x51, M9206_RC_INIT1)) != 0) | ||
77 | return ret; | ||
66 | 78 | ||
67 | return ret; | 79 | return ret; |
68 | } | 80 | } |
69 | 81 | ||
70 | static int m9206_rc_query(struct dvb_usb_device *d, u32 *event, int *state) | 82 | static int m9206_rc_query(struct dvb_usb_device *d, u32 *event, int *state) |
71 | { | 83 | { |
84 | struct m9206_state *m = d->priv; | ||
72 | int i, ret = 0; | 85 | int i, ret = 0; |
73 | u8 rc_state[2]; | 86 | u8 rc_state[2]; |
74 | 87 | ||
75 | if (mutex_lock_interruptible(&d->i2c_mutex) < 0) | 88 | if (mutex_lock_interruptible(&d->i2c_mutex) < 0) |
76 | return -EAGAIN; | 89 | return -EAGAIN; |
77 | 90 | ||
78 | if ((ret = m9206_read(d->udev, 0x22, 0x0, 0xff51, rc_state, 1)) != 0) | 91 | if ((ret = m9206_read(d->udev, M9206_CORE, 0x0, M9206_RC_STATE, rc_state, 1)) != 0) |
79 | goto unlock; | 92 | goto unlock; |
80 | 93 | ||
81 | if ((ret = m9206_read(d->udev, 0x22, 0x0, 0xff52, rc_state + 1, 1)) != 0) | 94 | if ((ret = m9206_read(d->udev, M9206_CORE, 0x0, M9206_RC_KEY, rc_state + 1, 1)) != 0) |
82 | goto unlock; | 95 | goto unlock; |
83 | 96 | ||
84 | for (i = 0; i < ARRAY_SIZE(megasky_rc_keys); i++) | 97 | for (i = 0; i < ARRAY_SIZE(megasky_rc_keys); i++) |
@@ -92,11 +105,14 @@ static int m9206_rc_query(struct dvb_usb_device *d, u32 *event, int *state) | |||
92 | 105 | ||
93 | case 0x93: | 106 | case 0x93: |
94 | case 0x92: | 107 | case 0x92: |
108 | m->rep_count = 0; | ||
95 | *state = REMOTE_KEY_PRESSED; | 109 | *state = REMOTE_KEY_PRESSED; |
96 | goto unlock; | 110 | goto unlock; |
97 | 111 | ||
98 | case 0x91: | 112 | case 0x91: |
99 | *state = REMOTE_KEY_REPEAT; | 113 | /* For comfort. */ |
114 | if (++m->rep_count > 2) | ||
115 | *state = REMOTE_KEY_REPEAT; | ||
100 | goto unlock; | 116 | goto unlock; |
101 | 117 | ||
102 | default: | 118 | default: |
@@ -125,6 +141,12 @@ static int m9206_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msg[], int nu | |||
125 | int i; | 141 | int i; |
126 | int ret = 0; | 142 | int ret = 0; |
127 | 143 | ||
144 | /* Need to access d->adapter[0] */ | ||
145 | if (d->num_adapters_initialized != 1) { | ||
146 | deb_rc("Impossible happened!\n"); | ||
147 | return -EINVAL; | ||
148 | } | ||
149 | |||
128 | if (mutex_lock_interruptible(&d->i2c_mutex) < 0) | 150 | if (mutex_lock_interruptible(&d->i2c_mutex) < 0) |
129 | return -EAGAIN; | 151 | return -EAGAIN; |
130 | 152 | ||
@@ -134,22 +156,23 @@ static int m9206_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msg[], int nu | |||
134 | for (i = 0; i < num; i++) { | 156 | for (i = 0; i < num; i++) { |
135 | u8 w_len; | 157 | u8 w_len; |
136 | 158 | ||
137 | if ((ret = m9206_write(d->udev, 0x23, msg[i].addr, 0x80)) != 0) | 159 | if ((ret = m9206_write(d->udev, M9206_I2C, msg[i].addr, 0x80)) != 0) |
138 | goto unlock; | 160 | goto unlock; |
139 | 161 | ||
140 | if ((ret = m9206_write(d->udev, 0x23, msg[i].buf[0], 0x0)) != 0) | 162 | if ((ret = m9206_write(d->udev, M9206_I2C, msg[i].buf[0], 0x0)) != 0) |
141 | goto unlock; | 163 | goto unlock; |
142 | 164 | ||
143 | if (i + 1 < num && msg[i + 1].flags & I2C_M_RD) { | 165 | if (i + 1 < num && msg[i + 1].flags & I2C_M_RD) { |
144 | if (msg[i].addr == 0x1e) | 166 | /* Possibly device dependant */ |
145 | w_len = 0x1f; | 167 | if (msg[i].addr == d->adapter[0].pll_addr) |
146 | else | ||
147 | w_len = 0xc5; | 168 | w_len = 0xc5; |
169 | else | ||
170 | w_len = 0x1f; | ||
148 | 171 | ||
149 | if ((ret = m9206_write(d->udev, 0x23, w_len, 0x80)) != 0) | 172 | if ((ret = m9206_write(d->udev, M9206_I2C, w_len, 0x80)) != 0) |
150 | goto unlock; | 173 | goto unlock; |
151 | 174 | ||
152 | if ((ret = m9206_read(d->udev, 0x23, 0x0, 0x60, msg[i + 1].buf, msg[i + 1].len)) != 0) | 175 | if ((ret = m9206_read(d->udev, M9206_I2C, 0x0, 0x60, msg[i + 1].buf, msg[i + 1].len)) != 0) |
153 | goto unlock; | 176 | goto unlock; |
154 | 177 | ||
155 | i++; | 178 | i++; |
@@ -157,7 +180,7 @@ static int m9206_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msg[], int nu | |||
157 | if (msg[i].len != 2) | 180 | if (msg[i].len != 2) |
158 | return -EINVAL; | 181 | return -EINVAL; |
159 | 182 | ||
160 | if ((ret = m9206_write(d->udev, 0x23, msg[i].buf[1], 0x40)) != 0) | 183 | if ((ret = m9206_write(d->udev, M9206_I2C, msg[i].buf[1], 0x40)) != 0) |
161 | goto unlock; | 184 | goto unlock; |
162 | } | 185 | } |
163 | } | 186 | } |
@@ -194,31 +217,23 @@ static int megasky_identify_state(struct usb_device *udev, | |||
194 | 217 | ||
195 | static int megasky_mt352_demod_init(struct dvb_frontend *fe) | 218 | static int megasky_mt352_demod_init(struct dvb_frontend *fe) |
196 | { | 219 | { |
197 | int i; | 220 | u8 config[] = { CONFIG, 0x3d }; |
198 | static u8 buf1[] = { | 221 | u8 clock[] = { CLOCK_CTL, 0x30 }; |
199 | CONFIG, 0x3d, | 222 | u8 reset[] = { RESET, 0x80 }; |
200 | CLOCK_CTL, 0x30, | 223 | u8 adc_ctl[] = { ADC_CTL_1, 0x40 }; |
201 | RESET, 0x80, | 224 | u8 agc[] = { AGC_TARGET, 0x1c, 0x20 }; |
202 | ADC_CTL_1, 0x40, | 225 | u8 sec_agc[] = { 0x69, 0x00, 0xff, 0xff, 0x40, 0xff, 0x00, 0x40, 0x40 }; |
203 | AGC_TARGET, 0x1c, | 226 | u8 unk1[] = { 0x93, 0x1a }; |
204 | AGC_CTL, 0x20, | 227 | u8 unk2[] = { 0xb5, 0x7a }; |
205 | 0x69, 0x00, | 228 | |
206 | 0x6a, 0xff, | 229 | mt352_write(fe, config, ARRAY_SIZE(config)); |
207 | 0x6b, 0xff, | 230 | mt352_write(fe, clock, ARRAY_SIZE(clock)); |
208 | 0x6c, 0x40, | 231 | mt352_write(fe, reset, ARRAY_SIZE(reset)); |
209 | 0x6d, 0xff, | 232 | mt352_write(fe, adc_ctl, ARRAY_SIZE(adc_ctl)); |
210 | 0x6e, 0x00, | 233 | mt352_write(fe, agc, ARRAY_SIZE(agc)); |
211 | 0x6f, 0x40, | 234 | mt352_write(fe, sec_agc, ARRAY_SIZE(sec_agc)); |
212 | 0x70, 0x40, | 235 | mt352_write(fe, unk1, ARRAY_SIZE(unk1)); |
213 | 0x93, 0x1a, | 236 | mt352_write(fe, unk2, ARRAY_SIZE(unk2)); |
214 | 0xb5, 0x7a, | ||
215 | ACQ_CTL, 0x50, | ||
216 | INPUT_FREQ_1, 0x31, | ||
217 | INPUT_FREQ_0, 0x05, | ||
218 | }; | ||
219 | |||
220 | for (i = 0; i < ARRAY_SIZE(buf1); i += 2) | ||
221 | mt352_write(fe, &buf1[i], 2); | ||
222 | 237 | ||
223 | deb_rc("Demod init!\n"); | 238 | deb_rc("Demod init!\n"); |
224 | 239 | ||
@@ -229,6 +244,7 @@ struct mt352_state; | |||
229 | 244 | ||
230 | static struct mt352_config megasky_mt352_config = { | 245 | static struct mt352_config megasky_mt352_config = { |
231 | .demod_address = 0x1e, | 246 | .demod_address = 0x1e, |
247 | .no_tuner = 1, | ||
232 | .demod_init = megasky_mt352_demod_init, | 248 | .demod_init = megasky_mt352_demod_init, |
233 | }; | 249 | }; |
234 | 250 | ||
@@ -237,22 +253,39 @@ static int megasky_frontend_attach(struct dvb_usb_adapter *adap) | |||
237 | deb_rc("megasky_frontend_attach!\n"); | 253 | deb_rc("megasky_frontend_attach!\n"); |
238 | 254 | ||
239 | if ((adap->fe = dvb_attach(mt352_attach, &megasky_mt352_config, &adap->dev->i2c_adap)) != NULL) { | 255 | if ((adap->fe = dvb_attach(mt352_attach, &megasky_mt352_config, &adap->dev->i2c_adap)) != NULL) { |
240 | adap->fe->ops.tuner_ops.calc_regs = qt1010_set_params; | ||
241 | return 0; | 256 | return 0; |
242 | } | 257 | } |
243 | return -EIO; | 258 | return -EIO; |
244 | } | 259 | } |
245 | 260 | ||
261 | static int megasky_tuner_attach(struct dvb_usb_adapter *adap) | ||
262 | { | ||
263 | adap->pll_addr = 0xc4; | ||
264 | adap->pll_desc = NULL; | ||
265 | adap->fe->ops.tuner_ops.set_params = qt1010_set_params; | ||
266 | |||
267 | return 0; | ||
268 | } | ||
269 | |||
246 | /* DVB USB Driver stuff */ | 270 | /* DVB USB Driver stuff */ |
247 | static struct dvb_usb_device_properties megasky_properties; | 271 | static struct dvb_usb_device_properties megasky_properties; |
248 | 272 | ||
249 | static int m920x_probe(struct usb_interface *intf, const struct usb_device_id *id) | 273 | static int m920x_probe(struct usb_interface *intf, const struct usb_device_id *id) |
250 | { | 274 | { |
275 | struct usb_device *udev = interface_to_usbdev(intf); | ||
251 | struct dvb_usb_device *d; | 276 | struct dvb_usb_device *d; |
252 | struct usb_host_interface *alt; | 277 | struct usb_host_interface *alt; |
278 | struct dvb_usb_device_properties props; | ||
253 | int ret; | 279 | int ret; |
254 | 280 | ||
255 | if ((ret = dvb_usb_device_init(intf, &megasky_properties, THIS_MODULE, &d)) == 0) { | 281 | memcpy(&props, &megasky_properties, sizeof(struct dvb_usb_device_properties)); |
282 | |||
283 | /* Hardware pid filtering isn't quite perfect so dont use unless have to. */ | ||
284 | if (udev->speed == USB_SPEED_FULL) | ||
285 | props.caps |= DVB_USB_ADAP_HAS_PID_FILTER | | ||
286 | DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF; | ||
287 | |||
288 | if ((ret = dvb_usb_device_init(intf, &props, THIS_MODULE, &d)) == 0) { | ||
256 | deb_rc("probed!\n"); | 289 | deb_rc("probed!\n"); |
257 | 290 | ||
258 | alt = usb_altnum_to_altsetting(intf, 1); | 291 | alt = usb_altnum_to_altsetting(intf, 1); |
@@ -267,11 +300,7 @@ static int m920x_probe(struct usb_interface *intf, const struct usb_device_id *i | |||
267 | 300 | ||
268 | deb_rc("Changed to alternate setting!\n"); | 301 | deb_rc("Changed to alternate setting!\n"); |
269 | 302 | ||
270 | /* Remote controller init. */ | 303 | if ((ret = m9206_rc_init(d->udev)) != 0) |
271 | if ((ret = m9206_write(d->udev, 0x22, 0xa8, 0xff55)) != 0) | ||
272 | return ret; | ||
273 | |||
274 | if ((ret = m9206_write(d->udev, 0x22, 0x51, 0xff54)) != 0) | ||
275 | return ret; | 304 | return ret; |
276 | } | 305 | } |
277 | return ret; | 306 | return ret; |
@@ -292,63 +321,71 @@ static int set_filter(struct dvb_usb_adapter *adap, int type, int idx, int pid) | |||
292 | 321 | ||
293 | pid |= 0x8000; | 322 | pid |= 0x8000; |
294 | 323 | ||
295 | if ((ret = m9206_write(adap->dev->udev, 0x25, pid, (type << 8) | (idx * 4) )) != 0) | 324 | if ((ret = m9206_write(adap->dev->udev, M9206_FILTER, pid, (type << 8) | (idx * 4) )) != 0) |
296 | return ret; | 325 | return ret; |
297 | 326 | ||
298 | if ((ret = m9206_write(adap->dev->udev, 0x25, 0, (type << 8) | (idx * 4) )) != 0) | 327 | if ((ret = m9206_write(adap->dev->udev, M9206_FILTER, 0, (type << 8) | (idx * 4) )) != 0) |
299 | return ret; | 328 | return ret; |
300 | 329 | ||
301 | return ret; | 330 | return ret; |
302 | } | 331 | } |
303 | 332 | ||
304 | static int m9206_pid_filter_ctrl(struct dvb_usb_adapter *adap, int onoff) | 333 | static int m9206_update_filters(struct dvb_usb_adapter *adap) |
305 | { | 334 | { |
306 | int ret = 0; | 335 | struct m9206_state *m = adap->dev->priv; |
336 | int enabled = m->filtering_enabled; | ||
337 | int i, ret = 0, filter = 0; | ||
307 | 338 | ||
308 | if (mutex_lock_interruptible(&adap->dev->i2c_mutex) < 0) | 339 | for (i = 0; i < M9206_MAX_FILTERS; i++) |
309 | return -EAGAIN; | 340 | if (m->filters[i] == 8192) |
341 | enabled = 0; | ||
310 | 342 | ||
311 | deb_rc("filtering %s\n", onoff ? "on" : "off"); | 343 | /* Disable all filters */ |
312 | if (onoff == 0) { | 344 | if ((ret = set_filter(adap, 0x81, 1, enabled)) != 0) |
313 | if ((ret = set_filter(adap, 0x81, 1, 0x00)) != 0) | 345 | return ret; |
314 | goto unlock; | ||
315 | 346 | ||
316 | if ((ret = set_filter(adap, 0x82, 0, 0x02f5)) != 0) | 347 | for (i = 0; i < M9206_MAX_FILTERS; i++) |
317 | goto unlock; | 348 | if ((ret = set_filter(adap, 0x81, i + 2, 0)) != 0) |
349 | return ret; | ||
350 | |||
351 | if ((ret = set_filter(adap, 0x82, 0, 0x0)) != 0) | ||
352 | return ret; | ||
353 | |||
354 | /* Set */ | ||
355 | if (enabled) { | ||
356 | for (i = 0; i < M9206_MAX_FILTERS; i++) { | ||
357 | if (m->filters[i] == 0) | ||
358 | continue; | ||
359 | |||
360 | if ((ret = set_filter(adap, 0x81, filter + 2, m->filters[i])) != 0) | ||
361 | return ret; | ||
362 | |||
363 | filter++; | ||
364 | } | ||
318 | } | 365 | } |
319 | unlock: | 366 | |
320 | mutex_unlock(&adap->dev->i2c_mutex); | 367 | if ((ret = set_filter(adap, 0x82, 0, 0x02f5)) != 0) |
368 | return ret; | ||
321 | 369 | ||
322 | return ret; | 370 | return ret; |
323 | } | 371 | } |
324 | 372 | ||
325 | static int m9206_pid_filter(struct dvb_usb_adapter *adap, int index, u16 pid, int onoff) | 373 | static int m9206_pid_filter_ctrl(struct dvb_usb_adapter *adap, int onoff) |
326 | { | 374 | { |
327 | int ret = 0; | 375 | struct m9206_state *m = adap->dev->priv; |
328 | |||
329 | if (pid == 8192) | ||
330 | return m9206_pid_filter_ctrl(adap, !onoff); | ||
331 | |||
332 | if (mutex_lock_interruptible(&adap->dev->i2c_mutex) < 0) | ||
333 | return -EAGAIN; | ||
334 | 376 | ||
335 | deb_rc("filter %d, pid %x, %s\n", index, pid, onoff ? "on" : "off"); | 377 | m->filtering_enabled = onoff ? 1 : 0; |
336 | if (onoff == 0) | ||
337 | pid = 0; | ||
338 | 378 | ||
339 | if ((ret = set_filter(adap, 0x81, 1, 0x01)) != 0) | 379 | return m9206_update_filters(adap); |
340 | goto unlock; | 380 | } |
341 | |||
342 | if ((ret = set_filter(adap, 0x81, index + 2, pid)) != 0) | ||
343 | goto unlock; | ||
344 | 381 | ||
345 | if ((ret = set_filter(adap, 0x82, 0, 0x02f5)) != 0) | 382 | static int m9206_pid_filter(struct dvb_usb_adapter *adap, int index, u16 pid, int onoff) |
346 | goto unlock; | 383 | { |
384 | struct m9206_state *m = adap->dev->priv; | ||
347 | 385 | ||
348 | unlock: | 386 | m->filters[index] = onoff ? pid : 0; |
349 | mutex_unlock(&adap->dev->i2c_mutex); | ||
350 | 387 | ||
351 | return ret; | 388 | return m9206_update_filters(adap); |
352 | } | 389 | } |
353 | 390 | ||
354 | static int m9206_firmware_download(struct usb_device *udev, const struct firmware *fw) | 391 | static int m9206_firmware_download(struct usb_device *udev, const struct firmware *fw) |
@@ -359,11 +396,11 @@ static int m9206_firmware_download(struct usb_device *udev, const struct firmwar | |||
359 | 396 | ||
360 | buff = kmalloc(65536, GFP_KERNEL); | 397 | buff = kmalloc(65536, GFP_KERNEL); |
361 | 398 | ||
362 | if ((ret = m9206_read(udev, 0x25, 0x0, 0x8000, read, 4)) != 0) | 399 | if ((ret = m9206_read(udev, M9206_FILTER, 0x0, 0x8000, read, 4)) != 0) |
363 | goto done; | 400 | goto done; |
364 | deb_rc("%x %x %x %x\n", read[0], read[1], read[2], read[3]); | 401 | deb_rc("%x %x %x %x\n", read[0], read[1], read[2], read[3]); |
365 | 402 | ||
366 | if ((ret = m9206_read(udev, 0x30, 0x0, 0x0, read, 1)) != 0) | 403 | if ((ret = m9206_read(udev, M9206_FW, 0x0, 0x0, read, 1)) != 0) |
367 | goto done; | 404 | goto done; |
368 | deb_rc("%x\n", read[0]); | 405 | deb_rc("%x\n", read[0]); |
369 | 406 | ||
@@ -383,7 +420,8 @@ static int m9206_firmware_download(struct usb_device *udev, const struct firmwar | |||
383 | memcpy(buff, fw->data + i, size); | 420 | memcpy(buff, fw->data + i, size); |
384 | 421 | ||
385 | ret = usb_control_msg(udev, usb_sndctrlpipe(udev,0), | 422 | ret = usb_control_msg(udev, usb_sndctrlpipe(udev,0), |
386 | 0x30, USB_TYPE_VENDOR | USB_DIR_OUT, | 423 | M9206_FW, |
424 | USB_TYPE_VENDOR | USB_DIR_OUT, | ||
387 | value, index, buff, size, 20); | 425 | value, index, buff, size, 20); |
388 | if (ret != size) { | 426 | if (ret != size) { |
389 | deb_rc("error while uploading fw!\n"); | 427 | deb_rc("error while uploading fw!\n"); |
@@ -403,7 +441,7 @@ static int m9206_firmware_download(struct usb_device *udev, const struct firmwar | |||
403 | msleep(36); | 441 | msleep(36); |
404 | 442 | ||
405 | /* m9206 will disconnect itself from the bus after this. */ | 443 | /* m9206 will disconnect itself from the bus after this. */ |
406 | (void) m9206_write(udev, 0x22, 0x01, 0xff69); | 444 | (void) m9206_write(udev, M9206_CORE, 0x01, M9206_FW_GO); |
407 | deb_rc("firmware uploaded!\n"); | 445 | deb_rc("firmware uploaded!\n"); |
408 | 446 | ||
409 | done: | 447 | done: |
@@ -417,24 +455,23 @@ static struct dvb_usb_device_properties megasky_properties = { | |||
417 | .firmware = "dvb-usb-megasky-02.fw", | 455 | .firmware = "dvb-usb-megasky-02.fw", |
418 | .download_firmware = m9206_firmware_download, | 456 | .download_firmware = m9206_firmware_download, |
419 | 457 | ||
420 | .rc_interval = 200, | 458 | .rc_interval = 100, |
421 | .rc_key_map = megasky_rc_keys, | 459 | .rc_key_map = megasky_rc_keys, |
422 | .rc_key_map_size = ARRAY_SIZE(megasky_rc_keys), | 460 | .rc_key_map_size = ARRAY_SIZE(megasky_rc_keys), |
423 | .rc_query = m9206_rc_query, | 461 | .rc_query = m9206_rc_query, |
424 | 462 | ||
425 | .size_of_priv = 0, | 463 | .size_of_priv = sizeof(struct m9206_state), |
426 | 464 | ||
427 | .identify_state = megasky_identify_state, | 465 | .identify_state = megasky_identify_state, |
428 | .num_adapters = 1, | 466 | .num_adapters = 1, |
429 | .adapter = {{ | 467 | .adapter = {{ |
430 | .caps = DVB_USB_IS_AN_I2C_ADAPTER | DVB_USB_ADAP_HAS_PID_FILTER | | 468 | .caps = DVB_USB_IS_AN_I2C_ADAPTER, |
431 | DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF | | ||
432 | DVB_USB_ADAP_NEED_PID_FILTERING, | ||
433 | .pid_filter_count = 8, | 469 | .pid_filter_count = 8, |
434 | .pid_filter = m9206_pid_filter, | 470 | .pid_filter = m9206_pid_filter, |
435 | .pid_filter_ctrl = m9206_pid_filter_ctrl, | 471 | .pid_filter_ctrl = m9206_pid_filter_ctrl, |
436 | 472 | ||
437 | .frontend_attach = megasky_frontend_attach, | 473 | .frontend_attach = megasky_frontend_attach, |
474 | .tuner_attach = megasky_tuner_attach, | ||
438 | 475 | ||
439 | .stream = { | 476 | .stream = { |
440 | .type = USB_BULK, | 477 | .type = USB_BULK, |
diff --git a/drivers/media/dvb/dvb-usb/m920x.h b/drivers/media/dvb/dvb-usb/m920x.h index fdb967aa30ef..709b7d205b6d 100644 --- a/drivers/media/dvb/dvb-usb/m920x.h +++ b/drivers/media/dvb/dvb-usb/m920x.h | |||
@@ -7,4 +7,22 @@ | |||
7 | extern int dvb_usb_m920x_debug; | 7 | extern int dvb_usb_m920x_debug; |
8 | #define deb_rc(args...) dprintk(dvb_usb_m920x_debug,0x01,args) | 8 | #define deb_rc(args...) dprintk(dvb_usb_m920x_debug,0x01,args) |
9 | 9 | ||
10 | #define M9206_CORE 0x22 | ||
11 | #define M9206_RC_STATE 0xff51 | ||
12 | #define M9206_RC_KEY 0xff52 | ||
13 | #define M9206_RC_INIT1 0xff54 | ||
14 | #define M9206_RC_INIT2 0xff55 | ||
15 | #define M9206_FW_GO 0xff69 | ||
16 | |||
17 | #define M9206_I2C 0x23 | ||
18 | #define M9206_FILTER 0x25 | ||
19 | #define M9206_FW 0x30 | ||
20 | |||
21 | #define M9206_MAX_FILTERS 8 | ||
22 | struct m9206_state { | ||
23 | u16 filters[M9206_MAX_FILTERS]; | ||
24 | int filtering_enabled; | ||
25 | int rep_count; | ||
26 | }; | ||
27 | |||
10 | #endif | 28 | #endif |
diff --git a/drivers/media/dvb/frontends/qt1010.h b/drivers/media/dvb/frontends/qt1010.h index e526e3c23265..3a566085fa32 100644 --- a/drivers/media/dvb/frontends/qt1010.h +++ b/drivers/media/dvb/frontends/qt1010.h | |||
@@ -25,7 +25,7 @@ | |||
25 | #define QT1010_MIN_STEP 2000000 | 25 | #define QT1010_MIN_STEP 2000000 |
26 | #define QT1010_MIN_FREQ 48000000 | 26 | #define QT1010_MIN_FREQ 48000000 |
27 | 27 | ||
28 | static int qt1010_set_params(struct dvb_frontend *fe, struct dvb_frontend_parameters *params, u8 *buf, int buf_len) | 28 | static int qt1010_set_params(struct dvb_frontend *fe, struct dvb_frontend_parameters *params) |
29 | { | 29 | { |
30 | int i; | 30 | int i; |
31 | int div, mod; | 31 | int div, mod; |
@@ -85,9 +85,6 @@ static int qt1010_set_params(struct dvb_frontend *fe, struct dvb_frontend_parame | |||
85 | if (freq % QT1010_MIN_STEP) | 85 | if (freq % QT1010_MIN_STEP) |
86 | printk("frequency not supported.\n"); | 86 | printk("frequency not supported.\n"); |
87 | 87 | ||
88 | (void) buf; | ||
89 | (void) buf_len; | ||
90 | |||
91 | div = (freq - QT1010_MIN_FREQ) / QT1010_MIN_STEP; | 88 | div = (freq - QT1010_MIN_FREQ) / QT1010_MIN_STEP; |
92 | mod = (div + 16 - 9) % 16; | 89 | mod = (div + 16 - 9) % 16; |
93 | 90 | ||
@@ -206,7 +203,7 @@ static int qt1010_set_params(struct dvb_frontend *fe, struct dvb_frontend_parame | |||
206 | 203 | ||
207 | msg.flags = 0; | 204 | msg.flags = 0; |
208 | msg.len = 2; | 205 | msg.len = 2; |
209 | msg.addr = 0xc4; | 206 | msg.addr = d->adapter[0].pll_addr; |
210 | msg.buf = &rd[i].reg; | 207 | msg.buf = &rd[i].reg; |
211 | 208 | ||
212 | if (i2c_transfer(&d->i2c_adap, &msg, 1) != 1) { | 209 | if (i2c_transfer(&d->i2c_adap, &msg, 1) != 1) { |