aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb
diff options
context:
space:
mode:
authorAntti Palosaari <crope@iki.fi>2011-03-18 18:36:42 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-03-22 03:54:53 -0400
commit1e8750c2ac2bcbf2b084d3fa77cbb5eef33b3e7f (patch)
treee6f2b58861e4312e7cf462b0847d8117c2753e19 /drivers/media/dvb
parentc1e13971b19324305b35fafc080b527465214d3c (diff)
[media] af9015: small RC change
Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/dvb')
-rw-r--r--drivers/media/dvb/dvb-usb/af9015.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/drivers/media/dvb/dvb-usb/af9015.c b/drivers/media/dvb/dvb-usb/af9015.c
index 6457d042b1a..da2f87efe07 100644
--- a/drivers/media/dvb/dvb-usb/af9015.c
+++ b/drivers/media/dvb/dvb-usb/af9015.c
@@ -479,9 +479,7 @@ static int af9015_init_endpoint(struct dvb_usb_device *d)
479 ret = af9015_set_reg_bit(d, 0xd50b, 0); 479 ret = af9015_set_reg_bit(d, 0xd50b, 0);
480 else 480 else
481 ret = af9015_clear_reg_bit(d, 0xd50b, 0); 481 ret = af9015_clear_reg_bit(d, 0xd50b, 0);
482 if (ret) 482
483 goto error;
484 ret = af9015_write_reg(d, 0x98e9, 0xff);
485error: 483error:
486 if (ret) 484 if (ret)
487 err("endpoint init failed:%d", ret); 485 err("endpoint init failed:%d", ret);
@@ -614,6 +612,11 @@ static int af9015_init(struct dvb_usb_device *d)
614 int ret; 612 int ret;
615 deb_info("%s:\n", __func__); 613 deb_info("%s:\n", __func__);
616 614
615 /* init RC canary */
616 ret = af9015_write_reg(d, 0x98e9, 0xff);
617 if (ret)
618 goto error;
619
617 ret = af9015_init_endpoint(d); 620 ret = af9015_init_endpoint(d);
618 if (ret) 621 if (ret)
619 goto error; 622 goto error;
@@ -1041,11 +1044,14 @@ static int af9015_rc_query(struct dvb_usb_device *d)
1041 1044
1042 /* Only process key if canary killed */ 1045 /* Only process key if canary killed */
1043 if (buf[16] != 0xff && buf[0] != 0x01) { 1046 if (buf[16] != 0xff && buf[0] != 0x01) {
1044 /* Reset the canary */
1045 af9015_write_reg(d, 0x98e9, 0xff);
1046 deb_rc("%s: key pressed %02x %02x %02x %02x\n", __func__, 1047 deb_rc("%s: key pressed %02x %02x %02x %02x\n", __func__,
1047 buf[12], buf[13], buf[14], buf[15]); 1048 buf[12], buf[13], buf[14], buf[15]);
1048 1049
1050 /* Reset the canary */
1051 ret = af9015_write_reg(d, 0x98e9, 0xff);
1052 if (ret)
1053 goto error;
1054
1049 /* Remember this key */ 1055 /* Remember this key */
1050 memcpy(priv->rc_last, &buf[12], 4); 1056 memcpy(priv->rc_last, &buf[12], 4);
1051 if (buf[14] == (u8) ~buf[15]) { 1057 if (buf[14] == (u8) ~buf[15]) {
@@ -1058,6 +1064,7 @@ static int af9015_rc_query(struct dvb_usb_device *d)
1058 buf[13] << 8 | buf[14]; 1064 buf[13] << 8 | buf[14];
1059 } 1065 }
1060 } else { 1066 } else {
1067 /* 32 bit NEC */
1061 priv->rc_keycode = buf[12] << 24 | buf[13] << 16 | 1068 priv->rc_keycode = buf[12] << 24 | buf[13] << 16 |
1062 buf[14] << 8 | buf[15]; 1069 buf[14] << 8 | buf[15];
1063 } 1070 }