Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 366705
b: refs/heads/master
c: 75cd588
h: refs/heads/master
i:
  366703: 6d8b53e
v: v3
  • Loading branch information
Antti Palosaari authored and Mauro Carvalho Chehab committed Mar 21, 2013
1 parent f202a1f commit 7dd277e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 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: 1bfd5294ddb8b3d3ac05f609334070454b5ef96f
refs/heads/master: 75cd5886ed45b4173aa29bc66e7814a820b4fbf7
23 changes: 13 additions & 10 deletions trunk/drivers/media/usb/dvb-usb-v2/af9035.c
Original file line number Diff line number Diff line change
Expand Up @@ -1221,29 +1221,32 @@ static int af9035_init(struct dvb_usb_device *d)
#if IS_ENABLED(CONFIG_RC_CORE)
static int af9035_rc_query(struct dvb_usb_device *d)
{
unsigned int key;
unsigned char b[4];
int ret;
struct usb_req req = { CMD_IR_GET, 0, 0, NULL, 4, b };
u32 key;
u8 buf[4];
struct usb_req req = { CMD_IR_GET, 0, 0, NULL, 4, buf };

ret = af9035_ctrl_msg(d, &req);
if (ret == 1)
return 0;
else if (ret < 0)
goto err;

if ((b[2] + b[3]) == 0xff) {
if ((b[0] + b[1]) == 0xff) {
/* NEC */
key = b[0] << 8 | b[2];
if ((buf[2] + buf[3]) == 0xff) {
if ((buf[0] + buf[1]) == 0xff) {
/* NEC standard 16bit */
key = buf[0] << 8 | buf[2];
} else {
/* ext. NEC */
key = b[0] << 16 | b[1] << 8 | b[2];
/* NEC extended 24bit */
key = buf[0] << 16 | buf[1] << 8 | buf[2];
}
} else {
key = b[0] << 24 | b[1] << 16 | b[2] << 8 | b[3];
/* NEC full code 32bit */
key = buf[0] << 24 | buf[1] << 16 | buf[2] << 8 | buf[3];
}

dev_dbg(&d->udev->dev, "%s: %*ph\n", __func__, 4, buf);

rc_keydown(d->rc_dev, key, 0);

return 0;
Expand Down

0 comments on commit 7dd277e

Please sign in to comment.