aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMalcolm Priestley <tvboxspy@gmail.com>2012-01-02 12:46:32 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-01-06 10:05:16 -0500
commitd4d5a40710701abd4535d6a5ada601c885a08865 (patch)
tree004670f7866cc730b207aa45528cab738e23097d
parentbcd158de94238d90adf7275548f0aaf2de724ab1 (diff)
[media] [BUG] it913x ver 1.20. PID filter problems
Fixes issues with PID filter Stalling of some channels when PID is on. PID filter not turning off fully. PID filter can now turn on and off each index. Removed PID_RST from it913x_pid_filter_ctrl. Replaced with PID_EN removed from it913x_pid_filter Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r--drivers/media/dvb/dvb-usb/it913x.c22
1 files changed, 9 insertions, 13 deletions
diff --git a/drivers/media/dvb/dvb-usb/it913x.c b/drivers/media/dvb/dvb-usb/it913x.c
index 635429522e9..6bf2086b54d 100644
--- a/drivers/media/dvb/dvb-usb/it913x.c
+++ b/drivers/media/dvb/dvb-usb/it913x.c
@@ -259,15 +259,15 @@ static u32 it913x_query(struct usb_device *udev, u8 pro)
259 259
260static int it913x_pid_filter_ctrl(struct dvb_usb_adapter *adap, int onoff) 260static int it913x_pid_filter_ctrl(struct dvb_usb_adapter *adap, int onoff)
261{ 261{
262 int ret = 0; 262 struct usb_device *udev = adap->dev->udev;
263 int ret;
263 u8 pro = (adap->id == 0) ? DEV_0_DMOD : DEV_1_DMOD; 264 u8 pro = (adap->id == 0) ? DEV_0_DMOD : DEV_1_DMOD;
264 265
265 if (mutex_lock_interruptible(&adap->dev->i2c_mutex) < 0) 266 if (mutex_lock_interruptible(&adap->dev->i2c_mutex) < 0)
266 return -EAGAIN; 267 return -EAGAIN;
267 deb_info(1, "PID_C (%02x)", onoff); 268 deb_info(1, "PID_C (%02x)", onoff);
268 269
269 if (!onoff) 270 ret = it913x_wr_reg(udev, pro, PID_EN, onoff);
270 ret = it913x_wr_reg(adap->dev->udev, pro, PID_RST, 0x1);
271 271
272 mutex_unlock(&adap->dev->i2c_mutex); 272 mutex_unlock(&adap->dev->i2c_mutex);
273 return ret; 273 return ret;
@@ -277,24 +277,20 @@ static int it913x_pid_filter(struct dvb_usb_adapter *adap,
277 int index, u16 pid, int onoff) 277 int index, u16 pid, int onoff)
278{ 278{
279 struct usb_device *udev = adap->dev->udev; 279 struct usb_device *udev = adap->dev->udev;
280 int ret = 0; 280 int ret;
281 u8 pro = (adap->id == 0) ? DEV_0_DMOD : DEV_1_DMOD; 281 u8 pro = (adap->id == 0) ? DEV_0_DMOD : DEV_1_DMOD;
282 282
283 if (mutex_lock_interruptible(&adap->dev->i2c_mutex) < 0) 283 if (mutex_lock_interruptible(&adap->dev->i2c_mutex) < 0)
284 return -EAGAIN; 284 return -EAGAIN;
285 deb_info(1, "PID_F (%02x)", onoff); 285 deb_info(1, "PID_F (%02x)", onoff);
286 if (onoff) {
287 ret = it913x_wr_reg(udev, pro, PID_EN, 0x1);
288 286
289 ret |= it913x_wr_reg(udev, pro, PID_LSB, (u8)(pid & 0xff)); 287 ret = it913x_wr_reg(udev, pro, PID_LSB, (u8)(pid & 0xff));
290 288
291 ret |= it913x_wr_reg(udev, pro, PID_MSB, (u8)(pid >> 8)); 289 ret |= it913x_wr_reg(udev, pro, PID_MSB, (u8)(pid >> 8));
292 290
293 ret |= it913x_wr_reg(udev, pro, PID_INX_EN, (u8)onoff); 291 ret |= it913x_wr_reg(udev, pro, PID_INX_EN, (u8)onoff);
294 292
295 ret |= it913x_wr_reg(udev, pro, PID_INX, (u8)(index & 0x1f)); 293 ret |= it913x_wr_reg(udev, pro, PID_INX, (u8)(index & 0x1f));
296
297 }
298 294
299 mutex_unlock(&adap->dev->i2c_mutex); 295 mutex_unlock(&adap->dev->i2c_mutex);
300 return 0; 296 return 0;
@@ -839,5 +835,5 @@ module_exit(it913x_module_exit);
839 835
840MODULE_AUTHOR("Malcolm Priestley <tvboxspy@gmail.com>"); 836MODULE_AUTHOR("Malcolm Priestley <tvboxspy@gmail.com>");
841MODULE_DESCRIPTION("it913x USB 2 Driver"); 837MODULE_DESCRIPTION("it913x USB 2 Driver");
842MODULE_VERSION("1.18"); 838MODULE_VERSION("1.20");
843MODULE_LICENSE("GPL"); 839MODULE_LICENSE("GPL");