Commit 781dacc8 authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab

[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: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 1c9a284f
...@@ -66,7 +66,7 @@ static struct drxk_config terratec_h7_drxk = { ...@@ -66,7 +66,7 @@ static struct drxk_config terratec_h7_drxk = {
.adr = 0x29, .adr = 0x29,
.single_master = 1, .single_master = 1,
.no_i2c_bridge = 0, .no_i2c_bridge = 0,
.max_size = 64, .chunk_size = 64,
.microcode_name = "dvb-usb-terratec-h7-drxk.fw", .microcode_name = "dvb-usb-terratec-h7-drxk.fw",
.parallel_ts = 1, .parallel_ts = 1,
}; };
...@@ -290,26 +290,21 @@ static int az6007_frontend_attach(struct dvb_usb_adapter *adap) ...@@ -290,26 +290,21 @@ static int az6007_frontend_attach(struct dvb_usb_adapter *adap)
{ {
struct az6007_device_state *st = adap->priv; struct az6007_device_state *st = adap->priv;
/* FIXME: dvb-usb will call this function twice! */
if (adap->fe[0])
return 0;
BUG_ON(!st); BUG_ON(!st);
az6007_frontend_poweron(adap); az6007_frontend_poweron(adap);
info("attaching demod drxk"); info("attaching demod drxk");
adap->fe[0] = dvb_attach(drxk_attach, &terratec_h7_drxk, adap->fe_adap[0].fe = dvb_attach(drxk_attach, &terratec_h7_drxk,
&adap->dev->i2c_adap, &adap->fe[1]); &adap->dev->i2c_adap);
if (!adap->fe[0]) if (!adap->fe_adap[0].fe)
return -EINVAL; return -EINVAL;
adap->fe[0]->sec_priv = adap; adap->fe_adap[0].fe->sec_priv = adap;
/* FIXME: do we need a pll semaphore? */ /* FIXME: do we need a pll semaphore? */
sema_init(&st->pll_mutex, 1); sema_init(&st->pll_mutex, 1);
st->gate_ctrl = adap->fe[0]->ops.i2c_gate_ctrl; st->gate_ctrl = adap->fe_adap[0].fe->ops.i2c_gate_ctrl;
adap->fe[0]->ops.i2c_gate_ctrl = drxk_gate_ctrl; adap->fe_adap[0].fe->ops.i2c_gate_ctrl = drxk_gate_ctrl;
adap->dont_attach_fe[1] = true;
return 0; return 0;
} }
...@@ -325,19 +320,15 @@ static int az6007_tuner_attach(struct dvb_usb_adapter *adap) ...@@ -325,19 +320,15 @@ static int az6007_tuner_attach(struct dvb_usb_adapter *adap)
info("attaching tuner mt2063"); info("attaching tuner mt2063");
/* Attach mt2063 to DVB-C frontend */ /* Attach mt2063 to DVB-C frontend */
if (adap->fe[0]->ops.i2c_gate_ctrl) if (adap->fe_adap[0].fe->ops.i2c_gate_ctrl)
adap->fe[0]->ops.i2c_gate_ctrl(adap->fe[0], 1); adap->fe_adap[0].fe->ops.i2c_gate_ctrl(adap->fe_adap[0].fe, 1);
if (!dvb_attach(mt2063_attach, adap->fe[0], &az6007_mt2063_config, if (!dvb_attach(mt2063_attach, adap->fe_adap[0].fe,
&az6007_mt2063_config,
&adap->dev->i2c_adap)) &adap->dev->i2c_adap))
return -EINVAL; return -EINVAL;
if (adap->fe[0]->ops.i2c_gate_ctrl) if (adap->fe_adap[0].fe->ops.i2c_gate_ctrl)
adap->fe[0]->ops.i2c_gate_ctrl(adap->fe[0], 0); adap->fe_adap[0].fe->ops.i2c_gate_ctrl(adap->fe_adap[0].fe, 0);
/* Hack - needed due to drxk */
adap->fe[1]->tuner_priv = adap->fe[0]->tuner_priv;
memcpy(&adap->fe[1]->ops.tuner_ops,
&adap->fe[0]->ops.tuner_ops, sizeof(adap->fe[0]->ops.tuner_ops));
return 0; return 0;
} }
...@@ -530,7 +521,8 @@ static struct dvb_usb_device_properties az6007_properties = { ...@@ -530,7 +521,8 @@ static struct dvb_usb_device_properties az6007_properties = {
.num_adapters = 1, .num_adapters = 1,
.adapter = { .adapter = {
{ {
.num_frontends = 2, .num_frontends = 1,
.fe = {{
.streaming_ctrl = az6007_streaming_ctrl, .streaming_ctrl = az6007_streaming_ctrl,
.tuner_attach = az6007_tuner_attach, .tuner_attach = az6007_tuner_attach,
.frontend_attach = az6007_frontend_attach, .frontend_attach = az6007_frontend_attach,
...@@ -547,8 +539,8 @@ static struct dvb_usb_device_properties az6007_properties = { ...@@ -547,8 +539,8 @@ static struct dvb_usb_device_properties az6007_properties = {
} }
}, },
.size_of_priv = sizeof(struct az6007_device_state), .size_of_priv = sizeof(struct az6007_device_state),
} }}
}, } },
.power_ctrl = az6007_power_ctrl, .power_ctrl = az6007_power_ctrl,
.read_mac_address = az6007_read_mac_addr, .read_mac_address = az6007_read_mac_addr,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment