Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 242091
b: refs/heads/master
c: 1e8750c
h: refs/heads/master
i:
  242089: 1435cf4
  242087: c42ccf6
v: v3
  • Loading branch information
Antti Palosaari authored and Mauro Carvalho Chehab committed Mar 22, 2011
1 parent a809678 commit c9fe8a3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 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: c1e13971b19324305b35fafc080b527465214d3c
refs/heads/master: 1e8750c2ac2bcbf2b084d3fa77cbb5eef33b3e7f
17 changes: 12 additions & 5 deletions trunk/drivers/media/dvb/dvb-usb/af9015.c
Original file line number Diff line number Diff line change
Expand Up @@ -479,9 +479,7 @@ static int af9015_init_endpoint(struct dvb_usb_device *d)
ret = af9015_set_reg_bit(d, 0xd50b, 0);
else
ret = af9015_clear_reg_bit(d, 0xd50b, 0);
if (ret)
goto error;
ret = af9015_write_reg(d, 0x98e9, 0xff);

error:
if (ret)
err("endpoint init failed:%d", ret);
Expand Down Expand Up @@ -614,6 +612,11 @@ static int af9015_init(struct dvb_usb_device *d)
int ret;
deb_info("%s:\n", __func__);

/* init RC canary */
ret = af9015_write_reg(d, 0x98e9, 0xff);
if (ret)
goto error;

ret = af9015_init_endpoint(d);
if (ret)
goto error;
Expand Down Expand Up @@ -1041,11 +1044,14 @@ static int af9015_rc_query(struct dvb_usb_device *d)

/* Only process key if canary killed */
if (buf[16] != 0xff && buf[0] != 0x01) {
/* Reset the canary */
af9015_write_reg(d, 0x98e9, 0xff);
deb_rc("%s: key pressed %02x %02x %02x %02x\n", __func__,
buf[12], buf[13], buf[14], buf[15]);

/* Reset the canary */
ret = af9015_write_reg(d, 0x98e9, 0xff);
if (ret)
goto error;

/* Remember this key */
memcpy(priv->rc_last, &buf[12], 4);
if (buf[14] == (u8) ~buf[15]) {
Expand All @@ -1058,6 +1064,7 @@ static int af9015_rc_query(struct dvb_usb_device *d)
buf[13] << 8 | buf[14];
}
} else {
/* 32 bit NEC */
priv->rc_keycode = buf[12] << 24 | buf[13] << 16 |
buf[14] << 8 | buf[15];
}
Expand Down

0 comments on commit c9fe8a3

Please sign in to comment.