Commit 3003812b authored by Sean Young's avatar Sean Young Committed by Mauro Carvalho Chehab

[media] media: dvb: a800: port to rc-core

This receiver only accepts nec16 messages, I've tried many other protocols
and they're all dropped.
Signed-off-by: default avatarSean Young <sean@mess.org>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
parent 6805454b
...@@ -37,48 +37,9 @@ static int a800_identify_state(struct usb_device *udev, struct dvb_usb_device_pr ...@@ -37,48 +37,9 @@ static int a800_identify_state(struct usb_device *udev, struct dvb_usb_device_pr
return 0; return 0;
} }
static struct rc_map_table rc_map_a800_table[] = { static int a800_rc_query(struct dvb_usb_device *d)
{ 0x0201, KEY_MODE }, /* SOURCE */
{ 0x0200, KEY_POWER2 }, /* POWER */
{ 0x0205, KEY_1 }, /* 1 */
{ 0x0206, KEY_2 }, /* 2 */
{ 0x0207, KEY_3 }, /* 3 */
{ 0x0209, KEY_4 }, /* 4 */
{ 0x020a, KEY_5 }, /* 5 */
{ 0x020b, KEY_6 }, /* 6 */
{ 0x020d, KEY_7 }, /* 7 */
{ 0x020e, KEY_8 }, /* 8 */
{ 0x020f, KEY_9 }, /* 9 */
{ 0x0212, KEY_LEFT }, /* L / DISPLAY */
{ 0x0211, KEY_0 }, /* 0 */
{ 0x0213, KEY_RIGHT }, /* R / CH RTN */
{ 0x0217, KEY_CAMERA }, /* SNAP SHOT */
{ 0x0210, KEY_LAST }, /* 16-CH PREV */
{ 0x021e, KEY_VOLUMEDOWN }, /* VOL DOWN */
{ 0x020c, KEY_ZOOM }, /* FULL SCREEN */
{ 0x021f, KEY_VOLUMEUP }, /* VOL UP */
{ 0x0214, KEY_MUTE }, /* MUTE */
{ 0x0208, KEY_AUDIO }, /* AUDIO */
{ 0x0219, KEY_RECORD }, /* RECORD */
{ 0x0218, KEY_PLAY }, /* PLAY */
{ 0x021b, KEY_STOP }, /* STOP */
{ 0x021a, KEY_PLAYPAUSE }, /* TIMESHIFT / PAUSE */
{ 0x021d, KEY_BACK }, /* << / RED */
{ 0x021c, KEY_FORWARD }, /* >> / YELLOW */
{ 0x0203, KEY_TEXT }, /* TELETEXT */
{ 0x0204, KEY_EPG }, /* EPG */
{ 0x0215, KEY_MENU }, /* MENU */
{ 0x0303, KEY_CHANNELUP }, /* CH UP */
{ 0x0302, KEY_CHANNELDOWN }, /* CH DOWN */
{ 0x0301, KEY_FIRST }, /* |<< / GREEN */
{ 0x0300, KEY_LAST }, /* >>| / BLUE */
};
static int a800_rc_query(struct dvb_usb_device *d, u32 *event, int *state)
{ {
int ret; int ret = 0;
u8 *key = kmalloc(5, GFP_KERNEL); u8 *key = kmalloc(5, GFP_KERNEL);
if (!key) if (!key)
return -ENOMEM; return -ENOMEM;
...@@ -90,11 +51,12 @@ static int a800_rc_query(struct dvb_usb_device *d, u32 *event, int *state) ...@@ -90,11 +51,12 @@ static int a800_rc_query(struct dvb_usb_device *d, u32 *event, int *state)
goto out; goto out;
} }
/* call the universal NEC remote processor, to find out the key's state and event */ /* Note that extended nec and nec32 are dropped */
dvb_usb_nec_rc_key_to_event(d,key,event,state); if (key[0] == 1)
if (key[0] != 0) rc_keydown(d->rc_dev, RC_PROTO_NEC,
deb_rc("key: %*ph\n", 5, key); RC_SCANCODE_NEC(key[1], key[3]), 0);
ret = 0; else if (key[0] == 2)
rc_repeat(d->rc_dev);
out: out:
kfree(key); kfree(key);
return ret; return ret;
...@@ -157,11 +119,12 @@ static struct dvb_usb_device_properties a800_properties = { ...@@ -157,11 +119,12 @@ static struct dvb_usb_device_properties a800_properties = {
.power_ctrl = a800_power_ctrl, .power_ctrl = a800_power_ctrl,
.identify_state = a800_identify_state, .identify_state = a800_identify_state,
.rc.legacy = { .rc.core = {
.rc_interval = DEFAULT_RC_INTERVAL, .rc_interval = DEFAULT_RC_INTERVAL,
.rc_map_table = rc_map_a800_table, .rc_codes = RC_MAP_AVERMEDIA_M135A,
.rc_map_size = ARRAY_SIZE(rc_map_a800_table), .module_name = KBUILD_MODNAME,
.rc_query = a800_rc_query, .rc_query = a800_rc_query,
.allowed_protos = RC_PROTO_BIT_NEC,
}, },
.i2c_algo = &dibusb_i2c_algo, .i2c_algo = &dibusb_i2c_algo,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment