diff options
Diffstat (limited to 'drivers/media/usb/dvb-usb-v2/az6007.c')
-rw-r--r-- | drivers/media/usb/dvb-usb-v2/az6007.c | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/drivers/media/usb/dvb-usb-v2/az6007.c b/drivers/media/usb/dvb-usb-v2/az6007.c index c3c4b98733bf..935dbaa80ef0 100644 --- a/drivers/media/usb/dvb-usb-v2/az6007.c +++ b/drivers/media/usb/dvb-usb-v2/az6007.c @@ -207,24 +207,27 @@ static int az6007_streaming_ctrl(struct dvb_frontend *fe, int onoff) static int az6007_rc_query(struct dvb_usb_device *d) { struct az6007_device_state *st = d_to_priv(d); - unsigned code = 0; + unsigned code; az6007_read(d, AZ6007_READ_IR, 0, 0, st->data, 10); if (st->data[1] == 0x44) return 0; - if ((st->data[1] ^ st->data[2]) == 0xff) - code = st->data[1]; - else - code = st->data[1] << 8 | st->data[2]; - - if ((st->data[3] ^ st->data[4]) == 0xff) - code = code << 8 | st->data[3]; - else - code = code << 16 | st->data[3] << 8 | st->data[4]; + if ((st->data[3] ^ st->data[4]) == 0xff) { + if ((st->data[1] ^ st->data[2]) == 0xff) + code = RC_SCANCODE_NEC(st->data[1], st->data[3]); + else + code = RC_SCANCODE_NECX(st->data[1] << 8 | st->data[2], + st->data[3]); + } else { + code = RC_SCANCODE_NEC32(st->data[1] << 24 | + st->data[2] << 16 | + st->data[3] << 8 | + st->data[4]); + } - rc_keydown(d->rc_dev, code, st->data[5]); + rc_keydown(d->rc_dev, RC_TYPE_NEC, code, st->data[5]); return 0; } |