summaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/dvb-usb
diff options
context:
space:
mode:
authorMalcolm Priestley <tvboxspy@gmail.com>2011-11-28 18:04:21 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-12-11 08:13:27 -0200
commit990f49af3f564b9a0f572e06f22e2ae34c79c37d (patch)
tree87858d195c1cb942dd2269f0cc46d79fe6f3b205 /drivers/media/dvb/dvb-usb
parent773ddbd228dc16a4829836e1dc16383e44c8575e (diff)
[media] it913x: support for different tuner regs
There appears to be differences in the tuner registers on earlier IT9135 devices. Using the current IT9137 settings cause corruptions on some channels This patch is in preparation for multi firmware loading and current unsupported types. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/dvb/dvb-usb')
-rw-r--r--drivers/media/dvb/dvb-usb/it913x.c37
1 files changed, 35 insertions, 2 deletions
diff --git a/drivers/media/dvb/dvb-usb/it913x.c b/drivers/media/dvb/dvb-usb/it913x.c
index 24f04b4ac87..d57e0626369 100644
--- a/drivers/media/dvb/dvb-usb/it913x.c
+++ b/drivers/media/dvb/dvb-usb/it913x.c
@@ -338,6 +338,31 @@ static int it913x_rc_query(struct dvb_usb_device *d)
return ret;
}
+static int ite_firmware_select(struct usb_device *udev,
+ struct dvb_usb_device_properties *props)
+{
+ int sw;
+ /* auto switch */
+ if (le16_to_cpu(udev->descriptor.idProduct) ==
+ USB_PID_ITETECH_IT9135)
+ sw = IT9135_V1_FW;
+ else
+ sw = IT9137_FW;
+
+ switch (sw) {
+ case IT9135_V1_FW:
+ it913x_config.firmware_ver = 0;
+ it913x_config.adc_x2 = 1;
+ break;
+ case IT9137_FW:
+ default:
+ it913x_config.firmware_ver = 0;
+ it913x_config.adc_x2 = 0;
+ }
+
+ return 0;
+}
+
#define TS_MPEG_PKT_SIZE 188
#define EP_LOW 21
#define TS_BUFFER_SIZE_PID (EP_LOW*TS_MPEG_PKT_SIZE)
@@ -392,6 +417,8 @@ static int it913x_identify_state(struct usb_device *udev,
props->adapter[1].fe[0].stream.u.bulk.buffersize =
props->adapter[0].fe[0].stream.u.bulk.buffersize;
+ ret = ite_firmware_select(udev, props);
+
if (firm_no > 0) {
*cold = 0;
return 0;
@@ -421,10 +448,16 @@ static int it913x_identify_state(struct usb_device *udev,
if (it913x_config.dual_mode) {
ret |= it913x_wr_reg(udev, DEV_0, 0x4bfb, CHIP2_I2C_ADDR);
- ret |= it913x_wr_reg(udev, DEV_0, CLK_O_EN, 0x1);
+ if (it913x_config.firmware_ver == 1)
+ ret |= it913x_wr_reg(udev, DEV_0, 0xcfff, 0x1);
+ else
+ ret |= it913x_wr_reg(udev, DEV_0, CLK_O_EN, 0x1);
} else {
ret |= it913x_wr_reg(udev, DEV_0, 0x4bfb, 0x0);
- ret |= it913x_wr_reg(udev, DEV_0, CLK_O_EN, 0x0);
+ if (it913x_config.firmware_ver == 1)
+ ret |= it913x_wr_reg(udev, DEV_0, 0xcfff, 0x0);
+ else
+ ret |= it913x_wr_reg(udev, DEV_0, CLK_O_EN, 0x0);
}
*cold = 1;