Commit d4d5a407 authored by Malcolm Priestley's avatar Malcolm Priestley Committed by Mauro Carvalho Chehab

[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: default avatarMalcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent bcd158de
...@@ -259,15 +259,15 @@ static u32 it913x_query(struct usb_device *udev, u8 pro) ...@@ -259,15 +259,15 @@ static u32 it913x_query(struct usb_device *udev, u8 pro)
static int it913x_pid_filter_ctrl(struct dvb_usb_adapter *adap, int onoff) static int it913x_pid_filter_ctrl(struct dvb_usb_adapter *adap, int onoff)
{ {
int ret = 0; struct usb_device *udev = adap->dev->udev;
int ret;
u8 pro = (adap->id == 0) ? DEV_0_DMOD : DEV_1_DMOD; u8 pro = (adap->id == 0) ? DEV_0_DMOD : DEV_1_DMOD;
if (mutex_lock_interruptible(&adap->dev->i2c_mutex) < 0) if (mutex_lock_interruptible(&adap->dev->i2c_mutex) < 0)
return -EAGAIN; return -EAGAIN;
deb_info(1, "PID_C (%02x)", onoff); deb_info(1, "PID_C (%02x)", onoff);
if (!onoff) ret = it913x_wr_reg(udev, pro, PID_EN, onoff);
ret = it913x_wr_reg(adap->dev->udev, pro, PID_RST, 0x1);
mutex_unlock(&adap->dev->i2c_mutex); mutex_unlock(&adap->dev->i2c_mutex);
return ret; return ret;
...@@ -277,16 +277,14 @@ static int it913x_pid_filter(struct dvb_usb_adapter *adap, ...@@ -277,16 +277,14 @@ static int it913x_pid_filter(struct dvb_usb_adapter *adap,
int index, u16 pid, int onoff) int index, u16 pid, int onoff)
{ {
struct usb_device *udev = adap->dev->udev; struct usb_device *udev = adap->dev->udev;
int ret = 0; int ret;
u8 pro = (adap->id == 0) ? DEV_0_DMOD : DEV_1_DMOD; u8 pro = (adap->id == 0) ? DEV_0_DMOD : DEV_1_DMOD;
if (mutex_lock_interruptible(&adap->dev->i2c_mutex) < 0) if (mutex_lock_interruptible(&adap->dev->i2c_mutex) < 0)
return -EAGAIN; return -EAGAIN;
deb_info(1, "PID_F (%02x)", onoff); deb_info(1, "PID_F (%02x)", onoff);
if (onoff) {
ret = it913x_wr_reg(udev, pro, PID_EN, 0x1);
ret |= it913x_wr_reg(udev, pro, PID_LSB, (u8)(pid & 0xff)); ret = it913x_wr_reg(udev, pro, PID_LSB, (u8)(pid & 0xff));
ret |= it913x_wr_reg(udev, pro, PID_MSB, (u8)(pid >> 8)); ret |= it913x_wr_reg(udev, pro, PID_MSB, (u8)(pid >> 8));
...@@ -294,8 +292,6 @@ static int it913x_pid_filter(struct dvb_usb_adapter *adap, ...@@ -294,8 +292,6 @@ static int it913x_pid_filter(struct dvb_usb_adapter *adap,
ret |= it913x_wr_reg(udev, pro, PID_INX, (u8)(index & 0x1f)); ret |= it913x_wr_reg(udev, pro, PID_INX, (u8)(index & 0x1f));
}
mutex_unlock(&adap->dev->i2c_mutex); mutex_unlock(&adap->dev->i2c_mutex);
return 0; return 0;
} }
...@@ -839,5 +835,5 @@ module_exit(it913x_module_exit); ...@@ -839,5 +835,5 @@ module_exit(it913x_module_exit);
MODULE_AUTHOR("Malcolm Priestley <tvboxspy@gmail.com>"); MODULE_AUTHOR("Malcolm Priestley <tvboxspy@gmail.com>");
MODULE_DESCRIPTION("it913x USB 2 Driver"); MODULE_DESCRIPTION("it913x USB 2 Driver");
MODULE_VERSION("1.18"); MODULE_VERSION("1.20");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment