From d3bb73de97a9685bb150f81017d7e184fdb18451 Mon Sep 17 00:00:00 2001 From: Antti Palosaari Date: Sun, 12 Sep 2010 13:31:56 -0300 Subject: [PATCH] V4L/DVB: af9015: reimplement remote controller Remove HID and polling via firmware API. Implement direct access to remote codes via memory read and write. HID and polling via firmware api never worked 100% well and there was also some limitations which tied used remote and device together. After that it is possible to use upcoming kernel remote controller core. Signed-off-by: Antti Palosaari Signed-off-by: Mauro Carvalho Chehab --- drivers/media/dvb/dvb-usb/af9015.c | 194 ++--- drivers/media/dvb/dvb-usb/af9015.h | 1142 ++++++++++------------------ 2 files changed, 466 insertions(+), 870 deletions(-) diff --git a/drivers/media/dvb/dvb-usb/af9015.c b/drivers/media/dvb/dvb-usb/af9015.c index bf6ff2bb95c5..f82f50d6acf5 100644 --- a/drivers/media/dvb/dvb-usb/af9015.c +++ b/drivers/media/dvb/dvb-usb/af9015.c @@ -599,37 +599,6 @@ free: return ret; } -static int af9015_download_ir_table(struct dvb_usb_device *d) -{ - int i, packets = 0, ret; - u16 addr = 0x9a56; /* ir-table start address */ - struct req_t req = {WRITE_MEMORY, 0, 0, 0, 0, 1, NULL}; - u8 *data = NULL; - deb_info("%s:\n", __func__); - - data = af9015_config.ir_table; - packets = af9015_config.ir_table_size; - - /* no remote */ - if (!packets) - goto exit; - - /* load remote ir-table */ - for (i = 0; i < packets; i++) { - req.addr = addr + i; - req.data = &data[i]; - ret = af9015_ctrl_msg(d, &req); - if (ret) { - err("ir-table download failed at packet %d with " \ - "code %d", i, ret); - return ret; - } - } - -exit: - return 0; -} - static int af9015_init(struct dvb_usb_device *d) { int ret; @@ -639,10 +608,6 @@ static int af9015_init(struct dvb_usb_device *d) if (ret) goto error; - ret = af9015_download_ir_table(d); - if (ret) - goto error; - error: return ret; } @@ -739,8 +704,6 @@ struct af9015_setup { unsigned int id; struct ir_scancode *rc_key_map; unsigned int rc_key_map_size; - u8 *ir_table; - unsigned int ir_table_size; }; static const struct af9015_setup *af9015_setup_match(unsigned int id, @@ -753,57 +716,40 @@ static const struct af9015_setup *af9015_setup_match(unsigned int id, } static const struct af9015_setup af9015_setup_modparam[] = { - { AF9015_REMOTE_A_LINK_DTU_M, - ir_codes_af9015_table_a_link, ARRAY_SIZE(ir_codes_af9015_table_a_link), - af9015_ir_table_a_link, ARRAY_SIZE(af9015_ir_table_a_link) }, - { AF9015_REMOTE_MSI_DIGIVOX_MINI_II_V3, - ir_codes_af9015_table_msi, ARRAY_SIZE(ir_codes_af9015_table_msi), - af9015_ir_table_msi, ARRAY_SIZE(af9015_ir_table_msi) }, - { AF9015_REMOTE_MYGICTV_U718, - ir_codes_af9015_table_mygictv, ARRAY_SIZE(ir_codes_af9015_table_mygictv), - af9015_ir_table_mygictv, ARRAY_SIZE(af9015_ir_table_mygictv) }, - { AF9015_REMOTE_DIGITTRADE_DVB_T, - ir_codes_af9015_table_digittrade, ARRAY_SIZE(ir_codes_af9015_table_digittrade), - af9015_ir_table_digittrade, ARRAY_SIZE(af9015_ir_table_digittrade) }, - { AF9015_REMOTE_AVERMEDIA_KS, - ir_codes_af9015_table_avermedia, ARRAY_SIZE(ir_codes_af9015_table_avermedia), - af9015_ir_table_avermedia_ks, ARRAY_SIZE(af9015_ir_table_avermedia_ks) }, + { AF9015_REMOTE_A_LINK_DTU_M, af9015_rc_a_link, + ARRAY_SIZE(af9015_rc_a_link) }, + { AF9015_REMOTE_MSI_DIGIVOX_MINI_II_V3, af9015_rc_msi, + ARRAY_SIZE(af9015_rc_msi) }, + { AF9015_REMOTE_MYGICTV_U718, af9015_rc_mygictv, + ARRAY_SIZE(af9015_rc_mygictv) }, + { AF9015_REMOTE_DIGITTRADE_DVB_T, af9015_rc_digittrade, + ARRAY_SIZE(af9015_rc_digittrade) }, + { AF9015_REMOTE_AVERMEDIA_KS, af9015_rc_avermedia_ks, + ARRAY_SIZE(af9015_rc_avermedia_ks) }, { } }; /* don't add new entries here anymore, use hashes instead */ static const struct af9015_setup af9015_setup_usbids[] = { - { USB_VID_LEADTEK, - ir_codes_af9015_table_leadtek, ARRAY_SIZE(ir_codes_af9015_table_leadtek), - af9015_ir_table_leadtek, ARRAY_SIZE(af9015_ir_table_leadtek) }, - { USB_VID_VISIONPLUS, - ir_codes_af9015_table_twinhan, ARRAY_SIZE(ir_codes_af9015_table_twinhan), - af9015_ir_table_twinhan, ARRAY_SIZE(af9015_ir_table_twinhan) }, - { USB_VID_KWORLD_2, /* TODO: use correct rc keys */ - ir_codes_af9015_table_twinhan, ARRAY_SIZE(ir_codes_af9015_table_twinhan), - af9015_ir_table_kworld, ARRAY_SIZE(af9015_ir_table_kworld) }, - { USB_VID_AVERMEDIA, - ir_codes_af9015_table_avermedia, ARRAY_SIZE(ir_codes_af9015_table_avermedia), - af9015_ir_table_avermedia, ARRAY_SIZE(af9015_ir_table_avermedia) }, - { USB_VID_MSI_2, - ir_codes_af9015_table_msi_digivox_iii, ARRAY_SIZE(ir_codes_af9015_table_msi_digivox_iii), - af9015_ir_table_msi_digivox_iii, ARRAY_SIZE(af9015_ir_table_msi_digivox_iii) }, - { USB_VID_TERRATEC, - ir_codes_terratec, ARRAY_SIZE(ir_codes_terratec), - af9015_ir_terratec, ARRAY_SIZE(af9015_ir_terratec) }, + { USB_VID_LEADTEK, af9015_rc_leadtek, + ARRAY_SIZE(af9015_rc_leadtek) }, + { USB_VID_VISIONPLUS, af9015_rc_twinhan, + ARRAY_SIZE(af9015_rc_twinhan) }, + { USB_VID_KWORLD_2, af9015_rc_kworld, + ARRAY_SIZE(af9015_rc_kworld) }, + { USB_VID_AVERMEDIA, af9015_rc_avermedia, + ARRAY_SIZE(af9015_rc_avermedia) }, + { USB_VID_MSI_2, af9015_rc_msi_digivox_iii, + ARRAY_SIZE(af9015_rc_msi_digivox_iii) }, + { USB_VID_TERRATEC, af9015_rc_terratec, + ARRAY_SIZE(af9015_rc_terratec) }, { } }; static const struct af9015_setup af9015_setup_hashes[] = { - { 0xb8feb708, - ir_codes_af9015_table_msi, ARRAY_SIZE(ir_codes_af9015_table_msi), - af9015_ir_table_msi, ARRAY_SIZE(af9015_ir_table_msi) }, - { 0xa3703d00, - ir_codes_af9015_table_a_link, ARRAY_SIZE(ir_codes_af9015_table_a_link), - af9015_ir_table_a_link, ARRAY_SIZE(af9015_ir_table_a_link) }, - { 0x9b7dc64e, - ir_codes_af9015_table_mygictv, ARRAY_SIZE(ir_codes_af9015_table_mygictv), - af9015_ir_table_mygictv, ARRAY_SIZE(af9015_ir_table_mygictv) }, + { 0xb8feb708, af9015_rc_msi, ARRAY_SIZE(af9015_rc_msi) }, + { 0xa3703d00, af9015_rc_a_link, ARRAY_SIZE(af9015_rc_a_link) }, + { 0x9b7dc64e, af9015_rc_mygictv, ARRAY_SIZE(af9015_rc_mygictv) }, { } }; @@ -841,11 +787,8 @@ static void af9015_set_remote_config(struct usb_device *udev, } else if (udev->descriptor.idProduct == cpu_to_le16(USB_PID_TREKSTOR_DVBT)) { table = &(const struct af9015_setup){ 0, - ir_codes_af9015_table_trekstor, - ARRAY_SIZE(ir_codes_af9015_table_trekstor), - af9015_ir_table_trekstor, - ARRAY_SIZE(af9015_ir_table_trekstor) - }; + af9015_rc_trekstor, + ARRAY_SIZE(af9015_rc_trekstor) }; } } else if (!table) table = af9015_setup_match(vendor, af9015_setup_usbids); @@ -854,8 +797,6 @@ static void af9015_set_remote_config(struct usb_device *udev, if (table) { props->rc.legacy.rc_key_map = table->rc_key_map; props->rc.legacy.rc_key_map_size = table->rc_key_map_size; - af9015_config.ir_table = table->ir_table; - af9015_config.ir_table_size = table->ir_table_size; } } @@ -1065,34 +1006,66 @@ static int af9015_identify_state(struct usb_device *udev, static int af9015_rc_query(struct dvb_usb_device *d, u32 *event, int *state) { - u8 buf[8]; - struct req_t req = {GET_IR_CODE, 0, 0, 0, 0, sizeof(buf), buf}; - struct ir_scancode *keymap = d->props.rc.legacy.rc_key_map; - int i, ret; + struct af9015_state *priv = d->priv; + int ret; + u8 ircode[5], repeat; - memset(buf, 0, sizeof(buf)); + /* read registers needed to detect remote controller code */ + ret = af9015_read_reg(d, 0x98df, &repeat); + if (ret) + goto error; - ret = af9015_ctrl_msg(d, &req); + ret = af9015_read_reg(d, 0x98e7, &ircode[3]); if (ret) - return ret; + goto error; + + ret = af9015_read_reg(d, 0x98e8, &ircode[4]); + if (ret) + goto error; - *event = 0; - *state = REMOTE_NO_KEY_PRESSED; + if (ircode[3] || ircode[4]) { + deb_rc("%s: key pressed\n", __func__); + ircode[0] = 1; /* DVB_USB_RC_NEC_KEY_PRESSED */ - for (i = 0; i < d->props.rc.legacy.rc_key_map_size; i++) { - if (!buf[1] && rc5_custom(&keymap[i]) == buf[0] && - rc5_data(&keymap[i]) == buf[2]) { - *event = keymap[i].keycode; - *state = REMOTE_KEY_PRESSED; - break; - } + /* read 1st address byte */ + ret = af9015_read_reg(d, 0x98e5, &ircode[1]); + if (ret) + goto error; + + /* clean data bytes from mem */ + ret = af9015_write_reg(d, 0x98e7, 0); + if (ret) + goto error; + + ret = af9015_write_reg(d, 0x98e8, 0); + if (ret) + goto error; + + /* FIXME: Hack to pass checksum on the custom field for the + remote controllers using NEC extended address. + That must done since dvb_usb_nec_rc_key_to_event() + does not support NEC extended address format. */ + ircode[2] = ~ircode[1]; + } else if (priv->rc_repeat != repeat) { + deb_rc("%s: key repeated\n", __func__); + ircode[0] = 2; /* DVB_USB_RC_NEC_KEY_REPEATED */ + } else { + deb_rc("%s: no key press\n", __func__); + ircode[0] = 0; /* DVB_USB_RC_NEC_EMPTY */ } - if (!buf[1]) - deb_rc("%s: %02x %02x %02x %02x %02x %02x %02x %02x\n", - __func__, buf[0], buf[1], buf[2], buf[3], buf[4], - buf[5], buf[6], buf[7]); - return 0; + priv->rc_repeat = repeat; + + deb_rc("%s: ", __func__); + debug_dump(ircode, sizeof(ircode), deb_rc); + + dvb_usb_nec_rc_key_to_event(d, ircode, event, state); + +error: + if (ret) + err("%s: failed:%d", __func__, ret); + + return ret; } /* init 2nd I2C adapter */ @@ -1329,6 +1302,7 @@ static struct usb_device_id af9015_usb_table[] = { }; MODULE_DEVICE_TABLE(usb, af9015_usb_table); +#define AF9015_RC_INTERVAL 500 static struct dvb_usb_device_properties af9015_properties[] = { { .caps = DVB_USB_IS_AN_I2C_ADAPTER, @@ -1381,7 +1355,7 @@ static struct dvb_usb_device_properties af9015_properties[] = { .rc.legacy = { .rc_query = af9015_rc_query, - .rc_interval = 150, + .rc_interval = AF9015_RC_INTERVAL, }, .i2c_algo = &af9015_i2c_algo, @@ -1500,7 +1474,7 @@ static struct dvb_usb_device_properties af9015_properties[] = { .rc.legacy = { .rc_query = af9015_rc_query, - .rc_interval = 150, + .rc_interval = AF9015_RC_INTERVAL, }, .i2c_algo = &af9015_i2c_algo, @@ -1609,7 +1583,7 @@ static struct dvb_usb_device_properties af9015_properties[] = { .rc.legacy = { .rc_query = af9015_rc_query, - .rc_interval = 150, + .rc_interval = AF9015_RC_INTERVAL, }, .i2c_algo = &af9015_i2c_algo, diff --git a/drivers/media/dvb/dvb-usb/af9015.h b/drivers/media/dvb/dvb-usb/af9015.h index ab5de92d3f2e..948e50b47ae1 100644 --- a/drivers/media/dvb/dvb-usb/af9015.h +++ b/drivers/media/dvb/dvb-usb/af9015.h @@ -100,6 +100,7 @@ enum af9015_ir_mode { struct af9015_state { struct i2c_adapter i2c_adap; /* I2C adapter for 2nd FE */ + u8 rc_repeat; }; struct af9015_config { @@ -108,8 +109,6 @@ struct af9015_config { u16 firmware_size; u16 firmware_checksum; u32 eeprom_sum; - u8 *ir_table; - u16 ir_table_size; }; enum af9015_remote { @@ -123,796 +122,419 @@ enum af9015_remote { /* LeadTek - Y04G0051 */ /* Leadtek WinFast DTV Dongle Gold */ -static struct ir_scancode ir_codes_af9015_table_leadtek[] = { - { 0x001e, KEY_1 }, - { 0x001f, KEY_2 }, - { 0x0020, KEY_3 }, - { 0x0021, KEY_4 }, - { 0x0022, KEY_5 }, - { 0x0023, KEY_6 }, - { 0x0024, KEY_7 }, - { 0x0025, KEY_8 }, - { 0x0026, KEY_9 }, - { 0x0027, KEY_0 }, - { 0x0028, KEY_OK }, - { 0x004f, KEY_RIGHT }, - { 0x0050, KEY_LEFT }, - { 0x0051, KEY_DOWN }, - { 0x0052, KEY_UP }, - { 0x011a, KEY_POWER2 }, - { 0x04b4, KEY_TV }, - { 0x04b3, KEY_RED }, - { 0x04b2, KEY_GREEN }, - { 0x04b1, KEY_YELLOW }, - { 0x04b0, KEY_BLUE }, - { 0x003d, KEY_TEXT }, - { 0x0113, KEY_SLEEP }, - { 0x0010, KEY_MUTE }, - { 0x0105, KEY_ESC }, - { 0x0009, KEY_SCREEN }, - { 0x010f, KEY_MENU }, - { 0x003f, KEY_CHANNEL }, - { 0x0013, KEY_REWIND }, - { 0x0012, KEY_PLAY }, - { 0x0011, KEY_FASTFORWARD }, - { 0x0005, KEY_PREVIOUS }, - { 0x0029, KEY_STOP }, - { 0x002b, KEY_NEXT }, - { 0x0041, KEY_EPG }, - { 0x0019, KEY_VIDEO }, - { 0x0016, KEY_AUDIO }, - { 0x0037, KEY_DOT }, - { 0x002a, KEY_AGAIN }, - { 0x002c, KEY_CAMERA }, - { 0x003c, KEY_NEW }, - { 0x0115, KEY_RECORD }, - { 0x010b, KEY_TIME }, - { 0x0043, KEY_VOLUMEUP }, - { 0x0042, KEY_VOLUMEDOWN }, - { 0x004b, KEY_CHANNELUP }, - { 0x004e, KEY_CHANNELDOWN }, -}; - -static u8 af9015_ir_table_leadtek[] = { - 0x03, 0xfc, 0x00, 0xff, 0x1a, 0x01, 0x00, /* KEY_POWER2 */ - 0x03, 0xfc, 0x56, 0xa9, 0xb4, 0x04, 0x00, /* KEY_TV */ - 0x03, 0xfc, 0x4b, 0xb4, 0xb3, 0x04, 0x00, /* KEY_RED */ - 0x03, 0xfc, 0x4c, 0xb3, 0xb2, 0x04, 0x00, /* KEY_GREEN */ - 0x03, 0xfc, 0x4d, 0xb2, 0xb1, 0x04, 0x00, /* KEY_YELLOW */ - 0x03, 0xfc, 0x4e, 0xb1, 0xb0, 0x04, 0x00, /* KEY_BLUE */ - 0x03, 0xfc, 0x1f, 0xe0, 0x3d, 0x00, 0x00, /* KEY_TEXT */ - 0x03, 0xfc, 0x40, 0xbf, 0x13, 0x01, 0x00, /* KEY_SLEEP */ - 0x03, 0xfc, 0x14, 0xeb, 0x10, 0x00, 0x00, /* KEY_MUTE */ - 0x03, 0xfc, 0x49, 0xb6, 0x05, 0x01, 0x00, /* KEY_ESC */ - 0x03, 0xfc, 0x50, 0xaf, 0x29, 0x00, 0x00, /* KEY_STOP (1)*/ - 0x03, 0xfc, 0x0c, 0xf3, 0x52, 0x00, 0x00, /* KEY_UP */ - 0x03, 0xfc, 0x03, 0xfc, 0x09, 0x00, 0x00, /* KEY_SCREEN */ - 0x03, 0xfc, 0x08, 0xf7, 0x50, 0x00, 0x00, /* KEY_LEFT */ - 0x03, 0xfc, 0x13, 0xec, 0x28, 0x00, 0x00, /* KEY_OK (1) */ - 0x03, 0xfc, 0x04, 0xfb, 0x4f, 0x00, 0x00, /* KEY_RIGHT */ - 0x03, 0xfc, 0x4f, 0xb0, 0x0f, 0x01, 0x00, /* KEY_MENU */ - 0x03, 0xfc, 0x10, 0xef, 0x51, 0x00, 0x00, /* KEY_DOWN */ - 0x03, 0xfc, 0x51, 0xae, 0x3f, 0x00, 0x00, /* KEY_CHANNEL */ - 0x03, 0xfc, 0x42, 0xbd, 0x13, 0x00, 0x00, /* KEY_REWIND */ - 0x03, 0xfc, 0x43, 0xbc, 0x12, 0x00, 0x00, /* KEY_PLAY */ - 0x03, 0xfc, 0x44, 0xbb, 0x11, 0x00, 0x00, /* KEY_FASTFORWARD */ - 0x03, 0xfc, 0x52, 0xad, 0x19, 0x00, 0x00, /* KEY_VIDEO (1) */ - 0x03, 0xfc, 0x54, 0xab, 0x05, 0x00, 0x00, /* KEY_PREVIOUS */ - 0x03, 0xfc, 0x46, 0xb9, 0x29, 0x00, 0x00, /* KEY_STOP (2) */ - 0x03, 0xfc, 0x55, 0xaa, 0x2b, 0x00, 0x00, /* KEY_NEXT */ - 0x03, 0xfc, 0x53, 0xac, 0x41, 0x00, 0x00, /* KEY_EPG */ - 0x03, 0xfc, 0x05, 0xfa, 0x1e, 0x00, 0x00, /* KEY_1 */ - 0x03, 0xfc, 0x06, 0xf9, 0x1f, 0x00, 0x00, /* KEY_2 */ - 0x03, 0xfc, 0x07, 0xf8, 0x20, 0x00, 0x00, /* KEY_3 */ - 0x03, 0xfc, 0x1e, 0xe1, 0x19, 0x00, 0x00, /* KEY_VIDEO (2) */ - 0x03, 0xfc, 0x09, 0xf6, 0x21, 0x00, 0x00, /* KEY_4 */ - 0x03, 0xfc, 0x0a, 0xf5, 0x22, 0x00, 0x00, /* KEY_5 */ - 0x03, 0xfc, 0x0b, 0xf4, 0x23, 0x00, 0x00, /* KEY_6 */ - 0x03, 0xfc, 0x1b, 0xe4, 0x16, 0x00, 0x00, /* KEY_AUDIO */ - 0x03, 0xfc, 0x0d, 0xf2, 0x24, 0x00, 0x00, /* KEY_7 */ - 0x03, 0xfc, 0x0e, 0xf1, 0x25, 0x00, 0x00, /* KEY_8 */ - 0x03, 0xfc, 0x0f, 0xf0, 0x26, 0x00, 0x00, /* KEY_9 */ - 0x03, 0xfc, 0x16, 0xe9, 0x28, 0x00, 0x00, /* KEY_OK (2) */ - 0x03, 0xfc, 0x41, 0xbe, 0x37, 0x00, 0x00, /* KEY_DOT */ - 0x03, 0xfc, 0x12, 0xed, 0x27, 0x00, 0x00, /* KEY_0 */ - 0x03, 0xfc, 0x11, 0xee, 0x2a, 0x00, 0x00, /* KEY_AGAIN */ - 0x03, 0xfc, 0x48, 0xb7, 0x2c, 0x00, 0x00, /* KEY_CAMERA */ - 0x03, 0xfc, 0x4a, 0xb5, 0x3c, 0x00, 0x00, /* KEY_NEW */ - 0x03, 0xfc, 0x47, 0xb8, 0x15, 0x01, 0x00, /* KEY_RECORD */ - 0x03, 0xfc, 0x45, 0xba, 0x0b, 0x01, 0x00, /* KEY_TIME */ - 0x03, 0xfc, 0x5e, 0xa1, 0x43, 0x00, 0x00, /* KEY_VOLUMEUP */ - 0x03, 0xfc, 0x5a, 0xa5, 0x42, 0x00, 0x00, /* KEY_VOLUMEDOWN */ - 0x03, 0xfc, 0x5b, 0xa4, 0x4b, 0x00, 0x00, /* KEY_CHANNELUP */ - 0x03, 0xfc, 0x5f, 0xa0, 0x4e, 0x00, 0x00, /* KEY_CHANNELDOWN */ +static struct ir_scancode af9015_rc_leadtek[] = { + { 0x0300, KEY_POWER2 }, + { 0x0303, KEY_SCREEN }, + { 0x0304, KEY_RIGHT }, + { 0x0305, KEY_1 }, + { 0x0306, KEY_2 }, + { 0x0307, KEY_3 }, + { 0x0308, KEY_LEFT }, + { 0x0309, KEY_4 }, + { 0x030a, KEY_5 }, + { 0x030b, KEY_6 }, + { 0x030c, KEY_UP }, + { 0x030d, KEY_7 }, + { 0x030e, KEY_8 }, + { 0x030f, KEY_9 }, + { 0x0310, KEY_DOWN }, + { 0x0311, KEY_AGAIN }, + { 0x0312, KEY_0 }, + { 0x0313, KEY_OK }, /* 1st ok */ + { 0x0314, KEY_MUTE }, + { 0x0316, KEY_OK }, /* 2nd ok */ + { 0x031e, KEY_VIDEO }, /* 2nd video */ + { 0x031b, KEY_AUDIO }, + { 0x031f, KEY_TEXT }, + { 0x0340, KEY_SLEEP }, + { 0x0341, KEY_DOT }, + { 0x0342, KEY_REWIND }, + { 0x0343, KEY_PLAY }, + { 0x0344, KEY_FASTFORWARD }, + { 0x0345, KEY_TIME }, + { 0x0346, KEY_STOP }, /* 2nd stop */ + { 0x0347, KEY_RECORD }, + { 0x0348, KEY_CAMERA }, + { 0x0349, KEY_ESC }, + { 0x034a, KEY_NEW }, + { 0x034b, KEY_RED }, + { 0x034c, KEY_GREEN }, + { 0x034d, KEY_YELLOW }, + { 0x034e, KEY_BLUE }, + { 0x034f, KEY_MENU }, + { 0x0350, KEY_STOP }, /* 1st stop */ + { 0x0351, KEY_CHANNEL }, + { 0x0352, KEY_VIDEO }, /* 1st video */ + { 0x0353, KEY_EPG }, + { 0x0354, KEY_PREVIOUS }, + { 0x0355, KEY_NEXT }, + { 0x0356, KEY_TV }, + { 0x035a, KEY_VOLUMEDOWN }, + { 0x035b, KEY_CHANNELUP }, + { 0x035e, KEY_VOLUMEUP }, + { 0x035f, KEY_CHANNELDOWN }, }; /* TwinHan AzureWave AD-TU700(704J) */ -static struct ir_scancode ir_codes_af9015_table_twinhan[] = { - { 0x053f, KEY_POWER }, - { 0x0019, KEY_FAVORITES }, /* Favorite List */ - { 0x0004, KEY_TEXT }, /* Teletext */ - { 0x000e, KEY_POWER }, - { 0x000e, KEY_INFO }, /* Preview */ - { 0x0008, KEY_EPG }, /* Info/EPG */ - { 0x000f, KEY_LIST }, /* Record List */ - { 0x001e, KEY_1 }, - { 0x001f, KEY_2 }, - { 0x0020, KEY_3 }, - { 0x0021, KEY_4 }, - { 0x0022, KEY_5 }, - { 0x0023, KEY_6 }, - { 0x0024, KEY_7 }, - { 0x0025, KEY_8 }, - { 0x0026, KEY_9 }, - { 0x0027, KEY_0 }, - { 0x0029, KEY_CANCEL }, /* Cancel */ - { 0x004c, KEY_CLEAR }, /* Clear */ - { 0x002a, KEY_BACK }, /* Back */ - { 0x002b, KEY_TAB }, /* Tab */ - { 0x0052, KEY_UP }, /* up arrow */ - { 0x0051, KEY_DOWN }, /* down arrow */ - { 0x004f, KEY_RIGHT }, /* right arrow */ - { 0x0050, KEY_LEFT }, /* left arrow */ - { 0x0028, KEY_ENTER }, /* Enter / ok */ - { 0x0252, KEY_VOLUMEUP }, - { 0x0251, KEY_VOLUMEDOWN }, - { 0x004e, KEY_CHANNELDOWN }, - { 0x004b, KEY_CHANNELUP }, - { 0x004a, KEY_RECORD }, - { 0x0111, KEY_PLAY }, - { 0x0017, KEY_PAUSE }, - { 0x000c, KEY_REWIND }, /* FR << */ - { 0x0011, KEY_FASTFORWARD }, /* FF >> */ - { 0x0115, KEY_PREVIOUS }, /* Replay */ - { 0x010e, KEY_NEXT }, /* Skip */ - { 0x0013, KEY_CAMERA }, /* Capture */ - { 0x010f, KEY_LANGUAGE }, /* SAP */ - { 0x0113, KEY_TV2 }, /* PIP */ - { 0x001d, KEY_ZOOM }, /* Full Screen */ - { 0x0117, KEY_SUBTITLE }, /* Subtitle / CC */ +static struct ir_scancode af9015_rc_twinhan[] = { + { 0x0000, KEY_TAB }, /* Tab */ + { 0x0001, KEY_2 }, + { 0x0002, KEY_CHANNELDOWN }, + { 0x0003, KEY_1 }, + { 0x0004, KEY_LIST }, /* Record List */ + { 0x0005, KEY_CHANNELUP }, + { 0x0006, KEY_3 }, + { 0x0007, KEY_SLEEP }, /* Hibernate */ + { 0x0008, KEY_SWITCHVIDEOMODE }, /* A/V */ + { 0x0009, KEY_4 }, + { 0x000a, KEY_VOLUMEDOWN }, + { 0x000c, KEY_CANCEL }, /* Cancel */ + { 0x000d, KEY_7 }, + { 0x000e, KEY_AGAIN }, /* Recall */ + { 0x000f, KEY_TEXT }, /* Teletext */ { 0x0010, KEY_MUTE }, - { 0x0119, KEY_AUDIO }, /* L/R */ /* TODO better event */ - { 0x0116, KEY_SLEEP }, /* Hibernate */ - { 0x0116, KEY_SWITCHVIDEOMODE }, - /* A/V */ /* TODO does not work */ - { 0x0006, KEY_AGAIN }, /* Recall */ - { 0x0116, KEY_KPPLUS }, /* Zoom+ */ /* TODO does not work */ - { 0x0116, KEY_KPMINUS }, /* Zoom- */ /* TODO does not work */ - { 0x0215, KEY_RED }, - { 0x020a, KEY_GREEN }, - { 0x021c, KEY_YELLOW }, - { 0x0205, KEY_BLUE }, -}; - -static u8 af9015_ir_table_twinhan[] = { - 0x00, 0xff, 0x16, 0xe9, 0x3f, 0x05, 0x00, - 0x00, 0xff, 0x07, 0xf8, 0x16, 0x01, 0x00, - 0x00, 0xff, 0x14, 0xeb, 0x11, 0x01, 0x00, - 0x00, 0xff, 0x1a, 0xe5, 0x4d, 0x00, 0x00, - 0x00, 0xff, 0x4c, 0xb3, 0x17, 0x00, 0x00, - 0x00, 0xff, 0x12, 0xed, 0x11, 0x00, 0x00, - 0x00, 0xff, 0x40, 0xbf, 0x0c, 0x00, 0x00, - 0x00, 0xff, 0x11, 0xee, 0x4a, 0x00, 0x00, - 0x00, 0xff, 0x54, 0xab, 0x13, 0x00, 0x00, - 0x00, 0xff, 0x41, 0xbe, 0x15, 0x01, 0x00, - 0x00, 0xff, 0x42, 0xbd, 0x0e, 0x01, 0x00, - 0x00, 0xff, 0x43, 0xbc, 0x17, 0x01, 0x00, - 0x00, 0xff, 0x50, 0xaf, 0x0f, 0x01, 0x00, - 0x00, 0xff, 0x4d, 0xb2, 0x1d, 0x00, 0x00, - 0x00, 0xff, 0x47, 0xb8, 0x13, 0x01, 0x00, - 0x00, 0xff, 0x05, 0xfa, 0x4b, 0x00, 0x00, - 0x00, 0xff, 0x02, 0xfd, 0x4e, 0x00, 0x00, - 0x00, 0xff, 0x0e, 0xf1, 0x06, 0x00, 0x00, - 0x00, 0xff, 0x1e, 0xe1, 0x52, 0x02, 0x00, - 0x00, 0xff, 0x0a, 0xf5, 0x51, 0x02, 0x00, - 0x00, 0xff, 0x10, 0xef, 0x10, 0x00, 0x00, - 0x00, 0xff, 0x49, 0xb6, 0x19, 0x01, 0x00, - 0x00, 0xff, 0x15, 0xea, 0x27, 0x00, 0x00, - 0x00, 0xff, 0x03, 0xfc, 0x1e, 0x00, 0x00, - 0x00, 0xff, 0x01, 0xfe, 0x1f, 0x00, 0x00, - 0x00, 0xff, 0x06, 0xf9, 0x20, 0x00, 0x00, - 0x00, 0xff, 0x09, 0xf6, 0x21, 0x00, 0x00, - 0x00, 0xff, 0x1d, 0xe2, 0x22, 0x00, 0x00, - 0x00, 0xff, 0x1f, 0xe0, 0x23, 0x00, 0x00, - 0x00, 0xff, 0x0d, 0xf2, 0x24, 0x00, 0x00, - 0x00, 0xff, 0x19, 0xe6, 0x25, 0x00, 0x00, - 0x00, 0xff, 0x1b, 0xe4, 0x26, 0x00, 0x00, - 0x00, 0xff, 0x00, 0xff, 0x2b, 0x00, 0x00, - 0x00, 0xff, 0x4a, 0xb5, 0x4c, 0x00, 0x00, - 0x00, 0xff, 0x4b, 0xb4, 0x52, 0x00, 0x00, - 0x00, 0xff, 0x51, 0xae, 0x51, 0x00, 0x00, - 0x00, 0xff, 0x52, 0xad, 0x4f, 0x00, 0x00, - 0x00, 0xff, 0x4e, 0xb1, 0x50, 0x00, 0x00, - 0x00, 0xff, 0x0c, 0xf3, 0x29, 0x00, 0x00, - 0x00, 0xff, 0x4f, 0xb0, 0x28, 0x00, 0x00, - 0x00, 0xff, 0x13, 0xec, 0x2a, 0x00, 0x00, - 0x00, 0xff, 0x17, 0xe8, 0x19, 0x00, 0x00, - 0x00, 0xff, 0x04, 0xfb, 0x0f, 0x00, 0x00, - 0x00, 0xff, 0x48, 0xb7, 0x0e, 0x00, 0x00, - 0x00, 0xff, 0x0f, 0xf0, 0x04, 0x00, 0x00, - 0x00, 0xff, 0x1c, 0xe3, 0x08, 0x00, 0x00, - 0x00, 0xff, 0x18, 0xe7, 0x15, 0x02, 0x00, - 0x00, 0xff, 0x53, 0xac, 0x0a, 0x02, 0x00, - 0x00, 0xff, 0x5e, 0xa1, 0x1c, 0x02, 0x00, - 0x00, 0xff, 0x5f, 0xa0, 0x05, 0x02, 0x00, -}; - -/* A-Link DTU(m) */ -static struct ir_scancode ir_codes_af9015_table_a_link[] = { - { 0x001e, KEY_1 }, - { 0x001f, KEY_2 }, - { 0x0020, KEY_3 }, - { 0x0021, KEY_4 }, - { 0x0022, KEY_5 }, - { 0x0023, KEY_6 }, - { 0x0024, KEY_7 }, - { 0x0025, KEY_8 }, - { 0x0026, KEY_9 }, - { 0x0027, KEY_0 }, - { 0x002e, KEY_CHANNELUP }, - { 0x002d, KEY_CHANNELDOWN }, - { 0x0428, KEY_ZOOM }, - { 0x0041, KEY_MUTE }, - { 0x0042, KEY_VOLUMEDOWN }, - { 0x0043, KEY_VOLUMEUP }, - { 0x0044, KEY_GOTO }, /* jump */ - { 0x0545, KEY_POWER }, + { 0x0011, KEY_RECORD }, + { 0x0012, KEY_FASTFORWARD }, /* FF >> */ + { 0x0013, KEY_BACK }, /* Back */ + { 0x0014, KEY_PLAY }, + { 0x0015, KEY_0 }, + { 0x0016, KEY_POWER }, + { 0x0017, KEY_FAVORITES }, /* Favorite List */ + { 0x0018, KEY_RED }, + { 0x0019, KEY_8 }, + { 0x001a, KEY_STOP }, + { 0x001b, KEY_9 }, + { 0x001c, KEY_EPG }, /* Info/EPG */ + { 0x001d, KEY_5 }, + { 0x001e, KEY_VOLUMEUP }, + { 0x001f, KEY_6 }, + { 0x0040, KEY_REWIND }, /* FR << */ + { 0x0041, KEY_PREVIOUS }, /* Replay */ + { 0x0042, KEY_NEXT }, /* Skip */ + { 0x0043, KEY_SUBTITLE }, /* Subtitle / CC */ + { 0x0045, KEY_KPPLUS }, /* Zoom+ */ + { 0x0046, KEY_KPMINUS }, /* Zoom- */ + { 0x0047, KEY_TV2 }, /* PIP */ + { 0x0048, KEY_INFO }, /* Preview */ + { 0x0049, KEY_AUDIO }, /* L/R */ /* TODO better event */ + { 0x004a, KEY_CLEAR }, /* Clear */ + { 0x004b, KEY_UP }, /* up arrow */ + { 0x004c, KEY_PAUSE }, + { 0x004d, KEY_ZOOM }, /* Full Screen */ + { 0x004e, KEY_LEFT }, /* left arrow */ + { 0x004f, KEY_ENTER }, /* Enter / ok */ + { 0x0050, KEY_LANGUAGE }, /* SAP */ + { 0x0051, KEY_DOWN }, /* down arrow */ + { 0x0052, KEY_RIGHT }, /* right arrow */ + { 0x0053, KEY_GREEN }, + { 0x0054, KEY_CAMERA }, /* Capture */ + { 0x005e, KEY_YELLOW }, + { 0x005f, KEY_BLUE }, }; -static u8 af9015_ir_table_a_link[] = { - 0x08, 0xf7, 0x12, 0xed, 0x45, 0x05, 0x00, /* power */ - 0x08, 0xf7, 0x1a, 0xe5, 0x41, 0x00, 0x00, /* mute */ - 0x08, 0xf7, 0x01, 0xfe, 0x1e, 0x00, 0x00, /* 1 */ - 0x08, 0xf7, 0x1c, 0xe3, 0x21, 0x00, 0x00, /* 4 */ - 0x08, 0xf7, 0x03, 0xfc, 0x24, 0x00, 0x00, /* 7 */ - 0x08, 0xf7, 0x05, 0xfa, 0x28, 0x04, 0x00, /* zoom */ - 0x08, 0xf7, 0x00, 0xff, 0x43, 0x00, 0x00, /* volume up */ - 0x08, 0xf7, 0x16, 0xe9, 0x42, 0x00, 0x00, /* volume down */ - 0x08, 0xf7, 0x0f, 0xf0, 0x1f, 0x00, 0x00, /* 2 */ - 0x08, 0xf7, 0x0d, 0xf2, 0x22, 0x00, 0x00, /* 5 */ - 0x08, 0xf7, 0x1b, 0xe4, 0x25, 0x00, 0x00, /* 8 */ - 0x08, 0xf7, 0x06, 0xf9, 0x27, 0x00, 0x00, /* 0 */ - 0x08, 0xf7, 0x14, 0xeb, 0x2e, 0x00, 0x00, /* channel up */ - 0x08, 0xf7, 0x1d, 0xe2, 0x2d, 0x00, 0x00, /* channel down */ - 0x08, 0xf7, 0x02, 0xfd, 0x20, 0x00, 0x00, /* 3 */ - 0x08, 0xf7, 0x18, 0xe7, 0x23, 0x00, 0x00, /* 6 */ - 0x08, 0xf7, 0x04, 0xfb, 0x26, 0x00, 0x00, /* 9 */ - 0x08, 0xf7, 0x07, 0xf8, 0x44, 0x00, 0x00, /* jump */ +/* A-Link DTU(m) - 3x6 slim remote */ +static struct ir_scancode af9015_rc_a_link[] = { + { 0x0800, KEY_VOLUMEUP }, + { 0x0801, KEY_1 }, + { 0x0802, KEY_3 }, + { 0x0803, KEY_7 }, + { 0x0804, KEY_9 }, + { 0x0805, KEY_ZOOM }, + { 0x0806, KEY_0 }, + { 0x0807, KEY_GOTO }, /* jump */ + { 0x080d, KEY_5 }, + { 0x080f, KEY_2 }, + { 0x0812, KEY_POWER }, + { 0x0814, KEY_CHANNELUP }, + { 0x0816, KEY_VOLUMEDOWN }, + { 0x0818, KEY_6 }, + { 0x081a, KEY_MUTE }, + { 0x081b, KEY_8 }, + { 0x081c, KEY_4 }, + { 0x081d, KEY_CHANNELDOWN }, }; /* MSI DIGIVOX mini II V3.0 */ -static struct ir_scancode ir_codes_af9015_table_msi[] = { - { 0x001e, KEY_1 }, - { 0x001f, KEY_2 }, - { 0x0020, KEY_3 }, - { 0x0021, KEY_4 }, - { 0x0022, KEY_5 }, - { 0x0023, KEY_6 }, - { 0x0024, KEY_7 }, - { 0x0025, KEY_8 }, - { 0x0026, KEY_9 }, - { 0x0027, KEY_0 }, - { 0x030f, KEY_CHANNELUP }, - { 0x030e, KEY_CHANNELDOWN }, - { 0x0042, KEY_VOLUMEDOWN }, - { 0x0043, KEY_VOLUMEUP }, - { 0x0545, KEY_POWER }, - { 0x0052, KEY_UP }, /* up */ - { 0x0051, KEY_DOWN }, /* down */ - { 0x0028, KEY_ENTER }, -}; - -static u8 af9015_ir_table_msi[] = { - 0x03, 0xfc, 0x17, 0xe8, 0x45, 0x05, 0x00, /* power */ - 0x03, 0xfc, 0x0d, 0xf2, 0x51, 0x00, 0x00, /* down */ - 0x03, 0xfc, 0x03, 0xfc, 0x52, 0x00, 0x00, /* up */ - 0x03, 0xfc, 0x1a, 0xe5, 0x1e, 0x00, 0x00, /* 1 */ - 0x03, 0xfc, 0x02, 0xfd, 0x1f, 0x00, 0x00, /* 2 */ - 0x03, 0xfc, 0x04, 0xfb, 0x20, 0x00, 0x00, /* 3 */ - 0x03, 0xfc, 0x1c, 0xe3, 0x21, 0x00, 0x00, /* 4 */ - 0x03, 0xfc, 0x08, 0xf7, 0x22, 0x00, 0x00, /* 5 */ - 0x03, 0xfc, 0x1d, 0xe2, 0x23, 0x00, 0x00, /* 6 */ - 0x03, 0xfc, 0x11, 0xee, 0x24, 0x00, 0x00, /* 7 */ - 0x03, 0xfc, 0x0b, 0xf4, 0x25, 0x00, 0x00, /* 8 */ - 0x03, 0xfc, 0x10, 0xef, 0x26, 0x00, 0x00, /* 9 */ - 0x03, 0xfc, 0x09, 0xf6, 0x27, 0x00, 0x00, /* 0 */ - 0x03, 0xfc, 0x14, 0xeb, 0x43, 0x00, 0x00, /* volume up */ - 0x03, 0xfc, 0x1f, 0xe0, 0x42, 0x00, 0x00, /* volume down */ - 0x03, 0xfc, 0x15, 0xea, 0x0f, 0x03, 0x00, /* channel up */ - 0x03, 0xfc, 0x05, 0xfa, 0x0e, 0x03, 0x00, /* channel down */ - 0x03, 0xfc, 0x16, 0xe9, 0x28, 0x00, 0x00, /* enter */ +static struct ir_scancode af9015_rc_msi[] = { + { 0x0002, KEY_2 }, + { 0x0003, KEY_UP }, /* up */ + { 0x0004, KEY_3 }, + { 0x0005, KEY_CHANNELDOWN }, + { 0x0008, KEY_5 }, + { 0x0009, KEY_0 }, + { 0x000b, KEY_8 }, + { 0x000d, KEY_DOWN }, /* down */ + { 0x0010, KEY_9 }, + { 0x0011, KEY_7 }, + { 0x0014, KEY_VOLUMEUP }, + { 0x0015, KEY_CHANNELUP }, + { 0x0016, KEY_ENTER }, + { 0x0017, KEY_POWER }, + { 0x001a, KEY_1 }, + { 0x001c, KEY_4 }, + { 0x001d, KEY_6 }, + { 0x001f, KEY_VOLUMEDOWN }, }; /* MYGICTV U718 */ -static struct ir_scancode ir_codes_af9015_table_mygictv[] = { - { 0x003d, KEY_SWITCHVIDEOMODE }, - /* TV / AV */ - { 0x0545, KEY_POWER }, - { 0x001e, KEY_1 }, - { 0x001f, KEY_2 }, - { 0x0020, KEY_3 }, - { 0x0021, KEY_4 }, - { 0x0022, KEY_5 }, - { 0x0023, KEY_6 }, - { 0x0024, KEY_7 }, - { 0x0025, KEY_8 }, - { 0x0026, KEY_9 }, - { 0x0027, KEY_0 }, - { 0x0041, KEY_MUTE }, - { 0x002a, KEY_ESC }, /* Esc */ - { 0x002e, KEY_CHANNELUP }, - { 0x002d, KEY_CHANNELDOWN }, - { 0x0042, KEY_VOLUMEDOWN }, - { 0x0043, KEY_VOLUMEUP }, - { 0x0052, KEY_UP }, /* up arrow */ - { 0x0051, KEY_DOWN }, /* down arrow */ - { 0x004f, KEY_RIGHT }, /* right arrow */ - { 0x0050, KEY_LEFT }, /* left arrow */ - { 0x0028, KEY_ENTER }, /* ok */ - { 0x0115, KEY_RECORD }, - { 0x0313, KEY_PLAY }, - { 0x0113, KEY_PAUSE }, - { 0x0116, KEY_STOP }, - { 0x0307, KEY_REWIND }, /* FR << */ - { 0x0309, KEY_FASTFORWARD }, /* FF >> */ - { 0x003b, KEY_TIME }, /* TimeShift */ - { 0x003e, KEY_CAMERA }, /* Snapshot */ - { 0x0316, KEY_CYCLEWINDOWS }, /* yellow, min / max */ - { 0x0000, KEY_ZOOM }, /* 'select' (?) */ - { 0x0316, KEY_SHUFFLE }, /* Shuffle */ - { 0x0345, KEY_POWER }, -}; - -static u8 af9015_ir_table_mygictv[] = { - 0x02, 0xbd, 0x0c, 0xf3, 0x3d, 0x00, 0x00, /* TV / AV */ - 0x02, 0xbd, 0x14, 0xeb, 0x45, 0x05, 0x00, /* power */ - 0x02, 0xbd, 0x00, 0xff, 0x1e, 0x00, 0x00, /* 1 */ - 0x02, 0xbd, 0x01, 0xfe, 0x1f, 0x00, 0x00, /* 2 */ - 0x02, 0xbd, 0x02, 0xfd, 0x20, 0x00, 0x00, /* 3 */ - 0x02, 0xbd, 0x03, 0xfc, 0x21, 0x00, 0x00, /* 4 */ - 0x02, 0xbd, 0x04, 0xfb, 0x22, 0x00, 0x00, /* 5 */ - 0x02, 0xbd, 0x05, 0xfa, 0x23, 0x00, 0x00, /* 6 */ - 0x02, 0xbd, 0x06, 0xf9, 0x24, 0x00, 0x00, /* 7 */ - 0x02, 0xbd, 0x07, 0xf8, 0x25, 0x00, 0x00, /* 8 */ - 0x02, 0xbd, 0x08, 0xf7, 0x26, 0x00, 0x00, /* 9 */ - 0x02, 0xbd, 0x09, 0xf6, 0x27, 0x00, 0x00, /* 0 */ - 0x02, 0xbd, 0x0a, 0xf5, 0x41, 0x00, 0x00, /* mute */ - 0x02, 0xbd, 0x1c, 0xe3, 0x2a, 0x00, 0x00, /* esc */ - 0x02, 0xbd, 0x1f, 0xe0, 0x43, 0x00, 0x00, /* volume up */ - 0x02, 0xbd, 0x12, 0xed, 0x52, 0x00, 0x00, /* up arrow */ - 0x02, 0xbd, 0x11, 0xee, 0x50, 0x00, 0x00, /* left arrow */ - 0x02, 0xbd, 0x15, 0xea, 0x28, 0x00, 0x00, /* ok */ - 0x02, 0xbd, 0x10, 0xef, 0x4f, 0x00, 0x00, /* right arrow */ - 0x02, 0xbd, 0x13, 0xec, 0x51, 0x00, 0x00, /* down arrow */ - 0x02, 0xbd, 0x0e, 0xf1, 0x42, 0x00, 0x00, /* volume down */ - 0x02, 0xbd, 0x19, 0xe6, 0x15, 0x01, 0x00, /* record */ - 0x02, 0xbd, 0x1e, 0xe1, 0x13, 0x03, 0x00, /* play */ - 0x02, 0xbd, 0x16, 0xe9, 0x16, 0x01, 0x00, /* stop */ - 0x02, 0xbd, 0x0b, 0xf4, 0x28, 0x04, 0x00, /* yellow, min / max */ - 0x02, 0xbd, 0x0f, 0xf0, 0x3b, 0x00, 0x00, /* time shift */ - 0x02, 0xbd, 0x18, 0xe7, 0x2e, 0x00, 0x00, /* channel up */ - 0x02, 0xbd, 0x1a, 0xe5, 0x2d, 0x00, 0x00, /* channel down */ - 0x02, 0xbd, 0x17, 0xe8, 0x3e, 0x00, 0x00, /* snapshot */ - 0x02, 0xbd, 0x40, 0xbf, 0x13, 0x01, 0x00, /* pause */ - 0x02, 0xbd, 0x41, 0xbe, 0x09, 0x03, 0x00, /* FF >> */ - 0x02, 0xbd, 0x42, 0xbd, 0x07, 0x03, 0x00, /* FR << */ - 0x02, 0xbd, 0x43, 0xbc, 0x00, 0x00, 0x00, /* 'select' (?) */ - 0x02, 0xbd, 0x44, 0xbb, 0x16, 0x03, 0x00, /* shuffle */ - 0x02, 0xbd, 0x45, 0xba, 0x45, 0x03, 0x00, /* power */ +/* Uses NEC extended 0x02bd. Extended byte removed for compatibility... */ +static struct ir_scancode af9015_rc_mygictv[] = { + { 0x0200, KEY_1 }, + { 0x0201, KEY_2 }, + { 0x0202, KEY_3 }, + { 0x0203, KEY_4 }, + { 0x0204, KEY_5 }, + { 0x0205, KEY_6 }, + { 0x0206, KEY_7 }, + { 0x0207, KEY_8 }, + { 0x0208, KEY_9 }, + { 0x0209, KEY_0 }, + { 0x020a, KEY_MUTE }, + { 0x020b, KEY_CYCLEWINDOWS }, /* yellow, min / max */ + { 0x020c, KEY_SWITCHVIDEOMODE }, /* TV / AV */ + { 0x020e, KEY_VOLUMEDOWN }, + { 0x020f, KEY_TIME }, /* TimeShift */ + { 0x0210, KEY_RIGHT }, /* right arrow */ + { 0x0211, KEY_LEFT }, /* left arrow */ + { 0x0212, KEY_UP }, /* up arrow */ + { 0x0213, KEY_DOWN }, /* down arrow */ + { 0x0214, KEY_POWER }, + { 0x0215, KEY_ENTER }, /* ok */ + { 0x0216, KEY_STOP }, + { 0x0217, KEY_CAMERA }, /* Snapshot */ + { 0x0218, KEY_CHANNELUP }, + { 0x0219, KEY_RECORD }, + { 0x021a, KEY_CHANNELDOWN }, + { 0x021c, KEY_ESC }, /* Esc */ + { 0x021e, KEY_PLAY }, + { 0x021f, KEY_VOLUMEUP }, + { 0x0240, KEY_PAUSE }, + { 0x0241, KEY_FASTFORWARD }, /* FF >> */ + { 0x0242, KEY_REWIND }, /* FR << */ + { 0x0243, KEY_ZOOM }, /* 'select' (?) */ + { 0x0244, KEY_SHUFFLE }, /* Shuffle */ + { 0x0245, KEY_POWER }, }; /* KWorld PlusTV Dual DVB-T Stick (DVB-T 399U) */ -static u8 af9015_ir_table_kworld[] = { - 0x86, 0x6b, 0x0c, 0xf3, 0x2e, 0x07, 0x00, - 0x86, 0x6b, 0x16, 0xe9, 0x2d, 0x07, 0x00, - 0x86, 0x6b, 0x1d, 0xe2, 0x37, 0x07, 0x00, - 0x86, 0x6b, 0x00, 0xff, 0x1e, 0x07, 0x00, - 0x86, 0x6b, 0x01, 0xfe, 0x1f, 0x07, 0x00, - 0x86, 0x6b, 0x02, 0xfd, 0x20, 0x07, 0x00, - 0x86, 0x6b, 0x03, 0xfc, 0x21, 0x07, 0x00, - 0x86, 0x6b, 0x04, 0xfb, 0x22, 0x07, 0x00, - 0x86, 0x6b, 0x05, 0xfa, 0x23, 0x07, 0x00, - 0x86, 0x6b, 0x06, 0xf9, 0x24, 0x07, 0x00, - 0x86, 0x6b, 0x07, 0xf8, 0x25, 0x07, 0x00, - 0x86, 0x6b, 0x08, 0xf7, 0x26, 0x07, 0x00, - 0x86, 0x6b, 0x09, 0xf6, 0x4d, 0x07, 0x00, - 0x86, 0x6b, 0x0a, 0xf5, 0x4e, 0x07, 0x00, - 0x86, 0x6b, 0x14, 0xeb, 0x4f, 0x07, 0x00, - 0x86, 0x6b, 0x1e, 0xe1, 0x50, 0x07, 0x00, - 0x86, 0x6b, 0x17, 0xe8, 0x52, 0x07, 0x00, - 0x86, 0x6b, 0x1f, 0xe0, 0x51, 0x07, 0x00, - 0x86, 0x6b, 0x0e, 0xf1, 0x0b, 0x07, 0x00, - 0x86, 0x6b, 0x20, 0xdf, 0x0c, 0x07, 0x00, - 0x86, 0x6b, 0x42, 0xbd, 0x0d, 0x07, 0x00, - 0x86, 0x6b, 0x0b, 0xf4, 0x0e, 0x07, 0x00, - 0x86, 0x6b, 0x43, 0xbc, 0x0f, 0x07, 0x00, - 0x86, 0x6b, 0x10, 0xef, 0x10, 0x07, 0x00, - 0x86, 0x6b, 0x21, 0xde, 0x11, 0x07, 0x00, - 0x86, 0x6b, 0x13, 0xec, 0x12, 0x07, 0x00, - 0x86, 0x6b, 0x11, 0xee, 0x13, 0x07, 0x00, - 0x86, 0x6b, 0x12, 0xed, 0x14, 0x07, 0x00, - 0x86, 0x6b, 0x19, 0xe6, 0x15, 0x07, 0x00, - 0x86, 0x6b, 0x1a, 0xe5, 0x16, 0x07, 0x00, - 0x86, 0x6b, 0x1b, 0xe4, 0x17, 0x07, 0x00, - 0x86, 0x6b, 0x4b, 0xb4, 0x18, 0x07, 0x00, - 0x86, 0x6b, 0x40, 0xbf, 0x19, 0x07, 0x00, - 0x86, 0x6b, 0x44, 0xbb, 0x1a, 0x07, 0x00, - 0x86, 0x6b, 0x41, 0xbe, 0x1b, 0x07, 0x00, - 0x86, 0x6b, 0x22, 0xdd, 0x1c, 0x07, 0x00, - 0x86, 0x6b, 0x15, 0xea, 0x1d, 0x07, 0x00, - 0x86, 0x6b, 0x0f, 0xf0, 0x3f, 0x07, 0x00, - 0x86, 0x6b, 0x1c, 0xe3, 0x40, 0x07, 0x00, - 0x86, 0x6b, 0x4a, 0xb5, 0x41, 0x07, 0x00, - 0x86, 0x6b, 0x48, 0xb7, 0x42, 0x07, 0x00, - 0x86, 0x6b, 0x49, 0xb6, 0x43, 0x07, 0x00, - 0x86, 0x6b, 0x18, 0xe7, 0x44, 0x07, 0x00, - 0x86, 0x6b, 0x23, 0xdc, 0x45, 0x07, 0x00, +/* FIXME: This mapping is totally incomplete and probably even wrong... */ +/* Uses NEC extended 0x866b. Extended byte removed for compatibility... */ +static struct ir_scancode af9015_rc_kworld[] = { + { 0x8600, KEY_1 }, + { 0x8601, KEY_2 }, + { 0x8602, KEY_3 }, + { 0x8603, KEY_4 }, + { 0x8604, KEY_5 }, + { 0x8605, KEY_6 }, + { 0x8606, KEY_7 }, + { 0x8607, KEY_8 }, + { 0x8608, KEY_9 }, + { 0x860a, KEY_0 }, }; /* AverMedia Volar X */ -static struct ir_scancode ir_codes_af9015_table_avermedia[] = { - { 0x053d, KEY_PROG1 }, /* SOURCE */ - { 0x0512, KEY_POWER }, /* POWER */ - { 0x051e, KEY_1 }, /* 1 */ - { 0x051f, KEY_2 }, /* 2 */ - { 0x0520, KEY_3 }, /* 3 */ - { 0x0521, KEY_4 }, /* 4 */ - { 0x0522, KEY_5 }, /* 5 */ - { 0x0523, KEY_6 }, /* 6 */ - { 0x0524, KEY_7 }, /* 7 */ - { 0x0525, KEY_8 }, /* 8 */ - { 0x0526, KEY_9 }, /* 9 */ - { 0x053f, KEY_LEFT }, /* L / DISPLAY */ - { 0x0527, KEY_0 }, /* 0 */ - { 0x050f, KEY_RIGHT }, /* R / CH RTN */ - { 0x0518, KEY_PROG2 }, /* SNAP SHOT */ - { 0x051c, KEY_PROG3 }, /* 16-CH PREV */ - { 0x052d, KEY_VOLUMEDOWN }, /* VOL DOWN */ - { 0x053e, KEY_ZOOM }, /* FULL SCREEN */ - { 0x052e, KEY_VOLUMEUP }, /* VOL UP */ - { 0x0510, KEY_MUTE }, /* MUTE */ - { 0x0504, KEY_AUDIO }, /* AUDIO */ - { 0x0515, KEY_RECORD }, /* RECORD */ - { 0x0511, KEY_PLAY }, /* PLAY */ - { 0x0516, KEY_STOP }, /* STOP */ - { 0x050c, KEY_PLAYPAUSE }, /* TIMESHIFT / PAUSE */ - { 0x0505, KEY_BACK }, /* << / RED */ - { 0x0509, KEY_FORWARD }, /* >> / YELLOW */ - { 0x0517, KEY_TEXT }, /* TELETEXT */ - { 0x050a, KEY_EPG }, /* EPG */ - { 0x0513, KEY_MENU }, /* MENU */ - - { 0x050e, KEY_CHANNELUP }, /* CH UP */ - { 0x050d, KEY_CHANNELDOWN }, /* CH DOWN */ - { 0x0519, KEY_FIRST }, /* |<< / GREEN */ - { 0x0508, KEY_LAST }, /* >>| / BLUE */ +static struct ir_scancode af9015_rc_avermedia[] = { + { 0x0200, KEY_POWER }, /* POWER */ + { 0x0201, KEY_PROG1 }, /* SOURCE */ + { 0x0203, KEY_TEXT }, /* TELETEXT */ + { 0x0204, KEY_EPG }, /* EPG */ + { 0x0205, KEY_1 }, /* 1 */ + { 0x0206, KEY_2 }, /* 2 */ + { 0x0207, KEY_3 }, /* 3 */ + { 0x0208, KEY_AUDIO }, /* AUDIO */ + { 0x0209, KEY_4 }, /* 4 */ + { 0x020a, KEY_5 }, /* 5 */ + { 0x020b, KEY_6 }, /* 6 */ + { 0x020c, KEY_ZOOM }, /* FULL SCREEN */ + { 0x020d, KEY_7 }, /* 7 */ + { 0x020e, KEY_8 }, /* 8 */ + { 0x020f, KEY_9 }, /* 9 */ + { 0x0210, KEY_PROG3 }, /* 16-CH PREV */ + { 0x0211, KEY_0 }, /* 0 */ + { 0x0212, KEY_LEFT }, /* L / DISPLAY */ + { 0x0213, KEY_RIGHT }, /* R / CH RTN */ + { 0x0214, KEY_MUTE }, /* MUTE */ + { 0x0215, KEY_MENU }, /* MENU */ + { 0x0217, KEY_PROG2 }, /* SNAP SHOT */ + { 0x0218, KEY_PLAY }, /* PLAY */ + { 0x0219, KEY_RECORD }, /* RECORD */ + { 0x021a, KEY_PLAYPAUSE }, /* TIMESHIFT / PAUSE */ + { 0x021b, KEY_STOP }, /* STOP */ + { 0x021c, KEY_FORWARD }, /* >> / YELLOW */ + { 0x021d, KEY_BACK }, /* << / RED */ + { 0x021e, KEY_VOLUMEDOWN }, /* VOL DOWN */ + { 0x021f, KEY_VOLUMEUP }, /* VOL UP */ + + { 0x0300, KEY_LAST }, /* >>| / BLUE */ + { 0x0301, KEY_FIRST }, /* |<< / GREEN */ + { 0x0302, KEY_CHANNELDOWN }, /* CH DOWN */ + { 0x0303, KEY_CHANNELUP }, /* CH UP */ }; -static u8 af9015_ir_table_avermedia[] = { - 0x02, 0xfd, 0x00, 0xff, 0x12, 0x05, 0x00, - 0x02, 0xfd, 0x01, 0xfe, 0x3d, 0x05, 0x00, - 0x02, 0xfd, 0x03, 0xfc, 0x17, 0x05, 0x00, - 0x02, 0xfd, 0x04, 0xfb, 0x0a, 0x05, 0x00, - 0x02, 0xfd, 0x05, 0xfa, 0x1e, 0x05, 0x00, - 0x02, 0xfd, 0x06, 0xf9, 0x1f, 0x05, 0x00, - 0x02, 0xfd, 0x07, 0xf8, 0x20, 0x05, 0x00, - 0x02, 0xfd, 0x09, 0xf6, 0x21, 0x05, 0x00, - 0x02, 0xfd, 0x0a, 0xf5, 0x22, 0x05, 0x00, - 0x02, 0xfd, 0x0b, 0xf4, 0x23, 0x05, 0x00, - 0x02, 0xfd, 0x0d, 0xf2, 0x24, 0x05, 0x00, - 0x02, 0xfd, 0x0e, 0xf1, 0x25, 0x05, 0x00, - 0x02, 0xfd, 0x0f, 0xf0, 0x26, 0x05, 0x00, - 0x02, 0xfd, 0x11, 0xee, 0x27, 0x05, 0x00, - 0x02, 0xfd, 0x08, 0xf7, 0x04, 0x05, 0x00, - 0x02, 0xfd, 0x0c, 0xf3, 0x3e, 0x05, 0x00, - 0x02, 0xfd, 0x10, 0xef, 0x1c, 0x05, 0x00, - 0x02, 0xfd, 0x12, 0xed, 0x3f, 0x05, 0x00, - 0x02, 0xfd, 0x13, 0xec, 0x0f, 0x05, 0x00, - 0x02, 0xfd, 0x14, 0xeb, 0x10, 0x05, 0x00, - 0x02, 0xfd, 0x15, 0xea, 0x13, 0x05, 0x00, - 0x02, 0xfd, 0x17, 0xe8, 0x18, 0x05, 0x00, - 0x02, 0xfd, 0x18, 0xe7, 0x11, 0x05, 0x00, - 0x02, 0xfd, 0x19, 0xe6, 0x15, 0x05, 0x00, - 0x02, 0xfd, 0x1a, 0xe5, 0x0c, 0x05, 0x00, - 0x02, 0xfd, 0x1b, 0xe4, 0x16, 0x05, 0x00, - 0x02, 0xfd, 0x1c, 0xe3, 0x09, 0x05, 0x00, - 0x02, 0xfd, 0x1d, 0xe2, 0x05, 0x05, 0x00, - 0x02, 0xfd, 0x1e, 0xe1, 0x2d, 0x05, 0x00, - 0x02, 0xfd, 0x1f, 0xe0, 0x2e, 0x05, 0x00, - 0x03, 0xfc, 0x00, 0xff, 0x08, 0x05, 0x00, - 0x03, 0xfc, 0x01, 0xfe, 0x19, 0x05, 0x00, - 0x03, 0xfc, 0x02, 0xfd, 0x0d, 0x05, 0x00, - 0x03, 0xfc, 0x03, 0xfc, 0x0e, 0x05, 0x00, -}; - -static u8 af9015_ir_table_avermedia_ks[] = { - 0x05, 0xfa, 0x01, 0xfe, 0x12, 0x05, 0x00, - 0x05, 0xfa, 0x02, 0xfd, 0x0e, 0x05, 0x00, - 0x05, 0xfa, 0x03, 0xfc, 0x0d, 0x05, 0x00, - 0x05, 0xfa, 0x04, 0xfb, 0x2e, 0x05, 0x00, - 0x05, 0xfa, 0x05, 0xfa, 0x2d, 0x05, 0x00, - 0x05, 0xfa, 0x06, 0xf9, 0x10, 0x05, 0x00, - 0x05, 0xfa, 0x07, 0xf8, 0x0f, 0x05, 0x00, - 0x05, 0xfa, 0x08, 0xf7, 0x3d, 0x05, 0x00, - 0x05, 0xfa, 0x09, 0xf6, 0x1e, 0x05, 0x00, - 0x05, 0xfa, 0x0a, 0xf5, 0x1f, 0x05, 0x00, - 0x05, 0xfa, 0x0b, 0xf4, 0x20, 0x05, 0x00, - 0x05, 0xfa, 0x0c, 0xf3, 0x21, 0x05, 0x00, - 0x05, 0xfa, 0x0d, 0xf2, 0x22, 0x05, 0x00, - 0x05, 0xfa, 0x0e, 0xf1, 0x23, 0x05, 0x00, - 0x05, 0xfa, 0x0f, 0xf0, 0x24, 0x05, 0x00, - 0x05, 0xfa, 0x10, 0xef, 0x25, 0x05, 0x00, - 0x05, 0xfa, 0x11, 0xee, 0x26, 0x05, 0x00, - 0x05, 0xfa, 0x12, 0xed, 0x27, 0x05, 0x00, - 0x05, 0xfa, 0x13, 0xec, 0x04, 0x05, 0x00, - 0x05, 0xfa, 0x15, 0xea, 0x0a, 0x05, 0x00, - 0x05, 0xfa, 0x16, 0xe9, 0x11, 0x05, 0x00, - 0x05, 0xfa, 0x17, 0xe8, 0x15, 0x05, 0x00, - 0x05, 0xfa, 0x18, 0xe7, 0x16, 0x05, 0x00, - 0x05, 0xfa, 0x1c, 0xe3, 0x05, 0x05, 0x00, - 0x05, 0xfa, 0x1d, 0xe2, 0x09, 0x05, 0x00, - 0x05, 0xfa, 0x4d, 0xb2, 0x3f, 0x05, 0x00, - 0x05, 0xfa, 0x56, 0xa9, 0x3e, 0x05, 0x00 +/* AverMedia KS */ +/* FIXME: mappings are not 100% correct? */ +static struct ir_scancode af9015_rc_avermedia_ks[] = { + { 0x0501, KEY_POWER }, + { 0x0502, KEY_CHANNELUP }, + { 0x0503, KEY_CHANNELDOWN }, + { 0x0504, KEY_VOLUMEUP }, + { 0x0505, KEY_VOLUMEDOWN }, + { 0x0506, KEY_MUTE }, + { 0x0507, KEY_RIGHT }, + { 0x0508, KEY_PROG1 }, + { 0x0509, KEY_1 }, + { 0x050a, KEY_2 }, + { 0x050b, KEY_3 }, + { 0x050c, KEY_4 }, + { 0x050d, KEY_5 }, + { 0x050e, KEY_6 }, + { 0x050f, KEY_7 }, + { 0x0510, KEY_8 }, + { 0x0511, KEY_9 }, + { 0x0512, KEY_0 }, + { 0x0513, KEY_AUDIO }, + { 0x0515, KEY_EPG }, + { 0x0516, KEY_PLAY }, + { 0x0517, KEY_RECORD }, + { 0x0518, KEY_STOP }, + { 0x051c, KEY_BACK }, + { 0x051d, KEY_FORWARD }, + { 0x054d, KEY_LEFT }, + { 0x0556, KEY_ZOOM }, }; /* Digittrade DVB-T USB Stick */ -static struct ir_scancode ir_codes_af9015_table_digittrade[] = { - { 0x010f, KEY_LAST }, /* RETURN */ - { 0x0517, KEY_TEXT }, /* TELETEXT */ - { 0x0108, KEY_EPG }, /* EPG */ - { 0x0513, KEY_POWER }, /* POWER */ - { 0x0109, KEY_ZOOM }, /* FULLSCREEN */ - { 0x0040, KEY_AUDIO }, /* DUAL SOUND */ - { 0x002c, KEY_PRINT }, /* SNAPSHOT */ - { 0x0516, KEY_SUBTITLE }, /* SUBTITLE */ - { 0x0052, KEY_CHANNELUP }, /* CH Up */ - { 0x0051, KEY_CHANNELDOWN },/* Ch Dn */ - { 0x0057, KEY_VOLUMEUP }, /* Vol Up */ - { 0x0056, KEY_VOLUMEDOWN }, /* Vol Dn */ - { 0x0110, KEY_MUTE }, /* MUTE */ - { 0x0027, KEY_0 }, - { 0x001e, KEY_1 }, - { 0x001f, KEY_2 }, - { 0x0020, KEY_3 }, - { 0x0021, KEY_4 }, - { 0x0022, KEY_5 }, - { 0x0023, KEY_6 }, - { 0x0024, KEY_7 }, - { 0x0025, KEY_8 }, - { 0x0026, KEY_9 }, - { 0x0117, KEY_PLAYPAUSE }, /* TIMESHIFT */ - { 0x0115, KEY_RECORD }, /* RECORD */ - { 0x0313, KEY_PLAY }, /* PLAY */ - { 0x0116, KEY_STOP }, /* STOP */ - { 0x0113, KEY_PAUSE }, /* PAUSE */ -}; - -static u8 af9015_ir_table_digittrade[] = { - 0x00, 0xff, 0x06, 0xf9, 0x13, 0x05, 0x00, - 0x00, 0xff, 0x4d, 0xb2, 0x17, 0x01, 0x00, - 0x00, 0xff, 0x1f, 0xe0, 0x2c, 0x00, 0x00, - 0x00, 0xff, 0x0a, 0xf5, 0x15, 0x01, 0x00, - 0x00, 0xff, 0x0e, 0xf1, 0x16, 0x01, 0x00, - 0x00, 0xff, 0x09, 0xf6, 0x09, 0x01, 0x00, - 0x00, 0xff, 0x01, 0xfe, 0x08, 0x01, 0x00, - 0x00, 0xff, 0x05, 0xfa, 0x10, 0x01, 0x00, - 0x00, 0xff, 0x02, 0xfd, 0x56, 0x00, 0x00, - 0x00, 0xff, 0x40, 0xbf, 0x57, 0x00, 0x00, - 0x00, 0xff, 0x19, 0xe6, 0x52, 0x00, 0x00, - 0x00, 0xff, 0x17, 0xe8, 0x51, 0x00, 0x00, - 0x00, 0xff, 0x10, 0xef, 0x0f, 0x01, 0x00, - 0x00, 0xff, 0x54, 0xab, 0x27, 0x00, 0x00, - 0x00, 0xff, 0x1b, 0xe4, 0x1e, 0x00, 0x00, - 0x00, 0xff, 0x11, 0xee, 0x1f, 0x00, 0x00, - 0x00, 0xff, 0x15, 0xea, 0x20, 0x00, 0x00, - 0x00, 0xff, 0x12, 0xed, 0x21, 0x00, 0x00, - 0x00, 0xff, 0x16, 0xe9, 0x22, 0x00, 0x00, - 0x00, 0xff, 0x4c, 0xb3, 0x23, 0x00, 0x00, - 0x00, 0xff, 0x48, 0xb7, 0x24, 0x00, 0x00, - 0x00, 0xff, 0x04, 0xfb, 0x25, 0x00, 0x00, - 0x00, 0xff, 0x00, 0xff, 0x26, 0x00, 0x00, - 0x00, 0xff, 0x1e, 0xe1, 0x13, 0x03, 0x00, - 0x00, 0xff, 0x1a, 0xe5, 0x13, 0x01, 0x00, - 0x00, 0xff, 0x03, 0xfc, 0x17, 0x05, 0x00, - 0x00, 0xff, 0x0d, 0xf2, 0x16, 0x05, 0x00, - 0x00, 0xff, 0x1d, 0xe2, 0x40, 0x00, 0x00, +static struct ir_scancode af9015_rc_digittrade[] = { + { 0x0000, KEY_9 }, + { 0x0001, KEY_EPG }, /* EPG */ + { 0x0002, KEY_VOLUMEDOWN }, /* Vol Dn */ + { 0x0003, KEY_TEXT }, /* TELETEXT */ + { 0x0004, KEY_8 }, + { 0x0005, KEY_MUTE }, /* MUTE */ + { 0x0006, KEY_POWER }, /* POWER */ + { 0x0009, KEY_ZOOM }, /* FULLSCREEN */ + { 0x000a, KEY_RECORD }, /* RECORD */ + { 0x000d, KEY_SUBTITLE }, /* SUBTITLE */ + { 0x000e, KEY_STOP }, /* STOP */ + { 0x0010, KEY_LAST }, /* RETURN */ + { 0x0011, KEY_2 }, + { 0x0012, KEY_4 }, + { 0x0015, KEY_3 }, + { 0x0016, KEY_5 }, + { 0x0017, KEY_CHANNELDOWN }, /* Ch Dn */ + { 0x0019, KEY_CHANNELUP }, /* CH Up */ + { 0x001a, KEY_PAUSE }, /* PAUSE */ + { 0x001b, KEY_1 }, + { 0x001d, KEY_AUDIO }, /* DUAL SOUND */ + { 0x001e, KEY_PLAY }, /* PLAY */ + { 0x001f, KEY_PRINT }, /* SNAPSHOT */ + { 0x0040, KEY_VOLUMEUP }, /* Vol Up */ + { 0x0048, KEY_7 }, + { 0x004c, KEY_6 }, + { 0x004d, KEY_PLAYPAUSE }, /* TIMESHIFT */ + { 0x0054, KEY_0 }, }; /* TREKSTOR DVB-T USB Stick */ -static struct ir_scancode ir_codes_af9015_table_trekstor[] = { - { 0x0704, KEY_AGAIN }, /* Home */ - { 0x0705, KEY_MUTE }, /* Mute */ - { 0x0706, KEY_UP }, /* Up */ - { 0x0707, KEY_DOWN }, /* Down */ - { 0x0709, KEY_RIGHT }, /* Right */ - { 0x070a, KEY_ENTER }, /* OK */ - { 0x070b, KEY_FASTFORWARD }, /* Fast forward */ - { 0x070c, KEY_REWIND }, /* Rewind */ - { 0x070d, KEY_PLAY }, /* Play/Pause */ - { 0x070e, KEY_VOLUMEUP }, /* Volume + */ - { 0x070f, KEY_VOLUMEDOWN }, /* Volume - */ - { 0x0710, KEY_RECORD }, /* Record */ - { 0x0711, KEY_STOP }, /* Stop */ - { 0x0712, KEY_ZOOM }, /* TV */ - { 0x0713, KEY_EPG }, /* Info/EPG */ - { 0x0714, KEY_CHANNELDOWN }, /* Channel - */ - { 0x0715, KEY_CHANNELUP }, /* Channel + */ - { 0x071e, KEY_1 }, - { 0x071f, KEY_2 }, - { 0x0720, KEY_3 }, - { 0x0721, KEY_4 }, - { 0x0722, KEY_5 }, - { 0x0723, KEY_6 }, - { 0x0724, KEY_7 }, - { 0x0725, KEY_8 }, - { 0x0726, KEY_9 }, - { 0x0708, KEY_LEFT }, /* LEFT */ - { 0x0727, KEY_0 }, -}; - -static u8 af9015_ir_table_trekstor[] = { - 0x00, 0xff, 0x86, 0x79, 0x04, 0x07, 0x00, - 0x00, 0xff, 0x85, 0x7a, 0x05, 0x07, 0x00, - 0x00, 0xff, 0x87, 0x78, 0x06, 0x07, 0x00, - 0x00, 0xff, 0x8c, 0x73, 0x07, 0x07, 0x00, - 0x00, 0xff, 0x89, 0x76, 0x09, 0x07, 0x00, - 0x00, 0xff, 0x88, 0x77, 0x0a, 0x07, 0x00, - 0x00, 0xff, 0x8a, 0x75, 0x0b, 0x07, 0x00, - 0x00, 0xff, 0x9e, 0x61, 0x0c, 0x07, 0x00, - 0x00, 0xff, 0x8d, 0x72, 0x0d, 0x07, 0x00, - 0x00, 0xff, 0x8b, 0x74, 0x0e, 0x07, 0x00, - 0x00, 0xff, 0x9b, 0x64, 0x0f, 0x07, 0x00, - 0x00, 0xff, 0x9d, 0x62, 0x10, 0x07, 0x00, - 0x00, 0xff, 0x8e, 0x71, 0x11, 0x07, 0x00, - 0x00, 0xff, 0x9c, 0x63, 0x12, 0x07, 0x00, - 0x00, 0xff, 0x8f, 0x70, 0x13, 0x07, 0x00, - 0x00, 0xff, 0x93, 0x6c, 0x14, 0x07, 0x00, - 0x00, 0xff, 0x97, 0x68, 0x15, 0x07, 0x00, - 0x00, 0xff, 0x92, 0x6d, 0x1e, 0x07, 0x00, - 0x00, 0xff, 0x96, 0x69, 0x1f, 0x07, 0x00, - 0x00, 0xff, 0x9a, 0x65, 0x20, 0x07, 0x00, - 0x00, 0xff, 0x91, 0x6e, 0x21, 0x07, 0x00, - 0x00, 0xff, 0x95, 0x6a, 0x22, 0x07, 0x00, - 0x00, 0xff, 0x99, 0x66, 0x23, 0x07, 0x00, - 0x00, 0xff, 0x90, 0x6f, 0x24, 0x07, 0x00, - 0x00, 0xff, 0x94, 0x6b, 0x25, 0x07, 0x00, - 0x00, 0xff, 0x98, 0x67, 0x26, 0x07, 0x00, - 0x00, 0xff, 0x9f, 0x60, 0x08, 0x07, 0x00, - 0x00, 0xff, 0x84, 0x7b, 0x27, 0x07, 0x00, +static struct ir_scancode af9015_rc_trekstor[] = { + { 0x0084, KEY_0 }, + { 0x0085, KEY_MUTE }, /* Mute */ + { 0x0086, KEY_AGAIN }, /* Home */ + { 0x0087, KEY_UP }, /* Up */ + { 0x0088, KEY_ENTER }, /* OK */ + { 0x0089, KEY_RIGHT }, /* Right */ + { 0x008a, KEY_FASTFORWARD }, /* Fast forward */ + { 0x008b, KEY_VOLUMEUP }, /* Volume + */ + { 0x008c, KEY_DOWN }, /* Down */ + { 0x008d, KEY_PLAY }, /* Play/Pause */ + { 0x008e, KEY_STOP }, /* Stop */ + { 0x008f, KEY_EPG }, /* Info/EPG */ + { 0x0090, KEY_7 }, + { 0x0091, KEY_4 }, + { 0x0092, KEY_1 }, + { 0x0093, KEY_CHANNELDOWN }, /* Channel - */ + { 0x0094, KEY_8 }, + { 0x0095, KEY_5 }, + { 0x0096, KEY_2 }, + { 0x0097, KEY_CHANNELUP }, /* Channel + */ + { 0x0098, KEY_9 }, + { 0x0099, KEY_6 }, + { 0x009a, KEY_3 }, + { 0x009b, KEY_VOLUMEDOWN }, /* Volume - */ + { 0x009c, KEY_ZOOM }, /* TV */ + { 0x009d, KEY_RECORD }, /* Record */ + { 0x009e, KEY_REWIND }, /* Rewind */ + { 0x009f, KEY_LEFT }, /* Left */ }; /* MSI DIGIVOX mini III */ -static struct ir_scancode ir_codes_af9015_table_msi_digivox_iii[] = { - { 0x0713, KEY_POWER }, /* [red power button] */ - { 0x073b, KEY_VIDEO }, /* Source */ - { 0x073e, KEY_ZOOM }, /* Zoom */ - { 0x070b, KEY_POWER2 }, /* ShutDown */ - { 0x071e, KEY_1 }, - { 0x071f, KEY_2 }, - { 0x0720, KEY_3 }, - { 0x0721, KEY_4 }, - { 0x0722, KEY_5 }, - { 0x0723, KEY_6 }, - { 0x0724, KEY_7 }, - { 0x0725, KEY_8 }, - { 0x0726, KEY_9 }, - { 0x0727, KEY_0 }, - { 0x0752, KEY_CHANNELUP }, /* CH+ */ - { 0x0751, KEY_CHANNELDOWN }, /* CH- */ - { 0x0750, KEY_VOLUMEUP }, /* Vol+ */ - { 0x074f, KEY_VOLUMEDOWN }, /* Vol- */ - { 0x0705, KEY_ESC }, /* [back up arrow] */ - { 0x0708, KEY_OK }, /* [enter arrow] */ - { 0x073f, KEY_RECORD }, /* Rec */ - { 0x0716, KEY_STOP }, /* Stop */ - { 0x072a, KEY_PLAY }, /* Play */ - { 0x073c, KEY_MUTE }, /* Mute */ - { 0x0718, KEY_UP }, - { 0x0707, KEY_DOWN }, - { 0x070f, KEY_LEFT }, - { 0x0715, KEY_RIGHT }, - { 0x0736, KEY_RED }, - { 0x0737, KEY_GREEN }, - { 0x072d, KEY_YELLOW }, - { 0x072e, KEY_BLUE }, -}; - -static u8 af9015_ir_table_msi_digivox_iii[] = { - 0x61, 0xd6, 0x43, 0xbc, 0x13, 0x07, 0x00, /* KEY_POWER */ - 0x61, 0xd6, 0x01, 0xfe, 0x3b, 0x07, 0x00, /* KEY_VIDEO */ - 0x61, 0xd6, 0x0b, 0xf4, 0x3e, 0x07, 0x00, /* KEY_ZOOM */ - 0x61, 0xd6, 0x03, 0xfc, 0x0b, 0x07, 0x00, /* KEY_POWER2 */ - 0x61, 0xd6, 0x04, 0xfb, 0x1e, 0x07, 0x00, /* KEY_1 */ - 0x61, 0xd6, 0x08, 0xf7, 0x1f, 0x07, 0x00, /* KEY_2 */ - 0x61, 0xd6, 0x02, 0xfd, 0x20, 0x07, 0x00, /* KEY_3 */ - 0x61, 0xd6, 0x0f, 0xf0, 0x21, 0x07, 0x00, /* KEY_4 */ - 0x61, 0xd6, 0x05, 0xfa, 0x22, 0x07, 0x00, /* KEY_5 */ - 0x61, 0xd6, 0x06, 0xf9, 0x23, 0x07, 0x00, /* KEY_6 */ - 0x61, 0xd6, 0x0c, 0xf3, 0x24, 0x07, 0x00, /* KEY_7 */ - 0x61, 0xd6, 0x0d, 0xf2, 0x25, 0x07, 0x00, /* KEY_8 */ - 0x61, 0xd6, 0x0a, 0xf5, 0x26, 0x07, 0x00, /* KEY_9 */ - 0x61, 0xd6, 0x11, 0xee, 0x27, 0x07, 0x00, /* KEY_0 */ - 0x61, 0xd6, 0x09, 0xf6, 0x52, 0x07, 0x00, /* KEY_CHANNELUP */ - 0x61, 0xd6, 0x07, 0xf8, 0x51, 0x07, 0x00, /* KEY_CHANNELDOWN */ - 0x61, 0xd6, 0x0e, 0xf1, 0x50, 0x07, 0x00, /* KEY_VOLUMEUP */ - 0x61, 0xd6, 0x13, 0xec, 0x4f, 0x07, 0x00, /* KEY_VOLUMEDOWN */ - 0x61, 0xd6, 0x10, 0xef, 0x05, 0x07, 0x00, /* KEY_ESC */ - 0x61, 0xd6, 0x12, 0xed, 0x08, 0x07, 0x00, /* KEY_OK */ - 0x61, 0xd6, 0x14, 0xeb, 0x3f, 0x07, 0x00, /* KEY_RECORD */ - 0x61, 0xd6, 0x15, 0xea, 0x16, 0x07, 0x00, /* KEY_STOP */ - 0x61, 0xd6, 0x16, 0xe9, 0x2a, 0x07, 0x00, /* KEY_PLAY */ - 0x61, 0xd6, 0x17, 0xe8, 0x3c, 0x07, 0x00, /* KEY_MUTE */ - 0x61, 0xd6, 0x18, 0xe7, 0x18, 0x07, 0x00, /* KEY_UP */ - 0x61, 0xd6, 0x19, 0xe6, 0x07, 0x07, 0x00, /* KEY_DOWN */ - 0x61, 0xd6, 0x1a, 0xe5, 0x0f, 0x07, 0x00, /* KEY_LEFT */ - 0x61, 0xd6, 0x1b, 0xe4, 0x15, 0x07, 0x00, /* KEY_RIGHT */ - 0x61, 0xd6, 0x1c, 0xe3, 0x36, 0x07, 0x00, /* KEY_RED */ - 0x61, 0xd6, 0x1d, 0xe2, 0x37, 0x07, 0x00, /* KEY_GREEN */ - 0x61, 0xd6, 0x1e, 0xe1, 0x2d, 0x07, 0x00, /* KEY_YELLOW */ - 0x61, 0xd6, 0x1f, 0xe0, 0x2e, 0x07, 0x00, /* KEY_BLUE */ +/* Uses NEC extended 0x61d6. Extended byte removed for compatibility... */ +static struct ir_scancode af9015_rc_msi_digivox_iii[] = { + { 0x6101, KEY_VIDEO }, /* Source */ + { 0x6102, KEY_3 }, + { 0x6103, KEY_POWER2 }, /* ShutDown */ + { 0x6104, KEY_1 }, + { 0x6105, KEY_5 }, + { 0x6106, KEY_6 }, + { 0x6107, KEY_CHANNELDOWN }, /* CH- */ + { 0x6108, KEY_2 }, + { 0x6109, KEY_CHANNELUP }, /* CH+ */ + { 0x610a, KEY_9 }, + { 0x610b, KEY_ZOOM }, /* Zoom */ + { 0x610c, KEY_7 }, + { 0x610d, KEY_8 }, + { 0x610e, KEY_VOLUMEUP }, /* Vol+ */ + { 0x610f, KEY_4 }, + { 0x6110, KEY_ESC }, /* [back up arrow] */ + { 0x6111, KEY_0 }, + { 0x6112, KEY_OK }, /* [enter arrow] */ + { 0x6113, KEY_VOLUMEDOWN }, /* Vol- */ + { 0x6114, KEY_RECORD }, /* Rec */ + { 0x6115, KEY_STOP }, /* Stop */ + { 0x6116, KEY_PLAY }, /* Play */ + { 0x6117, KEY_MUTE }, /* Mute */ + { 0x6118, KEY_UP }, + { 0x6119, KEY_DOWN }, + { 0x611a, KEY_LEFT }, + { 0x611b, KEY_RIGHT }, + { 0x611c, KEY_RED }, + { 0x611d, KEY_GREEN }, + { 0x611e, KEY_YELLOW }, + { 0x611f, KEY_BLUE }, + { 0x6143, KEY_POWER }, /* [red power button] */ }; /* TerraTec - 4x7 slim remote */ -static struct ir_scancode ir_codes_terratec[] = { - { 0x0010, KEY_MUTE }, - { 0x0008, KEY_EPG }, - { 0x0009, KEY_ZOOM }, /* symbol: PIP or zoom ? */ - { 0x043d, KEY_POWER2 }, /* [red power button] */ - { 0x001e, KEY_1 }, - { 0x001f, KEY_2 }, - { 0x0020, KEY_3 }, - { 0x0021, KEY_4 }, - { 0x0022, KEY_5 }, - { 0x0023, KEY_6 }, - { 0x0024, KEY_7 }, - { 0x0025, KEY_8 }, - { 0x0026, KEY_9 }, - { 0x0027, KEY_0 }, - { 0x0029, KEY_ESC }, - { 0x0013, KEY_CAMERA }, /* snapshot */ - { 0x0028, KEY_OK }, - { 0x004f, KEY_RIGHT }, - { 0x0050, KEY_LEFT }, - { 0x0051, KEY_DOWN }, - { 0x0052, KEY_UP }, - { 0x004b, KEY_CHANNELUP }, - { 0x004e, KEY_CHANNELDOWN }, - { 0x0057, KEY_VOLUMEUP }, - { 0x0056, KEY_VOLUMEDOWN }, - { 0x0015, KEY_RECORD }, - { 0x001b, KEY_STOP }, - { 0x002c, KEY_PLAYPAUSE }, -}; - -static u8 af9015_ir_terratec[] = { - 0x02, 0xbd, 0x0a, 0xf5, 0x10, 0x00, 0x00, /* KEY_MUTE */ - 0x02, 0xbd, 0x0b, 0xf4, 0x09, 0x00, 0x00, /* KEY_ZOOM */ - 0x02, 0xbd, 0x00, 0xff, 0x1e, 0x00, 0x00, /* KEY_1 */ - 0x02, 0xbd, 0x01, 0xfe, 0x1f, 0x00, 0x00, /* KEY_2 */ - 0x02, 0xbd, 0x02, 0xfd, 0x20, 0x00, 0x00, /* KEY_3 */ - 0x02, 0xbd, 0x03, 0xfc, 0x21, 0x00, 0x00, /* KEY_4 */ - 0x02, 0xbd, 0x04, 0xfb, 0x22, 0x00, 0x00, /* KEY_5 */ - 0x02, 0xbd, 0x05, 0xfa, 0x23, 0x00, 0x00, /* KEY_6 */ - 0x02, 0xbd, 0x06, 0xf9, 0x24, 0x00, 0x00, /* KEY_7 */ - 0x02, 0xbd, 0x07, 0xf8, 0x25, 0x00, 0x00, /* KEY_8 */ - 0x02, 0xbd, 0x08, 0xf7, 0x26, 0x00, 0x00, /* KEY_9 */ - 0x02, 0xbd, 0x09, 0xf6, 0x27, 0x00, 0x00, /* KEY_0 */ - 0x02, 0xbd, 0x12, 0xed, 0x52, 0x00, 0x00, /* KEY_UP */ - 0x02, 0xbd, 0x17, 0xe8, 0x13, 0x00, 0x00, /* KEY_CAMERA */ - 0x02, 0xbd, 0x11, 0xee, 0x50, 0x00, 0x00, /* KEY_LEFT */ - 0x02, 0xbd, 0x15, 0xea, 0x28, 0x00, 0x00, /* KEY_OK */ - 0x02, 0xbd, 0x10, 0xef, 0x4f, 0x00, 0x00, /* KEY_RIGHT */ - 0x02, 0xbd, 0x18, 0xe7, 0x4b, 0x00, 0x00, /* KEY_CHANNELUP */ - 0x02, 0xbd, 0x13, 0xec, 0x51, 0x00, 0x00, /* KEY_DOWN */ - 0x02, 0xbd, 0x19, 0xe6, 0x15, 0x00, 0x00, /* KEY_RECORD */ - 0x02, 0xbd, 0x1a, 0xe5, 0x4e, 0x00, 0x00, /* KEY_CHANNELDOWN */ - 0x02, 0xbd, 0x0e, 0xf1, 0x56, 0x00, 0x00, /* KEY_VOLUMEDOWN */ - 0x02, 0xbd, 0x16, 0xe9, 0x1b, 0x00, 0x00, /* KEY_STOP */ - 0x02, 0xbd, 0x1c, 0xe3, 0x29, 0x00, 0x00, /* KEY_ESC */ - 0x02, 0xbd, 0x1f, 0xe0, 0x57, 0x00, 0x00, /* KEY_VOLUMEUP */ - 0x02, 0xbd, 0x44, 0xbb, 0x08, 0x00, 0x00, /* KEY_EPG */ - 0x02, 0xbd, 0x45, 0xba, 0x3d, 0x04, 0x00, /* KEY_POWER2 */ - 0x02, 0xbd, 0x0f, 0xf0, 0x2c, 0x00, 0x00, /* KEY_PLAYPAUSE */ +/* Uses NEC extended 0x02bd. Extended byte removed for compatibility... */ +static struct ir_scancode af9015_rc_terratec[] = { + { 0x0200, KEY_1 }, + { 0x0201, KEY_2 }, + { 0x0202, KEY_3 }, + { 0x0203, KEY_4 }, + { 0x0204, KEY_5 }, + { 0x0205, KEY_6 }, + { 0x0206, KEY_7 }, + { 0x0207, KEY_8 }, + { 0x0208, KEY_9 }, + { 0x0209, KEY_0 }, + { 0x020a, KEY_MUTE }, + { 0x020b, KEY_ZOOM }, /* symbol: PIP or zoom ? */ + { 0x020e, KEY_VOLUMEDOWN }, + { 0x020f, KEY_PLAYPAUSE }, + { 0x0210, KEY_RIGHT }, + { 0x0211, KEY_LEFT }, + { 0x0212, KEY_UP }, + { 0x0213, KEY_DOWN }, + { 0x0215, KEY_OK }, + { 0x0216, KEY_STOP }, + { 0x0217, KEY_CAMERA }, /* snapshot */ + { 0x0218, KEY_CHANNELUP }, + { 0x0219, KEY_RECORD }, + { 0x021a, KEY_CHANNELDOWN }, + { 0x021c, KEY_ESC }, + { 0x021f, KEY_VOLUMEUP }, + { 0x0244, KEY_EPG }, + { 0x0245, KEY_POWER2 }, /* [red power button] */ }; #endif -- 2.20.1