projects
/
deliverable
/
linux.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
V4L/DVB (4028): Change dvb_frontend_ops to be a real field instead of a pointer field...
[deliverable/linux.git]
/
drivers
/
media
/
dvb
/
dvb-usb
/
digitv.c
diff --git
a/drivers/media/dvb/dvb-usb/digitv.c
b/drivers/media/dvb/dvb-usb/digitv.c
index e6c55c9c9417d2afe8bf67a0b906c0342548f56c..c14d9efb48fdb7162a809ba16b3cd5b207acebc0 100644
(file)
--- a/
drivers/media/dvb/dvb-usb/digitv.c
+++ b/
drivers/media/dvb/dvb-usb/digitv.c
@@
-48,7
+48,7
@@
static int digitv_i2c_xfer(struct i2c_adapter *adap,struct i2c_msg msg[],int num
struct dvb_usb_device *d = i2c_get_adapdata(adap);
int i;
struct dvb_usb_device *d = i2c_get_adapdata(adap);
int i;
- if (
down_interruptible(&d->i2c_sem
) < 0)
+ if (
mutex_lock_interruptible(&d->i2c_mutex
) < 0)
return -EAGAIN;
if (num > 2)
return -EAGAIN;
if (num > 2)
@@
-67,7
+67,7
@@
static int digitv_i2c_xfer(struct i2c_adapter *adap,struct i2c_msg msg[],int num
break;
}
break;
}
-
up(&d->i2c_sem
);
+
mutex_unlock(&d->i2c_mutex
);
return i;
}
return i;
}
@@
-112,27
+112,30
@@
static int digitv_mt352_demod_init(struct dvb_frontend *fe)
static struct mt352_config digitv_mt352_config = {
.demod_init = digitv_mt352_demod_init,
static struct mt352_config digitv_mt352_config = {
.demod_init = digitv_mt352_demod_init,
- .pll_set = dvb_usb_pll_set,
};
};
-static int digitv_nxt6000_
pll_set
(struct dvb_frontend *fe, struct dvb_frontend_parameters *fep)
+static int digitv_nxt6000_
tuner_set_params
(struct dvb_frontend *fe, struct dvb_frontend_parameters *fep)
{
struct dvb_usb_device *d = fe->dvb->priv;
u8 b[5];
{
struct dvb_usb_device *d = fe->dvb->priv;
u8 b[5];
- dvb_usb_
pll_set(fe,fep,b
);
+ dvb_usb_
tuner_calc_regs(fe,fep,b, 5
);
return digitv_ctrl_msg(d,USB_WRITE_TUNER,0,&b[1],4,NULL,0);
}
static struct nxt6000_config digitv_nxt6000_config = {
.clock_inversion = 1,
return digitv_ctrl_msg(d,USB_WRITE_TUNER,0,&b[1],4,NULL,0);
}
static struct nxt6000_config digitv_nxt6000_config = {
.clock_inversion = 1,
- .pll_set = digitv_nxt6000_pll_set,
};
static int digitv_frontend_attach(struct dvb_usb_device *d)
{
};
static int digitv_frontend_attach(struct dvb_usb_device *d)
{
- if ((d->fe = mt352_attach(&digitv_mt352_config, &d->i2c_adap)) != NULL
||
- (d->fe = nxt6000_attach(&digitv_nxt6000_config, &d->i2c_adap)) != NULL)
+ if ((d->fe = mt352_attach(&digitv_mt352_config, &d->i2c_adap)) != NULL
) {
+ d->fe->ops.tuner_ops.calc_regs = dvb_usb_tuner_calc_regs;
return 0;
return 0;
+ }
+ if ((d->fe = nxt6000_attach(&digitv_nxt6000_config, &d->i2c_adap)) != NULL) {
+ d->fe->ops.tuner_ops.set_params = digitv_nxt6000_tuner_set_params;
+ return 0;
+ }
return -EIO;
}
return -EIO;
}
@@
-175,11
+178,13
@@
static int digitv_probe(struct usb_interface *intf,
if ((ret = dvb_usb_device_init(intf,&digitv_properties,THIS_MODULE,&d)) == 0) {
u8 b[4] = { 0 };
if ((ret = dvb_usb_device_init(intf,&digitv_properties,THIS_MODULE,&d)) == 0) {
u8 b[4] = { 0 };
- b[0] = 1;
- digitv_ctrl_msg(d,USB_WRITE_REMOTE_TYPE,0,b,4,NULL,0);
+ if (d != NULL) { /* do that only when the firmware is loaded */
+ b[0] = 1;
+ digitv_ctrl_msg(d,USB_WRITE_REMOTE_TYPE,0,b,4,NULL,0);
- b[0] = 0;
- digitv_ctrl_msg(d,USB_WRITE_REMOTE,0,b,4,NULL,0);
+ b[0] = 0;
+ digitv_ctrl_msg(d,USB_WRITE_REMOTE,0,b,4,NULL,0);
+ }
}
return ret;
}
}
return ret;
}
@@
-194,7
+199,7
@@
static struct dvb_usb_properties digitv_properties = {
.caps = DVB_USB_IS_AN_I2C_ADAPTER,
.usb_ctrl = CYPRESS_FX2,
.caps = DVB_USB_IS_AN_I2C_ADAPTER,
.usb_ctrl = CYPRESS_FX2,
- .firmware = "dvb-usb-digitv-0
1
.fw",
+ .firmware = "dvb-usb-digitv-0
2
.fw",
.size_of_priv = 0,
.size_of_priv = 0,
@@
-229,6
+234,7
@@
static struct dvb_usb_properties digitv_properties = {
{ &digitv_table[0], NULL },
{ NULL },
},
{ &digitv_table[0], NULL },
{ NULL },
},
+ { NULL },
}
};
}
};
This page took
0.026053 seconds
and
5
git commands to generate.