Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 285175
b: refs/heads/master
c: b7d425d
h: refs/heads/master
i:
  285173: 8e04041
  285171: e5912fc
  285167: 7e0a39c
v: v3
  • Loading branch information
Malcolm Priestley authored and Mauro Carvalho Chehab committed Nov 7, 2011
1 parent 97f1c08 commit 58df616
Show file tree
Hide file tree
Showing 5 changed files with 824 additions and 82 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ead32d5357e4aae732ccd7427073ab4bf30d3068
refs/heads/master: b7d425d39179e125604cbf451a06d3204d2e1398
52 changes: 15 additions & 37 deletions trunk/drivers/media/dvb/dvb-usb/it913x.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,6 @@ struct it913x_state {
u8 id;
};

struct ite_config {
u8 chip_ver;
u16 chip_type;
u32 firmware;
u8 tuner_id_0;
u8 tuner_id_1;
u8 dual_mode;
};

struct ite_config it913x_config;

static int it913x_bulk_write(struct usb_device *dev,
Expand Down Expand Up @@ -390,8 +381,8 @@ static int it913x_identify_state(struct usb_device *udev,
if (ret != 0)
ret = it913x_wr_reg(udev, DEV_0,
GPIOH1_O, 0x0);
props->num_adapters = 2;
}
props->num_adapters = 2;
} else
props->num_adapters = 1;

Expand Down Expand Up @@ -474,12 +465,17 @@ static int it913x_download_firmware(struct usb_device *udev,
/* Tuner function */
if (it913x_config.dual_mode)
ret |= it913x_wr_reg(udev, DEV_0_DMOD , 0xec4c, 0xa0);

ret |= it913x_wr_reg(udev, DEV_0, PADODPU, 0x0);
ret |= it913x_wr_reg(udev, DEV_0, AGC_O_D, 0x0);
if (it913x_config.dual_mode) {
ret |= it913x_wr_reg(udev, DEV_1, PADODPU, 0x0);
ret |= it913x_wr_reg(udev, DEV_1, AGC_O_D, 0x0);
else
ret |= it913x_wr_reg(udev, DEV_0_DMOD , 0xec4c, 0x68);

if ((it913x_config.chip_ver == 1) &&
(it913x_config.chip_type == 0x9135)) {
ret |= it913x_wr_reg(udev, DEV_0, PADODPU, 0x0);
ret |= it913x_wr_reg(udev, DEV_0, AGC_O_D, 0x0);
if (it913x_config.dual_mode) {
ret |= it913x_wr_reg(udev, DEV_1, PADODPU, 0x0);
ret |= it913x_wr_reg(udev, DEV_1, AGC_O_D, 0x0);
}
}

return (ret < 0) ? -ENODEV : 0;
Expand All @@ -501,31 +497,13 @@ static int it913x_frontend_attach(struct dvb_usb_adapter *adap)
{
struct usb_device *udev = adap->dev->udev;
int ret = 0;
u8 adf = it913x_read_reg(udev, IO_MUX_POWER_CLK);
u8 adap_addr = I2C_BASE_ADDR + (adap->id << 5);
u16 ep_size = adap->props.fe[0].stream.u.bulk.buffersize;
u8 tuner_id, tuner_type;

if (adap->id == 0)
tuner_id = it913x_config.tuner_id_0;
else
tuner_id = it913x_config.tuner_id_1;

/* TODO we always use IT9137 possible references here*/
/* Documentation suggests don't care */
switch (tuner_id) {
case 0x51:
case 0x52:
case 0x60:
case 0x61:
case 0x62:
default:
case 0x38:
tuner_type = IT9137;
}
it913x_config.adf = it913x_read_reg(udev, IO_MUX_POWER_CLK);

adap->fe_adap[0].fe = dvb_attach(it913x_fe_attach,
&adap->dev->i2c_adap, adap_addr, adf, tuner_type);
&adap->dev->i2c_adap, adap_addr, &it913x_config);

if (adap->id == 0 && adap->fe_adap[0].fe) {
ret = it913x_wr_reg(udev, DEV_0_DMOD, MP2_SW_RST, 0x1);
Expand Down Expand Up @@ -698,5 +676,5 @@ module_exit(it913x_module_exit);

MODULE_AUTHOR("Malcolm Priestley <tvboxspy@gmail.com>");
MODULE_DESCRIPTION("it913x USB 2 Driver");
MODULE_VERSION("1.07");
MODULE_VERSION("1.08");
MODULE_LICENSE("GPL");
Loading

0 comments on commit 58df616

Please sign in to comment.