diff options
author | Antti Palosaari <crope@iki.fi> | 2013-03-08 15:50:21 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2013-03-21 18:06:31 -0400 |
commit | 75cd5886ed45b4173aa29bc66e7814a820b4fbf7 (patch) | |
tree | 28452f4e73a3e88bfa1cbc513b4ec5bd08449ff1 /drivers/media/usb/dvb-usb-v2/af9035.c | |
parent | 1bfd5294ddb8b3d3ac05f609334070454b5ef96f (diff) |
[media] af9035: style changes for remote controller polling
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/usb/dvb-usb-v2/af9035.c')
-rw-r--r-- | drivers/media/usb/dvb-usb-v2/af9035.c | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/drivers/media/usb/dvb-usb-v2/af9035.c b/drivers/media/usb/dvb-usb-v2/af9035.c index 5d6b3713e035..bc26b52e9887 100644 --- a/drivers/media/usb/dvb-usb-v2/af9035.c +++ b/drivers/media/usb/dvb-usb-v2/af9035.c | |||
@@ -1221,10 +1221,10 @@ err: | |||
1221 | #if IS_ENABLED(CONFIG_RC_CORE) | 1221 | #if IS_ENABLED(CONFIG_RC_CORE) |
1222 | static int af9035_rc_query(struct dvb_usb_device *d) | 1222 | static int af9035_rc_query(struct dvb_usb_device *d) |
1223 | { | 1223 | { |
1224 | unsigned int key; | ||
1225 | unsigned char b[4]; | ||
1226 | int ret; | 1224 | int ret; |
1227 | struct usb_req req = { CMD_IR_GET, 0, 0, NULL, 4, b }; | 1225 | u32 key; |
1226 | u8 buf[4]; | ||
1227 | struct usb_req req = { CMD_IR_GET, 0, 0, NULL, 4, buf }; | ||
1228 | 1228 | ||
1229 | ret = af9035_ctrl_msg(d, &req); | 1229 | ret = af9035_ctrl_msg(d, &req); |
1230 | if (ret == 1) | 1230 | if (ret == 1) |
@@ -1232,18 +1232,21 @@ static int af9035_rc_query(struct dvb_usb_device *d) | |||
1232 | else if (ret < 0) | 1232 | else if (ret < 0) |
1233 | goto err; | 1233 | goto err; |
1234 | 1234 | ||
1235 | if ((b[2] + b[3]) == 0xff) { | 1235 | if ((buf[2] + buf[3]) == 0xff) { |
1236 | if ((b[0] + b[1]) == 0xff) { | 1236 | if ((buf[0] + buf[1]) == 0xff) { |
1237 | /* NEC */ | 1237 | /* NEC standard 16bit */ |
1238 | key = b[0] << 8 | b[2]; | 1238 | key = buf[0] << 8 | buf[2]; |
1239 | } else { | 1239 | } else { |
1240 | /* ext. NEC */ | 1240 | /* NEC extended 24bit */ |
1241 | key = b[0] << 16 | b[1] << 8 | b[2]; | 1241 | key = buf[0] << 16 | buf[1] << 8 | buf[2]; |
1242 | } | 1242 | } |
1243 | } else { | 1243 | } else { |
1244 | key = b[0] << 24 | b[1] << 16 | b[2] << 8 | b[3]; | 1244 | /* NEC full code 32bit */ |
1245 | key = buf[0] << 24 | buf[1] << 16 | buf[2] << 8 | buf[3]; | ||
1245 | } | 1246 | } |
1246 | 1247 | ||
1248 | dev_dbg(&d->udev->dev, "%s: %*ph\n", __func__, 4, buf); | ||
1249 | |||
1247 | rc_keydown(d->rc_dev, key, 0); | 1250 | rc_keydown(d->rc_dev, key, 0); |
1248 | 1251 | ||
1249 | return 0; | 1252 | return 0; |