summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
a760d63)
Improve PID filtering and program register 20 correctly.
Make sure stream_on message is sent if streaming is off, otherwise
PIDs are not registered.
Move mutex outside lme2510_enable_pid.
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
u8 i2c_tuner_gate_r;
u8 i2c_tuner_addr;
u8 stream_on;
u8 i2c_tuner_gate_r;
u8 i2c_tuner_addr;
u8 stream_on;
void *buffer;
struct urb *lme_urb;
void *usb_buffer;
void *buffer;
struct urb *lme_urb;
void *usb_buffer;
static u8 pid_buff[] = LME_ZERO_PID;
static u8 rbuf[1];
u8 pid_no = index * 2;
static u8 pid_buff[] = LME_ZERO_PID;
static u8 rbuf[1];
u8 pid_no = index * 2;
+ u8 pid_len = pid_no + 2;
int ret = 0;
deb_info(1, "PID Setting Pid %04x", pid_out);
int ret = 0;
deb_info(1, "PID Setting Pid %04x", pid_out);
+ if (st->pid_size == 0)
+ ret |= lme2510_stream_restart(d);
+
pid_buff[2] = pid_no;
pid_buff[3] = (u8)pid_out & 0xff;
pid_buff[4] = pid_no + 1;
pid_buff[5] = (u8)(pid_out >> 8);
pid_buff[2] = pid_no;
pid_buff[3] = (u8)pid_out & 0xff;
pid_buff[4] = pid_no + 1;
pid_buff[5] = (u8)(pid_out >> 8);
- /* wait for i2c mutex */
- ret = mutex_lock_interruptible(&d->i2c_mutex);
- if (ret < 0) {
- ret = -EAGAIN;
- return ret;
- }
+ if (pid_len > st->pid_size)
+ st->pid_size = pid_len;
+ pid_buff[7] = 0x80 + st->pid_size;
ret |= lme2510_usb_talk(d, pid_buff ,
sizeof(pid_buff) , rbuf, sizeof(rbuf));
ret |= lme2510_usb_talk(d, pid_buff ,
sizeof(pid_buff) , rbuf, sizeof(rbuf));
ret |= lme2510_stream_restart(d);
ret |= lme2510_stream_restart(d);
- mutex_unlock(&d->i2c_mutex);
-
static int lme2510_pid_filter_ctrl(struct dvb_usb_adapter *adap, int onoff)
{
static int lme2510_pid_filter_ctrl(struct dvb_usb_adapter *adap, int onoff)
{
+ struct lme2510_state *st = adap->dev->priv;
static u8 clear_pid_reg[] = LME_CLEAR_PID;
static u8 rbuf[1];
static u8 clear_pid_reg[] = LME_CLEAR_PID;
static u8 rbuf[1];
deb_info(1, "PID Clearing Filter");
ret = mutex_lock_interruptible(&adap->dev->i2c_mutex);
deb_info(1, "PID Clearing Filter");
ret = mutex_lock_interruptible(&adap->dev->i2c_mutex);
+ if (ret < 0)
+ return -EAGAIN;
if (!onoff)
ret |= lme2510_usb_talk(adap->dev, clear_pid_reg,
sizeof(clear_pid_reg), rbuf, sizeof(rbuf));
if (!onoff)
ret |= lme2510_usb_talk(adap->dev, clear_pid_reg,
sizeof(clear_pid_reg), rbuf, sizeof(rbuf));
mutex_unlock(&adap->dev->i2c_mutex);
return 0;
mutex_unlock(&adap->dev->i2c_mutex);
return 0;
pid, index, onoff);
if (onoff)
pid, index, onoff);
if (onoff)
- if (!pid_filter)
- ret = lme2510_enable_pid(adap->dev, index, pid);
+ if (!pid_filter) {
+ ret = mutex_lock_interruptible(&adap->dev->i2c_mutex);
+ if (ret < 0)
+ return -EAGAIN;
+ ret |= lme2510_enable_pid(adap->dev, index, pid);
+ mutex_unlock(&adap->dev->i2c_mutex);
+ }
+
MODULE_AUTHOR("Malcolm Priestley <tvboxspy@gmail.com>");
MODULE_DESCRIPTION("LME2510(C) DVB-S USB2.0");
MODULE_AUTHOR("Malcolm Priestley <tvboxspy@gmail.com>");
MODULE_DESCRIPTION("LME2510(C) DVB-S USB2.0");