Skip to content

Commit

Permalink
V4L/DVB (3811): Cxusb: lgh064f: set auxiliary byte in pll_set
Browse files Browse the repository at this point in the history
This changeset removes pll_init, and instead sets the tuner
auxiliary byte in pll_set.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
  • Loading branch information
Michael Krufky authored and Mauro Carvalho Chehab committed Jun 25, 2006
1 parent 3febc04 commit 8d6cdd2
Showing 1 changed file with 31 additions and 5 deletions.
36 changes: 31 additions & 5 deletions drivers/media/dvb/dvb-usb/cxusb.c
Original file line number Diff line number Diff line change
Expand Up @@ -322,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,

Expand All @@ -334,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 = {
Expand Down Expand Up @@ -362,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;
}
Expand Down

0 comments on commit 8d6cdd2

Please sign in to comment.