aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/dvb-usb/az6007.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2012-01-16 16:57:51 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-01-21 10:46:08 -0500
commit781dacc82ac8105e19dd62e76b8d4278e680af81 (patch)
tree8d5879fe2e89eea30531b9bbcceedfca502c9039 /drivers/media/dvb/dvb-usb/az6007.c
parent1c9a284fbd3d25dc1a1a1da32be1eaff021c4029 (diff)
[media] az6007: Change it to use the MFE solution adopted at dvb-usb
This driver were written to use a previous solution for MFE at dvb-usb. Due to the internal API changes, change the binding to work with the new way. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/dvb/dvb-usb/az6007.c')
-rw-r--r--drivers/media/dvb/dvb-usb/az6007.c42
1 files changed, 17 insertions, 25 deletions
diff --git a/drivers/media/dvb/dvb-usb/az6007.c b/drivers/media/dvb/dvb-usb/az6007.c
index b667854bdbf0..92ded30b2cc6 100644
--- a/drivers/media/dvb/dvb-usb/az6007.c
+++ b/drivers/media/dvb/dvb-usb/az6007.c
@@ -66,7 +66,7 @@ static struct drxk_config terratec_h7_drxk = {
66 .adr = 0x29, 66 .adr = 0x29,
67 .single_master = 1, 67 .single_master = 1,
68 .no_i2c_bridge = 0, 68 .no_i2c_bridge = 0,
69 .max_size = 64, 69 .chunk_size = 64,
70 .microcode_name = "dvb-usb-terratec-h7-drxk.fw", 70 .microcode_name = "dvb-usb-terratec-h7-drxk.fw",
71 .parallel_ts = 1, 71 .parallel_ts = 1,
72}; 72};
@@ -290,26 +290,21 @@ static int az6007_frontend_attach(struct dvb_usb_adapter *adap)
290{ 290{
291 struct az6007_device_state *st = adap->priv; 291 struct az6007_device_state *st = adap->priv;
292 292
293 /* FIXME: dvb-usb will call this function twice! */
294 if (adap->fe[0])
295 return 0;
296
297 BUG_ON(!st); 293 BUG_ON(!st);
298 294
299 az6007_frontend_poweron(adap); 295 az6007_frontend_poweron(adap);
300 296
301 info("attaching demod drxk"); 297 info("attaching demod drxk");
302 adap->fe[0] = dvb_attach(drxk_attach, &terratec_h7_drxk, 298 adap->fe_adap[0].fe = dvb_attach(drxk_attach, &terratec_h7_drxk,
303 &adap->dev->i2c_adap, &adap->fe[1]); 299 &adap->dev->i2c_adap);
304 if (!adap->fe[0]) 300 if (!adap->fe_adap[0].fe)
305 return -EINVAL; 301 return -EINVAL;
306 302
307 adap->fe[0]->sec_priv = adap; 303 adap->fe_adap[0].fe->sec_priv = adap;
308 /* FIXME: do we need a pll semaphore? */ 304 /* FIXME: do we need a pll semaphore? */
309 sema_init(&st->pll_mutex, 1); 305 sema_init(&st->pll_mutex, 1);
310 st->gate_ctrl = adap->fe[0]->ops.i2c_gate_ctrl; 306 st->gate_ctrl = adap->fe_adap[0].fe->ops.i2c_gate_ctrl;
311 adap->fe[0]->ops.i2c_gate_ctrl = drxk_gate_ctrl; 307 adap->fe_adap[0].fe->ops.i2c_gate_ctrl = drxk_gate_ctrl;
312 adap->dont_attach_fe[1] = true;
313 308
314 return 0; 309 return 0;
315} 310}
@@ -325,19 +320,15 @@ static int az6007_tuner_attach(struct dvb_usb_adapter *adap)
325 320
326 info("attaching tuner mt2063"); 321 info("attaching tuner mt2063");
327 /* Attach mt2063 to DVB-C frontend */ 322 /* Attach mt2063 to DVB-C frontend */
328 if (adap->fe[0]->ops.i2c_gate_ctrl) 323 if (adap->fe_adap[0].fe->ops.i2c_gate_ctrl)
329 adap->fe[0]->ops.i2c_gate_ctrl(adap->fe[0], 1); 324 adap->fe_adap[0].fe->ops.i2c_gate_ctrl(adap->fe_adap[0].fe, 1);
330 if (!dvb_attach(mt2063_attach, adap->fe[0], &az6007_mt2063_config, 325 if (!dvb_attach(mt2063_attach, adap->fe_adap[0].fe,
326 &az6007_mt2063_config,
331 &adap->dev->i2c_adap)) 327 &adap->dev->i2c_adap))
332 return -EINVAL; 328 return -EINVAL;
333 329
334 if (adap->fe[0]->ops.i2c_gate_ctrl) 330 if (adap->fe_adap[0].fe->ops.i2c_gate_ctrl)
335 adap->fe[0]->ops.i2c_gate_ctrl(adap->fe[0], 0); 331 adap->fe_adap[0].fe->ops.i2c_gate_ctrl(adap->fe_adap[0].fe, 0);
336
337 /* Hack - needed due to drxk */
338 adap->fe[1]->tuner_priv = adap->fe[0]->tuner_priv;
339 memcpy(&adap->fe[1]->ops.tuner_ops,
340 &adap->fe[0]->ops.tuner_ops, sizeof(adap->fe[0]->ops.tuner_ops));
341 332
342 return 0; 333 return 0;
343} 334}
@@ -530,7 +521,8 @@ static struct dvb_usb_device_properties az6007_properties = {
530 .num_adapters = 1, 521 .num_adapters = 1,
531 .adapter = { 522 .adapter = {
532 { 523 {
533 .num_frontends = 2, 524 .num_frontends = 1,
525 .fe = {{
534 .streaming_ctrl = az6007_streaming_ctrl, 526 .streaming_ctrl = az6007_streaming_ctrl,
535 .tuner_attach = az6007_tuner_attach, 527 .tuner_attach = az6007_tuner_attach,
536 .frontend_attach = az6007_frontend_attach, 528 .frontend_attach = az6007_frontend_attach,
@@ -547,8 +539,8 @@ static struct dvb_usb_device_properties az6007_properties = {
547 } 539 }
548 }, 540 },
549 .size_of_priv = sizeof(struct az6007_device_state), 541 .size_of_priv = sizeof(struct az6007_device_state),
550 } 542 }}
551 }, 543 } },
552 .power_ctrl = az6007_power_ctrl, 544 .power_ctrl = az6007_power_ctrl,
553 .read_mac_address = az6007_read_mac_addr, 545 .read_mac_address = az6007_read_mac_addr,
554 546