summaryrefslogtreecommitdiff
path: root/linux/drivers/media/dvb/dvb-usb/cxusb.c
diff options
context:
space:
mode:
Diffstat (limited to 'linux/drivers/media/dvb/dvb-usb/cxusb.c')
-rw-r--r--linux/drivers/media/dvb/dvb-usb/cxusb.c55
1 files changed, 45 insertions, 10 deletions
diff --git a/linux/drivers/media/dvb/dvb-usb/cxusb.c b/linux/drivers/media/dvb/dvb-usb/cxusb.c
index d63f6ec4f..d40b9dba1 100644
--- a/linux/drivers/media/dvb/dvb-usb/cxusb.c
+++ b/linux/drivers/media/dvb/dvb-usb/cxusb.c
@@ -150,6 +150,15 @@ static int cxusb_power_ctrl(struct dvb_usb_device *d, int onoff)
return cxusb_ctrl_msg(d, CMD_POWER_OFF, &b, 1, NULL, 0);
}
+static int cxusb_bluebird_power_ctrl(struct dvb_usb_device *d, int onoff)
+{
+ u8 b = 0;
+ if (onoff)
+ return cxusb_ctrl_msg(d, CMD_POWER_ON, &b, 1, NULL, 0);
+ else
+ return 0;
+}
+
static int cxusb_streaming_ctrl(struct dvb_usb_device *d, int onoff)
{
u8 buf[2] = { 0x03, 0x00 };
@@ -313,6 +322,36 @@ static int cxusb_mt352_demod_init(struct dvb_frontend* fe)
return 0;
}
+static int cxusb_lgh064f_pll_set_i2c(struct dvb_frontend *fe,
+ struct dvb_frontend_parameters *fep)
+{
+ struct dvb_usb_device *d = fe->dvb->priv;
+ int ret = 0;
+ u8 b[5];
+ struct i2c_msg msg = { .addr = d->pll_addr, .flags = 0,
+ .buf = &b[1], .len = 4 };
+
+ dvb_usb_pll_set(fe,fep,b);
+
+ if (i2c_transfer (&d->i2c_adap, &msg, 1) != 1) {
+ err("tuner i2c write failed for pll_set.");
+ ret = -EREMOTEIO;
+ }
+ msleep(1);
+
+ /* Set the Auxiliary Byte. */
+ b[3] &= ~0x20;
+ b[3] |= 0x18;
+ b[4] = 0x50;
+ if (i2c_transfer(&d->i2c_adap, &msg, 1) != 1) {
+ err("tuner i2c write failed writing auxiliary byte.");
+ ret = -EREMOTEIO;
+ }
+ msleep(1);
+
+ return ret;
+}
+
static struct cx22702_config cxusb_cx22702_config = {
.demod_address = 0x63,
@@ -325,7 +364,7 @@ static struct cx22702_config cxusb_cx22702_config = {
static struct lgdt330x_config cxusb_lgdt3303_config = {
.demod_address = 0x0e,
.demod_chip = LGDT3303,
- .pll_set = dvb_usb_pll_set_i2c,
+ .pll_set = cxusb_lgh064f_pll_set_i2c,
};
static struct mt352_config cxusb_dee1601_config = {
@@ -334,7 +373,7 @@ static struct mt352_config cxusb_dee1601_config = {
.pll_set = dvb_usb_pll_set,
};
-struct mt352_config cxusb_mt352_config = {
+static struct mt352_config cxusb_mt352_config = {
/* used in both lgz201 and th7579 */
.demod_address = 0x0f,
.demod_init = cxusb_mt352_demod_init,
@@ -353,11 +392,7 @@ static int cxusb_fmd1216me_tuner_attach(struct dvb_usb_device *d)
static int cxusb_lgh064f_tuner_attach(struct dvb_usb_device *d)
{
- u8 bpll[4] = { 0x00, 0x00, 0x18, 0x50 };
- /* bpll[2] : unset bit 3, set bits 4&5
- bpll[3] : 0x50 - digital, 0x20 - analog */
d->pll_addr = 0x61;
- memcpy(d->pll_init, bpll, 4);
d->pll_desc = &dvb_pll_tdvs_tua6034;
return 0;
}
@@ -544,7 +579,7 @@ static struct dvb_usb_properties cxusb_bluebird_lgh064f_properties = {
.size_of_priv = sizeof(struct cxusb_state),
.streaming_ctrl = cxusb_streaming_ctrl,
- .power_ctrl = cxusb_power_ctrl,
+ .power_ctrl = cxusb_bluebird_power_ctrl,
.frontend_attach = cxusb_lgdt3303_frontend_attach,
.tuner_attach = cxusb_lgh064f_tuner_attach,
@@ -589,7 +624,7 @@ static struct dvb_usb_properties cxusb_bluebird_dee1601_properties = {
.size_of_priv = sizeof(struct cxusb_state),
.streaming_ctrl = cxusb_streaming_ctrl,
- .power_ctrl = cxusb_power_ctrl,
+ .power_ctrl = cxusb_bluebird_power_ctrl,
.frontend_attach = cxusb_dee1601_frontend_attach,
.tuner_attach = cxusb_dee1601_tuner_attach,
@@ -638,7 +673,7 @@ static struct dvb_usb_properties cxusb_bluebird_lgz201_properties = {
.size_of_priv = sizeof(struct cxusb_state),
.streaming_ctrl = cxusb_streaming_ctrl,
- .power_ctrl = cxusb_power_ctrl,
+ .power_ctrl = cxusb_bluebird_power_ctrl,
.frontend_attach = cxusb_mt352_frontend_attach,
.tuner_attach = cxusb_lgz201_tuner_attach,
@@ -683,7 +718,7 @@ static struct dvb_usb_properties cxusb_bluebird_dtt7579_properties = {
.size_of_priv = sizeof(struct cxusb_state),
.streaming_ctrl = cxusb_streaming_ctrl,
- .power_ctrl = cxusb_power_ctrl,
+ .power_ctrl = cxusb_bluebird_power_ctrl,
.frontend_attach = cxusb_mt352_frontend_attach,
.tuner_attach = cxusb_dtt7579_tuner_attach,