V4L/DVB: saa7134: Add support for both positive and negative edge IRQ
Subsystems (2)
PATCH 13/26 V4L/DVB: saa7134: Add support for both positive and negative edge IRQ
In reply to a message not in the archiveThe code that enables IRQ for the Remote Controller on saa7134 is a little
messy: it is outside saa7134-input, it checks if RC is GPIO based, and it mixes both serial raw decode with parallel reads from a hardware-based IR decoder.
Also, currently, it doesn't allow to trigger both transition edges at GPIO16 and GPIO18 lines. A rework on the code is needed to provide a better way to specify what saa7134-input needs, maybe even moving part of the code from saa7134-core and saa7134-cards into saa7134-input.
Yet, as a large rework is happening at RC core, it is better to wait until the core changes stablize, in order to rework saa7134 RC internals.While this don't happen, let's just change the logic a little bit to allow enabling IRQ to be generated on both edge transitions, in order to better support pulse/space raw decoders.
drivers/media/video/saa7134/saa7134-core.c +6 -4
@@ -701,10 +701,12 @@ static int saa7134_hw_enable2(struct saa7134_dev *dev)if (dev->has_remote ==SAA7134_REMOTE_GPIO && dev->remote) {if (dev->remote->mask_keydown &0x10000 ) irq2_mask |=SAA7134_IRQ2_INTE_GPIO16_N ; -else if (dev->remote->mask_keydown &0x40000 ) - irq2_mask |=SAA7134_IRQ2_INTE_GPIO18_P ; -else if (dev->remote->mask_keyup &0x40000 ) - irq2_mask |=SAA7134_IRQ2_INTE_GPIO18_N ; +else {/* Allow enabling both IRQ edge triggers */ +if (dev->remote->mask_keydown &0x40000 ) + irq2_mask |=SAA7134_IRQ2_INTE_GPIO18_P ; +if (dev->remote->mask_keyup &0x40000 ) + irq2_mask |=SAA7134_IRQ2_INTE_GPIO18_N ; + } }if (dev->has_remote ==SAA7134_REMOTE_I2C ) {
Signature · 1 line
1.6.6.1
PATCH 5/26 V4L/DVB: ir-common: Use macros to define the keytables
In reply to a message not in the archiveThe usage of macros ensures that the proper namespace is being used by all tables. It also makes easier to associate a keytable with the name used inside the drivers.
drivers/media/IR/ir-keymaps.c +128 -137
@@ -35,24 +35,15 @@* to define the proper IR_TYPE (IR_TYPE_RC5/IR_TYPE_NEC). * The deprecated tables should use IR_TYPE_UNKNOWN */ -#define IR_TABLE (irname, type, tabname) \ -struct ir_scancode_table tabname ## _table = { \ - .scan = tabname, \ - .size = ARRAY_SIZE(tabname), \ - .ir_type = type, \ - .name = #irname, \ -}; \ -EXPORT_SYMBOL_GPL(tabname ## _table) -/* empty keytable, can be used as placeholder for not-yet created keytables */ -static struct ir_scancode ir_codes_empty[] = { +static struct ir_scancode empty[] = { {0x2a ,KEY_COFFEE }, }; -IR_TABLE (empty,IR_TYPE_UNKNOWN , ir_codes_empty); +DEFINE_LEGACY_IR_KEYTABLE (empty);/* Michal Majchrowicz <[email protected]> */ -static struct ir_scancode ir_codes_proteus_2309[] = { +static struct ir_scancode proteus_2309[] = {/* numeric */ {0x00 ,KEY_0 }, {0x01 ,KEY_1 },
@@ -80,10 +71,10 @@ static struct ir_scancode ir_codes_proteus_2309[] = { { 0x1e, KEY_VOLUMEUP }, /* volume + */ { 0x14, KEY_F1 }, }; -IR_TABLE (proteus_2309,IR_TYPE_UNKNOWN , ir_codes_proteus_2309); +DEFINE_LEGACY_IR_KEYTABLE (proteus_2309);/* Matt Jesson <[email protected] */ -static struct ir_scancode ir_codes_avermedia_dvbt[] = { +static struct ir_scancode avermedia_dvbt[] = { {0x28 ,KEY_0 },/* '0' / 'enter' */ {0x22 ,KEY_1 },/* '1' */ { 0x12, KEY_2 }, /* '2' / 'up arrow' */
@@ -120,14 +111,14 @@ static struct ir_scancode ir_codes_avermedia_dvbt[] = { { 0x1e, KEY_VOLUMEDOWN }, /* 'volume -' */ { 0x3e, KEY_VOLUMEUP }, /* 'volume +' */ }; -IR_TABLE (avermedia_dvbt,IR_TYPE_UNKNOWN , ir_codes_avermedia_dvbt); +DEFINE_LEGACY_IR_KEYTABLE (avermedia_dvbt);/* * Avermedia M135A with IR model RM-JX * The same codes exist on both Positivo (BR) and original IR * Mauro Carvalho Chehab <[email protected]> */ -static struct ir_scancode ir_codes_avermedia_m135a_rm_jx[] = { +static struct ir_scancode avermedia_m135a_rm_jx[] = { {0x0200 ,KEY_POWER2 }, {0x022e ,KEY_DOT },/* '.' */ { 0x0201, KEY_MODE }, /* TV/FM or SOURCE */
@@ -172,10 +163,10 @@ static struct ir_scancode ir_codes_avermedia_m135a_rm_jx[] = { { 0x0218, KEY_PLAY }, { 0x021b, KEY_STOP }, }; -IR_TABLE (aver-m135a-RM -JX ,IR_TYPE_NEC , ir_codes_avermedia_m135a_rm_jx); +DEFINE_IR_KEYTABLE (avermedia_m135a_rm_jx,IR_TYPE_NEC );/* Oldrich Jedlicka <[email protected]> */ -static struct ir_scancode ir_codes_avermedia_cardbus[] = { +static struct ir_scancode avermedia_cardbus[] = { {0x00 ,KEY_POWER }, {0x01 ,KEY_TUNER },/* TV/FM */ { 0x03, KEY_TEXT }, /* Teletext */
@@ -231,10 +222,10 @@ static struct ir_scancode ir_codes_avermedia_cardbus[] = { { 0x42, KEY_CHANNELDOWN }, /* Channel down */ { 0x43, KEY_CHANNELUP }, /* Channel up */ }; -IR_TABLE (avermedia_cardbus,IR_TYPE_UNKNOWN , ir_codes_avermedia_cardbus); +DEFINE_LEGACY_IR_KEYTABLE (avermedia_cardbus);/* Attila Kondoros <[email protected]> */ -static struct ir_scancode ir_codes_apac_viewcomp[] = { +static struct ir_scancode apac_viewcomp[] = { {0x01 ,KEY_1 }, { 0x02, KEY_2 },
@@ -273,11 +264,11 @@ static struct ir_scancode ir_codes_apac_viewcomp[] = { { 0x0c, KEY_KPPLUS }, /* fine tune >>>> */ { 0x18, KEY_KPMINUS }, /* fine tune <<<< */ }; -IR_TABLE (apac_viewcomp,IR_TYPE_UNKNOWN , ir_codes_apac_viewcomp); +DEFINE_LEGACY_IR_KEYTABLE (apac_viewcomp);/* ---------------------------------------------------------------------- */ -static struct ir_scancode ir_codes_pixelview[] = { +static struct ir_scancode pixelview[] = { {0x1e ,KEY_POWER },/* power */ { 0x07, KEY_MEDIA }, /* source */
@@ -320,13 +311,13 @@ static struct ir_scancode ir_codes_pixelview[] = { { 0x1d, KEY_REFRESH }, /* reset */ { 0x18, KEY_MUTE }, /* mute/unmute */ }; -IR_TABLE (pixelview,IR_TYPE_UNKNOWN , ir_codes_pixelview); +DEFINE_LEGACY_IR_KEYTABLE (pixelview);/* Mauro Carvalho Chehab <[email protected]> present on PV MPEG 8000GT */ -static struct ir_scancode ir_codes_pixelview_new[] = { +static struct ir_scancode pixelview_new[] = { {0x3c ,KEY_TIME },/* Timeshift */ { 0x12, KEY_POWER },
@@ -365,9 +356,9 @@ static struct ir_scancode ir_codes_pixelview_new[] = { { 0x31, KEY_TV }, { 0x34, KEY_RADIO }, }; -IR_TABLE (pixelview_new,IR_TYPE_UNKNOWN , ir_codes_pixelview_new); +DEFINE_LEGACY_IR_KEYTABLE (pixelview_new); -static struct ir_scancode ir_codes_nebula[] = { +static struct ir_scancode nebula[] = { {0x00 ,KEY_0 }, {0x01 ,KEY_1 }, { 0x02, KEY_2 },
@@ -424,10 +415,10 @@ static struct ir_scancode ir_codes_nebula[] = { { 0x35, KEY_PHONE }, { 0x36, KEY_PC }, }; -IR_TABLE (nebula,IR_TYPE_UNKNOWN , ir_codes_nebula); +DEFINE_LEGACY_IR_KEYTABLE (nebula);/* DigitalNow DNTV Live DVB-T Remote */ -static struct ir_scancode ir_codes_dntv_live_dvb_t[] = { +static struct ir_scancode dntv_live_dvb_t[] = { {0x00 ,KEY_ESC },/* 'go up a level?' */ /* Keys 0 to 9 */ { 0x0a, KEY_0 },
@@ -464,12 +455,12 @@ static struct ir_scancode ir_codes_dntv_live_dvb_t[] = { { 0x1e, KEY_CHANNELDOWN }, { 0x1f, KEY_VOLUMEDOWN }, }; -IR_TABLE (dntv_live_dvb_t,IR_TYPE_UNKNOWN , ir_codes_dntv_live_dvb_t); +DEFINE_LEGACY_IR_KEYTABLE (dntv_live_dvb_t);/* ---------------------------------------------------------------------- */ /* IO-DATA BCTV7E Remote */ -static struct ir_scancode ir_codes_iodata_bctv7e[] = { +static struct ir_scancode iodata_bctv7e[] = { {0x40 ,KEY_TV }, {0x20 ,KEY_RADIO },/* FM */ { 0x60, KEY_EPG },
@@ -516,12 +507,12 @@ static struct ir_scancode ir_codes_iodata_bctv7e[] = { { 0x61, KEY_FASTFORWARD }, /* forward >> */ { 0x01, KEY_NEXT }, /* skip >| */ }; -IR_TABLE (iodata_bctv7e,IR_TYPE_UNKNOWN , ir_codes_iodata_bctv7e); +DEFINE_LEGACY_IR_KEYTABLE (iodata_bctv7e);/* ---------------------------------------------------------------------- */ /* ADS Tech Instant TV DVB-T PCI Remote */ -static struct ir_scancode ir_codes_adstech_dvb_t_pci[] = { +static struct ir_scancode adstech_dvb_t_pci[] = {/* Keys 0 to 9 */ {0x4d ,KEY_0 }, { 0x57, KEY_1 },
@@ -569,13 +560,13 @@ static struct ir_scancode ir_codes_adstech_dvb_t_pci[] = { { 0x15, KEY_VOLUMEUP }, { 0x1c, KEY_VOLUMEDOWN }, }; -IR_TABLE (adstech_dvb_t_pci,IR_TYPE_UNKNOWN , ir_codes_adstech_dvb_t_pci); +DEFINE_LEGACY_IR_KEYTABLE (adstech_dvb_t_pci);/* ---------------------------------------------------------------------- */ /* MSI TV@nywhere MASTER remote */ -static struct ir_scancode ir_codes_msi_tvanywhere[] = { +static struct ir_scancode msi_tvanywhere[] = {/* Keys 0 to 9 */ {0x00 ,KEY_0 }, { 0x01, KEY_1 },
@@ -603,7 +594,7 @@ static struct ir_scancode ir_codes_msi_tvanywhere[] = { { 0x1e, KEY_CHANNELDOWN }, { 0x1f, KEY_VOLUMEDOWN }, }; -IR_TABLE (msi_tvanywhere,IR_TYPE_UNKNOWN , ir_codes_msi_tvanywhere); +DEFINE_LEGACY_IR_KEYTABLE (msi_tvanywhere);/* ---------------------------------------------------------------------- */
@@ -622,7 +613,7 @@ IR_TABLE(msi_tvanywhere, IR_TYPE_UNKNOWN, ir_codes_msi_tvanywhere);*/ -static struct ir_scancode ir_codes_msi_tvanywhere_plus[] = { +static struct ir_scancode msi_tvanywhere_plus[] = {/* ---- Remote Button Layout ----
@@ -692,12 +683,12 @@ static struct ir_scancode ir_codes_msi_tvanywhere_plus[] = { { 0x0c, KEY_FASTFORWARD }, /* >> */ { 0x1d, KEY_RESTART }, /* Reset */ }; -IR_TABLE (msi_tvanywhere_plus,IR_TYPE_UNKNOWN , ir_codes_msi_tvanywhere_plus); +DEFINE_LEGACY_IR_KEYTABLE (msi_tvanywhere_plus);/* ---------------------------------------------------------------------- */ /* Cinergy 1400 DVB-T */ -static struct ir_scancode ir_codes_cinergy_1400[] = { +static struct ir_scancode cinergy_1400[] = { {0x01 ,KEY_POWER }, {0x02 ,KEY_1 }, { 0x03, KEY_2 },
@@ -740,12 +731,12 @@ static struct ir_scancode ir_codes_cinergy_1400[] = { { 0x48, KEY_STOP }, { 0x5c, KEY_NEXT }, }; -IR_TABLE (cinergy_1400,IR_TYPE_UNKNOWN , ir_codes_cinergy_1400); +DEFINE_LEGACY_IR_KEYTABLE (cinergy_1400);/* ---------------------------------------------------------------------- */ /* AVERTV STUDIO 303 Remote */ -static struct ir_scancode ir_codes_avertv_303[] = { +static struct ir_scancode avertv_303[] = { {0x2a ,KEY_1 }, {0x32 ,KEY_2 }, { 0x3a, KEY_3 },
@@ -789,12 +780,12 @@ static struct ir_scancode ir_codes_avertv_303[] = { { 0x13, KEY_DOWN }, { 0x1b, KEY_UP }, }; -IR_TABLE (avertv_303,IR_TYPE_UNKNOWN , ir_codes_avertv_303); +DEFINE_LEGACY_IR_KEYTABLE (avertv_303);/* ---------------------------------------------------------------------- */ /* DigitalNow DNTV Live! DVB-T Pro Remote */ -static struct ir_scancode ir_codes_dntv_live_dvbt_pro[] = { +static struct ir_scancode dntv_live_dvbt_pro[] = { {0x16 ,KEY_POWER }, { 0x5b, KEY_HOME },
@@ -850,9 +841,9 @@ static struct ir_scancode ir_codes_dntv_live_dvbt_pro[] = { { 0x5c, KEY_YELLOW }, { 0x5d, KEY_BLUE }, }; -IR_TABLE (dntv_live_dvbt_pro,IR_TYPE_UNKNOWN , ir_codes_dntv_live_dvbt_pro); +DEFINE_LEGACY_IR_KEYTABLE (dntv_live_dvbt_pro); -static struct ir_scancode ir_codes_em_terratec[] = { +static struct ir_scancode em_terratec[] = { {0x01 ,KEY_CHANNEL }, {0x02 ,KEY_SELECT }, { 0x03, KEY_MUTE },
@@ -882,9 +873,9 @@ static struct ir_scancode ir_codes_em_terratec[] = { { 0x1e, KEY_STOP }, { 0x40, KEY_ZOOM }, }; -IR_TABLE (em_terratec,IR_TYPE_UNKNOWN , ir_codes_em_terratec); +DEFINE_LEGACY_IR_KEYTABLE (em_terratec); -static struct ir_scancode ir_codes_pinnacle_grey[] = { +static struct ir_scancode pinnacle_grey[] = { {0x3a ,KEY_0 }, {0x31 ,KEY_1 }, { 0x32, KEY_2 },
@@ -934,9 +925,9 @@ static struct ir_scancode ir_codes_pinnacle_grey[] = { { 0x2a, KEY_MEDIA }, { 0x18, KEY_EPG }, }; -IR_TABLE (pinnacle_grey,IR_TYPE_UNKNOWN , ir_codes_pinnacle_grey); +DEFINE_LEGACY_IR_KEYTABLE (pinnacle_grey); -static struct ir_scancode ir_codes_flyvideo[] = { +static struct ir_scancode flyvideo[] = { {0x0f ,KEY_0 }, {0x03 ,KEY_1 }, { 0x04, KEY_2 },
@@ -967,9 +958,9 @@ static struct ir_scancode ir_codes_flyvideo[] = { { 0x1f, KEY_FORWARD }, /* Forward ( >>> ) */ { 0x0a, KEY_ANGLE }, /* no label, may be used as the PAUSE button */ }; -IR_TABLE (flyvideo,IR_TYPE_UNKNOWN , ir_codes_flyvideo); +DEFINE_LEGACY_IR_KEYTABLE (flyvideo); -static struct ir_scancode ir_codes_flydvb[] = { +static struct ir_scancode flydvb[] = { {0x01 ,KEY_ZOOM },/* Full Screen */ { 0x00, KEY_POWER }, /* Power */
@@ -1007,9 +998,9 @@ static struct ir_scancode ir_codes_flydvb[] = { { 0x11, KEY_STOP }, /* Stop */ { 0x0e, KEY_NEXT }, /* End >>| */ }; -IR_TABLE (flydvb,IR_TYPE_UNKNOWN , ir_codes_flydvb); +DEFINE_LEGACY_IR_KEYTABLE (flydvb); -static struct ir_scancode ir_codes_cinergy[] = { +static struct ir_scancode cinergy[] = { {0x00 ,KEY_0 }, {0x01 ,KEY_1 }, { 0x02, KEY_2 },
@@ -1048,11 +1039,11 @@ static struct ir_scancode ir_codes_cinergy[] = { { 0x22, KEY_PAUSE }, { 0x23, KEY_STOP }, }; -IR_TABLE (cinergy,IR_TYPE_UNKNOWN , ir_codes_cinergy); +DEFINE_LEGACY_IR_KEYTABLE (cinergy);/* Alfons Geser <[email protected]> * updates from Job D. R. Borges <[email protected]> */ -static struct ir_scancode ir_codes_eztv[] = { +static struct ir_scancode eztv[] = { {0x12 ,KEY_POWER }, {0x01 ,KEY_TV },/* DVR */ { 0x15, KEY_DVD }, /* DVD */
@@ -1106,10 +1097,10 @@ static struct ir_scancode ir_codes_eztv[] = { { 0x13, KEY_ENTER }, /* enter */ { 0x21, KEY_DOT }, /* . (decimal dot) */ }; -IR_TABLE (eztv,IR_TYPE_UNKNOWN , ir_codes_eztv); +DEFINE_LEGACY_IR_KEYTABLE (eztv);/* Alex Hermann <[email protected]> */ -static struct ir_scancode ir_codes_avermedia[] = { +static struct ir_scancode avermedia[] = { {0x28 ,KEY_1 }, {0x18 ,KEY_2 }, { 0x38, KEY_3 },
@@ -1154,9 +1145,9 @@ static struct ir_scancode ir_codes_avermedia[] = { { 0x11, KEY_CHANNELDOWN }, /* CHANNEL/PAGE- */ { 0x31, KEY_CHANNELUP } /* CHANNEL/PAGE+ */ }; -IR_TABLE (avermedia,IR_TYPE_UNKNOWN , ir_codes_avermedia); +DEFINE_LEGACY_IR_KEYTABLE (avermedia); -static struct ir_scancode ir_codes_videomate_tv_pvr[] = { +static struct ir_scancode videomate_tv_pvr[] = { {0x14 ,KEY_MUTE }, {0x24 ,KEY_ZOOM },
@@ -1204,7 +1195,7 @@ static struct ir_scancode ir_codes_videomate_tv_pvr[] = { { 0x20, KEY_LANGUAGE }, { 0x21, KEY_SLEEP }, }; -IR_TABLE (videomate_tv_pvr,IR_TYPE_UNKNOWN , ir_codes_videomate_tv_pvr); +DEFINE_LEGACY_IR_KEYTABLE (videomate_tv_pvr);/* Michael Tokarev <[email protected]> http://www.corpit.ru/mjt/beholdTV/remote_control.jpg
@@ -1215,7 +1206,7 @@ IR_TABLE(videomate_tv_pvr, IR_TYPE_UNKNOWN, ir_codes_videomate_tv_pvr);the button labels (several variants when appropriate) helps to descide which keycodes to assign to the buttons. */ -static struct ir_scancode ir_codes_manli[] = { +static struct ir_scancode manli[] = {/* 0x1c 0x12 * * FUNCTION POWER *
@@ -1301,10 +1292,10 @@ static struct ir_scancode ir_codes_manli[] = {/* 0x1d unused ? */ }; -IR_TABLE (manli,IR_TYPE_UNKNOWN , ir_codes_manli); +DEFINE_LEGACY_IR_KEYTABLE (manli);/* Mike Baikov <[email protected]> */ -static struct ir_scancode ir_codes_gotview7135[] = { +static struct ir_scancode gotview7135[] = { {0x11 ,KEY_POWER }, {0x35 ,KEY_TV },
@@ -1342,9 +1333,9 @@ static struct ir_scancode ir_codes_gotview7135[] = { { 0x1e, KEY_TIME }, /* TIMESHIFT */ { 0x38, KEY_F24 }, /* NORMAL TIMESHIFT */ }; -IR_TABLE (gotview7135,IR_TYPE_UNKNOWN , ir_codes_gotview7135); +DEFINE_LEGACY_IR_KEYTABLE (gotview7135); -static struct ir_scancode ir_codes_purpletv[] = { +static struct ir_scancode purpletv[] = { {0x03 ,KEY_POWER }, {0x6f ,KEY_MUTE }, { 0x10, KEY_BACKSPACE }, /* Recall */
@@ -1386,13 +1377,13 @@ static struct ir_scancode ir_codes_purpletv[] = { { 0x42, KEY_REWIND }, /* Backward ? */ }; -IR_TABLE (purpletv,IR_TYPE_UNKNOWN , ir_codes_purpletv); +DEFINE_LEGACY_IR_KEYTABLE (purpletv);/* Mapping for the 28 key remote control as seen at http://www.sednacomputer.com/photo/cardbus-tv.jpg Pavel Mihaylov <[email protected]> Also for the remote bundled with Kozumi KTV-01C card */ -static struct ir_scancode ir_codes_pctv_sedna[] = { +static struct ir_scancode pctv_sedna[] = { {0x00 ,KEY_0 }, {0x01 ,KEY_1 }, { 0x02, KEY_2 },
@@ -1428,10 +1419,10 @@ static struct ir_scancode ir_codes_pctv_sedna[] = { { 0x17, KEY_DIGITS }, /* Plus */ { 0x1f, KEY_PLAY }, /* Play */ }; -IR_TABLE (pctv_sedna,IR_TYPE_UNKNOWN , ir_codes_pctv_sedna); +DEFINE_LEGACY_IR_KEYTABLE (pctv_sedna);/* Mark Phalan <[email protected]> */ -static struct ir_scancode ir_codes_pv951[] = { +static struct ir_scancode pv951[] = { {0x00 ,KEY_0 }, {0x01 ,KEY_1 }, { 0x02, KEY_2 },
@@ -1468,12 +1459,12 @@ static struct ir_scancode ir_codes_pv951[] = { { 0x14, KEY_EQUAL }, /* SYNC */ { 0x1c, KEY_MEDIA }, /* PC/TV */ }; -IR_TABLE (pv951,IR_TYPE_UNKNOWN , ir_codes_pv951); +DEFINE_LEGACY_IR_KEYTABLE (pv951);/* generic RC5 keytable */ /* see http://users.pandora.be/nenya/electronics/rc5/codes00.htm */ /* used by old (black) Hauppauge remotes */ -static struct ir_scancode ir_codes_rc5_tv[] = { +static struct ir_scancode rc5_tv[] = {/* Keys 0 to 9 */ {0x00 ,KEY_0 }, { 0x01, KEY_1 },
@@ -1511,10 +1502,10 @@ static struct ir_scancode ir_codes_rc5_tv[] = { { 0x3d, KEY_SUSPEND }, /* system standby */ }; -IR_TABLE (rc5_tv,IR_TYPE_UNKNOWN , ir_codes_rc5_tv); +DEFINE_LEGACY_IR_KEYTABLE (rc5_tv);/* Table for Leadtek Winfast Remote Controls - used by both bttv and cx88 */ -static struct ir_scancode ir_codes_winfast[] = { +static struct ir_scancode winfast[] = {/* Keys 0 to 9 */ {0x12 ,KEY_0 }, { 0x05, KEY_1 },
@@ -1575,9 +1566,9 @@ static struct ir_scancode ir_codes_winfast[] = { { 0x3b, KEY_F23 }, /* MCE +CH, on Y04G0033 */ { 0x3f, KEY_F24 } /* MCE -CH, on Y04G0033 */ }; -IR_TABLE (winfast,IR_TYPE_UNKNOWN , ir_codes_winfast); +DEFINE_LEGACY_IR_KEYTABLE (winfast); -static struct ir_scancode ir_codes_pinnacle_color[] = { +static struct ir_scancode pinnacle_color[] = { {0x59 ,KEY_MUTE }, {0x4a ,KEY_POWER },
@@ -1632,12 +1623,12 @@ static struct ir_scancode ir_codes_pinnacle_color[] = { { 0x74, KEY_CHANNEL }, { 0x0a, KEY_BACKSPACE }, }; -IR_TABLE (pinnacle_color,IR_TYPE_UNKNOWN , ir_codes_pinnacle_color); +DEFINE_LEGACY_IR_KEYTABLE (pinnacle_color);/* Hauppauge: the newer, gray remotes (seems there are multiple * slightly different versions), shipped with cx88+ivtv cards. * almost rc5 coding, but some non-standard keys */ -static struct ir_scancode ir_codes_hauppauge_new[] = { +static struct ir_scancode hauppauge_new[] = {/* Keys 0 to 9 */ {0x00 ,KEY_0 }, { 0x01, KEY_1 },
@@ -1694,9 +1685,9 @@ static struct ir_scancode ir_codes_hauppauge_new[] = { { 0x3c, KEY_ZOOM }, /* full */ { 0x3d, KEY_POWER }, /* system power (green button) */ }; -IR_TABLE (hauppauge_new,IR_TYPE_UNKNOWN , ir_codes_hauppauge_new); +DEFINE_LEGACY_IR_KEYTABLE (hauppauge_new); -static struct ir_scancode ir_codes_npgtech[] = { +static struct ir_scancode npgtech[] = { {0x1d ,KEY_SWITCHVIDEOMODE },/* switch inputs */ { 0x2a, KEY_FRONT },
@@ -1737,12 +1728,12 @@ static struct ir_scancode ir_codes_npgtech[] = { { 0x10, KEY_POWER }, }; -IR_TABLE (npgtech,IR_TYPE_UNKNOWN , ir_codes_npgtech); +DEFINE_LEGACY_IR_KEYTABLE (npgtech);/* Norwood Micro (non-Pro) TV Tuner By Peter Naulls <[email protected]> Key comments are the functions given in the manual */ -static struct ir_scancode ir_codes_norwood[] = { +static struct ir_scancode norwood[] = {/* Keys 0 to 9 */ {0x20 ,KEY_0 }, { 0x21, KEY_1 },
@@ -1784,14 +1775,14 @@ static struct ir_scancode ir_codes_norwood[] = { { 0x34, KEY_RADIO }, /* FM */ { 0x65, KEY_POWER }, /* Computer power */ }; -IR_TABLE (norwood,IR_TYPE_UNKNOWN , ir_codes_norwood); +DEFINE_LEGACY_IR_KEYTABLE (norwood);/* From reading the following remotes: * Zenith Universal 7 / TV Mode 807 / VCR Mode 837 * Hauppauge (from NOVA-CI-s box product) * This is a "middle of the road" approach, differences are noted */ -static struct ir_scancode ir_codes_budget_ci_old[] = { +static struct ir_scancode budget_ci_old[] = { {0x00 ,KEY_0 }, {0x01 ,KEY_1 }, { 0x02, KEY_2 },
@@ -1838,14 +1829,14 @@ static struct ir_scancode ir_codes_budget_ci_old[] = { { 0x3d, KEY_POWER2 }, { 0x3e, KEY_TUNER }, }; -IR_TABLE (budget_ci_old,IR_TYPE_UNKNOWN , ir_codes_budget_ci_old); +DEFINE_LEGACY_IR_KEYTABLE (budget_ci_old);/* * Marc Fargas <[email protected]> * this is the remote control that comes with the asus p7131 * which has a label saying is "Model PC-39" */ -static struct ir_scancode ir_codes_asus_pc39[] = { +static struct ir_scancode asus_pc39[] = {/* Keys 0 to 9 */ {0x15 ,KEY_0 }, { 0x29, KEY_1 },
@@ -1891,11 +1882,11 @@ static struct ir_scancode ir_codes_asus_pc39[] = { { 0x3d, KEY_MUTE }, /* mute */ { 0x01, KEY_DVD }, /* dvd */ }; -IR_TABLE (asus_pc39,IR_TYPE_UNKNOWN , ir_codes_asus_pc39); +DEFINE_LEGACY_IR_KEYTABLE (asus_pc39);/* Encore ENLTV-FM - black plastic, white front cover with white glowing buttons Juan Pablo Sormani <[email protected]> */ -static struct ir_scancode ir_codes_encore_enltv[] = { +static struct ir_scancode encore_enltv[] = {/* Power button does nothing, neither in Windows app, although it sends data (used for BIOS wakeup?) */
@@ -1965,11 +1956,11 @@ static struct ir_scancode ir_codes_encore_enltv[] = { { 0x47, KEY_YELLOW }, /* AP3 */ { 0x57, KEY_BLUE }, /* AP4 */ }; -IR_TABLE (encore_enltv,IR_TYPE_UNKNOWN , ir_codes_encore_enltv); +DEFINE_LEGACY_IR_KEYTABLE (encore_enltv);/* Encore ENLTV2-FM - silver plastic - "Wand Media" written at the botton Mauro Carvalho Chehab <[email protected]> */ -static struct ir_scancode ir_codes_encore_enltv2[] = { +static struct ir_scancode encore_enltv2[] = { {0x4c ,KEY_POWER2 }, {0x4a ,KEY_TUNER }, { 0x40, KEY_1 },
@@ -2017,10 +2008,10 @@ static struct ir_scancode ir_codes_encore_enltv2[] = { { 0x7d, KEY_FORWARD }, { 0x79, KEY_STOP }, }; -IR_TABLE (encore_enltv2,IR_TYPE_UNKNOWN , ir_codes_encore_enltv2); +DEFINE_LEGACY_IR_KEYTABLE (encore_enltv2);/* for the Technotrend 1500 bundled remotes (grey and black): */ -static struct ir_scancode ir_codes_tt_1500[] = { +static struct ir_scancode tt_1500[] = { {0x01 ,KEY_POWER }, {0x02 ,KEY_SHUFFLE },/* ? double-arrow key */ { 0x03, KEY_1 },
@@ -2061,10 +2052,10 @@ static struct ir_scancode ir_codes_tt_1500[] = { { 0x3e, KEY_PAUSE }, { 0x3f, KEY_FORWARD }, }; -IR_TABLE (tt_1500,IR_TYPE_UNKNOWN , ir_codes_tt_1500); +DEFINE_LEGACY_IR_KEYTABLE (tt_1500);/* DViCO FUSION HDTV MCE remote */ -static struct ir_scancode ir_codes_fusionhdtv_mce[] = { +static struct ir_scancode fusionhdtv_mce[] = { {0x0b ,KEY_1 }, { 0x17, KEY_2 },
@@ -2121,10 +2112,10 @@ static struct ir_scancode ir_codes_fusionhdtv_mce[] = { { 0x01, KEY_RECORD }, { 0x4e, KEY_POWER }, }; -IR_TABLE (fusionhdtv_mce,IR_TYPE_UNKNOWN , ir_codes_fusionhdtv_mce); +DEFINE_LEGACY_IR_KEYTABLE (fusionhdtv_mce);/* Pinnacle PCTV HD 800i mini remote */ -static struct ir_scancode ir_codes_pinnacle_pctv_hd[] = { +static struct ir_scancode pinnacle_pctv_hd[] = { {0x0f ,KEY_1 }, { 0x15, KEY_2 },
@@ -2156,7 +2147,7 @@ static struct ir_scancode ir_codes_pinnacle_pctv_hd[] = { { 0x36, KEY_RECORD }, { 0x3f, KEY_EPG }, /* Labeled "?" */ }; -IR_TABLE (pinnacle_pctv_hd,IR_TYPE_UNKNOWN , ir_codes_pinnacle_pctv_hd); +DEFINE_LEGACY_IR_KEYTABLE (pinnacle_pctv_hd);/* * Igor Kuznetsov <[email protected]>
@@ -2169,7 +2160,7 @@ IR_TABLE(pinnacle_pctv_hd, IR_TYPE_UNKNOWN, ir_codes_pinnacle_pctv_hd);* the button labels (several variants when appropriate) * helps to descide which keycodes to assign to the buttons. */ -static struct ir_scancode ir_codes_behold[] = { +static struct ir_scancode behold[] = {/* 0x1c 0x12 * * TV/FM POWER *
@@ -2259,7 +2250,7 @@ static struct ir_scancode ir_codes_behold[] = { { 0x5c, KEY_CAMERA }, }; -IR_TABLE (behold,IR_TYPE_UNKNOWN , ir_codes_behold); +DEFINE_LEGACY_IR_KEYTABLE (behold);/* Beholder Intl. Ltd. 2008 * Dmitry Belimov [email protected]
@@ -2269,7 +2260,7 @@ IR_TABLE(behold, IR_TYPE_UNKNOWN, ir_codes_behold);* the button labels (several variants when appropriate) * helps to descide which keycodes to assign to the buttons. */ -static struct ir_scancode ir_codes_behold_columbus[] = { +static struct ir_scancode behold_columbus[] = {/* 0x13 0x11 0x1C 0x12 * * Mute Source TV/FM Power *
@@ -2329,13 +2320,13 @@ static struct ir_scancode ir_codes_behold_columbus[] = { { 0x1A, KEY_NEXT }, }; -IR_TABLE (behold_columbus,IR_TYPE_UNKNOWN , ir_codes_behold_columbus); +DEFINE_LEGACY_IR_KEYTABLE (behold_columbus);/* * Remote control for the Genius TVGO A11MCE * Adrian Pardini <[email protected]> */ -static struct ir_scancode ir_codes_genius_tvgo_a11mce[] = { +static struct ir_scancode genius_tvgo_a11mce[] = {/* Keys 0 to 9 */ {0x48 ,KEY_0 }, { 0x09, KEY_1 },
@@ -2375,13 +2366,13 @@ static struct ir_scancode ir_codes_genius_tvgo_a11mce[] = { { 0x13, KEY_YELLOW }, { 0x50, KEY_BLUE }, }; -IR_TABLE (genius_tvgo_a11mce,IR_TYPE_UNKNOWN , ir_codes_genius_tvgo_a11mce); +DEFINE_LEGACY_IR_KEYTABLE (genius_tvgo_a11mce);/* * Remote control for Powercolor Real Angel 330 * Daniel Fraga <[email protected]> */ -static struct ir_scancode ir_codes_powercolor_real_angel[] = { +static struct ir_scancode powercolor_real_angel[] = { {0x38 ,KEY_SWITCHVIDEOMODE },/* switch inputs */ {0x0c ,KEY_MEDIA },/* Turn ON/OFF App */ { 0x00, KEY_0 },
@@ -2418,12 +2409,12 @@ static struct ir_scancode ir_codes_powercolor_real_angel[] = { { 0x14, KEY_RADIO }, /* FM radio */ { 0x25, KEY_POWER }, /* power */ }; -IR_TABLE (powercolor_real_angel,IR_TYPE_UNKNOWN , ir_codes_powercolor_real_angel); +DEFINE_LEGACY_IR_KEYTABLE (powercolor_real_angel);/* Kworld Plus TV Analog Lite PCI IR Mauro Carvalho Chehab <[email protected]> */ -static struct ir_scancode ir_codes_kworld_plus_tv_analog[] = { +static struct ir_scancode kworld_plus_tv_analog[] = { {0x0c ,KEY_PROG1 },/* Kworld key */ {0x16 ,KEY_CLOSECD },/* -> ) */ { 0x1d, KEY_POWER2 },
@@ -2479,12 +2470,12 @@ static struct ir_scancode ir_codes_kworld_plus_tv_analog[] = { { 0x18, KEY_RED}, /* B */ { 0x23, KEY_GREEN}, /* C */ }; -IR_TABLE (kworld_plus_tv_analog,IR_TYPE_UNKNOWN , ir_codes_kworld_plus_tv_analog); +DEFINE_LEGACY_IR_KEYTABLE (kworld_plus_tv_analog);/* Kaiomy TVnPC U2 Mauro Carvalho Chehab <[email protected]> */ -static struct ir_scancode ir_codes_kaiomy[] = { +static struct ir_scancode kaiomy[] = { {0x43 ,KEY_POWER2 }, {0x01 ,KEY_LIST }, { 0x0b, KEY_ZOOM},
@@ -2528,9 +2519,9 @@ static struct ir_scancode ir_codes_kaiomy[] = { { 0x1e, KEY_YELLOW}, { 0x1f, KEY_BLUE}, }; -IR_TABLE (kaiomy,IR_TYPE_UNKNOWN , ir_codes_kaiomy); +DEFINE_LEGACY_IR_KEYTABLE (kaiomy); -static struct ir_scancode ir_codes_avermedia_a16d[] = { +static struct ir_scancode avermedia_a16d[] = { {0x20 ,KEY_LIST }, {0x00 ,KEY_POWER }, { 0x28, KEY_1},
@@ -2566,12 +2557,12 @@ static struct ir_scancode ir_codes_avermedia_a16d[] = { { 0x08, KEY_EPG}, { 0x2a, KEY_MENU}, }; -IR_TABLE (avermedia_a16d,IR_TYPE_UNKNOWN , ir_codes_avermedia_a16d); +DEFINE_LEGACY_IR_KEYTABLE (avermedia_a16d);/* Encore ENLTV-FM v5.3 Mauro Carvalho Chehab <[email protected]> */ -static struct ir_scancode ir_codes_encore_enltv_fm53[] = { +static struct ir_scancode encore_enltv_fm53[] = { {0x10 ,KEY_POWER2 }, { 0x06, KEY_MUTE},
@@ -2609,10 +2600,10 @@ static struct ir_scancode ir_codes_encore_enltv_fm53[] = { { 0x0c, KEY_ZOOM}, /* hide pannel */ { 0x47, KEY_SLEEP}, /* shutdown */ }; -IR_TABLE (encore_enltv_fm53,IR_TYPE_UNKNOWN , ir_codes_encore_enltv_fm53); +DEFINE_LEGACY_IR_KEYTABLE (encore_enltv_fm53);/* Zogis Real Audio 220 - 32 keys IR */ -static struct ir_scancode ir_codes_real_audio_220_32_keys[] = { +static struct ir_scancode real_audio_220_32_keys[] = { {0x1c ,KEY_RADIO }, { 0x12, KEY_POWER2},
@@ -2649,12 +2640,12 @@ static struct ir_scancode ir_codes_real_audio_220_32_keys[] = { { 0x19, KEY_CAMERA}, /* Snapshot */ }; -IR_TABLE (real_audio_220_32_keys,IR_TYPE_UNKNOWN , ir_codes_real_audio_220_32_keys); +DEFINE_LEGACY_IR_KEYTABLE (real_audio_220_32_keys);/* ATI TV Wonder HD 600 USB Devin Heitmueller <[email protected]> */ -static struct ir_scancode ir_codes_ati_tv_wonder_hd_600[] = { +static struct ir_scancode ati_tv_wonder_hd_600[] = { {0x00 ,KEY_RECORD },/* Row 1 */ {0x01 ,KEY_PLAYPAUSE }, { 0x02, KEY_STOP},
@@ -2680,12 +2671,12 @@ static struct ir_scancode ir_codes_ati_tv_wonder_hd_600[] = { { 0x16, KEY_MUTE}, { 0x17, KEY_VOLUMEDOWN}, }; -IR_TABLE (ati_tv_wonder_hd_600,IR_TYPE_UNKNOWN , ir_codes_ati_tv_wonder_hd_600); +DEFINE_LEGACY_IR_KEYTABLE (ati_tv_wonder_hd_600);/* DVBWorld remotes Igor M. Liplianin <[email protected]> */ -static struct ir_scancode ir_codes_dm1105_nec[] = { +static struct ir_scancode dm1105_nec[] = { {0x0a ,KEY_POWER2 },/* power */ {0x0c ,KEY_MUTE },/* mute */ { 0x11, KEY_1},
@@ -2718,9 +2709,9 @@ static struct ir_scancode ir_codes_dm1105_nec[] = { { 0x1e, KEY_TV}, /* tvmode */ { 0x1b, KEY_B}, /* recall */ }; -IR_TABLE (dm1105_nec,IR_TYPE_UNKNOWN , ir_codes_dm1105_nec); +DEFINE_LEGACY_IR_KEYTABLE (dm1105_nec); -static struct ir_scancode ir_codes_tevii_nec[] = { +static struct ir_scancode tevii_nec[] = { {0x0a ,KEY_POWER2 }, {0x0c ,KEY_MUTE }, { 0x11, KEY_1},
@@ -2769,9 +2760,9 @@ static struct ir_scancode ir_codes_tevii_nec[] = { { 0x56, KEY_MODE}, { 0x58, KEY_SWITCHVIDEOMODE}, }; -IR_TABLE (tevii_nec,IR_TYPE_UNKNOWN , ir_codes_tevii_nec); +DEFINE_LEGACY_IR_KEYTABLE (tevii_nec); -static struct ir_scancode ir_codes_tbs_nec[] = { +static struct ir_scancode tbs_nec[] = { {0x04 ,KEY_POWER2 },/*power*/ {0x14 ,KEY_MUTE },/*mute*/ { 0x07, KEY_1},
@@ -2805,12 +2796,12 @@ static struct ir_scancode ir_codes_tbs_nec[] = { { 0x00, KEY_PREVIOUS}, { 0x1b, KEY_MODE}, }; -IR_TABLE (tbs_nec,IR_TYPE_UNKNOWN , ir_codes_tbs_nec); +DEFINE_LEGACY_IR_KEYTABLE (tbs_nec);/* Terratec Cinergy Hybrid T USB XS Devin Heitmueller <[email protected]> */ -static struct ir_scancode ir_codes_terratec_cinergy_xs[] = { +static struct ir_scancode terratec_cinergy_xs[] = { {0x41 ,KEY_HOME }, {0x01 ,KEY_POWER }, { 0x42, KEY_MENU},
@@ -2859,12 +2850,12 @@ static struct ir_scancode ir_codes_terratec_cinergy_xs[] = { { 0x4f, KEY_FASTFORWARD}, { 0x5c, KEY_NEXT}, }; -IR_TABLE (terratec_cinergy_xs,IR_TYPE_UNKNOWN , ir_codes_terratec_cinergy_xs); +DEFINE_LEGACY_IR_KEYTABLE (terratec_cinergy_xs);/* EVGA inDtube Devin Heitmueller <[email protected]> */ -static struct ir_scancode ir_codes_evga_indtube[] = { +static struct ir_scancode evga_indtube[] = { {0x12 ,KEY_POWER }, {0x02 ,KEY_MODE },/* TV */ { 0x14, KEY_MUTE},
@@ -2882,9 +2873,9 @@ static struct ir_scancode ir_codes_evga_indtube[] = { { 0x1f, KEY_NEXT}, { 0x13, KEY_CAMERA}, }; -IR_TABLE (evga_indtube,IR_TYPE_UNKNOWN , ir_codes_evga_indtube); +DEFINE_LEGACY_IR_KEYTABLE (evga_indtube); -static struct ir_scancode ir_codes_videomate_s350[] = { +static struct ir_scancode videomate_s350[] = { {0x00 ,KEY_TV }, {0x01 ,KEY_DVD }, { 0x04, KEY_RECORD},
@@ -2930,12 +2921,12 @@ static struct ir_scancode ir_codes_videomate_s350[] = { { 0x11, KEY_ENTER}, { 0x20, KEY_TEXT}, }; -IR_TABLE (videomate_s350,IR_TYPE_UNKNOWN , ir_codes_videomate_s350); +DEFINE_LEGACY_IR_KEYTABLE (videomate_s350);/* GADMEI UTV330+ RM008Z remote Shine Liu <[email protected]> */ -static struct ir_scancode ir_codes_gadmei_rm008z[] = { +static struct ir_scancode gadmei_rm008z[] = { {0x14 ,KEY_POWER2 },/* POWER OFF */ { 0x0c, KEY_MUTE}, /* MUTE */
@@ -2973,7 +2964,7 @@ static struct ir_scancode ir_codes_gadmei_rm008z[] = { { 0x13, KEY_CHANNELDOWN}, /* CHANNELDOWN */ { 0x15, KEY_ENTER}, /* OK */ }; -IR_TABLE (gadmei_rm008z,IR_TYPE_UNKNOWN , ir_codes_gadmei_rm008z); +DEFINE_LEGACY_IR_KEYTABLE (gadmei_rm008z);/************************************************************* * COMPLETE SCANCODE TABLES
@@ -2987,7 +2978,7 @@ IR_TABLE(gadmei_rm008z, IR_TYPE_UNKNOWN, ir_codes_gadmei_rm008z);* * This table contains the complete RC5 code, instead of just the data part */ -static struct ir_scancode ir_codes_rc5_hauppauge_new[] = { +static struct ir_scancode rc5_hauppauge_new[] = {/* Keys 0 to 9 */ {0x1e00 ,KEY_0 }, {0x1e01 ,KEY_1 },
@@ -3044,12 +3035,12 @@ static struct ir_scancode ir_codes_rc5_hauppauge_new[] = { { 0x1e3c, KEY_ZOOM }, /* full */ { 0x1e3d, KEY_POWER }, /* system power (green button) */ }; -IR_TABLE (rc5_hauppauge_new,IR_TYPE_RC5 , ir_codes_rc5_hauppauge_new); +DEFINE_IR_KEYTABLE (rc5_hauppauge_new,IR_TYPE_RC5 );/* Terratec Cinergy Hybrid T USB XS FM Mauro Carvalho Chehab <[email protected]> */ -static struct ir_scancode ir_codes_nec_terratec_cinergy_xs[] = { +static struct ir_scancode nec_terratec_cinergy_xs[] = { {0x1441 ,KEY_HOME }, { 0x1401, KEY_POWER2},
@@ -3111,12 +3102,12 @@ static struct ir_scancode ir_codes_nec_terratec_cinergy_xs[] = { { 0x144f, KEY_FASTFORWARD}, { 0x145c, KEY_NEXT}, }; -IR_TABLE (nec_terratec_cinergy_xs,IR_TYPE_NEC , ir_codes_nec_terratec_cinergy_xs); +DEFINE_IR_KEYTABLE (nec_terratec_cinergy_xs,IR_TYPE_NEC );/* Leadtek Winfast TV USB II Deluxe remote Magnus Alm <[email protected]> */ -static struct ir_scancode ir_codes_winfast_usbii_deluxe[] = { +static struct ir_scancode winfast_usbii_deluxe[] = { {0x62 ,KEY_0 }, {0x75 ,KEY_1 }, { 0x76, KEY_2},
@@ -3155,11 +3146,11 @@ static struct ir_scancode ir_codes_winfast_usbii_deluxe[] = { { 0x63, KEY_ENTER}, /* ENTER */ }; -IR_TABLE (winfast_usbii_deluxe,IR_TYPE_UNKNOWN , ir_codes_winfast_usbii_deluxe); +DEFINE_LEGACY_IR_KEYTABLE (winfast_usbii_deluxe);/* Kworld 315U */ -static struct ir_scancode ir_codes_kworld_315u[] = { +static struct ir_scancode kworld_315u[] = { {0x6143 ,KEY_POWER }, {0x6101 ,KEY_TUNER },/* source */ { 0x610b, KEY_ZOOM },
@@ -3200,4 +3191,4 @@ static struct ir_scancode ir_codes_kworld_315u[] = { { 0x611e, KEY_YELLOW }, { 0x611f, KEY_BLUE }, }; -IR_TABLE (kworld_315u,IR_TYPE_NEC , ir_codes_kworld_315u); +DEFINE_IR_KEYTABLE (kworld_315u,IR_TYPE_NEC );
include/media/ir-common.h +13 -1
@@ -107,11 +107,23 @@ void ir_rc5_timer_keyup(unsigned long data);/* scancode->keycode map tables from ir-keymaps.c */ #define IR_KEYTABLE (a) \ -(ir_codes_ ## a ## _table) +ir_codes_ ## a ## _table#define DECLARE_IR_KEYTABLE (a) \ extern struct ir_scancode_table IR_KEYTABLE(a) +#define DEFINE_IR_KEYTABLE (tabname, type) \ +struct ir_scancode_table IR_KEYTABLE(tabname) = { \ + .scan = tabname, \ + .size = ARRAY_SIZE(tabname), \ + .ir_type = type, \ + .name = #tabname, \ +}; \ +EXPORT_SYMBOL_GPL(IR_KEYTABLE(tabname)) + +#define DEFINE_LEGACY_IR_KEYTABLE (tabname) \ + DEFINE_IR_KEYTABLE(tabname, IR_TYPE_UNKNOWN) +DECLARE_IR_KEYTABLE (adstech_dvb_t_pci);DECLARE_IR_KEYTABLE (apac_viewcomp);DECLARE_IR_KEYTABLE (asus_pc39);
Signature · 1 line
1.6.6.1
PATCH 26/26 V4L/DVB: ir-rc5-decoder: fix state machine
In reply to a message not in the archiveReimplement the RC-5 decoder state machine. Code is now clear, and works properly. It is also simpler than the previous implementations.
drivers/media/IR/ir-rc5-decoder.c +51 -108
@@ -15,19 +15,17 @@/* * This code only handles 14 bits RC-5 protocols. There are other variants * that use a different number of bits. This is currently unsupported +* It considers a carrier of 36 kHz, with a total of 14 bits, where +* the first two bits are start bits, and a third one is a filing bit */ #include <media/ir-core.h> +static unsigned int ir_rc5_remote_gap =888888 ; +#define RC5_NBITS 14 -#define RC5_HALFBIT 888888/* ns */ -#define RC5_BIT (RC5_HALFBIT * 2) -#define RC5_DURATION (RC5_BIT * RC5_NBITS) - -#define is_rc5_halfbit (nsec) ((ev->delta.tv_nsec >= RC5_HALFBIT / 2) && \ - (ev->delta.tv_nsec < RC5_HALFBIT + RC5_HALFBIT / 2)) - -#define n_half (nsec) ((ev->delta.tv_nsec + RC5_HALFBIT / 2) / RC5_HALFBIT) +#define RC5_BIT (ir_rc5_remote_gap * 2) +#define RC5_DURATION (ir_rc5_remote_gap * RC5_NBITS)/* Used to register rc5_decoder clients */ static LIST_HEAD (decoder_list);
@@ -35,19 +33,8 @@ static spinlock_t decoder_lock;enum rc5_state {STATE_INACTIVE , -STATE_START2_SPACE , -STATE_START2_MARK ,STATE_MARKSPACE , -STATE_TRAILER_MARK , -}; - -static char *st_name[] = { -"Inactive" , -"start2 sapce" , -"start2 mark" , -"mark" , -"space" , -"trailer" +STATE_TRAILER , };struct rc5_code {
@@ -63,8 +50,7 @@ struct decoder_data {/* State machine control */ enum rc5_state state;struct rc5_code rc5_code; -unsigned n_half; -unsigned count; +unsigned code, elapsed, last_bit, last_code; };
@@ -147,7 +133,7 @@ static int ir_rc5_decode(struct input_dev *input_dev, {struct decoder_data *data;struct ir_input_dev *ir_dev =input_get_drvdata (input_dev); -int bit, last_bit, n_half; +int is_pulse, scancode, delta, toggle; data =get_decoder_data (ir_dev);if (!data)
@@ -156,122 +142,79 @@ static int ir_rc5_decode(struct input_dev *input_dev,if (!data->enabled)return 0 ; -/* Except for the initial event, what matters is the previous bit */ - bit = (ev->type &IR_PULSE ) ?1 :0 ; + delta =DIV_ROUND_CLOSEST (ev->delta.tv_nsec, ir_rc5_remote_gap); - last_bit = !bit; - -/* Discards spurious space last_bits when inactive */ +/* The duration time refers to the last bit time */ + is_pulse = (ev->type &IR_PULSE ) ?1 :0 ;/* Very long delays are considered as start events */ -if (ev->delta.tv_nsec >RC5_DURATION +RC5_HALFBIT /2 ) - data->state =STATE_INACTIVE ; - -if (ev->type &IR_START_EVENT ) +if (delta >RC5_DURATION || (ev->type &IR_START_EVENT )) data->state =STATE_INACTIVE ;switch (data->state) {case STATE_INACTIVE : -IR_dprintk (1 ,"currently inative. Received bit (%s) @%luus\n" , - last_bit ?"pulse" :"space" , - (ev->delta.tv_nsec +500 ) /1000 ); +IR_dprintk (2 ,"currently inative. Start bit (%s) @%uus\n" , + is_pulse ?"pulse" :"space" , + (unsigned )(ev->delta.tv_nsec +500 ) /1000 );/* Discards the initial start space */ -if (bit) -return 0 ; - data->count =0 ; - data->n_half =0 ; -memset (&data->rc5_code,0 ,sizeof (data->rc5_code)); - - data->state =STATE_START2_SPACE ; -return 0 ; -case STATE_START2_SPACE : -if (last_bit) +if (!is_pulse) goto err; -if (!is_rc5_halfbit (ev->delta.tv_nsec)) - goto err; - data->state =STATE_START2_MARK ; -return 0 ; -case STATE_START2_MARK : -if (!last_bit) - goto err; - -if (!is_rc5_halfbit (ev->delta.tv_nsec)) - goto err; - + data->code =1 ; + data->last_bit =1 ; + data->elapsed =0 ; +memset (&data->rc5_code,0 ,sizeof (data->rc5_code)); data->state =STATE_MARKSPACE ;return 0 ;case STATE_MARKSPACE : - n_half =n_half (ev->delta.tv_nsec); -if (n_half <1 || n_half >3 ) { -IR_dprintk (1 ,"Decode failed at %d-th bit (%s) @%luus\n" , - data->count, - last_bit ?"pulse" :"space" , - (ev->delta.tv_nsec +500 ) /1000 ); -printk ("%d halves\n" , n_half); - goto err2; - } - data->n_half += n_half; +if (delta !=1 ) + data->last_bit = data->last_bit ?0 :1 ; -if (!last_bit) + data->elapsed += delta; + +if ((data->elapsed %2 ) ==1 )return 0 ; -/* Got one complete mark/space cycle */ + data->code <<=1 ; + data->code |= data->last_bit; - bit = ((data->count +1 ) *2 )/ data->n_half; +/* Fill the 2 unused bits at the command with 0 */ +if (data->elapsed /2 ==6 ) + data->code <<=2 ; -printk ("%d halves, %d bits\n" , n_half, bit); +if (data->elapsed >= (RC5_NBITS -1 ) *2 ) { + scancode = data->code; -#if 1 /* SANITY check - while testing the decoder */ -if (bit >1 ) { -IR_dprintk (1 ,"Decoder HAS failed at %d-th bit (%s) @%luus\n" , - data->count, - last_bit ?"pulse" :"space" , - (ev->delta.tv_nsec +500 ) /1000 ); +/* Check for the start bits */ +if ((scancode &0xc000 ) !=0xc000 ) { +IR_dprintk (1 ,"Code 0x%04x doesn't have two start bits. It is not RC-5\n" , scancode); + goto err; + } - goto err2; - } -#endif -/* Ok, we've got a valid bit. proccess it */ -if (bit) { -int shift = data->count; + toggle = (scancode &0x2000 ) ?1 :0 ; -/* -* RC-5 transmit bytes on this temporal order: -* address | not address | command | not command -*/ -if (shift <8 ) { - data->rc5_code.address |=1 << shift; +if (scancode == data->last_code) { +IR_dprintk (1 ,"RC-5 repeat\n" ); +ir_repeat (input_dev); }else { - data->rc5_code.command |=1 << (shift -8 ); + data->last_code = scancode; + scancode &=0x1fff ; +IR_dprintk (1 ,"RC-5 scancode 0x%04x\n" , scancode); + +ir_keydown (input_dev, scancode,0 ); } - } -IR_dprintk (1 ,"RC-5: bit #%d: %d (%d)\n" , - data->count, bit, data->n_half); -if (++data->count >=RC5_NBITS ) { -u32 scancode; - scancode = data->rc5_code.address <<8 | - data->rc5_code.command; -IR_dprintk (1 ,"RC-5 scancode 0x%04x\n" , scancode); - -ir_keydown (input_dev, scancode,0 ); - - data->state =STATE_TRAILER_MARK ; + data->state =STATE_TRAILER ; }return 0 ; -case STATE_TRAILER_MARK : -if (!last_bit) - goto err; +case STATE_TRAILER : data->state =STATE_INACTIVE ;return 0 ; } err: -IR_dprintk (1 ,"RC-5 decoded failed at state %s (%s) @ %luus\n" , - st_name[data->state], - bit ?"pulse" :"space" , +IR_dprintk (1 ,"RC-5 decoded failed at %s @ %luus\n" , + is_pulse ?"pulse" :"space" , (ev->delta.tv_nsec +500 ) /1000 ); -err2: data->state =STATE_INACTIVE ;return -EINVAL ; }
Signature · 1 line
1.6.6.1
PATCH 12/26 V4L/DVB: saa7134: Fix IRQ2 bit names for the register map
In reply to a message not in the archiveThere's an error at the IRQ2 bit map registers. Also, it doesn't show what bits are needed for positive and for negative edge.
In the case of IR raw decoding, for some protocols, it is important to detect both positive and negative edges. So, a latter patch will need to use the other values.
Also, the code that detects problems on IRQ handling is incomplete, as it disables only one of the IRQ bits for GPIO16 and GPIO18.
drivers/media/video/saa7134/saa7134-core.c +8 -6
@@ -471,7 +471,7 @@ static char *irqbits[] = {"DONE_RA0" ,"DONE_RA1" ,"DONE_RA2" ,"DONE_RA3" ,"AR" ,"PE" ,"PWR_ON" ,"RDCAP" ,"INTL" ,"FIDT" ,"MMC" ,"TRIG_ERR" ,"CONF_ERR" ,"LOAD_ERR" , -"GPIO16?" ,"GPIO18" ,"GPIO22" ,"GPIO23" +"GPIO16" ,"GPIO18" ,"GPIO22" ,"GPIO23" };#define IRQBITS ARRAY_SIZE(irqbits)
@@ -601,12 +601,14 @@ static irqreturn_t saa7134_irq(int irq, void *dev_id)/* disable gpio16 IRQ */ printk (KERN_WARNING "%s/irq: looping -- " "clearing GPIO16 enable bit\n" ,dev->name); -saa_clearl (SAA7134_IRQ2 ,SAA7134_IRQ2_INTE_GPIO16 ); +saa_clearl (SAA7134_IRQ2 ,SAA7134_IRQ2_INTE_GPIO16_P ); +saa_clearl (SAA7134_IRQ2 ,SAA7134_IRQ2_INTE_GPIO16_N ); }else if (report &SAA7134_IRQ_REPORT_GPIO18 ) {/* disable gpio18 IRQs */ printk (KERN_WARNING "%s/irq: looping -- " "clearing GPIO18 enable bit\n" ,dev->name); -saa_clearl (SAA7134_IRQ2 ,SAA7134_IRQ2_INTE_GPIO18 ); +saa_clearl (SAA7134_IRQ2 ,SAA7134_IRQ2_INTE_GPIO18_P ); +saa_clearl (SAA7134_IRQ2 ,SAA7134_IRQ2_INTE_GPIO18_N ); }else {/* disable all irqs */ printk(KERN_WARNING "%s/irq: looping -- "
@@ -698,11 +700,11 @@ static int saa7134_hw_enable2(struct saa7134_dev *dev)if (dev->has_remote ==SAA7134_REMOTE_GPIO && dev->remote) {if (dev->remote->mask_keydown &0x10000 ) - irq2_mask |=SAA7134_IRQ2_INTE_GPIO16 ; + irq2_mask |=SAA7134_IRQ2_INTE_GPIO16_N ;else if (dev->remote->mask_keydown &0x40000 ) - irq2_mask |=SAA7134_IRQ2_INTE_GPIO18 ; + irq2_mask |=SAA7134_IRQ2_INTE_GPIO18_P ;else if (dev->remote->mask_keyup &0x40000 ) - irq2_mask |=SAA7134_IRQ2_INTE_GPIO18A ; + irq2_mask |=SAA7134_IRQ2_INTE_GPIO18_N ; }if (dev->has_remote ==SAA7134_REMOTE_I2C ) {
drivers/media/video/saa7134/saa7134-input.c +2 -2
@@ -1188,14 +1188,14 @@ static void nec_task(unsigned long data)/* Keep repeating the last key */ mod_timer (&ir->timer_keyup, jiffies +msecs_to_jiffies (150 )); -saa_setl (SAA7134_IRQ2 ,SAA7134_IRQ2_INTE_GPIO18 ); +saa_setl (SAA7134_IRQ2 ,SAA7134_IRQ2_INTE_GPIO18_P ); }static int saa7134_nec_irq (struct saa7134_dev *dev) {struct card_ir *ir = dev->remote; -saa_clearl (SAA7134_IRQ2 ,SAA7134_IRQ2_INTE_GPIO18 ); +saa_clearl (SAA7134_IRQ2 ,SAA7134_IRQ2_INTE_GPIO18_P );tasklet_schedule (&ir->tlet);return 1 ;
drivers/media/video/saa7134/saa7134-reg.h +12 -12
@@ -112,17 +112,17 @@#define SAA7134_IRQ1_INTE_RA0_0 (1 << 0)#define SAA7134_IRQ2 (0x2c8 >> 2) -#define SAA7134_IRQ2_INTE_GPIO23A (1 << 17) -#define SAA7134_IRQ2_INTE_GPIO23 (1 << 16) -#define SAA7134_IRQ2_INTE_GPIO22A (1 << 15) -#define SAA7134_IRQ2_INTE_GPIO22 (1 << 14) -#define SAA7134_IRQ2_INTE_GPIO18A (1 << 13) -#define SAA7134_IRQ2_INTE_GPIO18 (1 << 12) -#define SAA7134_IRQ2_INTE_GPIO16 (1 << 11)/* not certain */ -#define SAA7134_IRQ2_INTE_SC2 (1 << 10) -#define SAA7134_IRQ2_INTE_SC1 (1 << 9) -#define SAA7134_IRQ2_INTE_SC0 (1 << 8) -#define SAA7134_IRQ2_INTE_DEC5 (1 << 7) +#define SAA7134_IRQ2_INTE_GPIO23_N (1 << 17)/* negative edge */ +#define SAA7134_IRQ2_INTE_GPIO23_P (1 << 16)/* positive edge */ +#define SAA7134_IRQ2_INTE_GPIO22_N (1 << 15)/* negative edge */ +#define SAA7134_IRQ2_INTE_GPIO22_P (1 << 14)/* positive edge */ +#define SAA7134_IRQ2_INTE_GPIO18_N (1 << 13)/* negative edge */ +#define SAA7134_IRQ2_INTE_GPIO18_P (1 << 12)/* positive edge */ +#define SAA7134_IRQ2_INTE_GPIO16_N (1 << 11)/* negative edge */ +#define SAA7134_IRQ2_INTE_GPIO16_P (1 << 10)/* positive edge */ +#define SAA7134_IRQ2_INTE_SC2 (1 << 9) +#define SAA7134_IRQ2_INTE_SC1 (1 << 8) +#define SAA7134_IRQ2_INTE_SC0 (1 << 7)#define SAA7134_IRQ2_INTE_DEC4 (1 << 6)#define SAA7134_IRQ2_INTE_DEC3 (1 << 5)#define SAA7134_IRQ2_INTE_DEC2 (1 << 4)
@@ -135,7 +135,7 @@#define SAA7134_IRQ_REPORT_GPIO23 (1 << 17)#define SAA7134_IRQ_REPORT_GPIO22 (1 << 16)#define SAA7134_IRQ_REPORT_GPIO18 (1 << 15) -#define SAA7134_IRQ_REPORT_GPIO16 (1 << 14)/* not certain */ +#define SAA7134_IRQ_REPORT_GPIO16 (1 << 14)#define SAA7134_IRQ_REPORT_LOAD_ERR (1 << 13)#define SAA7134_IRQ_REPORT_CONF_ERR (1 << 12)#define SAA7134_IRQ_REPORT_TRIG_ERR (1 << 11)
Signature · 1 line
1.6.6.1
PATCH 4/26 V4L/DVB: rename all *_rc_keys to ir_codes_*_nec_table
In reply to a message not in the archiveSeveral DVB drivers use a different name convention. As we're moving the keytables, we need to use the same convention on all places.
drivers/media/dvb/dvb-usb/a800.c +3 -3
@@ -37,7 +37,7 @@ static int a800_identify_state(struct usb_device *udev, struct dvb_usb_device_prreturn 0 ; } -static struct dvb_usb_rc_key a800_rc_keys[] = { +static struct dvb_usb_rc_key ir_codes_a800_table[] = { {0x0201 ,KEY_PROG1 },/* SOURCE */ {0x0200 ,KEY_POWER },/* POWER */ {0x0205 ,KEY_1 },/* 1 */
@@ -147,8 +147,8 @@ static struct dvb_usb_device_properties a800_properties = { .identify_state = a800_identify_state, .rc_interval = DEFAULT_RC_INTERVAL, - .rc_key_map = a800_rc_keys, - .rc_key_map_size = ARRAY_SIZE(a800_rc_keys), + .rc_key_map = ir_codes_a800_table, + .rc_key_map_size = ARRAY_SIZE(ir_codes_a800_table), .rc_query = a800_rc_query, .i2c_algo = &dibusb_i2c_algo,
drivers/media/dvb/dvb-usb/af9005-remote.c +8 -8
@@ -33,7 +33,7 @@ MODULE_PARM_DESC(debug, #define deb_decode(args...) dprintk(dvb_usb_af9005_remote_debug,0x01,args) -struct dvb_usb_rc_key af9005_rc_keys[] = { +struct dvb_usb_rc_key ir_codes_af9005_table[] = { {0x01b7 ,KEY_POWER }, {0x01a7 ,KEY_VOLUMEUP },
@@ -74,7 +74,7 @@ struct dvb_usb_rc_key af9005_rc_keys[] = { {0x00d5, KEY_GOTO}, /* marked jump on the remote */ }; -int af9005_rc_keys_size =ARRAY_SIZE (af9005_rc_keys); +int ir_codes_af9005_table_size =ARRAY_SIZE (ir_codes_af9005_table);static int repeatable_keys[] = { KEY_VOLUMEUP,
@@ -130,10 +130,10 @@ int af9005_rc_decode(struct dvb_usb_device *d, u8 * data, int len, u32 * event,deb_decode ("code != inverted code\n" );return 0 ; } -for (i =0 ; i < af9005_rc_keys_size; i++) { -if (rc5_custom (&af9005_rc_keys[i]) == cust - &&rc5_data (&af9005_rc_keys[i]) == dat) { - *event = af9005_rc_keys[i].event; +for (i =0 ; i < ir_codes_af9005_table_size; i++) { +if (rc5_custom (&ir_codes_af9005_table[i]) == cust + &&rc5_data (&ir_codes_af9005_table[i]) == dat) { + *event = ir_codes_af9005_table[i].event; *state =REMOTE_KEY_PRESSED ;deb_decode ("key pressed, event %x\n" , *event);
@@ -146,8 +146,8 @@ int af9005_rc_decode(struct dvb_usb_device *d, u8 * data, int len, u32 * event,return 0 ; } -EXPORT_SYMBOL (af9005_rc_keys); -EXPORT_SYMBOL (af9005_rc_keys_size); +EXPORT_SYMBOL (ir_codes_af9005_table); +EXPORT_SYMBOL (ir_codes_af9005_table_size);EXPORT_SYMBOL (af9005_rc_decode);MODULE_AUTHOR ("Luca Olivetti <[email protected]>" );
drivers/media/dvb/dvb-usb/af9005.c +4 -4
@@ -1109,8 +1109,8 @@ static int __init af9005_usb_module_init(void)return result; } rc_decode =symbol_request (af9005_rc_decode); - rc_keys =symbol_request (af9005_rc_keys); - rc_keys_size =symbol_request (af9005_rc_keys_size); + rc_keys =symbol_request (ir_codes_af9005_table); + rc_keys_size =symbol_request (ir_codes_af9005_table_size);if (rc_decode ==NULL || rc_keys ==NULL || rc_keys_size ==NULL ) {err ("af9005_rc_decode function not found, disabling remote" ); af9005_properties.rc_query =NULL ;
@@ -1128,9 +1128,9 @@ static void __exit af9005_usb_module_exit(void)if (rc_decode !=NULL )symbol_put (af9005_rc_decode);if (rc_keys !=NULL ) -symbol_put (af9005_rc_keys); +symbol_put (ir_codes_af9005_table);if (rc_keys_size !=NULL ) -symbol_put (af9005_rc_keys_size); +symbol_put (ir_codes_af9005_table_size);/* deregister this driver from the USB subsystem */ usb_deregister (&af9005_usb_driver); }
drivers/media/dvb/dvb-usb/af9005.h +2 -2
@@ -3490,7 +3490,7 @@ extern u8 regmask[8];/* remote control decoder */ extern int af9005_rc_decode (struct dvb_usb_device *d,u8 * data,int len,u32 * event,int *state); -extern struct dvb_usb_rc_key af9005_rc_keys[]; -extern int af9005_rc_keys_size; +extern struct dvb_usb_rc_key ir_codes_af9005_table[]; +extern int ir_codes_af9005_table_size;#endif
drivers/media/dvb/dvb-usb/af9015.c +15 -15
@@ -751,19 +751,19 @@ 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 , - af9015_rc_keys_a_link,ARRAY_SIZE (af9015_rc_keys_a_link), + 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 , - af9015_rc_keys_msi,ARRAY_SIZE (af9015_rc_keys_msi), + 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 , - af9015_rc_keys_mygictv,ARRAY_SIZE (af9015_rc_keys_mygictv), + 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 , - af9015_rc_keys_digittrade,ARRAY_SIZE (af9015_rc_keys_digittrade), + 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 , - af9015_rc_keys_avermedia,ARRAY_SIZE (af9015_rc_keys_avermedia), + ir_codes_af9015_table_avermedia,ARRAY_SIZE (ir_codes_af9015_table_avermedia), af9015_ir_table_avermedia_ks,ARRAY_SIZE (af9015_ir_table_avermedia_ks) }, { } };
@@ -771,32 +771,32 @@ static const struct af9015_setup af9015_setup_modparam[] = {/* don't add new entries here anymore, use hashes instead */ static const struct af9015_setup af9015_setup_usbids[] = { {USB_VID_LEADTEK , - af9015_rc_keys_leadtek,ARRAY_SIZE (af9015_rc_keys_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 , - af9015_rc_keys_twinhan,ARRAY_SIZE (af9015_rc_keys_twinhan), + 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 */ - af9015_rc_keys_twinhan,ARRAY_SIZE (af9015_rc_keys_twinhan), + 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 , - af9015_rc_keys_avermedia,ARRAY_SIZE (af9015_rc_keys_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 , - af9015_rc_keys_msi_digivox_iii,ARRAY_SIZE (af9015_rc_keys_msi_digivox_iii), + 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) }, { } };static const struct af9015_setup af9015_setup_hashes[] = { {0xb8feb708 , - af9015_rc_keys_msi,ARRAY_SIZE (af9015_rc_keys_msi), + ir_codes_af9015_table_msi,ARRAY_SIZE (ir_codes_af9015_table_msi), af9015_ir_table_msi,ARRAY_SIZE (af9015_ir_table_msi) }, {0xa3703d00 , - af9015_rc_keys_a_link,ARRAY_SIZE (af9015_rc_keys_a_link), + 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 , - af9015_rc_keys_mygictv,ARRAY_SIZE (af9015_rc_keys_mygictv), + ir_codes_af9015_table_mygictv,ARRAY_SIZE (ir_codes_af9015_table_mygictv), af9015_ir_table_mygictv,ARRAY_SIZE (af9015_ir_table_mygictv) }, { } };
@@ -835,8 +835,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 , - af9015_rc_keys_trekstor, -ARRAY_SIZE (af9015_rc_keys_trekstor), + ir_codes_af9015_table_trekstor, +ARRAY_SIZE (ir_codes_af9015_table_trekstor), af9015_ir_table_trekstor,ARRAY_SIZE (af9015_ir_table_trekstor) };
drivers/media/dvb/dvb-usb/af9015.h +9 -9
@@ -123,7 +123,7 @@ enum af9015_remote {/* LeadTek - Y04G0051 */ /* Leadtek WinFast DTV Dongle Gold */ -static struct dvb_usb_rc_key af9015_rc_keys_leadtek[] = { +static struct dvb_usb_rc_key ir_codes_af9015_table_leadtek[] = { {0x001e ,KEY_1 }, {0x001f ,KEY_2 }, {0x0020 ,KEY_3 },
@@ -227,7 +227,7 @@ static u8 af9015_ir_table_leadtek[] = { };/* TwinHan AzureWave AD-TU700(704J) */ -static struct dvb_usb_rc_key af9015_rc_keys_twinhan[] = { +static struct dvb_usb_rc_key ir_codes_af9015_table_twinhan[] = { {0x053f ,KEY_POWER }, {0x0019 ,KEY_FAVORITES },/* Favorite List */ {0x0004 ,KEY_TEXT },/* Teletext */
@@ -338,7 +338,7 @@ static u8 af9015_ir_table_twinhan[] = { };/* A-Link DTU(m) */ -static struct dvb_usb_rc_key af9015_rc_keys_a_link[] = { +static struct dvb_usb_rc_key ir_codes_af9015_table_a_link[] = { {0x001e ,KEY_1 }, {0x001f ,KEY_2 }, {0x0020 ,KEY_3 },
@@ -381,7 +381,7 @@ static u8 af9015_ir_table_a_link[] = { };/* MSI DIGIVOX mini II V3.0 */ -static struct dvb_usb_rc_key af9015_rc_keys_msi[] = { +static struct dvb_usb_rc_key ir_codes_af9015_table_msi[] = { {0x001e ,KEY_1 }, {0x001f ,KEY_2 }, {0x0020 ,KEY_3 },
@@ -424,7 +424,7 @@ static u8 af9015_ir_table_msi[] = { };/* MYGICTV U718 */ -static struct dvb_usb_rc_key af9015_rc_keys_mygictv[] = { +static struct dvb_usb_rc_key ir_codes_af9015_table_mygictv[] = { {0x003d ,KEY_SWITCHVIDEOMODE },/* TV / AV */ {0x0545 ,KEY_POWER },
@@ -550,7 +550,7 @@ static u8 af9015_ir_table_kworld[] = { };/* AverMedia Volar X */ -static struct dvb_usb_rc_key af9015_rc_keys_avermedia[] = { +static struct dvb_usb_rc_key ir_codes_af9015_table_avermedia[] = { {0x053d ,KEY_PROG1 },/* SOURCE */ {0x0512 ,KEY_POWER },/* POWER */ {0x051e ,KEY_1 },/* 1 */
@@ -656,7 +656,7 @@ static u8 af9015_ir_table_avermedia_ks[] = { };/* Digittrade DVB-T USB Stick */ -static struct dvb_usb_rc_key af9015_rc_keys_digittrade[] = { +static struct dvb_usb_rc_key ir_codes_af9015_table_digittrade[] = { {0x010f ,KEY_LAST },/* RETURN */ {0x0517 ,KEY_TEXT },/* TELETEXT */ {0x0108 ,KEY_EPG },/* EPG */
@@ -719,7 +719,7 @@ static u8 af9015_ir_table_digittrade[] = { };/* TREKSTOR DVB-T USB Stick */ -static struct dvb_usb_rc_key af9015_rc_keys_trekstor[] = { +static struct dvb_usb_rc_key ir_codes_af9015_table_trekstor[] = { {0x0704 ,KEY_AGAIN },/* Home */ {0x0705 ,KEY_MUTE },/* Mute */ {0x0706 ,KEY_UP },/* Up */
@@ -782,7 +782,7 @@ static u8 af9015_ir_table_trekstor[] = { };/* MSI DIGIVOX mini III */ -static struct dvb_usb_rc_key af9015_rc_keys_msi_digivox_iii[] = { +static struct dvb_usb_rc_key ir_codes_af9015_table_msi_digivox_iii[] = { {0x0713 ,KEY_POWER },/* [red power button] */ {0x073b ,KEY_VIDEO },/* Source */ {0x073e ,KEY_ZOOM },/* Zoom */
drivers/media/dvb/dvb-usb/anysee.c +3 -3
@@ -399,7 +399,7 @@ static int anysee_rc_query(struct dvb_usb_device *d, u32 *event, int *state)return 0 ; } -static struct dvb_usb_rc_key anysee_rc_keys[] = { +static struct dvb_usb_rc_key ir_codes_anysee_table[] = { {0x0100 ,KEY_0 }, {0x0101 ,KEY_1 }, {0x0102 ,KEY_2 },
@@ -518,8 +518,8 @@ static struct dvb_usb_device_properties anysee_properties = { } }, - .rc_key_map = anysee_rc_keys, - .rc_key_map_size = ARRAY_SIZE(anysee_rc_keys), + .rc_key_map = ir_codes_anysee_table, + .rc_key_map_size = ARRAY_SIZE(ir_codes_anysee_table), .rc_query = anysee_rc_query, .rc_interval = 200, /* windows driver uses 500ms */
drivers/media/dvb/dvb-usb/az6027.c +3 -3
@@ -386,7 +386,7 @@ static int az6027_streaming_ctrl(struct dvb_usb_adapter *adap, int onoff) }/* keys for the enclosed remote control */ -static struct dvb_usb_rc_key az6027_rc_keys[] = { +static struct dvb_usb_rc_key ir_codes_az6027_table[] = { {0x01 ,KEY_1 }, {0x02 ,KEY_2 }, };
@@ -1096,8 +1096,8 @@ static struct dvb_usb_device_properties az6027_properties = {.power_ctrl = az6027_power_ctrl, .read_mac_address = az6027_read_mac_addr, */ - .rc_key_map = az6027_rc_keys, - .rc_key_map_size = ARRAY_SIZE(az6027_rc_keys), + .rc_key_map = ir_codes_az6027_table, + .rc_key_map_size = ARRAY_SIZE(ir_codes_az6027_table), .rc_interval = 400, .rc_query = az6027_rc_query, .i2c_algo = &az6027_i2c_algo,
drivers/media/dvb/dvb-usb/cinergyT2-core.c +3 -3
@@ -84,7 +84,7 @@ static int cinergyt2_frontend_attach(struct dvb_usb_adapter *adap)return 0 ; } -static struct dvb_usb_rc_key cinergyt2_rc_keys[] = { +static struct dvb_usb_rc_key ir_codes_cinergyt2_table[] = { {0x0401 ,KEY_POWER }, {0x0402 ,KEY_1 }, {0x0403 ,KEY_2 },
@@ -218,8 +218,8 @@ static struct dvb_usb_device_properties cinergyt2_properties = { .power_ctrl = cinergyt2_power_ctrl, .rc_interval = 50, - .rc_key_map = cinergyt2_rc_keys, - .rc_key_map_size = ARRAY_SIZE(cinergyt2_rc_keys), + .rc_key_map = ir_codes_cinergyt2_table, + .rc_key_map_size = ARRAY_SIZE(ir_codes_cinergyt2_table), .rc_query = cinergyt2_rc_query, .generic_bulk_ctrl_endpoint = 1,
drivers/media/dvb/dvb-usb/cxusb.c +23 -23
124 lines not on this page · raw message
drivers/media/dvb/dvb-usb/dib0700_devices.c +27 -27
138 lines not on this page · raw message
drivers/media/dvb/dvb-usb/dibusb-common.c +2 -2
@@ -327,7 +327,7 @@ EXPORT_SYMBOL(dibusb_dib3000mc_tuner_attach);/* * common remote control stuff */ -struct dvb_usb_rc_key dibusb_rc_keys[] = { +struct dvb_usb_rc_key ir_codes_dibusb_table[] = {/* Key codes for the little Artec T1/Twinhan/HAMA/ remote. */ {0x0016 ,KEY_POWER }, {0x0010 ,KEY_MUTE },
@@ -456,7 +456,7 @@ struct dvb_usb_rc_key dibusb_rc_keys[] = { { 0x804e, KEY_ENTER }, { 0x804f, KEY_VOLUMEDOWN }, }; -EXPORT_SYMBOL (dibusb_rc_keys); +EXPORT_SYMBOL (ir_codes_dibusb_table);int dibusb_rc_query (struct dvb_usb_device *d,u32 *event,int *state) {
drivers/media/dvb/dvb-usb/dibusb-mb.c +4 -4
@@ -212,7 +212,7 @@ static struct dvb_usb_device_properties dibusb1_1_properties = { .power_ctrl = dibusb_power_ctrl, .rc_interval = DEFAULT_RC_INTERVAL, - .rc_key_map = dibusb_rc_keys, + .rc_key_map = ir_codes_dibusb_table, .rc_key_map_size = 111, /* wow, that is ugly ... I want to load it to the driver dynamically */ .rc_query = dibusb_rc_query,
@@ -296,7 +296,7 @@ static struct dvb_usb_device_properties dibusb1_1_an2235_properties = { .power_ctrl = dibusb_power_ctrl, .rc_interval = DEFAULT_RC_INTERVAL, - .rc_key_map = dibusb_rc_keys, + .rc_key_map = ir_codes_dibusb_table, .rc_key_map_size = 111, /* wow, that is ugly ... I want to load it to the driver dynamically */ .rc_query = dibusb_rc_query,
@@ -360,7 +360,7 @@ static struct dvb_usb_device_properties dibusb2_0b_properties = { .power_ctrl = dibusb2_0_power_ctrl, .rc_interval = DEFAULT_RC_INTERVAL, - .rc_key_map = dibusb_rc_keys, + .rc_key_map = ir_codes_dibusb_table, .rc_key_map_size = 111, /* wow, that is ugly ... I want to load it to the driver dynamically */ .rc_query = dibusb_rc_query,
@@ -417,7 +417,7 @@ static struct dvb_usb_device_properties artec_t1_usb2_properties = { .power_ctrl = dibusb2_0_power_ctrl, .rc_interval = DEFAULT_RC_INTERVAL, - .rc_key_map = dibusb_rc_keys, + .rc_key_map = ir_codes_dibusb_table, .rc_key_map_size = 111, /* wow, that is ugly ... I want to load it to the driver dynamically */ .rc_query = dibusb_rc_query,
drivers/media/dvb/dvb-usb/dibusb-mc.c +1 -1
@@ -82,7 +82,7 @@ static struct dvb_usb_device_properties dibusb_mc_properties = { .power_ctrl = dibusb2_0_power_ctrl, .rc_interval = DEFAULT_RC_INTERVAL, - .rc_key_map = dibusb_rc_keys, + .rc_key_map = ir_codes_dibusb_table, .rc_key_map_size = 111, /* FIXME */ .rc_query = dibusb_rc_query,
drivers/media/dvb/dvb-usb/dibusb.h +1 -1
@@ -124,7 +124,7 @@ extern int dibusb2_0_power_ctrl(struct dvb_usb_device *, int);#define DEFAULT_RC_INTERVAL 150//#define DEFAULT_RC_INTERVAL 100000 -extern struct dvb_usb_rc_key dibusb_rc_keys[]; +extern struct dvb_usb_rc_key ir_codes_dibusb_table[];extern int dibusb_rc_query (struct dvb_usb_device *,u32 *,int *);extern int dibusb_read_eeprom_byte (struct dvb_usb_device *,u8 ,u8 *);
drivers/media/dvb/dvb-usb/digitv.c +3 -3
@@ -161,7 +161,7 @@ static int digitv_tuner_attach(struct dvb_usb_adapter *adap)return 0 ; } -static struct dvb_usb_rc_key digitv_rc_keys[] = { +static struct dvb_usb_rc_key ir_codes_digitv_table[] = { {0x5f55 ,KEY_0 }, {0x6f55 ,KEY_1 }, {0x9f55 ,KEY_2 },
@@ -311,8 +311,8 @@ static struct dvb_usb_device_properties digitv_properties = { .identify_state = digitv_identify_state, .rc_interval = 1000, - .rc_key_map = digitv_rc_keys, - .rc_key_map_size = ARRAY_SIZE(digitv_rc_keys), + .rc_key_map = ir_codes_digitv_table, + .rc_key_map_size = ARRAY_SIZE(ir_codes_digitv_table), .rc_query = digitv_rc_query, .i2c_algo = &digitv_i2c_algo,
drivers/media/dvb/dvb-usb/dtt200u.c +9 -9
@@ -57,7 +57,7 @@ static int dtt200u_pid_filter(struct dvb_usb_adapter *adap, int index, u16 pid,/* remote control */ /* key list for the tiny remote control (Yakumo, don't know about the others) */ -static struct dvb_usb_rc_key dtt200u_rc_keys[] = { +static struct dvb_usb_rc_key ir_codes_dtt200u_table[] = { {0x8001 ,KEY_MUTE }, {0x8002 ,KEY_CHANNELDOWN }, {0x8003 ,KEY_VOLUMEDOWN },
@@ -162,8 +162,8 @@ static struct dvb_usb_device_properties dtt200u_properties = { .power_ctrl = dtt200u_power_ctrl, .rc_interval = 300, - .rc_key_map = dtt200u_rc_keys, - .rc_key_map_size = ARRAY_SIZE(dtt200u_rc_keys), + .rc_key_map = ir_codes_dtt200u_table, + .rc_key_map_size = ARRAY_SIZE(ir_codes_dtt200u_table), .rc_query = dtt200u_rc_query, .generic_bulk_ctrl_endpoint = 0x01,
@@ -207,8 +207,8 @@ static struct dvb_usb_device_properties wt220u_properties = { .power_ctrl = dtt200u_power_ctrl, .rc_interval = 300, - .rc_key_map = dtt200u_rc_keys, - .rc_key_map_size = ARRAY_SIZE(dtt200u_rc_keys), + .rc_key_map = ir_codes_dtt200u_table, + .rc_key_map_size = ARRAY_SIZE(ir_codes_dtt200u_table), .rc_query = dtt200u_rc_query, .generic_bulk_ctrl_endpoint = 0x01,
@@ -252,8 +252,8 @@ static struct dvb_usb_device_properties wt220u_fc_properties = { .power_ctrl = dtt200u_power_ctrl, .rc_interval = 300, - .rc_key_map = dtt200u_rc_keys, - .rc_key_map_size = ARRAY_SIZE(dtt200u_rc_keys), + .rc_key_map = ir_codes_dtt200u_table, + .rc_key_map_size = ARRAY_SIZE(ir_codes_dtt200u_table), .rc_query = dtt200u_rc_query, .generic_bulk_ctrl_endpoint = 0x01,
@@ -297,8 +297,8 @@ static struct dvb_usb_device_properties wt220u_zl0353_properties = { .power_ctrl = dtt200u_power_ctrl, .rc_interval = 300, - .rc_key_map = dtt200u_rc_keys, - .rc_key_map_size = ARRAY_SIZE(dtt200u_rc_keys), + .rc_key_map = ir_codes_dtt200u_table, + .rc_key_map_size = ARRAY_SIZE(ir_codes_dtt200u_table), .rc_query = dtt200u_rc_query, .generic_bulk_ctrl_endpoint = 0x01,
drivers/media/dvb/dvb-usb/dw2102.c +22 -22
114 lines not on this page · raw message
drivers/media/dvb/dvb-usb/m920x.c +9 -9
@@ -589,7 +589,7 @@ static struct m920x_inits pinnacle310e_init[] = { };/* ir keymaps */ -static struct dvb_usb_rc_key megasky_rc_keys [] = { +static struct dvb_usb_rc_key ir_codes_megasky_table [] = { {0x0012 ,KEY_POWER }, {0x001e ,KEY_CYCLEWINDOWS },/* min/max */ {0x0002 ,KEY_CHANNELUP },
@@ -608,7 +608,7 @@ static struct dvb_usb_rc_key megasky_rc_keys [] = { { 0x000e, KEY_COFFEE }, /* "MTS" */ }; -static struct dvb_usb_rc_key tvwalkertwin_rc_keys [] = { +static struct dvb_usb_rc_key ir_codes_tvwalkertwin_table [] = { {0x0001 ,KEY_ZOOM },/* Full Screen */ {0x0002 ,KEY_CAMERA },/* snapshot */ { 0x0003, KEY_MUTE },
@@ -628,7 +628,7 @@ static struct dvb_usb_rc_key tvwalkertwin_rc_keys [] = { { 0x001e, KEY_VOLUMEUP }, }; -static struct dvb_usb_rc_key pinnacle310e_rc_keys[] = { +static struct dvb_usb_rc_key ir_codes_pinnacle310e_table[] = { {0x16 ,KEY_POWER }, {0x17 ,KEY_FAVORITES }, { 0x0f, KEY_TEXT },
@@ -785,8 +785,8 @@ static struct dvb_usb_device_properties megasky_properties = { .download_firmware = m920x_firmware_download, .rc_interval = 100, - .rc_key_map = megasky_rc_keys, - .rc_key_map_size = ARRAY_SIZE(megasky_rc_keys), + .rc_key_map = ir_codes_megasky_table, + .rc_key_map_size = ARRAY_SIZE(ir_codes_megasky_table), .rc_query = m920x_rc_query, .size_of_priv = sizeof(struct m920x_state),
@@ -886,8 +886,8 @@ static struct dvb_usb_device_properties tvwalkertwin_properties = { .download_firmware = m920x_firmware_download, .rc_interval = 100, - .rc_key_map = tvwalkertwin_rc_keys, - .rc_key_map_size = ARRAY_SIZE(tvwalkertwin_rc_keys), + .rc_key_map = ir_codes_tvwalkertwin_table, + .rc_key_map_size = ARRAY_SIZE(ir_codes_tvwalkertwin_table), .rc_query = m920x_rc_query, .size_of_priv = sizeof(struct m920x_state),
@@ -993,8 +993,8 @@ static struct dvb_usb_device_properties pinnacle_pctv310e_properties = { .download_firmware = NULL, .rc_interval = 100, - .rc_key_map = pinnacle310e_rc_keys, - .rc_key_map_size = ARRAY_SIZE(pinnacle310e_rc_keys), + .rc_key_map = ir_codes_pinnacle310e_table, + .rc_key_map_size = ARRAY_SIZE(ir_codes_pinnacle310e_table), .rc_query = m920x_rc_query, .size_of_priv = sizeof(struct m920x_state),
drivers/media/dvb/dvb-usb/nova-t-usb2.c +9 -9
@@ -21,7 +21,7 @@ DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr); #define deb_ee(args...) dprintk(debug,0x02,args)/* Hauppauge NOVA-T USB2 keys */ -static struct dvb_usb_rc_key haupp_rc_keys [] = { +static struct dvb_usb_rc_key ir_codes_haupp_table [] = { {0x1e00 ,KEY_0 }, {0x1e01 ,KEY_1 }, {0x1e02 ,KEY_2 },
@@ -91,14 +91,14 @@ static int nova_t_rc_query(struct dvb_usb_device *d, u32 *event, int *state)deb_rc ("raw key code 0x%02x, 0x%02x, 0x%02x to c: %02x d: %02x toggle: %d\n" ,key[1 ],key[2 ],key[3 ],custom,data,toggle); -for (i =0 ; i <ARRAY_SIZE (haupp_rc_keys); i++) { -if (rc5_data (&haupp_rc_keys[i]) == data && -rc5_custom (&haupp_rc_keys[i]) == custom) { +for (i =0 ; i <ARRAY_SIZE (ir_codes_haupp_table); i++) { +if (rc5_data (&ir_codes_haupp_table[i]) == data && +rc5_custom (&ir_codes_haupp_table[i]) == custom) { -deb_rc ("c: %x, d: %x\n" ,rc5_data (&haupp_rc_keys[i]), -rc5_custom (&haupp_rc_keys[i])); +deb_rc ("c: %x, d: %x\n" ,rc5_data (&ir_codes_haupp_table[i]), +rc5_custom (&ir_codes_haupp_table[i])); - *event = haupp_rc_keys[i].event; + *event = ir_codes_haupp_table[i].event; *state =REMOTE_KEY_PRESSED ;if (st->old_toggle == toggle) {if (st->last_repeat_count++ <2 )
@@ -196,8 +196,8 @@ static struct dvb_usb_device_properties nova_t_properties = { .read_mac_address = nova_t_read_mac_address, .rc_interval = 100, - .rc_key_map = haupp_rc_keys, - .rc_key_map_size = ARRAY_SIZE(haupp_rc_keys), + .rc_key_map = ir_codes_haupp_table, + .rc_key_map_size = ARRAY_SIZE(ir_codes_haupp_table), .rc_query = nova_t_rc_query, .i2c_algo = &dibusb_i2c_algo,
drivers/media/dvb/dvb-usb/opera1.c +8 -8
@@ -35,7 +35,7 @@struct opera1_state {u32 last_key_pressed; }; -struct opera_rc_keys { +struct ir_codes_opera_table {u32 keycode;u32 event; };
@@ -331,7 +331,7 @@ static int opera1_pid_filter_control(struct dvb_usb_adapter *adap, int onoff)return 0 ; } -static struct dvb_usb_rc_key opera1_rc_keys[] = { +static struct dvb_usb_rc_key ir_codes_opera1_table[] = { {0x5fa0 ,KEY_1 }, {0x51af ,KEY_2 }, {0x5da2 ,KEY_3 },
@@ -404,12 +404,12 @@ static int opera1_rc_query(struct dvb_usb_device *dev, u32 * event, int *state) send_key = (send_key &0xffff ) |0x0100 ; -for (i =0 ; i <ARRAY_SIZE (opera1_rc_keys); i++) { -if (rc5_scan (&opera1_rc_keys[i]) == (send_key &0xffff )) { +for (i =0 ; i <ARRAY_SIZE (ir_codes_opera1_table); i++) { +if (rc5_scan (&ir_codes_opera1_table[i]) == (send_key &0xffff )) { *state =REMOTE_KEY_PRESSED ; - *event = opera1_rc_keys[i].event; + *event = ir_codes_opera1_table[i].event; opst->last_key_pressed = - opera1_rc_keys[i].event; + ir_codes_opera1_table[i].event;break ; } opst->last_key_pressed =0 ;
@@ -498,8 +498,8 @@ static struct dvb_usb_device_properties opera1_properties = { .power_ctrl = opera1_power_ctrl, .i2c_algo = &opera1_i2c_algo, - .rc_key_map = opera1_rc_keys, - .rc_key_map_size = ARRAY_SIZE(opera1_rc_keys), + .rc_key_map = ir_codes_opera1_table, + .rc_key_map_size = ARRAY_SIZE(ir_codes_opera1_table), .rc_interval = 200, .rc_query = opera1_rc_query, .read_mac_address = opera1_read_mac_address,
drivers/media/dvb/dvb-usb/vp702x.c +6 -6
@@ -174,7 +174,7 @@ static int vp702x_streaming_ctrl(struct dvb_usb_adapter *adap, int onoff) }/* keys for the enclosed remote control */ -static struct dvb_usb_rc_key vp702x_rc_keys[] = { +static struct dvb_usb_rc_key ir_codes_vp702x_table[] = { {0x0001 ,KEY_1 }, {0x0002 ,KEY_2 }, };
@@ -197,10 +197,10 @@ static int vp702x_rc_query(struct dvb_usb_device *d, u32 *event, int *state)return 0 ; } -for (i =0 ; i <ARRAY_SIZE (vp702x_rc_keys); i++) -if (rc5_custom (&vp702x_rc_keys[i]) == key[1 ]) { +for (i =0 ; i <ARRAY_SIZE (ir_codes_vp702x_table); i++) +if (rc5_custom (&ir_codes_vp702x_table[i]) == key[1 ]) { *state =REMOTE_KEY_PRESSED ; - *event = vp702x_rc_keys[i].event; + *event = ir_codes_vp702x_table[i].event;break ; }return 0 ;
@@ -283,8 +283,8 @@ static struct dvb_usb_device_properties vp702x_properties = { }, .read_mac_address = vp702x_read_mac_addr, - .rc_key_map = vp702x_rc_keys, - .rc_key_map_size = ARRAY_SIZE(vp702x_rc_keys), + .rc_key_map = ir_codes_vp702x_table, + .rc_key_map_size = ARRAY_SIZE(ir_codes_vp702x_table), .rc_interval = 400, .rc_query = vp702x_rc_query,
drivers/media/dvb/dvb-usb/vp7045.c +6 -6
@@ -99,7 +99,7 @@ static int vp7045_power_ctrl(struct dvb_usb_device *d, int onoff)/* The keymapping struct. Somehow this should be loaded to the driver, but * currently it is hardcoded. */ -static struct dvb_usb_rc_key vp7045_rc_keys[] = { +static struct dvb_usb_rc_key ir_codes_vp7045_table[] = { {0x0016 ,KEY_POWER }, {0x0010 ,KEY_MUTE }, {0x0003 ,KEY_1 },
@@ -165,10 +165,10 @@ static int vp7045_rc_query(struct dvb_usb_device *d, u32 *event, int *state)return 0 ; } -for (i =0 ; i <ARRAY_SIZE (vp7045_rc_keys); i++) -if (rc5_data (&vp7045_rc_keys[i]) == key) { +for (i =0 ; i <ARRAY_SIZE (ir_codes_vp7045_table); i++) +if (rc5_data (&ir_codes_vp7045_table[i]) == key) { *state =REMOTE_KEY_PRESSED ; - *event = vp7045_rc_keys[i].event; + *event = ir_codes_vp7045_table[i].event;break ; }return 0 ;
@@ -260,8 +260,8 @@ static struct dvb_usb_device_properties vp7045_properties = { .read_mac_address = vp7045_read_mac_addr, .rc_interval = 400, - .rc_key_map = vp7045_rc_keys, - .rc_key_map_size = ARRAY_SIZE(vp7045_rc_keys), + .rc_key_map = ir_codes_vp7045_table, + .rc_key_map_size = ARRAY_SIZE(ir_codes_vp7045_table), .rc_query = vp7045_rc_query, .num_device_descs = 2,
Signature · 1 line
1.6.6.1
PATCH 25/26 V4L/DVB: re-add enable/disable check to the IR decoders
In reply to a message not in the archiveA previous cleanup patch removed more than needed. Re-add the logic that disable the decoders.
drivers/media/IR/ir-nec-decoder.c +3 -0
@@ -142,6 +142,9 @@ static int ir_nec_decode(struct input_dev *input_dev,if (!data)return -EINVAL ; +if (!data->enabled) +return 0 ; +/* Except for the initial event, what matters is the previous bit */ bit = (ev->type &IR_PULSE ) ?1 :0 ;
drivers/media/IR/ir-rc5-decoder.c +3 -0
@@ -153,6 +153,9 @@ static int ir_rc5_decode(struct input_dev *input_dev,if (!data)return -EINVAL ; +if (!data->enabled) +return 0 ; +/* Except for the initial event, what matters is the previous bit */ bit = (ev->type &IR_PULSE ) ?1 :0 ;
Signature · 1 line
1.6.6.1
PATCH 11/26 V4L/DVB: ir-common: remove keymap tables from the module
In reply to a message not in the archiveNow that the remote keymaps were broken into separate modules, get rid of the keycode tables that were hardcoded into ir-common.
delete mode 100644 drivers/media/IR/ir-keymaps.c delete mode 100644 include/media/keycodes/adstech-dvb-t-pci.h delete mode 100644 include/media/keycodes/apac-viewcomp.h delete mode 100644 include/media/keycodes/asus-pc39.h delete mode 100644 include/media/keycodes/ati-tv-wonder-hd-600.h delete mode 100644 include/media/keycodes/avermedia-a16d.h delete mode 100644 include/media/keycodes/avermedia-cardbus.h delete mode 100644 include/media/keycodes/avermedia-dvbt.h delete mode 100644 include/media/keycodes/avermedia-m135a-rm-jx.h delete mode 100644 include/media/keycodes/avermedia.h delete mode 100644 include/media/keycodes/avertv-303.h delete mode 100644 include/media/keycodes/behold-columbus.h delete mode 100644 include/media/keycodes/behold.h delete mode 100644 include/media/keycodes/budget-ci-old.h delete mode 100644 include/media/keycodes/cinergy-1400.h delete mode 100644 include/media/keycodes/cinergy.h delete mode 100644 include/media/keycodes/dm1105-nec.h delete mode 100644 include/media/keycodes/dntv-live-dvb-t.h delete mode 100644 include/media/keycodes/dntv-live-dvbt-pro.h delete mode 100644 include/media/keycodes/em-terratec.h delete mode 100644 include/media/keycodes/empty.h delete mode 100644 include/media/keycodes/encore-enltv-fm53.h delete mode 100644 include/media/keycodes/encore-enltv.h delete mode 100644 include/media/keycodes/encore-enltv2.h delete mode 100644 include/media/keycodes/evga-indtube.h delete mode 100644 include/media/keycodes/eztv.h delete mode 100644 include/media/keycodes/flydvb.h delete mode 100644 include/media/keycodes/flyvideo.h delete mode 100644 include/media/keycodes/fusionhdtv-mce.h delete mode 100644 include/media/keycodes/gadmei-rm008z.h delete mode 100644 include/media/keycodes/genius-tvgo-a11mce.h delete mode 100644 include/media/keycodes/gotview7135.h delete mode 100644 include/media/keycodes/hauppauge-new.h delete mode 100644 include/media/keycodes/iodata-bctv7e.h delete mode 100644 include/media/keycodes/kaiomy.h delete mode 100644 include/media/keycodes/kworld-315u.h delete mode 100644 include/media/keycodes/kworld-plus-tv-analog.h delete mode 100644 include/media/keycodes/manli.h delete mode 100644 include/media/keycodes/msi-tvanywhere-plus.h delete mode 100644 include/media/keycodes/msi-tvanywhere.h delete mode 100644 include/media/keycodes/nebula.h delete mode 100644 include/media/keycodes/nec-terratec-cinergy-xs.h delete mode 100644 include/media/keycodes/norwood.h delete mode 100644 include/media/keycodes/npgtech.h delete mode 100644 include/media/keycodes/pctv-sedna.h delete mode 100644 include/media/keycodes/pinnacle-color.h delete mode 100644 include/media/keycodes/pinnacle-grey.h delete mode 100644 include/media/keycodes/pinnacle-pctv-hd.h delete mode 100644 include/media/keycodes/pixelview-new.h delete mode 100644 include/media/keycodes/pixelview.h delete mode 100644 include/media/keycodes/powercolor-real-angel.h delete mode 100644 include/media/keycodes/proteus-2309.h delete mode 100644 include/media/keycodes/purpletv.h delete mode 100644 include/media/keycodes/pv951.h delete mode 100644 include/media/keycodes/rc5-hauppauge-new.h delete mode 100644 include/media/keycodes/rc5-tv.h delete mode 100644 include/media/keycodes/real-audio-220-32-keys.h delete mode 100644 include/media/keycodes/tbs-nec.h delete mode 100644 include/media/keycodes/terratec-cinergy-xs.h delete mode 100644 include/media/keycodes/tevii-nec.h delete mode 100644 include/media/keycodes/tt-1500.h delete mode 100644 include/media/keycodes/videomate-s350.h delete mode 100644 include/media/keycodes/videomate-tv-pvr.h delete mode 100644 include/media/keycodes/winfast-usbii-deluxe.h delete mode 100644 include/media/keycodes/winfast.h
drivers/media/IR/Makefile +1 -1
@@ -1,4 +1,4 @@ -ir-common-objs := ir-functions.o ir-keymaps.o +ir-common-objs := ir-functions.o ir-core-objs := ir-keytable.o ir-sysfs.o ir-raw-event.o rc-map.o obj-y += keymaps/
drivers/media/IR/ir-keymaps.c deleted +0 -45
45 lines not on this page · raw message
include/media/ir-common.h +0 -65
71 lines not on this page · raw message
include/media/ir-core.h +0 -18
@@ -102,24 +102,6 @@ struct ir_raw_handler {#define to_ir_input_dev (_attr) container_of(_attr, struct ir_input_dev, attr) -#define IR_KEYTABLE (a) \ -ir_codes_ ## a ## _table - -#define DECLARE_IR_KEYTABLE (a) \ -extern struct ir_scancode_table IR_KEYTABLE(a) - -#define DEFINE_IR_KEYTABLE (tabname, type) \ -struct ir_scancode_table IR_KEYTABLE(tabname) = { \ - .scan = tabname, \ - .size = ARRAY_SIZE(tabname), \ - .ir_type = type, \ - .name = #tabname, \ -}; \ -EXPORT_SYMBOL_GPL(IR_KEYTABLE(tabname)) - -#define DEFINE_LEGACY_IR_KEYTABLE (tabname) \ - DEFINE_IR_KEYTABLE(tabname, IR_TYPE_UNKNOWN) -/* Routines from rc-map.c */ int ir_register_map (struct rc_keymap *map);
include/media/keycodes/adstech-dvb-t-pci.h deleted +0 -65
65 lines not on this page · raw message
include/media/keycodes/apac-viewcomp.h deleted +0 -56
56 lines not on this page · raw message
include/media/keycodes/asus-pc39.h deleted +0 -67
67 lines not on this page · raw message
include/media/keycodes/ati-tv-wonder-hd-600.h deleted +0 -45
45 lines not on this page · raw message
include/media/keycodes/avermedia-a16d.h deleted +0 -52
52 lines not on this page · raw message
include/media/keycodes/avermedia-cardbus.h deleted +0 -73
73 lines not on this page · raw message
include/media/keycodes/avermedia-dvbt.h deleted +0 -54
54 lines not on this page · raw message
include/media/keycodes/avermedia-m135a-rm-jx.h deleted +0 -66
66 lines not on this page · raw message
include/media/keycodes/avermedia.h deleted +0 -62
62 lines not on this page · raw message
include/media/keycodes/avertv-303.h deleted +0 -61
61 lines not on this page · raw message
include/media/keycodes/behold-columbus.h deleted +0 -84
84 lines not on this page · raw message
include/media/keycodes/behold.h deleted +0 -117
117 lines not on this page · raw message
include/media/keycodes/budget-ci-old.h deleted +0 -68
68 lines not on this page · raw message
include/media/keycodes/cinergy-1400.h deleted +0 -60
60 lines not on this page · raw message
include/media/keycodes/cinergy.h deleted +0 -55
55 lines not on this page · raw message
include/media/keycodes/dm1105-nec.h deleted +0 -52
52 lines not on this page · raw message
include/media/keycodes/dntv-live-dvb-t.h deleted +0 -54
54 lines not on this page · raw message
include/media/keycodes/dntv-live-dvbt-pro.h deleted +0 -73
73 lines not on this page · raw message
include/media/keycodes/em-terratec.h deleted +0 -46
46 lines not on this page · raw message
include/media/keycodes/empty.h deleted +0 -20
@@ -1,20 +0,0 @@ -/* empty.h - Keytable for empty Remote Controller -* -* Imported from ir-keymaps.c -* -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -*/ - -/* empty keytable, can be used as placeholder for not-yet created keytables */ - -#ifdef IR_KEYMAPS -static struct ir_scancode empty[] = { - {0x2a ,KEY_COFFEE }, -}; -DEFINE_LEGACY_IR_KEYTABLE (empty); -#else -DECLARE_IR_KEYTABLE (empty); -#endif
include/media/keycodes/encore-enltv-fm53.h deleted +0 -57
57 lines not on this page · raw message
include/media/keycodes/encore-enltv.h deleted +0 -88
88 lines not on this page · raw message
include/media/keycodes/encore-enltv2.h deleted +0 -66
66 lines not on this page · raw message
include/media/keycodes/evga-indtube.h deleted +0 -37
@@ -1,37 +0,0 @@ -/* evga-indtube.h - Keytable for evga_indtube Remote Controller -* -* Imported from ir-keymaps.c -* -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -*/ - -/* EVGA inDtube -Devin Heitmueller <[email protected]> -*/ - -#ifdef IR_KEYMAPS -static struct ir_scancode evga_indtube[] = { - {0x12 ,KEY_POWER }, - {0x02 ,KEY_MODE },/* TV */ - {0x14 ,KEY_MUTE }, - {0x1a ,KEY_CHANNELUP }, - {0x16 ,KEY_TV2 },/* PIP */ - {0x1d ,KEY_VOLUMEUP }, - {0x05 ,KEY_CHANNELDOWN }, - {0x0f ,KEY_PLAYPAUSE }, - {0x19 ,KEY_VOLUMEDOWN }, - {0x1c ,KEY_REWIND }, - {0x0d ,KEY_RECORD }, - {0x18 ,KEY_FORWARD }, - {0x1e ,KEY_PREVIOUS }, - {0x1b ,KEY_STOP }, - {0x1f ,KEY_NEXT }, - {0x13 ,KEY_CAMERA }, -}; -DEFINE_LEGACY_IR_KEYTABLE (evga_indtube); -#else -DECLARE_IR_KEYTABLE (evga_indtube); -#endif
include/media/keycodes/eztv.h deleted +0 -72
72 lines not on this page · raw message
include/media/keycodes/flydvb.h deleted +0 -54
54 lines not on this page · raw message
include/media/keycodes/flyvideo.h deleted +0 -47
47 lines not on this page · raw message
include/media/keycodes/fusionhdtv-mce.h deleted +0 -74
74 lines not on this page · raw message
include/media/keycodes/gadmei-rm008z.h deleted +0 -57
57 lines not on this page · raw message
include/media/keycodes/genius-tvgo-a11mce.h deleted +0 -60
60 lines not on this page · raw message
include/media/keycodes/gotview7135.h deleted +0 -55
55 lines not on this page · raw message
include/media/keycodes/hauppauge-new.h deleted +0 -76
76 lines not on this page · raw message
include/media/keycodes/iodata-bctv7e.h deleted +0 -64
64 lines not on this page · raw message
include/media/keycodes/kaiomy.h deleted +0 -63
63 lines not on this page · raw message
include/media/keycodes/kworld-315u.h deleted +0 -59
59 lines not on this page · raw message
include/media/keycodes/kworld-plus-tv-analog.h deleted +0 -75
75 lines not on this page · raw message
include/media/keycodes/manli.h deleted +0 -111
111 lines not on this page · raw message
include/media/keycodes/msi-tvanywhere-plus.h deleted +0 -100
100 lines not on this page · raw message
include/media/keycodes/msi-tvanywhere.h deleted +0 -44
44 lines not on this page · raw message
include/media/keycodes/nebula.h deleted +0 -73
73 lines not on this page · raw message
include/media/keycodes/nec-terratec-cinergy-xs.h deleted +0 -81
81 lines not on this page · raw message
include/media/keycodes/norwood.h deleted +0 -61
61 lines not on this page · raw message
include/media/keycodes/npgtech.h deleted +0 -57
57 lines not on this page · raw message
include/media/keycodes/pctv-sedna.h deleted +0 -56
56 lines not on this page · raw message
include/media/keycodes/pinnacle-color.h deleted +0 -71
38 lines not on this page · raw message
include/media/keycodes/pinnacle-grey.h deleted +0 -66
66 lines not on this page · raw message
include/media/keycodes/pinnacle-pctv-hd.h deleted +0 -49
49 lines not on this page · raw message
include/media/keycodes/pixelview-new.h deleted +0 -59
59 lines not on this page · raw message
include/media/keycodes/pixelview.h deleted +0 -59
59 lines not on this page · raw message
include/media/keycodes/powercolor-real-angel.h deleted +0 -57
57 lines not on this page · raw message
include/media/keycodes/proteus-2309.h deleted +0 -45
45 lines not on this page · raw message
include/media/keycodes/purpletv.h deleted +0 -58
58 lines not on this page · raw message
include/media/keycodes/pv951.h deleted +0 -54
54 lines not on this page · raw message
include/media/keycodes/rc5-hauppauge-new.h deleted +0 -79
79 lines not on this page · raw message
include/media/keycodes/rc5-tv.h deleted +0 -57
57 lines not on this page · raw message
include/media/keycodes/real-audio-220-32-keys.h deleted +0 -54
54 lines not on this page · raw message
include/media/keycodes/tbs-nec.h deleted +0 -50
50 lines not on this page · raw message
include/media/keycodes/terratec-cinergy-xs.h deleted +0 -68
68 lines not on this page · raw message
include/media/keycodes/tevii-nec.h deleted +0 -65
65 lines not on this page · raw message
include/media/keycodes/tt-1500.h deleted +0 -58
58 lines not on this page · raw message
include/media/keycodes/videomate-s350.h deleted +0 -62
62 lines not on this page · raw message
include/media/keycodes/videomate-tv-pvr.h deleted +0 -64
64 lines not on this page · raw message
include/media/keycodes/winfast-usbii-deluxe.h deleted +0 -58
58 lines not on this page · raw message
include/media/keycodes/winfast.h deleted +0 -78
78 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
1.6.6.1
Part of the diff is not shown here. View the raw message.
PATCH 3/26 V4L/DVB: IR: use IR_KEYTABLE where an IR table is needed
In reply to a message not in the archiveReplaces most of the occurences of IR keytables on V4L drivers by a macro that evaluates to provide the name of the exported symbol.
drivers/media/dvb/dm1105/dm1105.c +1 -1
@@ -595,7 +595,7 @@ static irqreturn_t dm1105_irq(int irq, void *dev_id)int __devinit dm1105_ir_init (struct dm1105_dev *dm1105) {struct input_dev *input_dev; -struct ir_scancode_table *ir_codes = &ir_codes_dm1105_nec_table; +struct ir_scancode_table *ir_codes = &IR_KEYTABLE (dm1105_nec);u64 ir_type =IR_TYPE_OTHER ;int err = -ENOMEM ;
drivers/media/dvb/ttpci/budget-ci.c +3 -3
@@ -232,7 +232,7 @@ static int msp430_ir_init(struct budget_ci *budget_ci)case 0x1011 :case 0x1012 :/* The hauppauge keymap is a superset of these remotes */ - ir_codes = &ir_codes_hauppauge_new_table; + ir_codes = &IR_KEYTABLE (hauppauge_new);if (rc5_device <0 ) budget_ci->ir.rc5_device =0x1f ;
@@ -241,11 +241,11 @@ static int msp430_ir_init(struct budget_ci *budget_ci)case 0x1017 :case 0x101a :/* for the Technotrend 1500 bundled remote */ - ir_codes = &ir_codes_tt_1500_table; + ir_codes = &IR_KEYTABLE (tt_1500);break ;default :/* unknown remote */ - ir_codes = &ir_codes_budget_ci_old_table; + ir_codes = &IR_KEYTABLE (budget_ci_old);break ; }
drivers/media/video/bt8xx/bttv-input.c +12 -12
@@ -265,7 +265,7 @@ int bttv_input_init(struct bttv *btv)case BTTV_BOARD_AVERMEDIA :case BTTV_BOARD_AVPHONE98 :case BTTV_BOARD_AVERMEDIA98 : - ir_codes = &ir_codes_avermedia_table; + ir_codes = &IR_KEYTABLE (avermedia); ir->mask_keycode =0xf88000 ; ir->mask_keydown =0x010000 ; ir->polling =50 ;// ms
@@ -273,14 +273,14 @@ int bttv_input_init(struct bttv *btv)case BTTV_BOARD_AVDVBT_761 :case BTTV_BOARD_AVDVBT_771 : - ir_codes = &ir_codes_avermedia_dvbt_table; + ir_codes = &IR_KEYTABLE (avermedia_dvbt); ir->mask_keycode =0x0f00c0 ; ir->mask_keydown =0x000020 ; ir->polling =50 ;// ms break ;case BTTV_BOARD_PXELVWPLTVPAK : - ir_codes = &ir_codes_pixelview_table; + ir_codes = &IR_KEYTABLE (pixelview); ir->mask_keycode =0x003e00 ; ir->mask_keyup =0x010000 ; ir->polling =50 ;// ms
@@ -288,24 +288,24 @@ int bttv_input_init(struct bttv *btv)case BTTV_BOARD_PV_M4900 :case BTTV_BOARD_PV_BT878P_9B :case BTTV_BOARD_PV_BT878P_PLUS : - ir_codes = &ir_codes_pixelview_table; + ir_codes = &IR_KEYTABLE (pixelview); ir->mask_keycode =0x001f00 ; ir->mask_keyup =0x008000 ; ir->polling =50 ;// ms break ;case BTTV_BOARD_WINFAST2000 : - ir_codes = &ir_codes_winfast_table; + ir_codes = &IR_KEYTABLE (winfast); ir->mask_keycode =0x1f8 ;break ;case BTTV_BOARD_MAGICTVIEW061 :case BTTV_BOARD_MAGICTVIEW063 : - ir_codes = &ir_codes_winfast_table; + ir_codes = &IR_KEYTABLE (winfast); ir->mask_keycode =0x0008e000 ; ir->mask_keydown =0x00200000 ;break ;case BTTV_BOARD_APAC_VIEWCOMP : - ir_codes = &ir_codes_apac_viewcomp_table; + ir_codes = &IR_KEYTABLE (apac_viewcomp); ir->mask_keycode =0x001f00 ; ir->mask_keyup =0x008000 ; ir->polling =50 ;// ms
@@ -313,30 +313,30 @@ int bttv_input_init(struct bttv *btv)case BTTV_BOARD_ASKEY_CPH03X :case BTTV_BOARD_CONCEPTRONIC_CTVFMI2 :case BTTV_BOARD_CONTVFMI : - ir_codes = &ir_codes_pixelview_table; + ir_codes = &IR_KEYTABLE (pixelview); ir->mask_keycode =0x001F00 ; ir->mask_keyup =0x006000 ; ir->polling =50 ;// ms break ;case BTTV_BOARD_NEBULA_DIGITV : - ir_codes = &ir_codes_nebula_table; + ir_codes = &IR_KEYTABLE (nebula); btv->custom_irq = bttv_rc5_irq; ir->rc5_gpio =1 ;break ;case BTTV_BOARD_MACHTV_MAGICTV : - ir_codes = &ir_codes_apac_viewcomp_table; + ir_codes = &IR_KEYTABLE (apac_viewcomp); ir->mask_keycode =0x001F00 ; ir->mask_keyup =0x004000 ; ir->polling =50 ;/* ms */ break ;case BTTV_BOARD_KOZUMI_KTV_01C : - ir_codes = &ir_codes_pctv_sedna_table; + ir_codes = &IR_KEYTABLE (pctv_sedna); ir->mask_keycode =0x001f00 ; ir->mask_keyup =0x006000 ; ir->polling =50 ;/* ms */ break ;case BTTV_BOARD_ENLTV_FM_2 : - ir_codes = &ir_codes_encore_enltv2_table; + ir_codes = &IR_KEYTABLE (encore_enltv2); ir->mask_keycode =0x00fd00 ; ir->mask_keyup =0x000080 ; ir->polling =1 ;/* ms */
drivers/media/video/cx18/cx18-i2c.c +1 -1
@@ -109,7 +109,7 @@ static int cx18_i2c_new_ir(struct cx18 *cx, struct i2c_adapter *adap, u32 hw,/* Our default information for ir-kbd-i2c.c to use */ switch (hw) {case CX18_HW_Z8F0811_IR_RX_HAUP : - init_data->ir_codes = &ir_codes_hauppauge_new_table; + init_data->ir_codes = &IR_KEYTABLE (hauppauge_new); init_data->internal_get_key_func =IR_KBD_GET_KEY_HAUP_XVR ; init_data->type =IR_TYPE_RC5 ; init_data->name = cx->card_name;
drivers/media/video/cx23885/cx23885-input.c +1 -1
@@ -354,7 +354,7 @@ int cx23885_input_init(struct cx23885_dev *dev)case CX23885_BOARD_HAUPPAUGE_HVR1850 :case CX23885_BOARD_HAUPPAUGE_HVR1290 :/* Parameters for the grey Hauppauge remote for the HVR-1850 */ - ir_codes = &ir_codes_hauppauge_new_table; + ir_codes = &IR_KEYTABLE (hauppauge_new); ir_type =IR_TYPE_RC5 ; ir_addr =0x1e ;/* RC-5 system bits emitted by the remote */ ir_start =RC5_START_BITS_NORMAL ;/* A basic RC-5 remote */
drivers/media/video/cx88/cx88-input.c +19 -19
@@ -260,14 +260,14 @@ int cx88_ir_init(struct cx88_core *core, struct pci_dev *pci)case CX88_BOARD_DNTV_LIVE_DVB_T :case CX88_BOARD_KWORLD_DVB_T :case CX88_BOARD_KWORLD_DVB_T_CX22702 : - ir_codes = &ir_codes_dntv_live_dvb_t_table; + ir_codes = &IR_KEYTABLE (dntv_live_dvb_t); ir->gpio_addr =MO_GP1_IO ; ir->mask_keycode =0x1f ; ir->mask_keyup =0x60 ; ir->polling =50 ;/* ms */ break ;case CX88_BOARD_TERRATEC_CINERGY_1400_DVB_T1 : - ir_codes = &ir_codes_cinergy_1400_table; + ir_codes = &IR_KEYTABLE (cinergy_1400); ir_type =IR_TYPE_PD ; ir->sampling =0xeb04 ;/* address */ break ;
@@ -282,14 +282,14 @@ int cx88_ir_init(struct cx88_core *core, struct pci_dev *pci)case CX88_BOARD_PCHDTV_HD3000 :case CX88_BOARD_PCHDTV_HD5500 :case CX88_BOARD_HAUPPAUGE_IRONLY : - ir_codes = &ir_codes_hauppauge_new_table; + ir_codes = &IR_KEYTABLE (hauppauge_new); ir_type =IR_TYPE_RC5 ; ir->sampling =1 ;break ;case CX88_BOARD_WINFAST_DTV2000H :case CX88_BOARD_WINFAST_DTV2000H_J :case CX88_BOARD_WINFAST_DTV1800H : - ir_codes = &ir_codes_winfast_table; + ir_codes = &IR_KEYTABLE (winfast); ir->gpio_addr =MO_GP0_IO ; ir->mask_keycode =0x8f8 ; ir->mask_keyup =0x100 ;
@@ -298,14 +298,14 @@ int cx88_ir_init(struct cx88_core *core, struct pci_dev *pci)case CX88_BOARD_WINFAST2000XP_EXPERT :case CX88_BOARD_WINFAST_DTV1000 :case CX88_BOARD_WINFAST_TV2000_XP_GLOBAL : - ir_codes = &ir_codes_winfast_table; + ir_codes = &IR_KEYTABLE (winfast); ir->gpio_addr =MO_GP0_IO ; ir->mask_keycode =0x8f8 ; ir->mask_keyup =0x100 ; ir->polling =1 ;/* ms */ break ;case CX88_BOARD_IODATA_GVBCTV7E : - ir_codes = &ir_codes_iodata_bctv7e_table; + ir_codes = &IR_KEYTABLE (iodata_bctv7e); ir->gpio_addr =MO_GP0_IO ; ir->mask_keycode =0xfd ; ir->mask_keydown =0x02 ;
@@ -313,7 +313,7 @@ int cx88_ir_init(struct cx88_core *core, struct pci_dev *pci)break ;case CX88_BOARD_PROLINK_PLAYTVPVR :case CX88_BOARD_PIXELVIEW_PLAYTV_ULTRA_PRO : - ir_codes = &ir_codes_pixelview_table; + ir_codes = &IR_KEYTABLE (pixelview); ir->gpio_addr =MO_GP1_IO ; ir->mask_keycode =0x1f ; ir->mask_keyup =0x80 ;
@@ -321,28 +321,28 @@ int cx88_ir_init(struct cx88_core *core, struct pci_dev *pci)break ;case CX88_BOARD_PROLINK_PV_8000GT :case CX88_BOARD_PROLINK_PV_GLOBAL_XTREME : - ir_codes = &ir_codes_pixelview_new_table; + ir_codes = &IR_KEYTABLE (pixelview_new); ir->gpio_addr =MO_GP1_IO ; ir->mask_keycode =0x3f ; ir->mask_keyup =0x80 ; ir->polling =1 ;/* ms */ break ;case CX88_BOARD_KWORLD_LTV883 : - ir_codes = &ir_codes_pixelview_table; + ir_codes = &IR_KEYTABLE (pixelview); ir->gpio_addr =MO_GP1_IO ; ir->mask_keycode =0x1f ; ir->mask_keyup =0x60 ; ir->polling =1 ;/* ms */ break ;case CX88_BOARD_ADSTECH_DVB_T_PCI : - ir_codes = &ir_codes_adstech_dvb_t_pci_table; + ir_codes = &IR_KEYTABLE (adstech_dvb_t_pci); ir->gpio_addr =MO_GP1_IO ; ir->mask_keycode =0xbf ; ir->mask_keyup =0x40 ; ir->polling =50 ;/* ms */ break ;case CX88_BOARD_MSI_TVANYWHERE_MASTER : - ir_codes = &ir_codes_msi_tvanywhere_table; + ir_codes = &IR_KEYTABLE (msi_tvanywhere); ir->gpio_addr =MO_GP1_IO ; ir->mask_keycode =0x1f ; ir->mask_keyup =0x40 ;
@@ -350,7 +350,7 @@ int cx88_ir_init(struct cx88_core *core, struct pci_dev *pci)break ;case CX88_BOARD_AVERTV_303 :case CX88_BOARD_AVERTV_STUDIO_303 : - ir_codes = &ir_codes_avertv_303_table; + ir_codes = &IR_KEYTABLE (avertv_303); ir->gpio_addr =MO_GP2_IO ; ir->mask_keycode =0xfb ; ir->mask_keydown =0x02 ;
@@ -363,41 +363,41 @@ int cx88_ir_init(struct cx88_core *core, struct pci_dev *pci)case CX88_BOARD_PROF_7300 :case CX88_BOARD_PROF_7301 :case CX88_BOARD_PROF_6200 : - ir_codes = &ir_codes_tbs_nec_table; + ir_codes = &IR_KEYTABLE (tbs_nec); ir_type =IR_TYPE_PD ; ir->sampling =0xff00 ;/* address */ break ;case CX88_BOARD_TEVII_S460 :case CX88_BOARD_TEVII_S420 : - ir_codes = &ir_codes_tevii_nec_table; + ir_codes = &IR_KEYTABLE (tevii_nec); ir_type =IR_TYPE_PD ; ir->sampling =0xff00 ;/* address */ break ;case CX88_BOARD_DNTV_LIVE_DVB_T_PRO : - ir_codes = &ir_codes_dntv_live_dvbt_pro_table; + ir_codes = &IR_KEYTABLE (dntv_live_dvbt_pro); ir_type =IR_TYPE_PD ; ir->sampling =0xff00 ;/* address */ break ;case CX88_BOARD_NORWOOD_MICRO : - ir_codes = &ir_codes_norwood_table; + ir_codes = &IR_KEYTABLE (norwood); ir->gpio_addr =MO_GP1_IO ; ir->mask_keycode =0x0e ; ir->mask_keyup =0x80 ; ir->polling =50 ;/* ms */ break ;case CX88_BOARD_NPGTECH_REALTV_TOP10FM : - ir_codes = &ir_codes_npgtech_table; + ir_codes = &IR_KEYTABLE (npgtech); ir->gpio_addr =MO_GP0_IO ; ir->mask_keycode =0xfa ; ir->polling =50 ;/* ms */ break ;case CX88_BOARD_PINNACLE_PCTV_HD_800i: - ir_codes = &ir_codes_pinnacle_pctv_hd_table; + ir_codes = &IR_KEYTABLE (pinnacle_pctv_hd); ir_type =IR_TYPE_RC5 ; ir->sampling =1 ;break ;case CX88_BOARD_POWERCOLOR_REAL_ANGEL : - ir_codes = &ir_codes_powercolor_real_angel_table; + ir_codes = &IR_KEYTABLE (powercolor_real_angel); ir->gpio_addr =MO_GP2_IO ; ir->mask_keycode =0x7e ; ir->polling =100 ;/* ms */
drivers/media/video/em28xx/em28xx-cards.c +17 -17
@@ -601,7 +601,7 @@ struct em28xx_board em28xx_boards[] = { .name = "Gadmei UTV330+", .tuner_type = TUNER_TNF_5335MF, .tda9887_conf = TDA9887_PRESENT, - .ir_codes = &ir_codes_gadmei_rm008z_table, + .ir_codes = &IR_KEYTABLE(gadmei_rm008z), .decoder = EM28XX_SAA711X, .xclk = EM28XX_XCLK_FREQUENCY_12MHZ, .input = { {
@@ -790,7 +790,7 @@ struct em28xx_board em28xx_boards[] = { .mts_firmware = 1, .has_dvb = 1, .dvb_gpio = hauppauge_wintv_hvr_900_digital, - .ir_codes = &ir_codes_hauppauge_new_table, + .ir_codes = &IR_KEYTABLE(hauppauge_new), .decoder = EM28XX_TVP5150, .input = { { .type = EM28XX_VMUX_TELEVISION,
@@ -815,7 +815,7 @@ struct em28xx_board em28xx_boards[] = { .tuner_type = TUNER_XC2028, .tuner_gpio = default_tuner_gpio, .mts_firmware = 1, - .ir_codes = &ir_codes_hauppauge_new_table, + .ir_codes = &IR_KEYTABLE(hauppauge_new), .decoder = EM28XX_TVP5150, .input = { { .type = EM28XX_VMUX_TELEVISION,
@@ -841,7 +841,7 @@ struct em28xx_board em28xx_boards[] = { .mts_firmware = 1, .has_dvb = 1, .dvb_gpio = hauppauge_wintv_hvr_900_digital, - .ir_codes = &ir_codes_hauppauge_new_table, + .ir_codes = &IR_KEYTABLE(hauppauge_new), .decoder = EM28XX_TVP5150, .input = { { .type = EM28XX_VMUX_TELEVISION,
@@ -867,7 +867,7 @@ struct em28xx_board em28xx_boards[] = { .mts_firmware = 1, .has_dvb = 1, .dvb_gpio = hauppauge_wintv_hvr_900_digital, - .ir_codes = &ir_codes_rc5_hauppauge_new_table, + .ir_codes = &IR_KEYTABLE(rc5_hauppauge_new), .decoder = EM28XX_TVP5150, .input = { { .type = EM28XX_VMUX_TELEVISION,
@@ -893,7 +893,7 @@ struct em28xx_board em28xx_boards[] = { .mts_firmware = 1, .has_dvb = 1, .dvb_gpio = hauppauge_wintv_hvr_900_digital, - .ir_codes = &ir_codes_pinnacle_pctv_hd_table, + .ir_codes = &IR_KEYTABLE(pinnacle_pctv_hd), .decoder = EM28XX_TVP5150, .input = { { .type = EM28XX_VMUX_TELEVISION,
@@ -919,7 +919,7 @@ struct em28xx_board em28xx_boards[] = { .mts_firmware = 1, .has_dvb = 1, .dvb_gpio = hauppauge_wintv_hvr_900_digital, - .ir_codes = &ir_codes_ati_tv_wonder_hd_600_table, + .ir_codes = &IR_KEYTABLE(ati_tv_wonder_hd_600), .decoder = EM28XX_TVP5150, .input = { { .type = EM28XX_VMUX_TELEVISION,
@@ -945,7 +945,7 @@ struct em28xx_board em28xx_boards[] = { .decoder = EM28XX_TVP5150, .has_dvb = 1, .dvb_gpio = default_digital, - .ir_codes = &ir_codes_terratec_cinergy_xs_table, + .ir_codes = &IR_KEYTABLE(terratec_cinergy_xs), .xclk = EM28XX_XCLK_FREQUENCY_12MHZ, /* NEC IR */ .input = { { .type = EM28XX_VMUX_TELEVISION,
@@ -1295,7 +1295,7 @@ struct em28xx_board em28xx_boards[] = { .decoder = EM28XX_SAA711X, .has_dvb = 1, .dvb_gpio = em2882_kworld_315u_digital, - .ir_codes = &ir_codes_kworld_315u_table, + .ir_codes = &IR_KEYTABLE(kworld_315u), .xclk = EM28XX_XCLK_FREQUENCY_12MHZ, .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE,/* Analog mode - still not ready */
@@ -1424,7 +1424,7 @@ struct em28xx_board em28xx_boards[] = { .has_dvb = 1, .dvb_gpio = kworld_330u_digital, .xclk = EM28XX_XCLK_FREQUENCY_12MHZ, /* NEC IR */ - .ir_codes = &ir_codes_kworld_315u_table, + .ir_codes = &IR_KEYTABLE(kworld_315u), .input = { { .type = EM28XX_VMUX_TELEVISION, .vmux = TVP5150_COMPOSITE0,
@@ -1447,7 +1447,7 @@ struct em28xx_board em28xx_boards[] = { .decoder = EM28XX_TVP5150, .has_dvb = 1, .dvb_gpio = hauppauge_wintv_hvr_900_digital, - .ir_codes = &ir_codes_terratec_cinergy_xs_table, + .ir_codes = &IR_KEYTABLE(terratec_cinergy_xs), .xclk = EM28XX_XCLK_FREQUENCY_12MHZ, .input = { { .type = EM28XX_VMUX_TELEVISION,
@@ -1540,7 +1540,7 @@ struct em28xx_board em28xx_boards[] = { .mts_firmware = 1, .decoder = EM28XX_TVP5150, .tuner_gpio = default_tuner_gpio, - .ir_codes = &ir_codes_kaiomy_table, + .ir_codes = &IR_KEYTABLE(kaiomy), .input = { { .type = EM28XX_VMUX_TELEVISION, .vmux = TVP5150_COMPOSITE0,
@@ -1640,7 +1640,7 @@ struct em28xx_board em28xx_boards[] = { .mts_firmware = 1, .has_dvb = 1, .dvb_gpio = evga_indtube_digital, - .ir_codes = &ir_codes_evga_indtube_table, + .ir_codes = &IR_KEYTABLE(evga_indtube), .input = { { .type = EM28XX_VMUX_TELEVISION, .vmux = TVP5150_COMPOSITE0,
@@ -2334,21 +2334,21 @@ void em28xx_register_i2c_ir(struct em28xx *dev)switch (dev->model) {case EM2800_BOARD_TERRATEC_CINERGY_200 :case EM2820_BOARD_TERRATEC_CINERGY_250 : - dev->init_data.ir_codes = &ir_codes_em_terratec_table; + dev->init_data.ir_codes = &IR_KEYTABLE (em_terratec); dev->init_data.get_key = em28xx_get_key_terratec; dev->init_data.name ="i2c IR (EM28XX Terratec)" ;break ;case EM2820_BOARD_PINNACLE_USB_2 : - dev->init_data.ir_codes = &ir_codes_pinnacle_grey_table; + dev->init_data.ir_codes = &IR_KEYTABLE (pinnacle_grey); dev->init_data.get_key = em28xx_get_key_pinnacle_usb_grey; dev->init_data.name ="i2c IR (EM28XX Pinnacle PCTV)" ;break ;case EM2820_BOARD_HAUPPAUGE_WINTV_USB_2 : - dev->init_data.ir_codes = &ir_codes_rc5_hauppauge_new_table; + dev->init_data.ir_codes = &IR_KEYTABLE (rc5_hauppauge_new); dev->init_data.get_key = em28xx_get_key_em_haup; dev->init_data.name ="i2c IR (EM2840 Hauppauge)" ;case EM2820_BOARD_LEADTEK_WINFAST_USBII_DELUXE : - dev->init_data.ir_codes = &ir_codes_winfast_usbii_deluxe_table;; + dev->init_data.ir_codes = &IR_KEYTABLE (winfast_usbii_deluxe);; dev->init_data.get_key = em28xx_get_key_winfast_usbii_deluxe; dev->init_data.name ="i2c IR (EM2820 Winfast TV USBII Deluxe)" ;break ;
drivers/media/video/ir-kbd-i2c.c +9 -9
@@ -322,13 +322,13 @@ static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id) name ="Pixelview" ; ir->get_key = get_key_pixelview; ir_type =IR_TYPE_OTHER ; - ir_codes = &ir_codes_empty_table; + ir_codes = &IR_KEYTABLE (empty);break ;case 0x4b : name ="PV951" ; ir->get_key = get_key_pv951; ir_type =IR_TYPE_OTHER ; - ir_codes = &ir_codes_pv951_table; + ir_codes = &IR_KEYTABLE (pv951);break ;case 0x18 :case 0x1f :
@@ -337,22 +337,22 @@ static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id) ir->get_key = get_key_haup; ir_type =IR_TYPE_RC5 ;if (hauppauge ==1 ) { - ir_codes = &ir_codes_hauppauge_new_table; + ir_codes = &IR_KEYTABLE (hauppauge_new); }else { - ir_codes = &ir_codes_rc5_tv_table; + ir_codes = &IR_KEYTABLE (rc5_tv); }break ;case 0x30 : name ="KNC One" ; ir->get_key = get_key_knc1; ir_type =IR_TYPE_OTHER ; - ir_codes = &ir_codes_empty_table; + ir_codes = &IR_KEYTABLE (empty);break ;case 0x6b : name ="FusionHDTV" ; ir->get_key = get_key_fusionhdtv; ir_type =IR_TYPE_RC5 ; - ir_codes = &ir_codes_fusionhdtv_mce_table; + ir_codes = &IR_KEYTABLE (fusionhdtv_mce);break ;case 0x0b :case 0x47 :
@@ -365,9 +365,9 @@ static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id) ir_type =IR_TYPE_RC5 ; ir->get_key = get_key_haup_xvr;if (hauppauge ==1 ) { - ir_codes = &ir_codes_hauppauge_new_table; + ir_codes = &IR_KEYTABLE (hauppauge_new); }else { - ir_codes = &ir_codes_rc5_tv_table; + ir_codes = &IR_KEYTABLE (rc5_tv); } }else {/* Handled by saa7134-input */
@@ -379,7 +379,7 @@ static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id) name ="AVerMedia Cardbus remote" ; ir->get_key = get_key_avermedia_cardbus; ir_type =IR_TYPE_OTHER ; - ir_codes = &ir_codes_avermedia_cardbus_table; + ir_codes = &IR_KEYTABLE (avermedia_cardbus);break ; }
drivers/media/video/ivtv/ivtv-i2c.c +3 -3
@@ -193,7 +193,7 @@ static int ivtv_i2c_new_ir(struct ivtv *itv, u32 hw, const char *type, u8 addr)/* Our default information for ir-kbd-i2c.c to use */ switch (hw) {case IVTV_HW_I2C_IR_RX_AVER : - init_data->ir_codes = &ir_codes_avermedia_cardbus_table; + init_data->ir_codes = &IR_KEYTABLE (avermedia_cardbus); init_data->internal_get_key_func =IR_KBD_GET_KEY_AVERMEDIA_CARDBUS ; init_data->type =IR_TYPE_OTHER ;
@@ -202,14 +202,14 @@ static int ivtv_i2c_new_ir(struct ivtv *itv, u32 hw, const char *type, u8 addr)case IVTV_HW_I2C_IR_RX_HAUP_EXT :case IVTV_HW_I2C_IR_RX_HAUP_INT :/* Default to old black remote */ - init_data->ir_codes = &ir_codes_rc5_tv_table; + init_data->ir_codes = &IR_KEYTABLE (rc5_tv); init_data->internal_get_key_func =IR_KBD_GET_KEY_HAUP ; init_data->type =IR_TYPE_RC5 ; init_data->name = itv->card_name;break ;case IVTV_HW_Z8F0811_IR_RX_HAUP :/* Default to grey remote */ - init_data->ir_codes = &ir_codes_hauppauge_new_table; + init_data->ir_codes = &IR_KEYTABLE (hauppauge_new); init_data->internal_get_key_func =IR_KBD_GET_KEY_HAUP_XVR ; init_data->type =IR_TYPE_RC5 ; init_data->name = itv->card_name;
drivers/media/video/saa7134/saa7134-input.c +34 -34
253 lines not on this page · raw message
Signature · 1 line
1.6.6.1
PATCH 24/26 V4L/DVB: ir-core: Add support for badly-implemented hardware decoders
In reply to a message not in the archiveA few hardware Remote Controller decoders, even using a standard protocol, aren't able to provide the entire scancode. Due to that, the capability of using other IR's are limited on those hardware.
Adds a way to indicate to ir-core what are the bits that the hardware provides, from a scancode, allowing the addition of a complete IR table to the kernel and allowing a limited support for changing the Remote Controller on those devices.
create mode 100644 drivers/media/IR/keymaps/rc-pixelview-mk12.c
drivers/media/IR/ir-keytable.c +19 -6
@@ -88,6 +88,18 @@ static int ir_do_setkeycode(struct input_dev *dev, {unsigned int i;int old_keycode =KEY_RESERVED ; +struct ir_input_dev *ir_dev =input_get_drvdata (dev); + +/* +* Unfortunately, some hardware-based IR decoders don't provide +* all bits for the complete IR code. In general, they provide only +* the command part of the IR code. Yet, as it is possible to replace +* the provided IR with another one, it is needed to allow loading +* IR tables from other remotes. So, +*/ +if (ir_dev->props && ir_dev->props->scanmask) { + scancode &= ir_dev->props->scanmask; + }/* First check if we already have a mapping for this ir command */ for (i =0 ; i < rc_tab->len; i++) {
@@ -447,6 +459,13 @@ int __ir_input_register(struct input_dev *input_dev, sizeof(struct ir_scancode)); ir_dev->rc_tab.scan =kmalloc (ir_dev->rc_tab.alloc,GFP_KERNEL ); ir_dev->rc_tab.size = ir_dev->rc_tab.alloc /sizeof (struct ir_scancode ); +if (props) { + ir_dev->props = props; +if (props->open) + input_dev->open = ir_open; +if (props->close) + input_dev->close = ir_close; + }if (!ir_dev->rc_tab.scan) { rc = -ENOMEM ;
@@ -464,12 +483,6 @@ int __ir_input_register(struct input_dev *input_dev, goto out_table; } - ir_dev->props = props; -if (props && props->open) - input_dev->open = ir_open; -if (props && props->close) - input_dev->close = ir_close; - rc =ir_register_class (input_dev);if (rc <0 ) goto out_table;
drivers/media/IR/keymaps/Makefile +1 -0
@@ -46,6 +46,7 @@ obj-$(CONFIG_RC_MAP) += rc-adstech-dvb-t-pci.o \ rc-pinnacle-grey.o \ rc-pinnacle-pctv-hd.o \ rc-pixelview.o \ + rc-pixelview-mk12.o \ rc-pixelview-new.o \ rc-powercolor-real-angel.o \ rc-proteus-2309.o \
drivers/media/IR/keymaps/rc-pixelview-mk12.c new file +83 -0
83 lines not on this page · raw message
drivers/media/video/cx88/cx88-input.c +28 -2
@@ -247,6 +247,9 @@ int cx88_ir_init(struct cx88_core *core, struct pci_dev *pci)char *ir_codes =NULL ;u64 ir_type =IR_TYPE_OTHER ;int err = -ENOMEM ; +u32 hardware_mask =0 ;/* For devices with a hardware mask, when +* used with a full-code IR table +*/ ir =kzalloc (sizeof (*ir),GFP_KERNEL ); input_dev =input_allocate_device ();
@@ -313,11 +316,18 @@ int cx88_ir_init(struct cx88_core *core, struct pci_dev *pci)break ;case CX88_BOARD_PROLINK_PLAYTVPVR :case CX88_BOARD_PIXELVIEW_PLAYTV_ULTRA_PRO : - ir_codes =RC_MAP_PIXELVIEW ; +/* +* It seems that this hardware is paired with NEC extended +* address 0x866b. So, unfortunately, its usage with other +* IR's with different address won't work. Still, there are +* other IR's from the same manufacturer that works, like the +* 002-T mini RC, provided with newer PV hardware +*/ + ir_codes =RC_MAP_PIXELVIEW_MK12 ; ir->gpio_addr =MO_GP1_IO ; - ir->mask_keycode =0x1f ;/* Only command is retrieved */ ir->mask_keyup =0x80 ; ir->polling =10 ;/* ms */ + hardware_mask =0x3f ;/* Hardware returns only 6 bits from command part */ break ;case CX88_BOARD_PROLINK_PV_8000GT :case CX88_BOARD_PROLINK_PV_GLOBAL_XTREME :
@@ -409,6 +419,21 @@ int cx88_ir_init(struct cx88_core *core, struct pci_dev *pci) goto err_out_free; } +/* +* The usage of mask_keycode were very convenient, due to several +* reasons. Among others, the scancode tables were using the scancode +* as the index elements. So, the less bits it was used, the smaller +* the table were stored. After the input changes, the better is to use +* the full scancodes, since it allows replacing the IR remote by +* another one. Unfortunately, there are still some hardware, like +* Pixelview Ultra Pro, where only part of the scancode is sent via +* GPIO. So, there's no way to get the full scancode. Due to that, +* hardware_mask were introduced here: it represents those hardware +* that has such limits. +*/ +if (hardware_mask && !ir->mask_keycode) + ir->mask_keycode = hardware_mask; +/* init input device */ snprintf (ir->name,sizeof (ir->name),"cx88 IR (%s)" , core->board.name);snprintf (ir->phys,sizeof (ir->phys),"pci-%s/ir0" ,pci_name (pci));
@@ -436,6 +461,7 @@ int cx88_ir_init(struct cx88_core *core, struct pci_dev *pci) ir->props.priv = core; ir->props.open = cx88_ir_open; ir->props.close = cx88_ir_close; + ir->props.scanmask = hardware_mask;/* all done */ err =ir_input_register (ir->input, ir_codes, &ir->props,MODULE_NAME );
include/media/ir-core.h +20 -4
@@ -33,12 +33,28 @@ enum raw_event_type { IR_STOP_EVENT = (1 << 3), }; +/** +* struct ir_dev_props - Allow caller drivers to set special properties +* @allowed_protos: bitmask with the supported IR_TYPE_* protocols +* @scanmask: some hardware decoders are not capable of providing the full +* scancode to the application. As this is a hardware limit, we can't do +* anything with it. Yet, as the same keycode table can be used with other +* devices, a mask is provided to allow its usage. Drivers should generally +* leave this field in blank +* @priv: driver-specific data, to be used on the callbacks +* @change_protocol: allow changing the protocol used on hardware decoders +* @open: callback to allow drivers to enable polling/irq when IR input device +* is opened. +* @close: callback to allow drivers to disable polling/irq when IR input device +* is opened. +*/ struct ir_dev_props { -unsigned long allowed_protos; +unsigned long allowed_protos; +u32 scanmask;void *priv; -int (*change_protocol)(void *priv,u64 ir_type); -int (*open)(void *priv); -void (*close)(void *priv); +int (*change_protocol)(void *priv,u64 ir_type); +int (*open)(void *priv); +void (*close)(void *priv); };struct ir_raw_event {
include/media/rc-map.h +2 -1
@@ -18,7 +18,7 @@#define IR_TYPE_OTHER (1u << 31)struct ir_scancode { -u16 scancode; +u32 scancode;u32 keycode; };
@@ -95,6 +95,7 @@ void rc_map_init(void);#define RC_MAP_PINNACLE_PCTV_HD "rc-pinnacle-pctv-hd"#define RC_MAP_PIXELVIEW_NEW "rc-pixelview-new"#define RC_MAP_PIXELVIEW "rc-pixelview" +#define RC_MAP_PIXELVIEW_MK12 "rc-pixelview-mk12"#define RC_MAP_POWERCOLOR_REAL_ANGEL "rc-powercolor-real-angel"#define RC_MAP_PROTEUS_2309 "rc-proteus-2309"#define RC_MAP_PURPLETV "rc-purpletv"
Signature · 1 line
1.6.6.1
PATCH 10/26 V4L/DVB: ir-core: Make use of the new IR keymap modules
In reply to a message not in the archiveInstead of using the ugly keymap sequences, use the new rc-*.ko keymap files. For now, it is still needed to have one keymap loaded, for the RC code to work. Later patches will remove this depenency.
create mode 100644 include/media/rc-map.h
drivers/media/IR/Makefile +2 -0
@@ -1,6 +1,8 @@ ir-common-objs := ir-functions.o ir-keymaps.o ir-core-objs := ir-keytable.o ir-sysfs.o ir-raw-event.o rc-map.o +obj-y += keymaps/ + obj-$(CONFIG_IR_CORE) += ir-core.o obj-$(CONFIG_VIDEO_IR) += ir-common.o obj-$(CONFIG_IR_NEC_DECODER) += ir-nec-decoder.o
drivers/media/IR/ir-sysfs.c +3 -1
@@ -250,8 +250,10 @@ static int __init ir_core_init(void)return rc; } -/* Initialize/load the decoders that will be used */ +/* Initialize/load the decoders/keymap code that will be used */ ir_raw_init (); +rc_map_init (); +return 0 ; }
drivers/media/IR/rc-map.c +21 -6
@@ -26,12 +26,14 @@ static struct rc_keymap *seek_rc_map(const char *name)spin_lock (&rc_map_lock);list_for_each_entry (map, &rc_map_list, list) { -if (!strcmp (name, map->map.name)) -break ; +if (!strcmp (name, map->map.name)) { +spin_unlock (&rc_map_lock); +return map; + } }spin_unlock (&rc_map_lock); -return map; +return NULL ; }struct ir_scancode_table *get_rc_map (const char *name)
@@ -43,15 +45,22 @@ struct ir_scancode_table *get_rc_map(const char *name) map =seek_rc_map (name);#ifdef MODULE if (!map) { - rc =request_module ("name" ); -if (rc <0 ) + rc =request_module (name); +if (rc <0 ) { +printk (KERN_ERR "Couldn't load IR keymap %s\n" , name);return NULL ; + } +msleep (20 );/* Give some time for IR to register */ map =seek_rc_map (name); }#endif -if (!map) +if (!map) { +printk (KERN_ERR "IR keymap %s not found\n" , name);return NULL ; + } + +printk (KERN_INFO "Registered IR keymap %s\n" , map->map.name);return &map->map; }
@@ -73,3 +82,9 @@ void ir_unregister_map(struct rc_keymap *map)spin_unlock (&rc_map_lock); }EXPORT_SYMBOL_GPL (ir_unregister_map); + +void rc_map_init (void ) +{ +spin_lock_init (&rc_map_lock); + +}
drivers/media/dvb/dm1105/dm1105.c +2 -2
@@ -595,7 +595,7 @@ static irqreturn_t dm1105_irq(int irq, void *dev_id)int __devinit dm1105_ir_init (struct dm1105_dev *dm1105) {struct input_dev *input_dev; -struct ir_scancode_table *ir_codes = &IR_KEYTABLE (dm1105_nec); +char *ir_codes =NULL ;u64 ir_type =IR_TYPE_OTHER ;int err = -ENOMEM ;
@@ -629,7 +629,7 @@ int __devinit dm1105_ir_init(struct dm1105_dev *dm1105)INIT_WORK (&dm1105->ir.work, dm1105_emit_key); - err =__ir_input_register (input_dev, ir_codes,NULL ,MODULE_NAME ); + err =ir_input_register (input_dev, ir_codes,NULL ,MODULE_NAME );return err; }
drivers/media/dvb/ttpci/budget-ci.c +5 -5
@@ -192,7 +192,7 @@ static int msp430_ir_init(struct budget_ci *budget_ci)struct saa7146_dev *saa = budget_ci->budget.dev;struct input_dev *input_dev = budget_ci->ir.dev;int error; -struct ir_scancode_table *ir_codes; +char *ir_codes =NULL ; budget_ci->ir.dev = input_dev =input_allocate_device ();
@@ -232,7 +232,7 @@ static int msp430_ir_init(struct budget_ci *budget_ci)case 0x1011 :case 0x1012 :/* The hauppauge keymap is a superset of these remotes */ - ir_codes = &IR_KEYTABLE (hauppauge_new); + ir_codes =RC_MAP_HAUPPAUGE_NEW ;if (rc5_device <0 ) budget_ci->ir.rc5_device =0x1f ;
@@ -241,11 +241,11 @@ static int msp430_ir_init(struct budget_ci *budget_ci)case 0x1017 :case 0x101a :/* for the Technotrend 1500 bundled remote */ - ir_codes = &IR_KEYTABLE (tt_1500); + ir_codes =RC_MAP_TT_1500 ;break ;default :/* unknown remote */ - ir_codes = &IR_KEYTABLE (budget_ci_old); + ir_codes =RC_MAP_BUDGET_CI_OLD ;break ; }
@@ -256,7 +256,7 @@ static int msp430_ir_init(struct budget_ci *budget_ci) budget_ci->ir.timer_keyup.function = msp430_ir_keyup; budget_ci->ir.timer_keyup.data = (unsigned long ) &budget_ci->ir; budget_ci->ir.last_raw =0xffff ;/* An impossible value */ - error =__ir_input_register (input_dev, ir_codes,NULL ,MODULE_NAME ); + error =ir_input_register (input_dev, ir_codes,NULL ,MODULE_NAME );if (error) {printk (KERN_ERR "budget_ci: could not init driver for IR device (code %d)\n" , error);return error;
drivers/media/video/bt8xx/bttv-input.c +14 -14
@@ -247,7 +247,7 @@ static void bttv_ir_stop(struct bttv *btv)int bttv_input_init (struct bttv *btv) {struct card_ir *ir; -struct ir_scancode_table *ir_codes =NULL ; +char *ir_codes =NULL ;struct input_dev *input_dev;u64 ir_type =IR_TYPE_OTHER ;int err = -ENOMEM ;
@@ -265,7 +265,7 @@ int bttv_input_init(struct bttv *btv)case BTTV_BOARD_AVERMEDIA :case BTTV_BOARD_AVPHONE98 :case BTTV_BOARD_AVERMEDIA98 : - ir_codes = &IR_KEYTABLE (avermedia); + ir_codes =RC_MAP_AVERMEDIA ; ir->mask_keycode =0xf88000 ; ir->mask_keydown =0x010000 ; ir->polling =50 ;// ms
@@ -273,14 +273,14 @@ int bttv_input_init(struct bttv *btv)case BTTV_BOARD_AVDVBT_761 :case BTTV_BOARD_AVDVBT_771 : - ir_codes = &IR_KEYTABLE (avermedia_dvbt); + ir_codes =RC_MAP_AVERMEDIA_DVBT ; ir->mask_keycode =0x0f00c0 ; ir->mask_keydown =0x000020 ; ir->polling =50 ;// ms break ;case BTTV_BOARD_PXELVWPLTVPAK : - ir_codes = &IR_KEYTABLE (pixelview); + ir_codes =RC_MAP_PIXELVIEW ; ir->mask_keycode =0x003e00 ; ir->mask_keyup =0x010000 ; ir->polling =50 ;// ms
@@ -288,24 +288,24 @@ int bttv_input_init(struct bttv *btv)case BTTV_BOARD_PV_M4900 :case BTTV_BOARD_PV_BT878P_9B :case BTTV_BOARD_PV_BT878P_PLUS : - ir_codes = &IR_KEYTABLE (pixelview); + ir_codes =RC_MAP_PIXELVIEW ; ir->mask_keycode =0x001f00 ; ir->mask_keyup =0x008000 ; ir->polling =50 ;// ms break ;case BTTV_BOARD_WINFAST2000 : - ir_codes = &IR_KEYTABLE (winfast); + ir_codes =RC_MAP_WINFAST ; ir->mask_keycode =0x1f8 ;break ;case BTTV_BOARD_MAGICTVIEW061 :case BTTV_BOARD_MAGICTVIEW063 : - ir_codes = &IR_KEYTABLE (winfast); + ir_codes =RC_MAP_WINFAST ; ir->mask_keycode =0x0008e000 ; ir->mask_keydown =0x00200000 ;break ;case BTTV_BOARD_APAC_VIEWCOMP : - ir_codes = &IR_KEYTABLE (apac_viewcomp); + ir_codes =RC_MAP_APAC_VIEWCOMP ; ir->mask_keycode =0x001f00 ; ir->mask_keyup =0x008000 ; ir->polling =50 ;// ms
@@ -313,30 +313,30 @@ int bttv_input_init(struct bttv *btv)case BTTV_BOARD_ASKEY_CPH03X :case BTTV_BOARD_CONCEPTRONIC_CTVFMI2 :case BTTV_BOARD_CONTVFMI : - ir_codes = &IR_KEYTABLE (pixelview); + ir_codes =RC_MAP_PIXELVIEW ; ir->mask_keycode =0x001F00 ; ir->mask_keyup =0x006000 ; ir->polling =50 ;// ms break ;case BTTV_BOARD_NEBULA_DIGITV : - ir_codes = &IR_KEYTABLE (nebula); + ir_codes =RC_MAP_NEBULA ; btv->custom_irq = bttv_rc5_irq; ir->rc5_gpio =1 ;break ;case BTTV_BOARD_MACHTV_MAGICTV : - ir_codes = &IR_KEYTABLE (apac_viewcomp); + ir_codes =RC_MAP_APAC_VIEWCOMP ; ir->mask_keycode =0x001F00 ; ir->mask_keyup =0x004000 ; ir->polling =50 ;/* ms */ break ;case BTTV_BOARD_KOZUMI_KTV_01C : - ir_codes = &IR_KEYTABLE (pctv_sedna); + ir_codes =RC_MAP_PCTV_SEDNA ; ir->mask_keycode =0x001f00 ; ir->mask_keyup =0x006000 ; ir->polling =50 ;/* ms */ break ;case BTTV_BOARD_ENLTV_FM_2 : - ir_codes = &IR_KEYTABLE (encore_enltv2); + ir_codes =RC_MAP_ENCORE_ENLTV2 ; ir->mask_keycode =0x00fd00 ; ir->mask_keyup =0x000080 ; ir->polling =1 ;/* ms */
@@ -391,7 +391,7 @@ int bttv_input_init(struct bttv *btv)bttv_ir_start (btv, ir);/* all done */ - err =__ir_input_register (btv->remote->dev, ir_codes,NULL ,MODULE_NAME ); + err =ir_input_register (btv->remote->dev, ir_codes,NULL ,MODULE_NAME );if (err) goto err_out_stop;
drivers/media/video/cx18/cx18-i2c.c +1 -1
@@ -109,7 +109,7 @@ static int cx18_i2c_new_ir(struct cx18 *cx, struct i2c_adapter *adap, u32 hw,/* Our default information for ir-kbd-i2c.c to use */ switch (hw) {case CX18_HW_Z8F0811_IR_RX_HAUP : - init_data->ir_codes = &IR_KEYTABLE (hauppauge_new); + init_data->ir_codes =RC_MAP_HAUPPAUGE_NEW ; init_data->internal_get_key_func =IR_KBD_GET_KEY_HAUP_XVR ; init_data->type =IR_TYPE_RC5 ; init_data->name = cx->card_name;
drivers/media/video/cx23885/cx23885-input.c +3 -3
@@ -339,7 +339,7 @@ int cx23885_input_init(struct cx23885_dev *dev) {struct card_ir *ir;struct input_dev *input_dev; -struct ir_scancode_table *ir_codes =NULL ; +char *ir_codes =NULL ;int ir_type, ir_addr, ir_start;int ret;
@@ -354,7 +354,7 @@ int cx23885_input_init(struct cx23885_dev *dev)case CX23885_BOARD_HAUPPAUGE_HVR1850 :case CX23885_BOARD_HAUPPAUGE_HVR1290 :/* Parameters for the grey Hauppauge remote for the HVR-1850 */ - ir_codes = &IR_KEYTABLE (hauppauge_new); + ir_codes =RC_MAP_HAUPPAUGE_NEW ; ir_type =IR_TYPE_RC5 ; ir_addr =0x1e ;/* RC-5 system bits emitted by the remote */ ir_start =RC5_START_BITS_NORMAL ;/* A basic RC-5 remote */
@@ -399,7 +399,7 @@ int cx23885_input_init(struct cx23885_dev *dev) dev->ir_input = ir;cx23885_input_ir_start (dev); - ret =__ir_input_register (ir->dev, ir_codes,NULL ,MODULE_NAME ); + ret =ir_input_register (ir->dev, ir_codes,NULL ,MODULE_NAME );if (ret) goto err_out_stop;
drivers/media/video/cx88/cx88-input.c +21 -21
160 lines not on this page · raw message
drivers/media/video/em28xx/em28xx-cards.c +17 -17
@@ -601,7 +601,7 @@ struct em28xx_board em28xx_boards[] = { .name = "Gadmei UTV330+", .tuner_type = TUNER_TNF_5335MF, .tda9887_conf = TDA9887_PRESENT, - .ir_codes = &IR_KEYTABLE(gadmei_rm008z), + .ir_codes = RC_MAP_GADMEI_RM008Z, .decoder = EM28XX_SAA711X, .xclk = EM28XX_XCLK_FREQUENCY_12MHZ, .input = { {
@@ -790,7 +790,7 @@ struct em28xx_board em28xx_boards[] = { .mts_firmware = 1, .has_dvb = 1, .dvb_gpio = hauppauge_wintv_hvr_900_digital, - .ir_codes = &IR_KEYTABLE(hauppauge_new), + .ir_codes = RC_MAP_HAUPPAUGE_NEW, .decoder = EM28XX_TVP5150, .input = { { .type = EM28XX_VMUX_TELEVISION,
@@ -815,7 +815,7 @@ struct em28xx_board em28xx_boards[] = { .tuner_type = TUNER_XC2028, .tuner_gpio = default_tuner_gpio, .mts_firmware = 1, - .ir_codes = &IR_KEYTABLE(hauppauge_new), + .ir_codes = RC_MAP_HAUPPAUGE_NEW, .decoder = EM28XX_TVP5150, .input = { { .type = EM28XX_VMUX_TELEVISION,
@@ -841,7 +841,7 @@ struct em28xx_board em28xx_boards[] = { .mts_firmware = 1, .has_dvb = 1, .dvb_gpio = hauppauge_wintv_hvr_900_digital, - .ir_codes = &IR_KEYTABLE(hauppauge_new), + .ir_codes = RC_MAP_HAUPPAUGE_NEW, .decoder = EM28XX_TVP5150, .input = { { .type = EM28XX_VMUX_TELEVISION,
@@ -867,7 +867,7 @@ struct em28xx_board em28xx_boards[] = { .mts_firmware = 1, .has_dvb = 1, .dvb_gpio = hauppauge_wintv_hvr_900_digital, - .ir_codes = &IR_KEYTABLE(rc5_hauppauge_new), + .ir_codes = RC_MAP_RC5_HAUPPAUGE_NEW, .decoder = EM28XX_TVP5150, .input = { { .type = EM28XX_VMUX_TELEVISION,
@@ -893,7 +893,7 @@ struct em28xx_board em28xx_boards[] = { .mts_firmware = 1, .has_dvb = 1, .dvb_gpio = hauppauge_wintv_hvr_900_digital, - .ir_codes = &IR_KEYTABLE(pinnacle_pctv_hd), + .ir_codes = RC_MAP_PINNACLE_PCTV_HD, .decoder = EM28XX_TVP5150, .input = { { .type = EM28XX_VMUX_TELEVISION,
@@ -919,7 +919,7 @@ struct em28xx_board em28xx_boards[] = { .mts_firmware = 1, .has_dvb = 1, .dvb_gpio = hauppauge_wintv_hvr_900_digital, - .ir_codes = &IR_KEYTABLE(ati_tv_wonder_hd_600), + .ir_codes = RC_MAP_ATI_TV_WONDER_HD_600, .decoder = EM28XX_TVP5150, .input = { { .type = EM28XX_VMUX_TELEVISION,
@@ -945,7 +945,7 @@ struct em28xx_board em28xx_boards[] = { .decoder = EM28XX_TVP5150, .has_dvb = 1, .dvb_gpio = default_digital, - .ir_codes = &IR_KEYTABLE(terratec_cinergy_xs), + .ir_codes = RC_MAP_TERRATEC_CINERGY_XS, .xclk = EM28XX_XCLK_FREQUENCY_12MHZ, /* NEC IR */ .input = { { .type = EM28XX_VMUX_TELEVISION,
@@ -1295,7 +1295,7 @@ struct em28xx_board em28xx_boards[] = { .decoder = EM28XX_SAA711X, .has_dvb = 1, .dvb_gpio = em2882_kworld_315u_digital, - .ir_codes = &IR_KEYTABLE(kworld_315u), + .ir_codes = RC_MAP_KWORLD_315U, .xclk = EM28XX_XCLK_FREQUENCY_12MHZ, .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE,/* Analog mode - still not ready */
@@ -1424,7 +1424,7 @@ struct em28xx_board em28xx_boards[] = { .has_dvb = 1, .dvb_gpio = kworld_330u_digital, .xclk = EM28XX_XCLK_FREQUENCY_12MHZ, /* NEC IR */ - .ir_codes = &IR_KEYTABLE(kworld_315u), + .ir_codes = RC_MAP_KWORLD_315U, .input = { { .type = EM28XX_VMUX_TELEVISION, .vmux = TVP5150_COMPOSITE0,
@@ -1447,7 +1447,7 @@ struct em28xx_board em28xx_boards[] = { .decoder = EM28XX_TVP5150, .has_dvb = 1, .dvb_gpio = hauppauge_wintv_hvr_900_digital, - .ir_codes = &IR_KEYTABLE(terratec_cinergy_xs), + .ir_codes = RC_MAP_TERRATEC_CINERGY_XS, .xclk = EM28XX_XCLK_FREQUENCY_12MHZ, .input = { { .type = EM28XX_VMUX_TELEVISION,
@@ -1540,7 +1540,7 @@ struct em28xx_board em28xx_boards[] = { .mts_firmware = 1, .decoder = EM28XX_TVP5150, .tuner_gpio = default_tuner_gpio, - .ir_codes = &IR_KEYTABLE(kaiomy), + .ir_codes = RC_MAP_KAIOMY, .input = { { .type = EM28XX_VMUX_TELEVISION, .vmux = TVP5150_COMPOSITE0,
@@ -1640,7 +1640,7 @@ struct em28xx_board em28xx_boards[] = { .mts_firmware = 1, .has_dvb = 1, .dvb_gpio = evga_indtube_digital, - .ir_codes = &IR_KEYTABLE(evga_indtube), + .ir_codes = RC_MAP_EVGA_INDTUBE, .input = { { .type = EM28XX_VMUX_TELEVISION, .vmux = TVP5150_COMPOSITE0,
@@ -2334,21 +2334,21 @@ void em28xx_register_i2c_ir(struct em28xx *dev)switch (dev->model) {case EM2800_BOARD_TERRATEC_CINERGY_200 :case EM2820_BOARD_TERRATEC_CINERGY_250 : - dev->init_data.ir_codes = &IR_KEYTABLE (em_terratec); + dev->init_data.ir_codes =RC_MAP_EM_TERRATEC ; dev->init_data.get_key = em28xx_get_key_terratec; dev->init_data.name ="i2c IR (EM28XX Terratec)" ;break ;case EM2820_BOARD_PINNACLE_USB_2 : - dev->init_data.ir_codes = &IR_KEYTABLE (pinnacle_grey); + dev->init_data.ir_codes =RC_MAP_PINNACLE_GREY ; dev->init_data.get_key = em28xx_get_key_pinnacle_usb_grey; dev->init_data.name ="i2c IR (EM28XX Pinnacle PCTV)" ;break ;case EM2820_BOARD_HAUPPAUGE_WINTV_USB_2 : - dev->init_data.ir_codes = &IR_KEYTABLE (rc5_hauppauge_new); + dev->init_data.ir_codes =RC_MAP_RC5_HAUPPAUGE_NEW ; dev->init_data.get_key = em28xx_get_key_em_haup; dev->init_data.name ="i2c IR (EM2840 Hauppauge)" ;case EM2820_BOARD_LEADTEK_WINFAST_USBII_DELUXE : - dev->init_data.ir_codes = &IR_KEYTABLE (winfast_usbii_deluxe);; + dev->init_data.ir_codes =RC_MAP_WINFAST_USBII_DELUXE ;; dev->init_data.get_key = em28xx_get_key_winfast_usbii_deluxe; dev->init_data.name ="i2c IR (EM2820 Winfast TV USBII Deluxe)" ;break ;
drivers/media/video/em28xx/em28xx-input.c +1 -5
@@ -381,7 +381,6 @@ int em28xx_ir_change_protocol(void *priv, u64 ir_type)/* Adjust xclk based o IR table for RC5/NEC tables */ - dev->board.ir_codes->ir_type =IR_TYPE_OTHER ;if (ir_type ==IR_TYPE_RC5 ) { dev->board.xclk |=EM28XX_XCLK_IR_RC5_MODE ; ir->full_code =1 ;
@@ -392,8 +391,6 @@ int em28xx_ir_change_protocol(void *priv, u64 ir_type) }else rc = -EINVAL ; - dev->board.ir_codes->ir_type = ir_type; -em28xx_write_reg_bits (dev,EM28XX_R0F_XCLK , dev->board.xclk,EM28XX_XCLK_IR_RC5_MODE );
@@ -456,7 +453,6 @@ int em28xx_ir_init(struct em28xx *dev)strlcat (ir->phys,"/input0" ,sizeof (ir->phys));/* Set IR protocol */ -em28xx_ir_change_protocol (ir, dev->board.ir_codes->ir_type); err =ir_input_init (input_dev, &ir->ir,IR_TYPE_OTHER );if (err <0 ) goto err_out_free;
@@ -474,7 +470,7 @@ int em28xx_ir_init(struct em28xx *dev)em28xx_ir_start (ir);/* all done */ - err =__ir_input_register (ir->input, dev->board.ir_codes, + err =ir_input_register (ir->input, dev->board.ir_codes, &ir->props,MODULE_NAME );if (err) goto err_out_stop;
drivers/media/video/em28xx/em28xx.h +1 -1
@@ -412,7 +412,7 @@ struct em28xx_board {struct em28xx_input input[MAX_EM28XX_INPUT ];struct em28xx_input radio; -struct ir_scancode_table *ir_codes; +char *ir_codes; };struct em28xx_eeprom {
drivers/media/video/ir-kbd-i2c.c +11 -11
@@ -297,7 +297,7 @@ static void ir_work(struct work_struct *work)static int ir_probe (struct i2c_client *client,const struct i2c_device_id *id) { -struct ir_scancode_table *ir_codes =NULL ; +char *ir_codes =NULL ;const char *name =NULL ;u64 ir_type =0 ;struct IR_i2c *ir;
@@ -322,13 +322,13 @@ static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id) name ="Pixelview" ; ir->get_key = get_key_pixelview; ir_type =IR_TYPE_OTHER ; - ir_codes = &IR_KEYTABLE (empty); + ir_codes =RC_MAP_EMPTY ;break ;case 0x4b : name ="PV951" ; ir->get_key = get_key_pv951; ir_type =IR_TYPE_OTHER ; - ir_codes = &IR_KEYTABLE (pv951); + ir_codes =RC_MAP_PV951 ;break ;case 0x18 :case 0x1f :
@@ -337,22 +337,22 @@ static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id) ir->get_key = get_key_haup; ir_type =IR_TYPE_RC5 ;if (hauppauge ==1 ) { - ir_codes = &IR_KEYTABLE (hauppauge_new); + ir_codes =RC_MAP_HAUPPAUGE_NEW ; }else { - ir_codes = &IR_KEYTABLE (rc5_tv); + ir_codes =RC_MAP_RC5_TV ; }break ;case 0x30 : name ="KNC One" ; ir->get_key = get_key_knc1; ir_type =IR_TYPE_OTHER ; - ir_codes = &IR_KEYTABLE (empty); + ir_codes =RC_MAP_EMPTY ;break ;case 0x6b : name ="FusionHDTV" ; ir->get_key = get_key_fusionhdtv; ir_type =IR_TYPE_RC5 ; - ir_codes = &IR_KEYTABLE (fusionhdtv_mce); + ir_codes =RC_MAP_FUSIONHDTV_MCE ;break ;case 0x0b :case 0x47 :
@@ -365,9 +365,9 @@ static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id) ir_type =IR_TYPE_RC5 ; ir->get_key = get_key_haup_xvr;if (hauppauge ==1 ) { - ir_codes = &IR_KEYTABLE (hauppauge_new); + ir_codes =RC_MAP_HAUPPAUGE_NEW ; }else { - ir_codes = &IR_KEYTABLE (rc5_tv); + ir_codes =RC_MAP_RC5_TV ; } }else {/* Handled by saa7134-input */
@@ -379,7 +379,7 @@ static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id) name ="AVerMedia Cardbus remote" ; ir->get_key = get_key_avermedia_cardbus; ir_type =IR_TYPE_OTHER ; - ir_codes = &IR_KEYTABLE (avermedia_cardbus); + ir_codes =RC_MAP_AVERMEDIA_CARDBUS ;break ; }
@@ -447,7 +447,7 @@ static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id) input_dev->name = ir->name; input_dev->phys = ir->phys; - err =__ir_input_register (ir->input, ir->ir_codes,NULL ,MODULE_NAME ); + err =ir_input_register (ir->input, ir->ir_codes,NULL ,MODULE_NAME );if (err) goto err_out_free;
drivers/media/video/ivtv/ivtv-i2c.c +3 -3
@@ -193,7 +193,7 @@ static int ivtv_i2c_new_ir(struct ivtv *itv, u32 hw, const char *type, u8 addr)/* Our default information for ir-kbd-i2c.c to use */ switch (hw) {case IVTV_HW_I2C_IR_RX_AVER : - init_data->ir_codes = &IR_KEYTABLE (avermedia_cardbus); + init_data->ir_codes =RC_MAP_AVERMEDIA_CARDBUS ; init_data->internal_get_key_func =IR_KBD_GET_KEY_AVERMEDIA_CARDBUS ; init_data->type =IR_TYPE_OTHER ;
@@ -202,14 +202,14 @@ static int ivtv_i2c_new_ir(struct ivtv *itv, u32 hw, const char *type, u8 addr)case IVTV_HW_I2C_IR_RX_HAUP_EXT :case IVTV_HW_I2C_IR_RX_HAUP_INT :/* Default to old black remote */ - init_data->ir_codes = &IR_KEYTABLE (rc5_tv); + init_data->ir_codes =RC_MAP_RC5_TV ; init_data->internal_get_key_func =IR_KBD_GET_KEY_HAUP ; init_data->type =IR_TYPE_RC5 ; init_data->name = itv->card_name;break ;case IVTV_HW_Z8F0811_IR_RX_HAUP :/* Default to grey remote */ - init_data->ir_codes = &IR_KEYTABLE (hauppauge_new); + init_data->ir_codes =RC_MAP_HAUPPAUGE_NEW ; init_data->internal_get_key_func =IR_KBD_GET_KEY_HAUP_XVR ; init_data->type =IR_TYPE_RC5 ; init_data->name = itv->card_name;
drivers/media/video/saa7134/saa7134-input.c +40 -41
295 lines not on this page · raw message
include/media/ir-core.h +19 -2
@@ -21,6 +21,7 @@#include <linux/kfifo.h> #include <linux/time.h> #include <linux/timer.h> +#include <media/rc-map.h> extern int ir_core_debug; #define IR_dprintk(level, fmt, arg...) if (ir_core_debug >= level) \
@@ -124,6 +125,7 @@ EXPORT_SYMBOL_GPL(IR_KEYTABLE(tabname))int ir_register_map (struct rc_keymap *map);void ir_unregister_map (struct rc_keymap *map);struct ir_scancode_table *get_rc_map (const char *name); +void rc_map_init (void );/* Routines from ir-keytable.c */
@@ -141,15 +143,30 @@ static inline int ir_input_register(struct input_dev *dev,const struct ir_dev_props *props, const char *driver_name) { struct ir_scancode_table *ir_codes; +struct ir_input_dev *ir_dev; +int rc; + +if (!map_name) +return -EINVAL ; ir_codes =get_rc_map (map_name);if (!ir_codes)return -EINVAL ; -return __ir_input_register (dev, ir_codes, props, driver_name); + rc =__ir_input_register (dev, ir_codes, props, driver_name); +if (rc <0 ) +return -EINVAL ; + + ir_dev =input_get_drvdata (dev); + +if (!rc && ir_dev->props && ir_dev->props->change_protocol) + rc = ir_dev->props->change_protocol (ir_dev->props->priv, + ir_codes->ir_type); + +return rc; } -void ir_input_unregister (struct input_dev *input_dev); +void ir_input_unregister (struct input_dev *input_dev);/* Routines from ir-sysfs.c */
include/media/ir-kbd-i2c.h +2 -2
@@ -6,7 +6,7 @@struct IR_i2c ;struct IR_i2c { -struct ir_scancode_table *ir_codes; +char *ir_codes;struct i2c_client *c;struct input_dev *input;
@@ -34,7 +34,7 @@ enum ir_kbd_get_key_fn {/* Can be passed when instantiating an ir_video i2c device */ struct IR_i2c_init_data { -struct ir_scancode_table *ir_codes; +char *ir_codes;const char *name;u64 type;/* IR_TYPE_RC5, IR_TYPE_PD, etc */ /*
include/media/rc-map.h new file +81 -0
81 lines not on this page · raw message
Signature · 1 line
1.6.6.1
PATCH 2/26 V4L/DVB: ir-common: re-order keytables by name and remove duplicates
In reply to a message not in the archiveinclude/media/ir-common.h +48 -48
@@ -112,69 +112,69 @@ void ir_rc5_timer_keyup(unsigned long data);#define DECLARE_IR_KEYTABLE (a) \ extern struct ir_scancode_table IR_KEYTABLE(a) -DECLARE_IR_KEYTABLE (empty); +DECLARE_IR_KEYTABLE (adstech_dvb_t_pci); +DECLARE_IR_KEYTABLE (apac_viewcomp); +DECLARE_IR_KEYTABLE (asus_pc39); +DECLARE_IR_KEYTABLE (ati_tv_wonder_hd_600);DECLARE_IR_KEYTABLE (avermedia); +DECLARE_IR_KEYTABLE (avermedia_a16d); +DECLARE_IR_KEYTABLE (avermedia_cardbus);DECLARE_IR_KEYTABLE (avermedia_dvbt);DECLARE_IR_KEYTABLE (avermedia_m135a_rm_jx); -DECLARE_IR_KEYTABLE (avermedia_cardbus); -DECLARE_IR_KEYTABLE (apac_viewcomp); -DECLARE_IR_KEYTABLE (pixelview); -DECLARE_IR_KEYTABLE (pixelview_new); -DECLARE_IR_KEYTABLE (nebula); -DECLARE_IR_KEYTABLE (dntv_live_dvb_t); -DECLARE_IR_KEYTABLE (iodata_bctv7e); -DECLARE_IR_KEYTABLE (adstech_dvb_t_pci); -DECLARE_IR_KEYTABLE (msi_tvanywhere); -DECLARE_IR_KEYTABLE (cinergy_1400);DECLARE_IR_KEYTABLE (avertv_303); +DECLARE_IR_KEYTABLE (behold); +DECLARE_IR_KEYTABLE (behold_columbus); +DECLARE_IR_KEYTABLE (budget_ci_old); +DECLARE_IR_KEYTABLE (cinergy); +DECLARE_IR_KEYTABLE (cinergy_1400); +DECLARE_IR_KEYTABLE (dm1105_nec); +DECLARE_IR_KEYTABLE (dntv_live_dvb_t);DECLARE_IR_KEYTABLE (dntv_live_dvbt_pro); +DECLARE_IR_KEYTABLE (empty);DECLARE_IR_KEYTABLE (em_terratec); -DECLARE_IR_KEYTABLE (pinnacle_grey); -DECLARE_IR_KEYTABLE (flyvideo); -DECLARE_IR_KEYTABLE (flydvb); -DECLARE_IR_KEYTABLE (cinergy); +DECLARE_IR_KEYTABLE (encore_enltv); +DECLARE_IR_KEYTABLE (encore_enltv2); +DECLARE_IR_KEYTABLE (encore_enltv_fm53); +DECLARE_IR_KEYTABLE (evga_indtube);DECLARE_IR_KEYTABLE (eztv); -DECLARE_IR_KEYTABLE (avermedia); -DECLARE_IR_KEYTABLE (videomate_tv_pvr); -DECLARE_IR_KEYTABLE (manli); +DECLARE_IR_KEYTABLE (flydvb); +DECLARE_IR_KEYTABLE (flyvideo); +DECLARE_IR_KEYTABLE (fusionhdtv_mce); +DECLARE_IR_KEYTABLE (gadmei_rm008z); +DECLARE_IR_KEYTABLE (genius_tvgo_a11mce);DECLARE_IR_KEYTABLE (gotview7135); -DECLARE_IR_KEYTABLE (purpletv); -DECLARE_IR_KEYTABLE (pctv_sedna); -DECLARE_IR_KEYTABLE (pv951); -DECLARE_IR_KEYTABLE (rc5_tv); -DECLARE_IR_KEYTABLE (winfast); -DECLARE_IR_KEYTABLE (pinnacle_color);DECLARE_IR_KEYTABLE (hauppauge_new); -DECLARE_IR_KEYTABLE (rc5_hauppauge_new); -DECLARE_IR_KEYTABLE (npgtech); +DECLARE_IR_KEYTABLE (iodata_bctv7e); +DECLARE_IR_KEYTABLE (kaiomy); +DECLARE_IR_KEYTABLE (kworld_315u); +DECLARE_IR_KEYTABLE (kworld_plus_tv_analog); +DECLARE_IR_KEYTABLE (manli); +DECLARE_IR_KEYTABLE (msi_tvanywhere); +DECLARE_IR_KEYTABLE (msi_tvanywhere_plus); +DECLARE_IR_KEYTABLE (nebula); +DECLARE_IR_KEYTABLE (nec_terratec_cinergy_xs);DECLARE_IR_KEYTABLE (norwood); -DECLARE_IR_KEYTABLE (proteus_2309); -DECLARE_IR_KEYTABLE (budget_ci_old); -DECLARE_IR_KEYTABLE (asus_pc39); -DECLARE_IR_KEYTABLE (encore_enltv); -DECLARE_IR_KEYTABLE (encore_enltv2); -DECLARE_IR_KEYTABLE (tt_1500); -DECLARE_IR_KEYTABLE (fusionhdtv_mce); -DECLARE_IR_KEYTABLE (behold); -DECLARE_IR_KEYTABLE (behold_columbus); +DECLARE_IR_KEYTABLE (npgtech); +DECLARE_IR_KEYTABLE (pctv_sedna); +DECLARE_IR_KEYTABLE (pinnacle_color); +DECLARE_IR_KEYTABLE (pinnacle_grey);DECLARE_IR_KEYTABLE (pinnacle_pctv_hd); -DECLARE_IR_KEYTABLE (genius_tvgo_a11mce); +DECLARE_IR_KEYTABLE (pixelview); +DECLARE_IR_KEYTABLE (pixelview_new);DECLARE_IR_KEYTABLE (powercolor_real_angel); -DECLARE_IR_KEYTABLE (avermedia_a16d); -DECLARE_IR_KEYTABLE (encore_enltv_fm53); +DECLARE_IR_KEYTABLE (proteus_2309); +DECLARE_IR_KEYTABLE (purpletv); +DECLARE_IR_KEYTABLE (pv951); +DECLARE_IR_KEYTABLE (rc5_hauppauge_new); +DECLARE_IR_KEYTABLE (rc5_tv);DECLARE_IR_KEYTABLE (real_audio_220_32_keys); -DECLARE_IR_KEYTABLE (msi_tvanywhere_plus); -DECLARE_IR_KEYTABLE (ati_tv_wonder_hd_600); -DECLARE_IR_KEYTABLE (kworld_plus_tv_analog); -DECLARE_IR_KEYTABLE (kaiomy); -DECLARE_IR_KEYTABLE (dm1105_nec); -DECLARE_IR_KEYTABLE (tevii_nec);DECLARE_IR_KEYTABLE (tbs_nec); -DECLARE_IR_KEYTABLE (evga_indtube);DECLARE_IR_KEYTABLE (terratec_cinergy_xs); +DECLARE_IR_KEYTABLE (tevii_nec); +DECLARE_IR_KEYTABLE (tt_1500);DECLARE_IR_KEYTABLE (videomate_s350); -DECLARE_IR_KEYTABLE (gadmei_rm008z); -DECLARE_IR_KEYTABLE (nec_terratec_cinergy_xs); +DECLARE_IR_KEYTABLE (videomate_tv_pvr); +DECLARE_IR_KEYTABLE (winfast);DECLARE_IR_KEYTABLE (winfast_usbii_deluxe); -DECLARE_IR_KEYTABLE (kworld_315u); +#endif
Signature · 1 line
1.6.6.1
PATCH 23/26 V4L/DVB: ir-core: move rc map code to rc-map.h
In reply to a message not in the archiveThe keymaps don't need to be recompiled every time a change at ir-core.h happens, since it only depends on rc-map defines. By moving those definitions to the proper header, the code became cleaner, and avoids needing to recompile all the RC maps every time a non-related change is introduced.
include/media/ir-core.h +0 -34
@@ -16,7 +16,6 @@#ifndef _IR_CORE#define _IR_CORE -#include <linux/input.h> #include <linux/spinlock.h> #include <linux/kfifo.h> #include <linux/time.h>
@@ -27,12 +26,6 @@ extern int ir_core_debug; #define IR_dprintk(level, fmt, arg...) if (ir_core_debug >= level) \ printk(KERN_DEBUG "%s: " fmt , __func__, ## arg) -#define IR_TYPE_UNKNOWN 0 -#define IR_TYPE_RC5 (1 << 0)/* Philips RC5 protocol */ -#define IR_TYPE_PD (1 << 1)/* Pulse distance encoded IR */ -#define IR_TYPE_NEC (1 << 2) -#define IR_TYPE_OTHER (((u64)1) << 63l) -enum raw_event_type {IR_SPACE = (1 <<0 ),IR_PULSE = (1 <<1 ),
@@ -40,26 +33,6 @@ enum raw_event_type { IR_STOP_EVENT = (1 << 3), }; -struct ir_scancode { -u16 scancode; -u32 keycode; -}; - -struct ir_scancode_table { -struct ir_scancode *scan; -unsigned int size;/* Max number of entries */ -unsigned int len;/* Used number of entries */ -unsigned int alloc;/* Size of *scan in bytes */ -u64 ir_type; -char *name; -spinlock_t lock; -}; - -struct rc_keymap { -struct list_head list; -struct ir_scancode_table map; -}; -struct ir_dev_props {unsigned long allowed_protos;void *priv;
@@ -108,13 +81,6 @@ struct ir_raw_handler {#define to_ir_input_dev (_attr) container_of(_attr, struct ir_input_dev, attr) -/* Routines from rc-map.c */ - -int ir_register_map (struct rc_keymap *map); -void ir_unregister_map (struct rc_keymap *map); -struct ir_scancode_table *get_rc_map (const char *name); -void rc_map_init (void ); -/* Routines from ir-keytable.c */ u32 ir_g_keycode_from_table(struct input_dev *input_dev,
include/media/rc-map.h +36 -1
@@ -9,7 +9,42 @@* (at your option) any later version. */ -#include <media/ir-core.h> +#include <linux/input.h> + +#define IR_TYPE_UNKNOWN 0 +#define IR_TYPE_RC5 (1 << 0)/* Philips RC5 protocol */ +#define IR_TYPE_PD (1 << 1)/* Pulse distance encoded IR */ +#define IR_TYPE_NEC (1 << 2) +#define IR_TYPE_OTHER (1u << 31) + +struct ir_scancode { +u16 scancode; +u32 keycode; +}; + +struct ir_scancode_table { +struct ir_scancode *scan; +unsigned int size;/* Max number of entries */ +unsigned int len;/* Used number of entries */ +unsigned int alloc;/* Size of *scan in bytes */ +u64 ir_type; +char *name; +spinlock_t lock; +}; + +struct rc_keymap { +struct list_head list; +struct ir_scancode_table map; +}; + +/* Routines from rc-map.c */ + +int ir_register_map (struct rc_keymap *map); +void ir_unregister_map (struct rc_keymap *map); +struct ir_scancode_table *get_rc_map (const char *name); +void rc_map_init (void ); + +/* Names of the several keytables defined in-kernel */ #define RC_MAP_ADSTECH_DVB_T_PCI "rc-adstech-dvb-t-pci"#define RC_MAP_APAC_VIEWCOMP "rc-apac-viewcomp"
Signature · 1 line
1.6.6.1
PATCH 1/26 V4L/DVB: ir-common: Use a function to declare an IR table
In reply to a message not in the archiveThis is the first patch of a series of changes that will break the IR tables into a series of small modules that can be dynamically loaded, or just loaded from userspace.
include/media/ir-common.h +71 -65
@@ -106,69 +106,75 @@ void ir_rc5_timer_keyup(unsigned long data);/* scancode->keycode map tables from ir-keymaps.c */ -extern struct ir_scancode_table ir_codes_empty_table; -extern struct ir_scancode_table ir_codes_avermedia_table; -extern struct ir_scancode_table ir_codes_avermedia_dvbt_table; -extern struct ir_scancode_table ir_codes_avermedia_m135a_rm_jx_table; -extern struct ir_scancode_table ir_codes_avermedia_cardbus_table; -extern struct ir_scancode_table ir_codes_apac_viewcomp_table; -extern struct ir_scancode_table ir_codes_pixelview_table; -extern struct ir_scancode_table ir_codes_pixelview_new_table; -extern struct ir_scancode_table ir_codes_nebula_table; -extern struct ir_scancode_table ir_codes_dntv_live_dvb_t_table; -extern struct ir_scancode_table ir_codes_iodata_bctv7e_table; -extern struct ir_scancode_table ir_codes_adstech_dvb_t_pci_table; -extern struct ir_scancode_table ir_codes_msi_tvanywhere_table; -extern struct ir_scancode_table ir_codes_cinergy_1400_table; -extern struct ir_scancode_table ir_codes_avertv_303_table; -extern struct ir_scancode_table ir_codes_dntv_live_dvbt_pro_table; -extern struct ir_scancode_table ir_codes_em_terratec_table; -extern struct ir_scancode_table ir_codes_pinnacle_grey_table; -extern struct ir_scancode_table ir_codes_flyvideo_table; -extern struct ir_scancode_table ir_codes_flydvb_table; -extern struct ir_scancode_table ir_codes_cinergy_table; -extern struct ir_scancode_table ir_codes_eztv_table; -extern struct ir_scancode_table ir_codes_avermedia_table; -extern struct ir_scancode_table ir_codes_videomate_tv_pvr_table; -extern struct ir_scancode_table ir_codes_manli_table; -extern struct ir_scancode_table ir_codes_gotview7135_table; -extern struct ir_scancode_table ir_codes_purpletv_table; -extern struct ir_scancode_table ir_codes_pctv_sedna_table; -extern struct ir_scancode_table ir_codes_pv951_table; -extern struct ir_scancode_table ir_codes_rc5_tv_table; -extern struct ir_scancode_table ir_codes_winfast_table; -extern struct ir_scancode_table ir_codes_pinnacle_color_table; -extern struct ir_scancode_table ir_codes_hauppauge_new_table; -extern struct ir_scancode_table ir_codes_rc5_hauppauge_new_table; -extern struct ir_scancode_table ir_codes_npgtech_table; -extern struct ir_scancode_table ir_codes_norwood_table; -extern struct ir_scancode_table ir_codes_proteus_2309_table; -extern struct ir_scancode_table ir_codes_budget_ci_old_table; -extern struct ir_scancode_table ir_codes_asus_pc39_table; -extern struct ir_scancode_table ir_codes_encore_enltv_table; -extern struct ir_scancode_table ir_codes_encore_enltv2_table; -extern struct ir_scancode_table ir_codes_tt_1500_table; -extern struct ir_scancode_table ir_codes_fusionhdtv_mce_table; -extern struct ir_scancode_table ir_codes_behold_table; -extern struct ir_scancode_table ir_codes_behold_columbus_table; -extern struct ir_scancode_table ir_codes_pinnacle_pctv_hd_table; -extern struct ir_scancode_table ir_codes_genius_tvgo_a11mce_table; -extern struct ir_scancode_table ir_codes_powercolor_real_angel_table; -extern struct ir_scancode_table ir_codes_avermedia_a16d_table; -extern struct ir_scancode_table ir_codes_encore_enltv_fm53_table; -extern struct ir_scancode_table ir_codes_real_audio_220_32_keys_table; -extern struct ir_scancode_table ir_codes_msi_tvanywhere_plus_table; -extern struct ir_scancode_table ir_codes_ati_tv_wonder_hd_600_table; -extern struct ir_scancode_table ir_codes_kworld_plus_tv_analog_table; -extern struct ir_scancode_table ir_codes_kaiomy_table; -extern struct ir_scancode_table ir_codes_dm1105_nec_table; -extern struct ir_scancode_table ir_codes_tevii_nec_table; -extern struct ir_scancode_table ir_codes_tbs_nec_table; -extern struct ir_scancode_table ir_codes_evga_indtube_table; -extern struct ir_scancode_table ir_codes_terratec_cinergy_xs_table; -extern struct ir_scancode_table ir_codes_videomate_s350_table; -extern struct ir_scancode_table ir_codes_gadmei_rm008z_table; -extern struct ir_scancode_table ir_codes_nec_terratec_cinergy_xs_table; -extern struct ir_scancode_table ir_codes_winfast_usbii_deluxe_table; -extern struct ir_scancode_table ir_codes_kworld_315u_table; +#define IR_KEYTABLE (a) \ +(ir_codes_ ## a ## _table) + +#define DECLARE_IR_KEYTABLE (a) \ +extern struct ir_scancode_table IR_KEYTABLE(a) + +DECLARE_IR_KEYTABLE (empty); +DECLARE_IR_KEYTABLE (avermedia); +DECLARE_IR_KEYTABLE (avermedia_dvbt); +DECLARE_IR_KEYTABLE (avermedia_m135a_rm_jx); +DECLARE_IR_KEYTABLE (avermedia_cardbus); +DECLARE_IR_KEYTABLE (apac_viewcomp); +DECLARE_IR_KEYTABLE (pixelview); +DECLARE_IR_KEYTABLE (pixelview_new); +DECLARE_IR_KEYTABLE (nebula); +DECLARE_IR_KEYTABLE (dntv_live_dvb_t); +DECLARE_IR_KEYTABLE (iodata_bctv7e); +DECLARE_IR_KEYTABLE (adstech_dvb_t_pci); +DECLARE_IR_KEYTABLE (msi_tvanywhere); +DECLARE_IR_KEYTABLE (cinergy_1400); +DECLARE_IR_KEYTABLE (avertv_303); +DECLARE_IR_KEYTABLE (dntv_live_dvbt_pro); +DECLARE_IR_KEYTABLE (em_terratec); +DECLARE_IR_KEYTABLE (pinnacle_grey); +DECLARE_IR_KEYTABLE (flyvideo); +DECLARE_IR_KEYTABLE (flydvb); +DECLARE_IR_KEYTABLE (cinergy); +DECLARE_IR_KEYTABLE (eztv); +DECLARE_IR_KEYTABLE (avermedia); +DECLARE_IR_KEYTABLE (videomate_tv_pvr); +DECLARE_IR_KEYTABLE (manli); +DECLARE_IR_KEYTABLE (gotview7135); +DECLARE_IR_KEYTABLE (purpletv); +DECLARE_IR_KEYTABLE (pctv_sedna); +DECLARE_IR_KEYTABLE (pv951); +DECLARE_IR_KEYTABLE (rc5_tv); +DECLARE_IR_KEYTABLE (winfast); +DECLARE_IR_KEYTABLE (pinnacle_color); +DECLARE_IR_KEYTABLE (hauppauge_new); +DECLARE_IR_KEYTABLE (rc5_hauppauge_new); +DECLARE_IR_KEYTABLE (npgtech); +DECLARE_IR_KEYTABLE (norwood); +DECLARE_IR_KEYTABLE (proteus_2309); +DECLARE_IR_KEYTABLE (budget_ci_old); +DECLARE_IR_KEYTABLE (asus_pc39); +DECLARE_IR_KEYTABLE (encore_enltv); +DECLARE_IR_KEYTABLE (encore_enltv2); +DECLARE_IR_KEYTABLE (tt_1500); +DECLARE_IR_KEYTABLE (fusionhdtv_mce); +DECLARE_IR_KEYTABLE (behold); +DECLARE_IR_KEYTABLE (behold_columbus); +DECLARE_IR_KEYTABLE (pinnacle_pctv_hd); +DECLARE_IR_KEYTABLE (genius_tvgo_a11mce); +DECLARE_IR_KEYTABLE (powercolor_real_angel); +DECLARE_IR_KEYTABLE (avermedia_a16d); +DECLARE_IR_KEYTABLE (encore_enltv_fm53); +DECLARE_IR_KEYTABLE (real_audio_220_32_keys); +DECLARE_IR_KEYTABLE (msi_tvanywhere_plus); +DECLARE_IR_KEYTABLE (ati_tv_wonder_hd_600); +DECLARE_IR_KEYTABLE (kworld_plus_tv_analog); +DECLARE_IR_KEYTABLE (kaiomy); +DECLARE_IR_KEYTABLE (dm1105_nec); +DECLARE_IR_KEYTABLE (tevii_nec); +DECLARE_IR_KEYTABLE (tbs_nec); +DECLARE_IR_KEYTABLE (evga_indtube); +DECLARE_IR_KEYTABLE (terratec_cinergy_xs); +DECLARE_IR_KEYTABLE (videomate_s350); +DECLARE_IR_KEYTABLE (gadmei_rm008z); +DECLARE_IR_KEYTABLE (nec_terratec_cinergy_xs); +DECLARE_IR_KEYTABLE (winfast_usbii_deluxe); +DECLARE_IR_KEYTABLE (kworld_315u);#endif
Signature · 1 line
1.6.6.1
PATCH 22/26 V4L-DVB: ir-core: remove the ancillary buffer
In reply to a message not in the archiveNow that the decoders are state machine, there's no need to create an ancillary buffer while decoding the protocol. Just call the decoders code directly, event by event.
drivers/media/IR/ir-nec-decoder.c +3 -29
@@ -125,14 +125,14 @@ static struct attribute_group decoder_attribute_group = {/** -* handle_event() - Decode one NEC pulse or space +* ir_nec_decode() - Decode one NEC pulse or space * @input_dev: the struct input_dev descriptor of the device * @ev: event array with type/duration of pulse/space * * This function returns -EINVAL if the pulse violates the state machine */ -static int handle_event (struct input_dev *input_dev, -struct ir_raw_event *ev) +static int ir_nec_decode (struct input_dev *input_dev, +struct ir_raw_event *ev) {struct decoder_data *data;struct ir_input_dev *ir_dev =input_get_drvdata (input_dev);
@@ -289,32 +289,6 @@ checksum_err:return -EINVAL ; } -/** -* ir_nec_decode() - Decodes all NEC pulsecodes on a given array -* @input_dev: the struct input_dev descriptor of the device -* @evs: event array with type/duration of pulse/space -* @len: length of the array -* This function returns the number of decoded pulses -*/ -static int ir_nec_decode (struct input_dev *input_dev, -struct ir_raw_event *evs, -int len) -{ -struct ir_input_dev *ir_dev =input_get_drvdata (input_dev); -struct decoder_data *data; -int pos =0 ; -int rc =0 ; - - data =get_decoder_data (ir_dev); -if (!data || !data->enabled) -return 0 ; - -for (pos =0 ; pos < len; pos++) -handle_event (input_dev, &evs[pos]); - -return rc; -} -static int ir_nec_register (struct input_dev *input_dev) {struct ir_input_dev *ir_dev =input_get_drvdata (input_dev);
drivers/media/IR/ir-raw-event.c +8 -12
@@ -138,37 +138,33 @@ int ir_raw_event_handle(struct input_dev *input_dev) {struct ir_input_dev *ir =input_get_drvdata (input_dev);int rc; -struct ir_raw_event *evs; +struct ir_raw_event ev;int len, i;/* * Store the events into a temporary buffer. This allows calling more than * one decoder to deal with the received data */ - len =kfifo_len (&ir->raw->kfifo) /sizeof (*evs); + len =kfifo_len (&ir->raw->kfifo) /sizeof (ev);if (!len)return 0 ; - evs =kmalloc (len *sizeof (*evs),GFP_ATOMIC );for (i =0 ; i < len; i++) { - rc =kfifo_out (&ir->raw->kfifo, &evs[i],sizeof (*evs)); -if (rc !=sizeof (*evs)) { + rc =kfifo_out (&ir->raw->kfifo, &ev,sizeof (ev)); +if (rc !=sizeof (ev)) {IR_dprintk (1 ,"overflow error: received %d instead of %zd\n" , - rc,sizeof (*evs)); + rc,sizeof (ev));return -EINVAL ; }IR_dprintk (2 ,"event type %d, time before event: %07luus\n" , - evs[i].type, (evs[i].delta.tv_nsec +500 ) /1000 ); + ev.type, (ev.delta.tv_nsec +500 ) /1000 ); + rc =RUN_DECODER (decode, input_dev, &ev); }/* * Call all ir decoders. This allows decoding the same event with -* more than one protocol handler. It returns the number of keystrokes -* sent to the event interface +* more than one protocol handler. */ - rc =RUN_DECODER (decode, input_dev, evs, len); - -kfree (evs);return rc; }
drivers/media/IR/ir-rc5-decoder.c +1 -27
@@ -142,7 +142,7 @@ static struct attribute_group decoder_attribute_group = {* * This function returns -EINVAL if the pulse violates the state machine */ -static int handle_event (struct input_dev *input_dev, +static int ir_rc5_decode (struct input_dev *input_dev,struct ir_raw_event *ev) {struct decoder_data *data;
@@ -273,32 +273,6 @@ err2:return -EINVAL ; } -/** -* ir_rc5_decode() - Decodes all RC-5 pulsecodes on a given array -* @input_dev: the struct input_dev descriptor of the device -* @evs: event array with type/duration of pulse/space -* @len: length of the array -* This function returns the number of decoded pulses -*/ -static int ir_rc5_decode (struct input_dev *input_dev, -struct ir_raw_event *evs, -int len) -{ -struct ir_input_dev *ir_dev =input_get_drvdata (input_dev); -struct decoder_data *data; -int pos =0 ; -int rc =0 ; - - data =get_decoder_data (ir_dev); -if (!data || !data->enabled) -return 0 ; - -for (pos =0 ; pos < len; pos++) -handle_event (input_dev, &evs[pos]); - -return rc; -} -static int ir_rc5_register (struct input_dev *input_dev) {struct ir_input_dev *ir_dev =input_get_drvdata (input_dev);
include/media/ir-core.h +1 -2
@@ -101,8 +101,7 @@ struct ir_raw_handler {struct list_head list;int (*decode)(struct input_dev *input_dev, -struct ir_raw_event *evs, -int len); +struct ir_raw_event *ev);int (*raw_register)(struct input_dev *input_dev);int (*raw_unregister)(struct input_dev *input_dev); };
Signature · 1 line
1.6.6.1
PATCH 21/26 V4L/DVB: cx88: don't handle IR on Pixelview too fast
In reply to a message not in the archivedrivers/media/video/cx88/cx88-input.c +2 -2
@@ -315,9 +315,9 @@ int cx88_ir_init(struct cx88_core *core, struct pci_dev *pci)case CX88_BOARD_PIXELVIEW_PLAYTV_ULTRA_PRO : ir_codes =RC_MAP_PIXELVIEW ; ir->gpio_addr =MO_GP1_IO ; - ir->mask_keycode =0x1f ; + ir->mask_keycode =0x1f ;/* Only command is retrieved */ ir->mask_keyup =0x80 ; - ir->polling =1 ;/* ms */ + ir->polling =10 ;/* ms */ break ;case CX88_BOARD_PROLINK_PV_8000GT :case CX88_BOARD_PROLINK_PV_GLOBAL_XTREME :
Signature · 1 line
1.6.6.1
PATCH 20/26 V4L-DVB: ir-rc5-decoder: Add a decoder for RC-5 IR protocol
In reply to a message not in the archiveThis decoder is also based on a state machine, just like the NEC protocol decoder. It is pedantic in the sense that accepts only 14 bits. As there are some variants that outputs less bits, it needs to be improved to also handle those.
create mode 100644 drivers/media/IR/ir-rc5-decoder.c
drivers/media/IR/Kconfig +9 -0
@@ -18,3 +18,12 @@ config IR_NEC_DECODER ---help--- Enable this option if you have IR with NEC protocol, and if the IR is decoded in software + +config IR_RC5_DECODER + tristate "Enable IR raw decoder for RC-5 protocol" + depends on IR_CORE + default y + + ---help--- + Enable this option if you have IR with RC-5 protocol, and + if the IR is decoded in software
drivers/media/IR/Makefile +1 -0
@@ -6,3 +6,4 @@ obj-y += keymaps/ obj-$(CONFIG_IR_CORE) += ir-core.o obj-$(CONFIG_VIDEO_IR) += ir-common.o obj-$(CONFIG_IR_NEC_DECODER) += ir-nec-decoder.o +obj-$(CONFIG_IR_RC5_DECODER) += ir-rc5-decoder.o
drivers/media/IR/ir-raw-event.c +1 -0
@@ -200,6 +200,7 @@ static void init_decoders(struct work_struct *work)/* Load the decoder modules */ load_nec_decode (); +load_rc5_decode ();/* If needed, we may later add some init code. In this case, it is needed to change the CONFIG_MODULE test at ir-core.h
drivers/media/IR/ir-rc5-decoder.c new file +371 -0
371 lines not on this page · raw message
include/media/ir-core.h +7 -0
@@ -178,4 +178,11 @@ void ir_raw_init(void);#define load_nec_decode () 0#endif +/* from ir-rc5-decoder.c */ +#ifdef CONFIG_IR_RC5_DECODER_MODULE +#define load_rc5_decode () request_module("ir-rc5-decoder") +#else +#define load_rc5_decode () 0 +#endif +#endif /* _IR_CORE */
Signature · 1 line
1.6.6.1
PATCH 9/26 V4L/DVB: ir: prepare IR code for a parameter change at register function
In reply to a message not in the archiveA latter patch will reuse the ir_input_register with a different meaning. Before it, change all occurrences to a temporary name.
drivers/media/IR/ir-keytable.c +3 -3
@@ -460,7 +460,7 @@ static void ir_close(struct input_dev *input_dev) }/** -* ir_input_register() - sets the IR keycode table and add the handlers +* __ir_input_register() - sets the IR keycode table and add the handlers * for keymap table get/set * @input_dev: the struct input_dev descriptor of the device * @rc_tab: the struct ir_scancode_table table of scancode/keymap
@@ -470,7 +470,7 @@ static void ir_close(struct input_dev *input_dev)* It will register the input/evdev interface for the device and * register the syfs code for IR class */ -int ir_input_register (struct input_dev *input_dev, +int __ir_input_register (struct input_dev *input_dev,const struct ir_scancode_table *rc_tab,const struct ir_dev_props *props,const char *driver_name)
@@ -538,7 +538,7 @@ err:kfree (ir_dev);return rc; } -EXPORT_SYMBOL_GPL (ir_input_register); +EXPORT_SYMBOL_GPL (__ir_input_register);/** * ir_input_unregister() - unregisters IR and frees resources
drivers/media/dvb/dm1105/dm1105.c +1 -1
@@ -629,7 +629,7 @@ int __devinit dm1105_ir_init(struct dm1105_dev *dm1105)INIT_WORK (&dm1105->ir.work, dm1105_emit_key); - err =ir_input_register (input_dev, ir_codes,NULL ,MODULE_NAME ); + err =__ir_input_register (input_dev, ir_codes,NULL ,MODULE_NAME );return err; }
drivers/media/dvb/mantis/mantis_input.c +1 -1
@@ -128,7 +128,7 @@ int mantis_input_init(struct mantis_pci *mantis) rc->id.version =1 ; rc->dev = mantis->pdev->dev; - err =ir_input_register (rc, &ir_mantis,NULL ,MODULE_NAME ); + err =__ir_input_register (rc, &ir_mantis,NULL ,MODULE_NAME );if (err) {dprintk (MANTIS_ERROR ,1 ,"IR device registration failed, ret = %d" , err);input_free_device (rc);
drivers/media/dvb/ttpci/budget-ci.c +1 -1
@@ -256,7 +256,7 @@ static int msp430_ir_init(struct budget_ci *budget_ci) budget_ci->ir.timer_keyup.function = msp430_ir_keyup; budget_ci->ir.timer_keyup.data = (unsigned long ) &budget_ci->ir; budget_ci->ir.last_raw =0xffff ;/* An impossible value */ - error =ir_input_register (input_dev, ir_codes,NULL ,MODULE_NAME ); + error =__ir_input_register (input_dev, ir_codes,NULL ,MODULE_NAME );if (error) {printk (KERN_ERR "budget_ci: could not init driver for IR device (code %d)\n" , error);return error;
drivers/media/video/bt8xx/bttv-input.c +1 -1
@@ -391,7 +391,7 @@ int bttv_input_init(struct bttv *btv)bttv_ir_start (btv, ir);/* all done */ - err =ir_input_register (btv->remote->dev, ir_codes,NULL ,MODULE_NAME ); + err =__ir_input_register (btv->remote->dev, ir_codes,NULL ,MODULE_NAME );if (err) goto err_out_stop;
drivers/media/video/cx231xx/cx231xx-input.c +1 -1
@@ -218,7 +218,7 @@ int cx231xx_ir_init(struct cx231xx *dev)cx231xx_ir_start (ir);/* all done */ - err =ir_input_register (ir->input, dev->board.ir_codes, + err =__ir_input_register (ir->input, dev->board.ir_codes,NULL ,MODULE_NAME );if (err) goto err_out_stop;
drivers/media/video/cx23885/cx23885-input.c +1 -1
@@ -399,7 +399,7 @@ int cx23885_input_init(struct cx23885_dev *dev) dev->ir_input = ir;cx23885_input_ir_start (dev); - ret =ir_input_register (ir->dev, ir_codes,NULL ,MODULE_NAME ); + ret =__ir_input_register (ir->dev, ir_codes,NULL ,MODULE_NAME );if (ret) goto err_out_stop;
drivers/media/video/cx88/cx88-input.c +1 -1
@@ -438,7 +438,7 @@ int cx88_ir_init(struct cx88_core *core, struct pci_dev *pci) ir->props.close = cx88_ir_close;/* all done */ - err =ir_input_register (ir->input, ir_codes, &ir->props,MODULE_NAME ); + err =__ir_input_register (ir->input, ir_codes, &ir->props,MODULE_NAME );if (err) goto err_out_free;
drivers/media/video/em28xx/em28xx-input.c +1 -1
@@ -474,7 +474,7 @@ int em28xx_ir_init(struct em28xx *dev)em28xx_ir_start (ir);/* all done */ - err =ir_input_register (ir->input, dev->board.ir_codes, + err =__ir_input_register (ir->input, dev->board.ir_codes, &ir->props,MODULE_NAME );if (err) goto err_out_stop;
drivers/media/video/ir-kbd-i2c.c +1 -1
@@ -447,7 +447,7 @@ static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id) input_dev->name = ir->name; input_dev->phys = ir->phys; - err =ir_input_register (ir->input, ir->ir_codes,NULL ,MODULE_NAME ); + err =__ir_input_register (ir->input, ir->ir_codes,NULL ,MODULE_NAME );if (err) goto err_out_free;
drivers/media/video/saa7134/saa7134-input.c +1 -1
@@ -877,7 +877,7 @@ int saa7134_input_init1(struct saa7134_dev *dev) } input_dev->dev.parent = &dev->pci->dev; - err =ir_input_register (ir->dev, ir_codes, &ir->props,MODULE_NAME ); + err =__ir_input_register (ir->dev, ir_codes, &ir->props,MODULE_NAME );if (err) goto err_out_free;if (ir_codes->ir_type !=IR_TYPE_OTHER ) {
include/media/ir-core.h +20 -6
@@ -119,23 +119,37 @@ EXPORT_SYMBOL_GPL(IR_KEYTABLE(tabname))#define DEFINE_LEGACY_IR_KEYTABLE (tabname) \ DEFINE_IR_KEYTABLE(tabname, IR_TYPE_UNKNOWN) +/* Routines from rc-map.c */ + +int ir_register_map (struct rc_keymap *map); +void ir_unregister_map (struct rc_keymap *map); +struct ir_scancode_table *get_rc_map (const char *name); +/* Routines from ir-keytable.c */ u32 ir_g_keycode_from_table (struct input_dev *input_dev,u32 scancode);void ir_keyup (struct input_dev *dev);void ir_keydown (struct input_dev *dev,int scancode); -int ir_input_register (struct input_dev *dev, +int __ir_input_register (struct input_dev *dev,const struct ir_scancode_table *ir_codes,const struct ir_dev_props *props,const char *driver_name); -void ir_input_unregister (struct input_dev *input_dev); -/* Routines from rc-map.c */ +static inline int ir_input_register (struct input_dev *dev, +const char *map_name, +const struct ir_dev_props *props, +const char *driver_name) { +struct ir_scancode_table *ir_codes; -int ir_register_map (struct rc_keymap *map); -void ir_unregister_map (struct rc_keymap *map); -struct ir_scancode_table *get_rc_map (const char *name); + ir_codes =get_rc_map (map_name); +if (!ir_codes) +return -EINVAL ; + +return __ir_input_register (dev, ir_codes, props, driver_name); +} + +void ir_input_unregister (struct input_dev *input_dev);/* Routines from ir-sysfs.c */
Signature · 1 line
1.6.6.1
PATCH 19/26 ir-nec-decoder: Cleanups
In reply to a message not in the archiveRemove dead code and properly name a few constants
drivers/media/IR/ir-nec-decoder.c +8 -32
@@ -14,38 +14,14 @@#include <media/ir-core.h> +#define NEC_NBITS 32#define NEC_UNIT 559979/* ns */ #define NEC_HEADER_MARK (16 * NEC_UNIT)#define NEC_HEADER_SPACE (8 * NEC_UNIT)#define NEC_REPEAT_SPACE (4 * NEC_UNIT)#define NEC_MARK (NEC_UNIT) -#define NEC_0_SYMBOL (NEC_UNIT) -#define NEC_1_SYMBOL (3 * NEC_UNIT) - -/* Start time: 4.5 ms + 560 us of the next pulse */ -#define MIN_START_TIME (3900000 + 560000) -#define MAX_START_TIME (5100000 + 560000) - -/* Bit 1 time: 2.25ms us */ -#define MIN_BIT1_TIME 2050000 -#define MAX_BIT1_TIME 2450000 - -/* Bit 0 time: 1.12ms us */ -#define MIN_BIT0_TIME 920000 -#define MAX_BIT0_TIME 1320000 - -/* Total IR code is 110 ms, including the 9 ms for the start pulse */ -#define MAX_NEC_TIME 4000000 - -/* Total IR code is 110 ms, including the 9 ms for the start pulse */ -#define MIN_REPEAT_TIME 99000000 -#define MAX_REPEAT_TIME 112000000 - -/* Repeat time: 2.25ms us */ -#define MIN_REPEAT_START_TIME 2050000 -#define MAX_REPEAT_START_TIME 3000000 - -#define REPEAT_TIME 240/* ms */ +#define NEC_0_SPACE (NEC_UNIT) +#define NEC_1_SPACE (3 * NEC_UNIT)/* Used to register nec_decoder clients */ static LIST_HEAD (decoder_list);
@@ -223,11 +199,11 @@ static int handle_event(struct input_dev *input_dev,if (last_bit) goto err; -if ((ev->delta.tv_nsec >=NEC_0_SYMBOL -NEC_UNIT /2 ) && - (ev->delta.tv_nsec <NEC_0_SYMBOL +NEC_UNIT /2 )) +if ((ev->delta.tv_nsec >=NEC_0_SPACE -NEC_UNIT /2 ) && + (ev->delta.tv_nsec <NEC_0_SPACE +NEC_UNIT /2 )) bit =0 ; -else if ((ev->delta.tv_nsec >=NEC_1_SYMBOL -NEC_UNIT /2 ) && - (ev->delta.tv_nsec <NEC_1_SYMBOL +NEC_UNIT /2 )) +else if ((ev->delta.tv_nsec >=NEC_1_SPACE -NEC_UNIT /2 ) && + (ev->delta.tv_nsec <NEC_1_SPACE +NEC_UNIT /2 )) bit =1 ;else { IR_dprintk(1, "Decode failed at %d-th bit (%s) @%luus\n",
@@ -256,7 +232,7 @@ static int handle_event(struct input_dev *input_dev, data->nec_code.not_command |=1 << (shift -24 ); } } -if (++data->count ==32 ) { +if (++data->count ==NEC_NBITS ) {u32 scancode;/* * Fixme: may need to accept Extended NEC protocol?
Signature · 1 line
1.6.6.1
PATCH 8/26 V4L/DVB: Break Remote Controller keymaps into modules
In reply to a message not in the archiveThe original Remote Controller approach were very messy: a big file, that were part of ir-common kernel module, containing 64 different RC keymap tables, used by the V4L/DVB drivers.
Better to break each RC keymap table into a separate module, registering them into rc core on a process similar to the fs/nls tables.
As an userspace program is now in charge of loading those tables, adds an option to allow the complete removal of those tables from kernelspace.
Yet, on embedded devices like Set Top Boxes and TV sets, maybe the only available input device is the IR. So, we should keep allowing the usage of in-kernel tables, but a latter patch should change the default to 'n', after giving some time for distros to add the v4l-utils with the ir-keytable program, to allow the table load via userspace.
create mode 100644 drivers/media/IR/keymaps/Kconfig create mode 100644 drivers/media/IR/keymaps/Makefile create mode 100644 drivers/media/IR/keymaps/rc-adstech-dvb-t-pci.c create mode 100644 drivers/media/IR/keymaps/rc-apac-viewcomp.c create mode 100644 drivers/media/IR/keymaps/rc-asus-pc39.c create mode 100644 drivers/media/IR/keymaps/rc-ati-tv-wonder-hd-600.c create mode 100644 drivers/media/IR/keymaps/rc-avermedia-a16d.c create mode 100644 drivers/media/IR/keymaps/rc-avermedia-cardbus.c create mode 100644 drivers/media/IR/keymaps/rc-avermedia-dvbt.c create mode 100644 drivers/media/IR/keymaps/rc-avermedia-m135a-rm-jx.c create mode 100644 drivers/media/IR/keymaps/rc-avermedia.c create mode 100644 drivers/media/IR/keymaps/rc-avertv-303.c create mode 100644 drivers/media/IR/keymaps/rc-behold-columbus.c create mode 100644 drivers/media/IR/keymaps/rc-behold.c create mode 100644 drivers/media/IR/keymaps/rc-budget-ci-old.c create mode 100644 drivers/media/IR/keymaps/rc-cinergy-1400.c create mode 100644 drivers/media/IR/keymaps/rc-cinergy.c create mode 100644 drivers/media/IR/keymaps/rc-dm1105-nec.c create mode 100644 drivers/media/IR/keymaps/rc-dntv-live-dvb-t.c create mode 100644 drivers/media/IR/keymaps/rc-dntv-live-dvbt-pro.c create mode 100644 drivers/media/IR/keymaps/rc-em-terratec.c create mode 100644 drivers/media/IR/keymaps/rc-empty.c create mode 100644 drivers/media/IR/keymaps/rc-encore-enltv-fm53.c create mode 100644 drivers/media/IR/keymaps/rc-encore-enltv.c create mode 100644 drivers/media/IR/keymaps/rc-encore-enltv2.c create mode 100644 drivers/media/IR/keymaps/rc-evga-indtube.c create mode 100644 drivers/media/IR/keymaps/rc-eztv.c create mode 100644 drivers/media/IR/keymaps/rc-flydvb.c create mode 100644 drivers/media/IR/keymaps/rc-flyvideo.c create mode 100644 drivers/media/IR/keymaps/rc-fusionhdtv-mce.c create mode 100644 drivers/media/IR/keymaps/rc-gadmei-rm008z.c create mode 100644 drivers/media/IR/keymaps/rc-genius-tvgo-a11mce.c create mode 100644 drivers/media/IR/keymaps/rc-gotview7135.c create mode 100644 drivers/media/IR/keymaps/rc-hauppauge-new.c create mode 100644 drivers/media/IR/keymaps/rc-iodata-bctv7e.c create mode 100644 drivers/media/IR/keymaps/rc-kaiomy.c create mode 100644 drivers/media/IR/keymaps/rc-kworld-315u.c create mode 100644 drivers/media/IR/keymaps/rc-kworld-plus-tv-analog.c create mode 100644 drivers/media/IR/keymaps/rc-manli.c create mode 100644 drivers/media/IR/keymaps/rc-msi-tvanywhere-plus.c create mode 100644 drivers/media/IR/keymaps/rc-msi-tvanywhere.c create mode 100644 drivers/media/IR/keymaps/rc-nebula.c create mode 100644 drivers/media/IR/keymaps/rc-nec-terratec-cinergy-xs.c create mode 100644 drivers/media/IR/keymaps/rc-norwood.c create mode 100644 drivers/media/IR/keymaps/rc-npgtech.c create mode 100644 drivers/media/IR/keymaps/rc-pctv-sedna.c create mode 100644 drivers/media/IR/keymaps/rc-pinnacle-color.c create mode 100644 drivers/media/IR/keymaps/rc-pinnacle-grey.c create mode 100644 drivers/media/IR/keymaps/rc-pinnacle-pctv-hd.c create mode 100644 drivers/media/IR/keymaps/rc-pixelview-new.c create mode 100644 drivers/media/IR/keymaps/rc-pixelview.c create mode 100644 drivers/media/IR/keymaps/rc-powercolor-real-angel.c create mode 100644 drivers/media/IR/keymaps/rc-proteus-2309.c create mode 100644 drivers/media/IR/keymaps/rc-purpletv.c create mode 100644 drivers/media/IR/keymaps/rc-pv951.c create mode 100644 drivers/media/IR/keymaps/rc-rc5-hauppauge-new.c create mode 100644 drivers/media/IR/keymaps/rc-rc5-tv.c create mode 100644 drivers/media/IR/keymaps/rc-real-audio-220-32-keys.c create mode 100644 drivers/media/IR/keymaps/rc-tbs-nec.c create mode 100644 drivers/media/IR/keymaps/rc-terratec-cinergy-xs.c create mode 100644 drivers/media/IR/keymaps/rc-tevii-nec.c create mode 100644 drivers/media/IR/keymaps/rc-tt-1500.c create mode 100644 drivers/media/IR/keymaps/rc-videomate-s350.c create mode 100644 drivers/media/IR/keymaps/rc-videomate-tv-pvr.c create mode 100644 drivers/media/IR/keymaps/rc-winfast-usbii-deluxe.c create mode 100644 drivers/media/IR/keymaps/rc-winfast.c
drivers/media/IR/Kconfig +2 -0
@@ -8,6 +8,8 @@ config VIDEO_IR depends on IR_CORE default IR_CORE +source "drivers/media/IR/keymaps/Kconfig" + config IR_NEC_DECODER tristate "Enable IR raw decoder for NEC protocol" depends on IR_CORE
drivers/media/IR/keymaps/Kconfig new file +15 -0
@@ -0,0 +1,15 @@ +config RC_MAP + tristate "Compile Remote Controller keymap modules" + depends on IR_CORE + default y + + ---help--- + This option enables the compilation of lots of Remote + Controller tables. They are short tables, but if you + don't use a remote controller, or prefer to load the + tables on userspace, you should disable it. + + The ir-keytable program, available at v4l-utils package + provide the tool and the same RC maps for load from + userspace. Its available at + http://git.linuxtv.org/v4l-utils
drivers/media/IR/keymaps/Makefile new file +64 -0
64 lines not on this page · raw message
drivers/media/IR/keymaps/rc-adstech-dvb-t-pci.c new file +89 -0
89 lines not on this page · raw message
drivers/media/IR/keymaps/rc-apac-viewcomp.c new file +80 -0
80 lines not on this page · raw message
drivers/media/IR/keymaps/rc-asus-pc39.c new file +91 -0
91 lines not on this page · raw message
drivers/media/IR/keymaps/rc-ati-tv-wonder-hd-600.c new file +69 -0
69 lines not on this page · raw message
drivers/media/IR/keymaps/rc-avermedia-a16d.c new file +75 -0
75 lines not on this page · raw message
drivers/media/IR/keymaps/rc-avermedia-cardbus.c new file +97 -0
97 lines not on this page · raw message
drivers/media/IR/keymaps/rc-avermedia-dvbt.c new file +78 -0
78 lines not on this page · raw message
drivers/media/IR/keymaps/rc-avermedia-m135a-rm-jx.c new file +90 -0
90 lines not on this page · raw message
drivers/media/IR/keymaps/rc-avermedia.c new file +86 -0
86 lines not on this page · raw message
drivers/media/IR/keymaps/rc-avertv-303.c new file +85 -0
85 lines not on this page · raw message
drivers/media/IR/keymaps/rc-behold-columbus.c new file +108 -0
108 lines not on this page · raw message
drivers/media/IR/keymaps/rc-behold.c new file +141 -0
141 lines not on this page · raw message
drivers/media/IR/keymaps/rc-budget-ci-old.c new file +92 -0
92 lines not on this page · raw message
drivers/media/IR/keymaps/rc-cinergy-1400.c new file +84 -0
84 lines not on this page · raw message
drivers/media/IR/keymaps/rc-cinergy.c new file +78 -0
78 lines not on this page · raw message
drivers/media/IR/keymaps/rc-dm1105-nec.c new file +76 -0
76 lines not on this page · raw message
drivers/media/IR/keymaps/rc-dntv-live-dvb-t.c new file +78 -0
78 lines not on this page · raw message
drivers/media/IR/keymaps/rc-dntv-live-dvbt-pro.c new file +97 -0
97 lines not on this page · raw message
drivers/media/IR/keymaps/rc-em-terratec.c new file +69 -0
69 lines not on this page · raw message
drivers/media/IR/keymaps/rc-empty.c new file +44 -0
44 lines not on this page · raw message
drivers/media/IR/keymaps/rc-encore-enltv-fm53.c new file +81 -0
81 lines not on this page · raw message
drivers/media/IR/keymaps/rc-encore-enltv.c new file +112 -0
112 lines not on this page · raw message
drivers/media/IR/keymaps/rc-encore-enltv2.c new file +90 -0
90 lines not on this page · raw message
drivers/media/IR/keymaps/rc-evga-indtube.c new file +61 -0
61 lines not on this page · raw message
drivers/media/IR/keymaps/rc-eztv.c new file +96 -0
96 lines not on this page · raw message
drivers/media/IR/keymaps/rc-flydvb.c new file +77 -0
77 lines not on this page · raw message
drivers/media/IR/keymaps/rc-flyvideo.c new file +70 -0
70 lines not on this page · raw message
drivers/media/IR/keymaps/rc-fusionhdtv-mce.c new file +98 -0
98 lines not on this page · raw message
drivers/media/IR/keymaps/rc-gadmei-rm008z.c new file +81 -0
81 lines not on this page · raw message
drivers/media/IR/keymaps/rc-genius-tvgo-a11mce.c new file +84 -0
84 lines not on this page · raw message
drivers/media/IR/keymaps/rc-gotview7135.c new file +79 -0
79 lines not on this page · raw message
drivers/media/IR/keymaps/rc-hauppauge-new.c new file +100 -0
100 lines not on this page · raw message
drivers/media/IR/keymaps/rc-iodata-bctv7e.c new file +88 -0
88 lines not on this page · raw message
drivers/media/IR/keymaps/rc-kaiomy.c new file +87 -0
87 lines not on this page · raw message
drivers/media/IR/keymaps/rc-kworld-315u.c new file +83 -0
2 lines not on this page · raw message
drivers/media/IR/keymaps/rc-kworld-plus-tv-analog.c new file +99 -0
99 lines not on this page · raw message
drivers/media/IR/keymaps/rc-manli.c new file +135 -0
135 lines not on this page · raw message
drivers/media/IR/keymaps/rc-msi-tvanywhere-plus.c new file +123 -0
123 lines not on this page · raw message
drivers/media/IR/keymaps/rc-msi-tvanywhere.c new file +69 -0
69 lines not on this page · raw message
drivers/media/IR/keymaps/rc-nebula.c new file +96 -0
96 lines not on this page · raw message
drivers/media/IR/keymaps/rc-nec-terratec-cinergy-xs.c new file +105 -0
105 lines not on this page · raw message
drivers/media/IR/keymaps/rc-norwood.c new file +85 -0
85 lines not on this page · raw message
drivers/media/IR/keymaps/rc-npgtech.c new file +80 -0
80 lines not on this page · raw message
drivers/media/IR/keymaps/rc-pctv-sedna.c new file +80 -0
80 lines not on this page · raw message
drivers/media/IR/keymaps/rc-pinnacle-color.c new file +94 -0
94 lines not on this page · raw message
drivers/media/IR/keymaps/rc-pinnacle-grey.c new file +89 -0
89 lines not on this page · raw message
drivers/media/IR/keymaps/rc-pinnacle-pctv-hd.c new file +73 -0
73 lines not on this page · raw message
drivers/media/IR/keymaps/rc-pixelview-new.c new file +83 -0
83 lines not on this page · raw message
drivers/media/IR/keymaps/rc-pixelview.c new file +82 -0
82 lines not on this page · raw message
drivers/media/IR/keymaps/rc-powercolor-real-angel.c new file +81 -0
81 lines not on this page · raw message
drivers/media/IR/keymaps/rc-proteus-2309.c new file +69 -0
69 lines not on this page · raw message
drivers/media/IR/keymaps/rc-purpletv.c new file +81 -0
81 lines not on this page · raw message
drivers/media/IR/keymaps/rc-pv951.c new file +78 -0
78 lines not on this page · raw message
drivers/media/IR/keymaps/rc-rc5-hauppauge-new.c new file +103 -0
103 lines not on this page · raw message
drivers/media/IR/keymaps/rc-rc5-tv.c new file +81 -0
81 lines not on this page · raw message
drivers/media/IR/keymaps/rc-real-audio-220-32-keys.c new file +78 -0
78 lines not on this page · raw message
drivers/media/IR/keymaps/rc-tbs-nec.c new file +73 -0
73 lines not on this page · raw message
drivers/media/IR/keymaps/rc-terratec-cinergy-xs.c new file +92 -0
92 lines not on this page · raw message
drivers/media/IR/keymaps/rc-tevii-nec.c new file +88 -0
88 lines not on this page · raw message
drivers/media/IR/keymaps/rc-tt-1500.c new file +82 -0
82 lines not on this page · raw message
drivers/media/IR/keymaps/rc-videomate-s350.c new file +85 -0
85 lines not on this page · raw message
drivers/media/IR/keymaps/rc-videomate-tv-pvr.c new file +87 -0
87 lines not on this page · raw message
drivers/media/IR/keymaps/rc-winfast-usbii-deluxe.c new file +82 -0
82 lines not on this page · raw message
drivers/media/IR/keymaps/rc-winfast.c new file +102 -0
102 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
1.6.6.1
Part of the diff is not shown here. View the raw message.
PATCH 18/26 V4L/DVB: ir-nec-decoder: Reimplement the entire decoder
In reply to a message not in the archiveThanks to Andy Walls <[email protected]> for pointing me his code, that gave me some ideas to better implement it.
After some work with saa7134 bits, I found a way to catch both IRQ edge pulses. By enabling it, the NEC decoder can now take both pulse and spaces into account, making it more precise.
Instead of the old strategy of handling the events all at once, this code implements a state machine. Due to that, it handles individual pulse or space events, validating them against the protocol, producing a much more reliable decoding.
With the new implementation, the protocol trailer bits are properly handled, making possible for the repeat key to work.
Also, the code is now capable of handling both NEC and NEC extended IR devices. With NEC, it produces a 16 bits code, while with NEC extended, a 24 bits code is returned.
drivers/media/IR/ir-nec-decoder.c +170 -107
@@ -14,6 +14,14 @@#include <media/ir-core.h> +#define NEC_UNIT 559979/* ns */ +#define NEC_HEADER_MARK (16 * NEC_UNIT) +#define NEC_HEADER_SPACE (8 * NEC_UNIT) +#define NEC_REPEAT_SPACE (4 * NEC_UNIT) +#define NEC_MARK (NEC_UNIT) +#define NEC_0_SYMBOL (NEC_UNIT) +#define NEC_1_SYMBOL (3 * NEC_UNIT) +/* Start time: 4.5 ms + 560 us of the next pulse */ #define MIN_START_TIME (3900000 + 560000)#define MAX_START_TIME (5100000 + 560000)
@@ -43,10 +51,32 @@static LIST_HEAD (decoder_list);static spinlock_t decoder_lock; +enum nec_state { +STATE_INACTIVE , +STATE_HEADER_MARK , +STATE_HEADER_SPACE , +STATE_MARK , +STATE_SPACE , +STATE_TRAILER_MARK , +STATE_TRAILER_SPACE , +}; + +struct nec_code { +u8 address; +u8 not_address; +u8 command; +u8 not_command; +}; +struct decoder_data {struct list_head list;struct ir_input_dev *ir_dev;int enabled:1 ; + +/* State machine control */ +enum nec_state state; +struct nec_code nec_code; +unsigned count; };
@@ -118,139 +148,173 @@ static struct attribute_group decoder_attribute_group = { }; -/** is_repeat - Check if it is a NEC repeat event -* @input_dev: the struct input_dev descriptor of the device -* @pos: the position of the first event -* @len: the length of the buffer -*/ -static int is_repeat (struct ir_raw_event *evs,int len,int pos) -{ -if ((evs[pos].delta.tv_nsec <MIN_REPEAT_START_TIME ) || - (evs[pos].delta.tv_nsec >MAX_REPEAT_START_TIME )) -return 0 ; - -if (++pos >= len) -return 0 ; - -if ((evs[pos].delta.tv_nsec <MIN_REPEAT_TIME ) || - (evs[pos].delta.tv_nsec >MAX_REPEAT_TIME )) -return 0 ; - -return 1 ; -} -/** -* __ir_nec_decode() - Decode one NEC pulsecode +* handle_event() - Decode one NEC pulse or space * @input_dev: the struct input_dev descriptor of the device -* @evs: event array with type/duration of pulse/space -* @len: length of the array -* @pos: position to start seeking for a code -* This function returns -EINVAL if no pulse got decoded, -* 0 if buffer is empty and 1 if one keycode were handled. +* @ev: event array with type/duration of pulse/space +* +* This function returns -EINVAL if the pulse violates the state machine */ -static int __ir_nec_decode (struct input_dev *input_dev, -struct ir_raw_event *evs, -int len,int *pos) +static int handle_event (struct input_dev *input_dev, +struct ir_raw_event *ev) { -struct ir_input_dev *ir =input_get_drvdata (input_dev); -int count =-1 ; -int ircode =0 , not_code =0 ; - -/* Be sure that the first event is an start one and is a pulse */ -for (; *pos < len; (*pos)++) { -/* Very long delays are considered as start events */ -if (evs[*pos].delta.tv_nsec >MAX_NEC_TIME ) -break ; -if (evs[*pos].type &IR_START_EVENT ) -break ; -IR_dprintk (1 ,"%luus: Spurious NEC %s\n" , - (evs[*pos].delta.tv_nsec +500 ) /1000 , - (evs[*pos].type &IR_SPACE ) ?"space" :"pulse" ); - - } -if (*pos >= len) -return 0 ; +struct decoder_data *data; +struct ir_input_dev *ir_dev =input_get_drvdata (input_dev); +int bit, last_bit; + + data =get_decoder_data (ir_dev); +if (!data) +return -EINVAL ; + +/* Except for the initial event, what matters is the previous bit */ + bit = (ev->type &IR_PULSE ) ?1 :0 ; + + last_bit = !bit; + +/* Discards spurious space last_bits when inactive */ - (*pos)++;/* First event doesn't contain data */ +/* Very long delays are considered as start events */ +if (ev->delta.tv_nsec >NEC_HEADER_MARK +NEC_HEADER_SPACE -NEC_UNIT /2 ) + data->state =STATE_INACTIVE ; -if (evs[*pos].type !=IR_PULSE ) - goto err; +if (ev->type &IR_START_EVENT ) + data->state =STATE_INACTIVE ; + +switch (data->state) { +case STATE_INACTIVE : +if (!bit)/* PULSE marks the start event */ +return 0 ; + + data->count =0 ; + data->state =STATE_HEADER_MARK ; +memset (&data->nec_code,0 ,sizeof (data->nec_code)); +return 0 ; +case STATE_HEADER_MARK : +if (!last_bit) + goto err; +if (ev->delta.tv_nsec <NEC_HEADER_MARK -6 *NEC_UNIT ) + goto err; + data->state =STATE_HEADER_SPACE ; +return 0 ; +case STATE_HEADER_SPACE : +if (last_bit) + goto err; +if (ev->delta.tv_nsec >=NEC_HEADER_SPACE -NEC_UNIT /2 ) { + data->state =STATE_MARK ; +return 0 ; + } -/* Check if it is a NEC repeat event */ -if (is_repeat (evs, len, *pos)) { - *pos +=2 ; -if (ir->keypressed) { +if (ev->delta.tv_nsec >=NEC_REPEAT_SPACE -NEC_UNIT /2 ) {ir_repeat (input_dev); -IR_dprintk (1 ,"NEC repeat event\n" ); -return 1 ; - }else { -IR_dprintk (1 ,"missing NEC repeat event\n" ); +IR_dprintk (1 ,"Repeat last key\n" ); + data->state =STATE_TRAILER_MARK ;return 0 ; } - } - -/* First space should have 4.5 ms otherwise is not NEC protocol */ -if ((evs[*pos].delta.tv_nsec <MIN_START_TIME ) || - (evs[*pos].delta.tv_nsec >MAX_START_TIME )) goto err; +case STATE_MARK : +if (!last_bit) + goto err; +if ((ev->delta.tv_nsec >NEC_MARK +NEC_UNIT /2 ) || + (ev->delta.tv_nsec <NEC_MARK -NEC_UNIT /2 )) + goto err; + data->state =STATE_SPACE ; +return 0 ; +case STATE_SPACE : +if (last_bit) + goto err; - count =0 ; -for ((*pos)++; *pos < len; (*pos)++) { -int bit; -if ((evs[*pos].delta.tv_nsec >MIN_BIT1_TIME ) && - (evs[*pos].delta.tv_nsec <MAX_BIT1_TIME )) - bit =1 ; -else if ((evs[*pos].delta.tv_nsec >MIN_BIT0_TIME ) && - (evs[*pos].delta.tv_nsec <MAX_BIT0_TIME )) +if ((ev->delta.tv_nsec >=NEC_0_SYMBOL -NEC_UNIT /2 ) && + (ev->delta.tv_nsec <NEC_0_SYMBOL +NEC_UNIT /2 )) bit =0 ; -else - goto err; +else if ((ev->delta.tv_nsec >=NEC_1_SYMBOL -NEC_UNIT /2 ) && + (ev->delta.tv_nsec <NEC_1_SYMBOL +NEC_UNIT /2 )) + bit =1 ; +else { +IR_dprintk (1 ,"Decode failed at %d-th bit (%s) @%luus\n" , + data->count, + last_bit ?"pulse" :"space" , + (ev->delta.tv_nsec +500 ) /1000 ); + goto err2; + } + +/* Ok, we've got a valid bit. proccess it */ if (bit) { -int shift = count; -/* Address first, then command */ +int shift = data->count; + +/* +* NEC transmit bytes on this temporal order: +* address | not address | command | not command +*/ if (shift <8 ) { - shift +=8 ; - ircode |=1 << shift; + data->nec_code.address |=1 << shift; }else if (shift <16 ) { - not_code |=1 << shift; + data->nec_code.not_address |=1 << (shift -8 ); }else if (shift <24 ) { - shift -=16 ; - ircode |=1 << shift; + data->nec_code.command |=1 << (shift -16 ); }else { - shift -=24 ; - not_code |=1 << shift; + data->nec_code.not_command |=1 << (shift -24 ); } } -if (++count ==32 ) -break ; - } - (*pos)++; +if (++data->count ==32 ) { +u32 scancode; +/* +* Fixme: may need to accept Extended NEC protocol? +*/ +if ((data->nec_code.command ^ data->nec_code.not_command) !=0xff ) + goto checksum_err; -/* -* Fixme: may need to accept Extended NEC protocol? -*/ -if ((ircode & ~not_code) != ircode) { -IR_dprintk (1 ,"NEC checksum error: code 0x%04x, not-code 0x%04x\n" , - ircode, not_code); -return -EINVAL ; - } +if ((data->nec_code.address ^ data->nec_code.not_address) !=0xff ) { +/* Extended NEC */ + scancode = data->nec_code.address <<16 | + data->nec_code.not_address <<8 | + data->nec_code.command; +IR_dprintk (1 ,"NEC scancode 0x%06x\n" , scancode); + }else { +/* normal NEC */ + scancode = data->nec_code.address <<8 | + data->nec_code.command; +IR_dprintk (1 ,"NEC scancode 0x%04x\n" , scancode); + } +ir_keydown (input_dev, scancode,0 ); -IR_dprintk (1 ,"NEC scancode 0x%04x\n" , ircode); -ir_keydown (input_dev, ircode,0 ); + data->state =STATE_TRAILER_MARK ; + }else + data->state =STATE_MARK ; +return 0 ; +case STATE_TRAILER_MARK : +if (!last_bit) + goto err; + data->state =STATE_TRAILER_SPACE ; +return 0 ; +case STATE_TRAILER_SPACE : +if (last_bit) + goto err; + data->state =STATE_INACTIVE ; +return 0 ; + } -return 1 ; err: -IR_dprintk (1 ,"NEC decoded failed at bit %d (%s) while decoding %luus time\n" , - count, - (evs[*pos].type &IR_SPACE ) ?"space" :"pulse" , - (evs[*pos].delta.tv_nsec +500 ) /1000 ); +IR_dprintk (1 ,"NEC decoded failed at state %d (%s) @ %luus\n" , + data->state, + bit ?"pulse" :"space" , + (ev->delta.tv_nsec +500 ) /1000 ); +err2: + data->state =STATE_INACTIVE ; +return -EINVAL ; +checksum_err: + data->state =STATE_INACTIVE ; +IR_dprintk (1 ,"NEC checksum error: received 0x%02x%02x%02x%02x\n" , + data->nec_code.address, + data->nec_code.not_address, + data->nec_code.command, + data->nec_code.not_command);return -EINVAL ; }/** -* __ir_nec_decode() - Decodes all NEC pulsecodes on a given array +* ir_nec_decode() - Decodes all NEC pulsecodes on a given array * @input_dev: the struct input_dev descriptor of the device * @evs: event array with type/duration of pulse/space * @len: length of the array
@@ -269,10 +333,9 @@ static int ir_nec_decode(struct input_dev *input_dev,if (!data || !data->enabled)return 0 ; -while (pos < len) { -if (__ir_nec_decode (input_dev, evs, len, &pos) >0 ) - rc++; - } +for (pos =0 ; pos < len; pos++) +handle_event (input_dev, &evs[pos]); +return rc; }
drivers/media/video/saa7134/saa7134-input.c +5 -4
@@ -658,7 +658,8 @@ int saa7134_input_init1(struct saa7134_dev *dev)break ;case SAA7134_BOARD_AVERMEDIA_M135A : ir_codes =RC_MAP_AVERMEDIA_M135A_RM_JX ; - mask_keydown =0x0040000 ; + mask_keydown =0x0040000 ;/* Enable GPIO18 line on both edges */ + mask_keyup =0x0040000 ; mask_keycode =0xffff ; raw_decode =1 ;break ;
@@ -1014,13 +1015,13 @@ static int saa7134_raw_decode_irq(struct saa7134_dev *dev) {struct card_ir *ir = dev->remote;unsigned long timeout; -int pulse; +int space;/* Generate initial event */ saa_clearb (SAA7134_GPIO_GPMODE3 ,SAA7134_GPIO_GPRESCAN );saa_setb (SAA7134_GPIO_GPMODE3 ,SAA7134_GPIO_GPRESCAN ); - pulse =saa_readl (SAA7134_GPIO_GPSTATUS0 >>2 ) & ir->mask_keydown; -ir_raw_event_store (dev->remote->dev, pulse ?IR_PULSE :IR_SPACE ); + space =saa_readl (SAA7134_GPIO_GPSTATUS0 >>2 ) & ir->mask_keydown; +ir_raw_event_store (dev->remote->dev, space ?IR_SPACE :IR_PULSE );/*
Signature · 1 line
1.6.6.1
PATCH 7/26 V4L/DVB: ir-core: Add support for RC map code register
In reply to a message not in the archiveInstead of having all RC tables hardcoded on one file with all tables there, add infrastructure for registering and dynamically load the table(s) when needed.
create mode 100644 drivers/media/IR/rc-map.c
drivers/media/IR/Makefile +1 -1
@@ -1,5 +1,5 @@ ir-common-objs := ir-functions.o ir-keymaps.o -ir-core-objs := ir-keytable.o ir-sysfs.o ir-raw-event.o +ir-core-objs := ir-keytable.o ir-sysfs.o ir-raw-event.o rc-map.o obj-$(CONFIG_IR_CORE) += ir-core.o obj-$(CONFIG_VIDEO_IR) += ir-common.o
drivers/media/IR/rc-map.c new file +75 -0
75 lines not on this page · raw message
include/media/ir-core.h +11 -0
@@ -52,6 +52,11 @@ struct ir_scancode_table {spinlock_t lock; }; +struct rc_keymap { +struct list_head list; +struct ir_scancode_table map; +}; +struct ir_dev_props {unsigned long allowed_protos;void *priv;
@@ -126,6 +131,12 @@ int ir_input_register(struct input_dev *dev, const char *driver_name);void ir_input_unregister (struct input_dev *input_dev); +/* Routines from rc-map.c */ + +int ir_register_map (struct rc_keymap *map); +void ir_unregister_map (struct rc_keymap *map); +struct ir_scancode_table *get_rc_map (const char *name); +/* Routines from ir-sysfs.c */ int ir_register_class (struct input_dev *input_dev);
Signature · 1 line
1.6.6.1
PATCH 15/26 V4L/DVB: ir-core: re-add some debug functions for keytable changes
In reply to a message not in the archivedrivers/media/IR/ir-keytable.c +17 -2
@@ -99,6 +99,8 @@ static int ir_do_setkeycode(struct input_dev *dev,/* Did the user wish to remove the mapping? */ if (keycode ==KEY_RESERVED || keycode ==KEY_UNKNOWN ) { +IR_dprintk (1 ,"#%d: Deleting scan 0x%04x\n" , + i, scancode); rc_tab->len--;memmove (&rc_tab->scan[i], &rc_tab->scan[i +1 ], (rc_tab->len - i) *sizeof (struct ir_scancode ));
@@ -114,6 +116,9 @@ static int ir_do_setkeycode(struct input_dev *dev,if (ir_resize_table (rc_tab))return -ENOMEM ; +IR_dprintk (1 ,"#%d: New scan 0x%04x with key 0x%04x\n" , + i, scancode, keycode); +/* i is the proper index to insert our new keycode */ memmove (&rc_tab->scan[i +1 ], &rc_tab->scan[i], (rc_tab->len - i) *sizeof (struct ir_scancode ));
@@ -122,6 +127,8 @@ static int ir_do_setkeycode(struct input_dev *dev, rc_tab->len++;set_bit (keycode, dev->keybit); }else { +IR_dprintk (1 ,"#%d: Replacing scan 0x%04x with key 0x%04x\n" , + i, scancode, keycode);/* A previous mapping was updated... */ clear_bit (old_keycode, dev->keybit);/* ...but another scancode might use the same keycode */
@@ -223,6 +230,10 @@ static int ir_getkeycode(struct input_dev *dev, }spin_unlock_irqrestore (&rc_tab->lock, flags); +if (key ==KEY_RESERVED ) +IR_dprintk (1 ,"unknown key for scancode 0x%04x\n" , + scancode); + *keycode = key;return 0 ; }
@@ -242,8 +253,9 @@ u32 ir_g_keycode_from_table(struct input_dev *dev, u32 scancode)int keycode;ir_getkeycode (dev, scancode, &keycode); -IR_dprintk (1 ,"%s: scancode 0x%04x keycode 0x%02x\n" , - dev->name, scancode, keycode); +if (keycode !=KEY_RESERVED ) +IR_dprintk (1 ,"%s: scancode 0x%04x keycode 0x%02x\n" , + dev->name, scancode, keycode);return keycode; }EXPORT_SYMBOL_GPL (ir_g_keycode_from_table);
@@ -385,6 +397,9 @@ int __ir_input_register(struct input_dev *input_dev,if (rc <0 ) goto out_table; +IR_dprintk (1 ,"Registered input device on %s for %s remote.\n" , + driver_name, rc_tab->name); +return 0 ; out_table:
Signature · 1 line
1.6.6.1
PATCH 6/26 V4L/DVB: ir-common: move IR tables from ir-keymaps.c to a separate file
In reply to a message not in the archiveInstead of having one big file with lots of keytables, create one include file for each IR keymap.
create mode 100644 include/media/keycodes/adstech-dvb-t-pci.h create mode 100644 include/media/keycodes/apac-viewcomp.h create mode 100644 include/media/keycodes/asus-pc39.h create mode 100644 include/media/keycodes/ati-tv-wonder-hd-600.h create mode 100644 include/media/keycodes/avermedia-a16d.h create mode 100644 include/media/keycodes/avermedia-cardbus.h create mode 100644 include/media/keycodes/avermedia-dvbt.h create mode 100644 include/media/keycodes/avermedia-m135a-rm-jx.h create mode 100644 include/media/keycodes/avermedia.h create mode 100644 include/media/keycodes/avertv-303.h create mode 100644 include/media/keycodes/behold-columbus.h create mode 100644 include/media/keycodes/behold.h create mode 100644 include/media/keycodes/budget-ci-old.h create mode 100644 include/media/keycodes/cinergy-1400.h create mode 100644 include/media/keycodes/cinergy.h create mode 100644 include/media/keycodes/dm1105-nec.h create mode 100644 include/media/keycodes/dntv-live-dvb-t.h create mode 100644 include/media/keycodes/dntv-live-dvbt-pro.h create mode 100644 include/media/keycodes/em-terratec.h create mode 100644 include/media/keycodes/empty.h create mode 100644 include/media/keycodes/encore-enltv-fm53.h create mode 100644 include/media/keycodes/encore-enltv.h create mode 100644 include/media/keycodes/encore-enltv2.h create mode 100644 include/media/keycodes/evga-indtube.h create mode 100644 include/media/keycodes/eztv.h create mode 100644 include/media/keycodes/flydvb.h create mode 100644 include/media/keycodes/flyvideo.h create mode 100644 include/media/keycodes/fusionhdtv-mce.h create mode 100644 include/media/keycodes/gadmei-rm008z.h create mode 100644 include/media/keycodes/genius-tvgo-a11mce.h create mode 100644 include/media/keycodes/gotview7135.h create mode 100644 include/media/keycodes/hauppauge-new.h create mode 100644 include/media/keycodes/iodata-bctv7e.h create mode 100644 include/media/keycodes/kaiomy.h create mode 100644 include/media/keycodes/kworld-315u.h create mode 100644 include/media/keycodes/kworld-plus-tv-analog.h create mode 100644 include/media/keycodes/manli.h create mode 100644 include/media/keycodes/msi-tvanywhere-plus.h create mode 100644 include/media/keycodes/msi-tvanywhere.h create mode 100644 include/media/keycodes/nebula.h create mode 100644 include/media/keycodes/nec-terratec-cinergy-xs.h create mode 100644 include/media/keycodes/norwood.h create mode 100644 include/media/keycodes/npgtech.h create mode 100644 include/media/keycodes/pctv-sedna.h create mode 100644 include/media/keycodes/pinnacle-color.h create mode 100644 include/media/keycodes/pinnacle-grey.h create mode 100644 include/media/keycodes/pinnacle-pctv-hd.h create mode 100644 include/media/keycodes/pixelview-new.h create mode 100644 include/media/keycodes/pixelview.h create mode 100644 include/media/keycodes/powercolor-real-angel.h create mode 100644 include/media/keycodes/proteus-2309.h create mode 100644 include/media/keycodes/purpletv.h create mode 100644 include/media/keycodes/pv951.h create mode 100644 include/media/keycodes/rc5-hauppauge-new.h create mode 100644 include/media/keycodes/rc5-tv.h create mode 100644 include/media/keycodes/real-audio-220-32-keys.h create mode 100644 include/media/keycodes/tbs-nec.h create mode 100644 include/media/keycodes/terratec-cinergy-xs.h create mode 100644 include/media/keycodes/tevii-nec.h create mode 100644 include/media/keycodes/tt-1500.h create mode 100644 include/media/keycodes/videomate-s350.h create mode 100644 include/media/keycodes/videomate-tv-pvr.h create mode 100644 include/media/keycodes/winfast-usbii-deluxe.h create mode 100644 include/media/keycodes/winfast.h
drivers/media/IR/ir-keymaps.c +11 -3160
@@ -17,3178 +17,29 @@Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#define IR_KEYMAPS +/* * NOTICE FOR DEVELOPERS: * The IR mappings should be as close as possible to what's * specified at: * http://linuxtv.org/wiki/index.php/Remote_Controllers -*/ -#include <linux/module.h> - -#include <linux/input.h> -#include <media/ir-common.h> - - -/* +* * The usage of tables with just the command part is deprecated. * All new IR keytables should contain address+command and need * to define the proper IR_TYPE (IR_TYPE_RC5/IR_TYPE_NEC). * The deprecated tables should use IR_TYPE_UNKNOWN */ +#include <linux/module.h> -/* empty keytable, can be used as placeholder for not-yet created keytables */ -static struct ir_scancode empty[] = { - {0x2a ,KEY_COFFEE }, -}; -DEFINE_LEGACY_IR_KEYTABLE (empty); - -/* Michal Majchrowicz <[email protected]> */ -static struct ir_scancode proteus_2309[] = { -/* numeric */ - {0x00 ,KEY_0 }, - {0x01 ,KEY_1 }, - {0x02 ,KEY_2 }, - {0x03 ,KEY_3 }, - {0x04 ,KEY_4 }, - {0x05 ,KEY_5 }, - {0x06 ,KEY_6 }, - {0x07 ,KEY_7 }, - {0x08 ,KEY_8 }, - {0x09 ,KEY_9 }, - - {0x5c ,KEY_POWER },/* power */ - {0x20 ,KEY_ZOOM },/* full screen */ - {0x0f ,KEY_BACKSPACE },/* recall */ - {0x1b ,KEY_ENTER },/* mute */ - {0x41 ,KEY_RECORD },/* record */ - {0x43 ,KEY_STOP },/* stop */ - {0x16 ,KEY_S }, - {0x1a ,KEY_POWER2 },/* off */ - {0x2e ,KEY_RED }, - {0x1f ,KEY_CHANNELDOWN },/* channel - */ - {0x1c ,KEY_CHANNELUP },/* channel + */ - {0x10 ,KEY_VOLUMEDOWN },/* volume - */ - {0x1e ,KEY_VOLUMEUP },/* volume + */ - {0x14 ,KEY_F1 }, -}; -DEFINE_LEGACY_IR_KEYTABLE (proteus_2309); - -/* Matt Jesson <[email protected] */ -static struct ir_scancode avermedia_dvbt[] = { - {0x28 ,KEY_0 },/* '0' / 'enter' */ - {0x22 ,KEY_1 },/* '1' */ - {0x12 ,KEY_2 },/* '2' / 'up arrow' */ - {0x32 ,KEY_3 },/* '3' */ - {0x24 ,KEY_4 },/* '4' / 'left arrow' */ - {0x14 ,KEY_5 },/* '5' */ - {0x34 ,KEY_6 },/* '6' / 'right arrow' */ - {0x26 ,KEY_7 },/* '7' */ - {0x16 ,KEY_8 },/* '8' / 'down arrow' */ - {0x36 ,KEY_9 },/* '9' */ - - {0x20 ,KEY_LIST },/* 'source' */ - {0x10 ,KEY_TEXT },/* 'teletext' */ - {0x00 ,KEY_POWER },/* 'power' */ - {0x04 ,KEY_AUDIO },/* 'audio' */ - {0x06 ,KEY_ZOOM },/* 'full screen' */ - {0x18 ,KEY_VIDEO },/* 'display' */ - {0x38 ,KEY_SEARCH },/* 'loop' */ - {0x08 ,KEY_INFO },/* 'preview' */ - {0x2a ,KEY_REWIND },/* 'backward <<' */ - {0x1a ,KEY_FASTFORWARD },/* 'forward >>' */ - {0x3a ,KEY_RECORD },/* 'capture' */ - {0x0a ,KEY_MUTE },/* 'mute' */ - {0x2c ,KEY_RECORD },/* 'record' */ - {0x1c ,KEY_PAUSE },/* 'pause' */ - {0x3c ,KEY_STOP },/* 'stop' */ - {0x0c ,KEY_PLAY },/* 'play' */ - {0x2e ,KEY_RED },/* 'red' */ - {0x01 ,KEY_BLUE },/* 'blue' / 'cancel' */ - {0x0e ,KEY_YELLOW },/* 'yellow' / 'ok' */ - {0x21 ,KEY_GREEN },/* 'green' */ - {0x11 ,KEY_CHANNELDOWN },/* 'channel -' */ - {0x31 ,KEY_CHANNELUP },/* 'channel +' */ - {0x1e ,KEY_VOLUMEDOWN },/* 'volume -' */ - {0x3e ,KEY_VOLUMEUP },/* 'volume +' */ -}; -DEFINE_LEGACY_IR_KEYTABLE (avermedia_dvbt); - -/* -* Avermedia M135A with IR model RM-JX -* The same codes exist on both Positivo (BR) and original IR -* Mauro Carvalho Chehab <[email protected]> -*/ -static struct ir_scancode avermedia_m135a_rm_jx[] = { - {0x0200 ,KEY_POWER2 }, - {0x022e ,KEY_DOT },/* '.' */ - {0x0201 ,KEY_MODE },/* TV/FM or SOURCE */ - - {0x0205 ,KEY_1 }, - {0x0206 ,KEY_2 }, - {0x0207 ,KEY_3 }, - {0x0209 ,KEY_4 }, - {0x020a ,KEY_5 }, - {0x020b ,KEY_6 }, - {0x020d ,KEY_7 }, - {0x020e ,KEY_8 }, - {0x020f ,KEY_9 }, - {0x0211 ,KEY_0 }, - - {0x0213 ,KEY_RIGHT },/* -> or L */ - {0x0212 ,KEY_LEFT },/* <- or R */ - - {0x0217 ,KEY_SLEEP },/* Capturar Imagem or Snapshot */ - {0x0210 ,KEY_SHUFFLE },/* Amostra or 16 chan prev */ - - {0x0303 ,KEY_CHANNELUP }, - {0x0302 ,KEY_CHANNELDOWN }, - {0x021f ,KEY_VOLUMEUP }, - {0x021e ,KEY_VOLUMEDOWN }, - {0x020c ,KEY_ENTER },/* Full Screen */ - - {0x0214 ,KEY_MUTE }, - {0x0208 ,KEY_AUDIO }, - - {0x0203 ,KEY_TEXT },/* Teletext */ - {0x0204 ,KEY_EPG }, - {0x022b ,KEY_TV2 },/* TV2 or PIP */ - - {0x021d ,KEY_RED }, - {0x021c ,KEY_YELLOW }, - {0x0301 ,KEY_GREEN }, - {0x0300 ,KEY_BLUE }, - - {0x021a ,KEY_PLAYPAUSE }, - {0x0219 ,KEY_RECORD }, - {0x0218 ,KEY_PLAY }, - {0x021b ,KEY_STOP }, -}; -DEFINE_IR_KEYTABLE (avermedia_m135a_rm_jx,IR_TYPE_NEC ); - -/* Oldrich Jedlicka <[email protected]> */ -static struct ir_scancode avermedia_cardbus[] = { - {0x00 ,KEY_POWER }, - {0x01 ,KEY_TUNER },/* TV/FM */ - {0x03 ,KEY_TEXT },/* Teletext */ - {0x04 ,KEY_EPG }, - {0x05 ,KEY_1 }, - {0x06 ,KEY_2 }, - {0x07 ,KEY_3 }, - {0x08 ,KEY_AUDIO }, - {0x09 ,KEY_4 }, - {0x0a ,KEY_5 }, - {0x0b ,KEY_6 }, - {0x0c ,KEY_ZOOM },/* Full screen */ - {0x0d ,KEY_7 }, - {0x0e ,KEY_8 }, - {0x0f ,KEY_9 }, - {0x10 ,KEY_PAGEUP },/* 16-CH PREV */ - {0x11 ,KEY_0 }, - {0x12 ,KEY_INFO }, - {0x13 ,KEY_AGAIN },/* CH RTN - channel return */ - {0x14 ,KEY_MUTE }, - {0x15 ,KEY_EDIT },/* Autoscan */ - {0x17 ,KEY_SAVE },/* Screenshot */ - {0x18 ,KEY_PLAYPAUSE }, - {0x19 ,KEY_RECORD }, - {0x1a ,KEY_PLAY }, - {0x1b ,KEY_STOP }, - {0x1c ,KEY_FASTFORWARD }, - {0x1d ,KEY_REWIND }, - {0x1e ,KEY_VOLUMEDOWN }, - {0x1f ,KEY_VOLUMEUP }, - {0x22 ,KEY_SLEEP },/* Sleep */ - {0x23 ,KEY_ZOOM },/* Aspect */ - {0x26 ,KEY_SCREEN },/* Pos */ - {0x27 ,KEY_ANGLE },/* Size */ - {0x28 ,KEY_SELECT },/* Select */ - {0x29 ,KEY_BLUE },/* Blue/Picture */ - {0x2a ,KEY_BACKSPACE },/* Back */ - {0x2b ,KEY_MEDIA },/* PIP (Picture-in-picture) */ - {0x2c ,KEY_DOWN }, - {0x2e ,KEY_DOT }, - {0x2f ,KEY_TV },/* Live TV */ - {0x32 ,KEY_LEFT }, - {0x33 ,KEY_CLEAR },/* Clear */ - {0x35 ,KEY_RED },/* Red/TV */ - {0x36 ,KEY_UP }, - {0x37 ,KEY_HOME },/* Home */ - {0x39 ,KEY_GREEN },/* Green/Video */ - {0x3d ,KEY_YELLOW },/* Yellow/Music */ - {0x3e ,KEY_OK },/* Ok */ - {0x3f ,KEY_RIGHT }, - {0x40 ,KEY_NEXT },/* Next */ - {0x41 ,KEY_PREVIOUS },/* Previous */ - {0x42 ,KEY_CHANNELDOWN },/* Channel down */ - {0x43 ,KEY_CHANNELUP },/* Channel up */ -}; -DEFINE_LEGACY_IR_KEYTABLE (avermedia_cardbus); - -/* Attila Kondoros <[email protected]> */ -static struct ir_scancode apac_viewcomp[] = { - - {0x01 ,KEY_1 }, - {0x02 ,KEY_2 }, - {0x03 ,KEY_3 }, - {0x04 ,KEY_4 }, - {0x05 ,KEY_5 }, - {0x06 ,KEY_6 }, - {0x07 ,KEY_7 }, - {0x08 ,KEY_8 }, - {0x09 ,KEY_9 }, - {0x00 ,KEY_0 }, - {0x17 ,KEY_LAST },/* +100 */ - {0x0a ,KEY_LIST },/* recall */ - - - {0x1c ,KEY_TUNER },/* TV/FM */ - {0x15 ,KEY_SEARCH },/* scan */ - {0x12 ,KEY_POWER },/* power */ - {0x1f ,KEY_VOLUMEDOWN },/* vol up */ - {0x1b ,KEY_VOLUMEUP },/* vol down */ - {0x1e ,KEY_CHANNELDOWN },/* chn up */ - {0x1a ,KEY_CHANNELUP },/* chn down */ - - {0x11 ,KEY_VIDEO },/* video */ - {0x0f ,KEY_ZOOM },/* full screen */ - {0x13 ,KEY_MUTE },/* mute/unmute */ - {0x10 ,KEY_TEXT },/* min */ - - {0x0d ,KEY_STOP },/* freeze */ - {0x0e ,KEY_RECORD },/* record */ - {0x1d ,KEY_PLAYPAUSE },/* stop */ - {0x19 ,KEY_PLAY },/* play */ - - {0x16 ,KEY_GOTO },/* osd */ - {0x14 ,KEY_REFRESH },/* default */ - {0x0c ,KEY_KPPLUS },/* fine tune >>>> */ - {0x18 ,KEY_KPMINUS },/* fine tune <<<< */ -}; -DEFINE_LEGACY_IR_KEYTABLE (apac_viewcomp); - -/* ---------------------------------------------------------------------- */ - -static struct ir_scancode pixelview[] = { - - {0x1e ,KEY_POWER },/* power */ - {0x07 ,KEY_MEDIA },/* source */ - {0x1c ,KEY_SEARCH },/* scan */ - - - {0x03 ,KEY_TUNER },/* TV/FM */ - - {0x00 ,KEY_RECORD }, - {0x08 ,KEY_STOP }, - {0x11 ,KEY_PLAY }, - - {0x1a ,KEY_PLAYPAUSE },/* freeze */ - {0x19 ,KEY_ZOOM },/* zoom */ - {0x0f ,KEY_TEXT },/* min */ - - {0x01 ,KEY_1 }, - {0x0b ,KEY_2 }, - {0x1b ,KEY_3 }, - {0x05 ,KEY_4 }, - {0x09 ,KEY_5 }, - {0x15 ,KEY_6 }, - {0x06 ,KEY_7 }, - {0x0a ,KEY_8 }, - {0x12 ,KEY_9 }, - {0x02 ,KEY_0 }, - {0x10 ,KEY_LAST },/* +100 */ - {0x13 ,KEY_LIST },/* recall */ - - {0x1f ,KEY_CHANNELUP },/* chn down */ - {0x17 ,KEY_CHANNELDOWN },/* chn up */ - {0x16 ,KEY_VOLUMEUP },/* vol down */ - {0x14 ,KEY_VOLUMEDOWN },/* vol up */ - - {0x04 ,KEY_KPMINUS },/* <<< */ - {0x0e ,KEY_SETUP },/* function */ - {0x0c ,KEY_KPPLUS },/* >>> */ - - {0x0d ,KEY_GOTO },/* mts */ - {0x1d ,KEY_REFRESH },/* reset */ - {0x18 ,KEY_MUTE },/* mute/unmute */ -}; -DEFINE_LEGACY_IR_KEYTABLE (pixelview); +#include <linux/input.h> +#include <media/ir-common.h> /* -Mauro Carvalho Chehab <[email protected]> -present on PV MPEG 8000GT -*/ -static struct ir_scancode pixelview_new[] = { - {0x3c ,KEY_TIME },/* Timeshift */ - {0x12 ,KEY_POWER }, - - {0x3d ,KEY_1 }, - {0x38 ,KEY_2 }, - {0x18 ,KEY_3 }, - {0x35 ,KEY_4 }, - {0x39 ,KEY_5 }, - {0x15 ,KEY_6 }, - {0x36 ,KEY_7 }, - {0x3a ,KEY_8 }, - {0x1e ,KEY_9 }, - {0x3e ,KEY_0 }, - - {0x1c ,KEY_AGAIN },/* LOOP */ - {0x3f ,KEY_MEDIA },/* Source */ - {0x1f ,KEY_LAST },/* +100 */ - {0x1b ,KEY_MUTE }, - - {0x17 ,KEY_CHANNELDOWN }, - {0x16 ,KEY_CHANNELUP }, - {0x10 ,KEY_VOLUMEUP }, - {0x14 ,KEY_VOLUMEDOWN }, - {0x13 ,KEY_ZOOM }, - - {0x19 ,KEY_CAMERA },/* SNAPSHOT */ - {0x1a ,KEY_SEARCH },/* scan */ - - {0x37 ,KEY_REWIND },/* << */ - {0x32 ,KEY_RECORD },/* o (red) */ - {0x33 ,KEY_FORWARD },/* >> */ - {0x11 ,KEY_STOP },/* square */ - {0x3b ,KEY_PLAY },/* > */ - {0x30 ,KEY_PLAYPAUSE },/* || */ - - {0x31 ,KEY_TV }, - {0x34 ,KEY_RADIO }, -}; -DEFINE_LEGACY_IR_KEYTABLE (pixelview_new); - -static struct ir_scancode nebula[] = { - {0x00 ,KEY_0 }, - {0x01 ,KEY_1 }, - {0x02 ,KEY_2 }, - {0x03 ,KEY_3 }, - {0x04 ,KEY_4 }, - {0x05 ,KEY_5 }, - {0x06 ,KEY_6 }, - {0x07 ,KEY_7 }, - {0x08 ,KEY_8 }, - {0x09 ,KEY_9 }, - {0x0a ,KEY_TV }, - {0x0b ,KEY_AUX }, - {0x0c ,KEY_DVD }, - {0x0d ,KEY_POWER }, - {0x0e ,KEY_MHP },/* labelled 'Picture' */ - {0x0f ,KEY_AUDIO }, - {0x10 ,KEY_INFO }, - {0x11 ,KEY_F13 },/* 16:9 */ - {0x12 ,KEY_F14 },/* 14:9 */ - {0x13 ,KEY_EPG }, - {0x14 ,KEY_EXIT }, - {0x15 ,KEY_MENU }, - {0x16 ,KEY_UP }, - {0x17 ,KEY_DOWN }, - {0x18 ,KEY_LEFT }, - {0x19 ,KEY_RIGHT }, - {0x1a ,KEY_ENTER }, - {0x1b ,KEY_CHANNELUP }, - {0x1c ,KEY_CHANNELDOWN }, - {0x1d ,KEY_VOLUMEUP }, - {0x1e ,KEY_VOLUMEDOWN }, - {0x1f ,KEY_RED }, - {0x20 ,KEY_GREEN }, - {0x21 ,KEY_YELLOW }, - {0x22 ,KEY_BLUE }, - {0x23 ,KEY_SUBTITLE }, - {0x24 ,KEY_F15 },/* AD */ - {0x25 ,KEY_TEXT }, - {0x26 ,KEY_MUTE }, - {0x27 ,KEY_REWIND }, - {0x28 ,KEY_STOP }, - {0x29 ,KEY_PLAY }, - {0x2a ,KEY_FASTFORWARD }, - {0x2b ,KEY_F16 },/* chapter */ - {0x2c ,KEY_PAUSE }, - {0x2d ,KEY_PLAY }, - {0x2e ,KEY_RECORD }, - {0x2f ,KEY_F17 },/* picture in picture */ - {0x30 ,KEY_KPPLUS },/* zoom in */ - {0x31 ,KEY_KPMINUS },/* zoom out */ - {0x32 ,KEY_F18 },/* capture */ - {0x33 ,KEY_F19 },/* web */ - {0x34 ,KEY_EMAIL }, - {0x35 ,KEY_PHONE }, - {0x36 ,KEY_PC }, -}; -DEFINE_LEGACY_IR_KEYTABLE (nebula); - -/* DigitalNow DNTV Live DVB-T Remote */ -static struct ir_scancode dntv_live_dvb_t[] = { - {0x00 ,KEY_ESC },/* 'go up a level?' */ -/* Keys 0 to 9 */ - {0x0a ,KEY_0 }, - {0x01 ,KEY_1 }, - {0x02 ,KEY_2 }, - {0x03 ,KEY_3 }, - {0x04 ,KEY_4 }, - {0x05 ,KEY_5 }, - {0x06 ,KEY_6 }, - {0x07 ,KEY_7 }, - {0x08 ,KEY_8 }, - {0x09 ,KEY_9 }, - - {0x0b ,KEY_TUNER },/* tv/fm */ - {0x0c ,KEY_SEARCH },/* scan */ - {0x0d ,KEY_STOP }, - {0x0e ,KEY_PAUSE }, - {0x0f ,KEY_LIST },/* source */ - - {0x10 ,KEY_MUTE }, - {0x11 ,KEY_REWIND },/* backward << */ - {0x12 ,KEY_POWER }, - {0x13 ,KEY_CAMERA },/* snap */ - {0x14 ,KEY_AUDIO },/* stereo */ - {0x15 ,KEY_CLEAR },/* reset */ - {0x16 ,KEY_PLAY }, - {0x17 ,KEY_ENTER }, - {0x18 ,KEY_ZOOM },/* full screen */ - {0x19 ,KEY_FASTFORWARD },/* forward >> */ - {0x1a ,KEY_CHANNELUP }, - {0x1b ,KEY_VOLUMEUP }, - {0x1c ,KEY_INFO },/* preview */ - {0x1d ,KEY_RECORD },/* record */ - {0x1e ,KEY_CHANNELDOWN }, - {0x1f ,KEY_VOLUMEDOWN }, -}; -DEFINE_LEGACY_IR_KEYTABLE (dntv_live_dvb_t); - -/* ---------------------------------------------------------------------- */ - -/* IO-DATA BCTV7E Remote */ -static struct ir_scancode iodata_bctv7e[] = { - {0x40 ,KEY_TV }, - {0x20 ,KEY_RADIO },/* FM */ - {0x60 ,KEY_EPG }, - {0x00 ,KEY_POWER }, - -/* Keys 0 to 9 */ - {0x44 ,KEY_0 },/* 10 */ - {0x50 ,KEY_1 }, - {0x30 ,KEY_2 }, - {0x70 ,KEY_3 }, - {0x48 ,KEY_4 }, - {0x28 ,KEY_5 }, - {0x68 ,KEY_6 }, - {0x58 ,KEY_7 }, - {0x38 ,KEY_8 }, - {0x78 ,KEY_9 }, - - {0x10 ,KEY_L },/* Live */ - {0x08 ,KEY_TIME },/* Time Shift */ - - {0x18 ,KEY_PLAYPAUSE },/* Play */ - - {0x24 ,KEY_ENTER },/* 11 */ - {0x64 ,KEY_ESC },/* 12 */ - {0x04 ,KEY_M },/* Multi */ - - {0x54 ,KEY_VIDEO }, - {0x34 ,KEY_CHANNELUP }, - {0x74 ,KEY_VOLUMEUP }, - {0x14 ,KEY_MUTE }, - - {0x4c ,KEY_VCR },/* SVIDEO */ - {0x2c ,KEY_CHANNELDOWN }, - {0x6c ,KEY_VOLUMEDOWN }, - {0x0c ,KEY_ZOOM }, - - {0x5c ,KEY_PAUSE }, - {0x3c ,KEY_RED },/* || (red) */ - {0x7c ,KEY_RECORD },/* recording */ - {0x1c ,KEY_STOP }, - - {0x41 ,KEY_REWIND },/* backward << */ - {0x21 ,KEY_PLAY }, - {0x61 ,KEY_FASTFORWARD },/* forward >> */ - {0x01 ,KEY_NEXT },/* skip >| */ -}; -DEFINE_LEGACY_IR_KEYTABLE (iodata_bctv7e); - -/* ---------------------------------------------------------------------- */ - -/* ADS Tech Instant TV DVB-T PCI Remote */ -static struct ir_scancode adstech_dvb_t_pci[] = { -/* Keys 0 to 9 */ - {0x4d ,KEY_0 }, - {0x57 ,KEY_1 }, - {0x4f ,KEY_2 }, - {0x53 ,KEY_3 }, - {0x56 ,KEY_4 }, - {0x4e ,KEY_5 }, - {0x5e ,KEY_6 }, - {0x54 ,KEY_7 }, - {0x4c ,KEY_8 }, - {0x5c ,KEY_9 }, - - {0x5b ,KEY_POWER }, - {0x5f ,KEY_MUTE }, - {0x55 ,KEY_GOTO }, - {0x5d ,KEY_SEARCH }, - {0x17 ,KEY_EPG },/* Guide */ - {0x1f ,KEY_MENU }, - {0x0f ,KEY_UP }, - {0x46 ,KEY_DOWN }, - {0x16 ,KEY_LEFT }, - {0x1e ,KEY_RIGHT }, - {0x0e ,KEY_SELECT },/* Enter */ - {0x5a ,KEY_INFO }, - {0x52 ,KEY_EXIT }, - {0x59 ,KEY_PREVIOUS }, - {0x51 ,KEY_NEXT }, - {0x58 ,KEY_REWIND }, - {0x50 ,KEY_FORWARD }, - {0x44 ,KEY_PLAYPAUSE }, - {0x07 ,KEY_STOP }, - {0x1b ,KEY_RECORD }, - {0x13 ,KEY_TUNER },/* Live */ - {0x0a ,KEY_A }, - {0x12 ,KEY_B }, - {0x03 ,KEY_PROG1 },/* 1 */ - {0x01 ,KEY_PROG2 },/* 2 */ - {0x00 ,KEY_PROG3 },/* 3 */ - {0x06 ,KEY_DVD }, - {0x48 ,KEY_AUX },/* Photo */ - {0x40 ,KEY_VIDEO }, - {0x19 ,KEY_AUDIO },/* Music */ - {0x0b ,KEY_CHANNELUP }, - {0x08 ,KEY_CHANNELDOWN }, - {0x15 ,KEY_VOLUMEUP }, - {0x1c ,KEY_VOLUMEDOWN }, -}; -DEFINE_LEGACY_IR_KEYTABLE (adstech_dvb_t_pci); - -/* ---------------------------------------------------------------------- */ - -/* MSI TV@nywhere MASTER remote */ - -static struct ir_scancode msi_tvanywhere[] = { -/* Keys 0 to 9 */ - {0x00 ,KEY_0 }, - {0x01 ,KEY_1 }, - {0x02 ,KEY_2 }, - {0x03 ,KEY_3 }, - {0x04 ,KEY_4 }, - {0x05 ,KEY_5 }, - {0x06 ,KEY_6 }, - {0x07 ,KEY_7 }, - {0x08 ,KEY_8 }, - {0x09 ,KEY_9 }, - - {0x0c ,KEY_MUTE }, - {0x0f ,KEY_SCREEN },/* Full Screen */ - {0x10 ,KEY_FN },/* Funtion */ - {0x11 ,KEY_TIME },/* Time shift */ - {0x12 ,KEY_POWER }, - {0x13 ,KEY_MEDIA },/* MTS */ - {0x14 ,KEY_SLOW }, - {0x16 ,KEY_REWIND },/* backward << */ - {0x17 ,KEY_ENTER },/* Return */ - {0x18 ,KEY_FASTFORWARD },/* forward >> */ - {0x1a ,KEY_CHANNELUP }, - {0x1b ,KEY_VOLUMEUP }, - {0x1e ,KEY_CHANNELDOWN }, - {0x1f ,KEY_VOLUMEDOWN }, -}; -DEFINE_LEGACY_IR_KEYTABLE (msi_tvanywhere); - -/* ---------------------------------------------------------------------- */ - -/* -Keycodes for remote on the MSI TV@nywhere Plus. The controller IC on the card -is marked "KS003". The controller is I2C at address 0x30, but does not seem -to respond to probes until a read is performed from a valid device. -I don't know why... - -Note: This remote may be of similar or identical design to the -Pixelview remote (?). The raw codes and duplicate button codes -appear to be the same. - -Henry Wong <[email protected]> -Some changes to formatting and keycodes by Mark Schultz <[email protected]> - -*/ - -static struct ir_scancode msi_tvanywhere_plus[] = { - -/* ---- Remote Button Layout ---- - -POWER SOURCE SCAN MUTE -TV/FM 1 2 3 -|> 4 5 6 -<| 7 8 9 -^^UP 0 + RECALL -vvDN RECORD STOP PLAY - -MINIMIZE ZOOM - -CH+ -VOL- VOL+ -CH- - -SNAPSHOT MTS - -<< FUNC >> RESET -*/ - - {0x01 ,KEY_1 },/* 1 */ - {0x0b ,KEY_2 },/* 2 */ - {0x1b ,KEY_3 },/* 3 */ - {0x05 ,KEY_4 },/* 4 */ - {0x09 ,KEY_5 },/* 5 */ - {0x15 ,KEY_6 },/* 6 */ - {0x06 ,KEY_7 },/* 7 */ - {0x0a ,KEY_8 },/* 8 */ - {0x12 ,KEY_9 },/* 9 */ - {0x02 ,KEY_0 },/* 0 */ - {0x10 ,KEY_KPPLUS },/* + */ - {0x13 ,KEY_AGAIN },/* Recall */ - - {0x1e ,KEY_POWER },/* Power */ - {0x07 ,KEY_TUNER },/* Source */ - {0x1c ,KEY_SEARCH },/* Scan */ - {0x18 ,KEY_MUTE },/* Mute */ - - {0x03 ,KEY_RADIO },/* TV/FM */ -/* The next four keys are duplicates that appear to send the -same IR code as Ch+, Ch-, >>, and << . The raw code assigned -to them is the actual code + 0x20 - they will never be -detected as such unless some way is discovered to distinguish -these buttons from those that have the same code. */ - {0x3f ,KEY_RIGHT },/* |> and Ch+ */ - {0x37 ,KEY_LEFT },/* <| and Ch- */ - {0x2c ,KEY_UP },/* ^^Up and >> */ - {0x24 ,KEY_DOWN },/* vvDn and << */ - - {0x00 ,KEY_RECORD },/* Record */ - {0x08 ,KEY_STOP },/* Stop */ - {0x11 ,KEY_PLAY },/* Play */ - - {0x0f ,KEY_CLOSE },/* Minimize */ - {0x19 ,KEY_ZOOM },/* Zoom */ - {0x1a ,KEY_CAMERA },/* Snapshot */ - {0x0d ,KEY_LANGUAGE },/* MTS */ - - {0x14 ,KEY_VOLUMEDOWN },/* Vol- */ - {0x16 ,KEY_VOLUMEUP },/* Vol+ */ - {0x17 ,KEY_CHANNELDOWN },/* Ch- */ - {0x1f ,KEY_CHANNELUP },/* Ch+ */ - - {0x04 ,KEY_REWIND },/* << */ - {0x0e ,KEY_MENU },/* Function */ - {0x0c ,KEY_FASTFORWARD },/* >> */ - {0x1d ,KEY_RESTART },/* Reset */ -}; -DEFINE_LEGACY_IR_KEYTABLE (msi_tvanywhere_plus); - -/* ---------------------------------------------------------------------- */ - -/* Cinergy 1400 DVB-T */ -static struct ir_scancode cinergy_1400[] = { - {0x01 ,KEY_POWER }, - {0x02 ,KEY_1 }, - {0x03 ,KEY_2 }, - {0x04 ,KEY_3 }, - {0x05 ,KEY_4 }, - {0x06 ,KEY_5 }, - {0x07 ,KEY_6 }, - {0x08 ,KEY_7 }, - {0x09 ,KEY_8 }, - {0x0a ,KEY_9 }, - {0x0c ,KEY_0 }, - - {0x0b ,KEY_VIDEO }, - {0x0d ,KEY_REFRESH }, - {0x0e ,KEY_SELECT }, - {0x0f ,KEY_EPG }, - {0x10 ,KEY_UP }, - {0x11 ,KEY_LEFT }, - {0x12 ,KEY_OK }, - {0x13 ,KEY_RIGHT }, - {0x14 ,KEY_DOWN }, - {0x15 ,KEY_TEXT }, - {0x16 ,KEY_INFO }, - - {0x17 ,KEY_RED }, - {0x18 ,KEY_GREEN }, - {0x19 ,KEY_YELLOW }, - {0x1a ,KEY_BLUE }, - - {0x1b ,KEY_CHANNELUP }, - {0x1c ,KEY_VOLUMEUP }, - {0x1d ,KEY_MUTE }, - {0x1e ,KEY_VOLUMEDOWN }, - {0x1f ,KEY_CHANNELDOWN }, - - {0x40 ,KEY_PAUSE }, - {0x4c ,KEY_PLAY }, - {0x58 ,KEY_RECORD }, - {0x54 ,KEY_PREVIOUS }, - {0x48 ,KEY_STOP }, - {0x5c ,KEY_NEXT }, -}; -DEFINE_LEGACY_IR_KEYTABLE (cinergy_1400); - -/* ---------------------------------------------------------------------- */ - -/* AVERTV STUDIO 303 Remote */ -static struct ir_scancode avertv_303[] = { - {0x2a ,KEY_1 }, - {0x32 ,KEY_2 }, - {0x3a ,KEY_3 }, - {0x4a ,KEY_4 }, - {0x52 ,KEY_5 }, - {0x5a ,KEY_6 }, - {0x6a ,KEY_7 }, - {0x72 ,KEY_8 }, - {0x7a ,KEY_9 }, - {0x0e ,KEY_0 }, - - {0x02 ,KEY_POWER }, - {0x22 ,KEY_VIDEO }, - {0x42 ,KEY_AUDIO }, - {0x62 ,KEY_ZOOM }, - {0x0a ,KEY_TV }, - {0x12 ,KEY_CD }, - {0x1a ,KEY_TEXT }, - - {0x16 ,KEY_SUBTITLE }, - {0x1e ,KEY_REWIND }, - {0x06 ,KEY_PRINT }, - - {0x2e ,KEY_SEARCH }, - {0x36 ,KEY_SLEEP }, - {0x3e ,KEY_SHUFFLE }, - {0x26 ,KEY_MUTE }, - - {0x4e ,KEY_RECORD }, - {0x56 ,KEY_PAUSE }, - {0x5e ,KEY_STOP }, - {0x46 ,KEY_PLAY }, - - {0x6e ,KEY_RED }, - {0x0b ,KEY_GREEN }, - {0x66 ,KEY_YELLOW }, - {0x03 ,KEY_BLUE }, - - {0x76 ,KEY_LEFT }, - {0x7e ,KEY_RIGHT }, - {0x13 ,KEY_DOWN }, - {0x1b ,KEY_UP }, -}; -DEFINE_LEGACY_IR_KEYTABLE (avertv_303); - -/* ---------------------------------------------------------------------- */ - -/* DigitalNow DNTV Live! DVB-T Pro Remote */ -static struct ir_scancode dntv_live_dvbt_pro[] = { - {0x16 ,KEY_POWER }, - {0x5b ,KEY_HOME }, - - {0x55 ,KEY_TV },/* live tv */ - {0x58 ,KEY_TUNER },/* digital Radio */ - {0x5a ,KEY_RADIO },/* FM radio */ - {0x59 ,KEY_DVD },/* dvd menu */ - {0x03 ,KEY_1 }, - {0x01 ,KEY_2 }, - {0x06 ,KEY_3 }, - {0x09 ,KEY_4 }, - {0x1d ,KEY_5 }, - {0x1f ,KEY_6 }, - {0x0d ,KEY_7 }, - {0x19 ,KEY_8 }, - {0x1b ,KEY_9 }, - {0x0c ,KEY_CANCEL }, - {0x15 ,KEY_0 }, - {0x4a ,KEY_CLEAR }, - {0x13 ,KEY_BACK }, - {0x00 ,KEY_TAB }, - {0x4b ,KEY_UP }, - {0x4e ,KEY_LEFT }, - {0x4f ,KEY_OK }, - {0x52 ,KEY_RIGHT }, - {0x51 ,KEY_DOWN }, - {0x1e ,KEY_VOLUMEUP }, - {0x0a ,KEY_VOLUMEDOWN }, - {0x02 ,KEY_CHANNELDOWN }, - {0x05 ,KEY_CHANNELUP }, - {0x11 ,KEY_RECORD }, - {0x14 ,KEY_PLAY }, - {0x4c ,KEY_PAUSE }, - {0x1a ,KEY_STOP }, - {0x40 ,KEY_REWIND }, - {0x12 ,KEY_FASTFORWARD }, - {0x41 ,KEY_PREVIOUSSONG },/* replay |< */ - {0x42 ,KEY_NEXTSONG },/* skip >| */ - {0x54 ,KEY_CAMERA },/* capture */ - {0x50 ,KEY_LANGUAGE },/* sap */ - {0x47 ,KEY_TV2 },/* pip */ - {0x4d ,KEY_SCREEN }, - {0x43 ,KEY_SUBTITLE }, - {0x10 ,KEY_MUTE }, - {0x49 ,KEY_AUDIO },/* l/r */ - {0x07 ,KEY_SLEEP }, - {0x08 ,KEY_VIDEO },/* a/v */ - {0x0e ,KEY_PREVIOUS },/* recall */ - {0x45 ,KEY_ZOOM },/* zoom + */ - {0x46 ,KEY_ANGLE },/* zoom - */ - {0x56 ,KEY_RED }, - {0x57 ,KEY_GREEN }, - {0x5c ,KEY_YELLOW }, - {0x5d ,KEY_BLUE }, -}; -DEFINE_LEGACY_IR_KEYTABLE (dntv_live_dvbt_pro); - -static struct ir_scancode em_terratec[] = { - {0x01 ,KEY_CHANNEL }, - {0x02 ,KEY_SELECT }, - {0x03 ,KEY_MUTE }, - {0x04 ,KEY_POWER }, - {0x05 ,KEY_1 }, - {0x06 ,KEY_2 }, - {0x07 ,KEY_3 }, - {0x08 ,KEY_CHANNELUP }, - {0x09 ,KEY_4 }, - {0x0a ,KEY_5 }, - {0x0b ,KEY_6 }, - {0x0c ,KEY_CHANNELDOWN }, - {0x0d ,KEY_7 }, - {0x0e ,KEY_8 }, - {0x0f ,KEY_9 }, - {0x10 ,KEY_VOLUMEUP }, - {0x11 ,KEY_0 }, - {0x12 ,KEY_MENU }, - {0x13 ,KEY_PRINT }, - {0x14 ,KEY_VOLUMEDOWN }, - {0x16 ,KEY_PAUSE }, - {0x18 ,KEY_RECORD }, - {0x19 ,KEY_REWIND }, - {0x1a ,KEY_PLAY }, - {0x1b ,KEY_FORWARD }, - {0x1c ,KEY_BACKSPACE }, - {0x1e ,KEY_STOP }, - {0x40 ,KEY_ZOOM }, -}; -DEFINE_LEGACY_IR_KEYTABLE (em_terratec); - -static struct ir_scancode pinnacle_grey[] = { - {0x3a ,KEY_0 }, - {0x31 ,KEY_1 }, - {0x32 ,KEY_2 }, - {0x33 ,KEY_3 }, - {0x34 ,KEY_4 }, - {0x35 ,KEY_5 }, - {0x36 ,KEY_6 }, - {0x37 ,KEY_7 }, - {0x38 ,KEY_8 }, - {0x39 ,KEY_9 }, - - {0x2f ,KEY_POWER }, - - {0x2e ,KEY_P }, - {0x1f ,KEY_L }, - {0x2b ,KEY_I }, - - {0x2d ,KEY_SCREEN }, - {0x1e ,KEY_ZOOM }, - {0x1b ,KEY_VOLUMEUP }, - {0x0f ,KEY_VOLUMEDOWN }, - {0x17 ,KEY_CHANNELUP }, - {0x1c ,KEY_CHANNELDOWN }, - {0x25 ,KEY_INFO }, - - {0x3c ,KEY_MUTE }, - - {0x3d ,KEY_LEFT }, - {0x3b ,KEY_RIGHT }, - - {0x3f ,KEY_UP }, - {0x3e ,KEY_DOWN }, - {0x1a ,KEY_ENTER }, - - {0x1d ,KEY_MENU }, - {0x19 ,KEY_AGAIN }, - {0x16 ,KEY_PREVIOUSSONG }, - {0x13 ,KEY_NEXTSONG }, - {0x15 ,KEY_PAUSE }, - {0x0e ,KEY_REWIND }, - {0x0d ,KEY_PLAY }, - {0x0b ,KEY_STOP }, - {0x07 ,KEY_FORWARD }, - {0x27 ,KEY_RECORD }, - {0x26 ,KEY_TUNER }, - {0x29 ,KEY_TEXT }, - {0x2a ,KEY_MEDIA }, - {0x18 ,KEY_EPG }, -}; -DEFINE_LEGACY_IR_KEYTABLE (pinnacle_grey); - -static struct ir_scancode flyvideo[] = { - {0x0f ,KEY_0 }, - {0x03 ,KEY_1 }, - {0x04 ,KEY_2 }, - {0x05 ,KEY_3 }, - {0x07 ,KEY_4 }, - {0x08 ,KEY_5 }, - {0x09 ,KEY_6 }, - {0x0b ,KEY_7 }, - {0x0c ,KEY_8 }, - {0x0d ,KEY_9 }, - - {0x0e ,KEY_MODE },/* Air/Cable */ - {0x11 ,KEY_VIDEO },/* Video */ - {0x15 ,KEY_AUDIO },/* Audio */ - {0x00 ,KEY_POWER },/* Power */ - {0x18 ,KEY_TUNER },/* AV Source */ - {0x02 ,KEY_ZOOM },/* Fullscreen */ - {0x1a ,KEY_LANGUAGE },/* Stereo */ - {0x1b ,KEY_MUTE },/* Mute */ - {0x14 ,KEY_VOLUMEUP },/* Volume + */ - {0x17 ,KEY_VOLUMEDOWN },/* Volume - */ - {0x12 ,KEY_CHANNELUP },/* Channel + */ - {0x13 ,KEY_CHANNELDOWN },/* Channel - */ - {0x06 ,KEY_AGAIN },/* Recall */ - {0x10 ,KEY_ENTER },/* Enter */ - - {0x19 ,KEY_BACK },/* Rewind ( <<< ) */ - {0x1f ,KEY_FORWARD },/* Forward ( >>> ) */ - {0x0a ,KEY_ANGLE },/* no label, may be used as the PAUSE button */ -}; -DEFINE_LEGACY_IR_KEYTABLE (flyvideo); - -static struct ir_scancode flydvb[] = { - {0x01 ,KEY_ZOOM },/* Full Screen */ - {0x00 ,KEY_POWER },/* Power */ - - {0x03 ,KEY_1 }, - {0x04 ,KEY_2 }, - {0x05 ,KEY_3 }, - {0x07 ,KEY_4 }, - {0x08 ,KEY_5 }, - {0x09 ,KEY_6 }, - {0x0b ,KEY_7 }, - {0x0c ,KEY_8 }, - {0x0d ,KEY_9 }, - {0x06 ,KEY_AGAIN },/* Recall */ - {0x0f ,KEY_0 }, - {0x10 ,KEY_MUTE },/* Mute */ - {0x02 ,KEY_RADIO },/* TV/Radio */ - {0x1b ,KEY_LANGUAGE },/* SAP (Second Audio Program) */ - - {0x14 ,KEY_VOLUMEUP },/* VOL+ */ - {0x17 ,KEY_VOLUMEDOWN },/* VOL- */ - {0x12 ,KEY_CHANNELUP },/* CH+ */ - {0x13 ,KEY_CHANNELDOWN },/* CH- */ - {0x1d ,KEY_ENTER },/* Enter */ - - {0x1a ,KEY_MODE },/* PIP */ - {0x18 ,KEY_TUNER },/* Source */ - - {0x1e ,KEY_RECORD },/* Record/Pause */ - {0x15 ,KEY_ANGLE },/* Swap (no label on key) */ - {0x1c ,KEY_PAUSE },/* Timeshift/Pause */ - {0x19 ,KEY_BACK },/* Rewind << */ - {0x0a ,KEY_PLAYPAUSE },/* Play/Pause */ - {0x1f ,KEY_FORWARD },/* Forward >> */ - {0x16 ,KEY_PREVIOUS },/* Back |<< */ - {0x11 ,KEY_STOP },/* Stop */ - {0x0e ,KEY_NEXT },/* End >>| */ -}; -DEFINE_LEGACY_IR_KEYTABLE (flydvb); - -static struct ir_scancode cinergy[] = { - {0x00 ,KEY_0 }, - {0x01 ,KEY_1 }, - {0x02 ,KEY_2 }, - {0x03 ,KEY_3 }, - {0x04 ,KEY_4 }, - {0x05 ,KEY_5 }, - {0x06 ,KEY_6 }, - {0x07 ,KEY_7 }, - {0x08 ,KEY_8 }, - {0x09 ,KEY_9 }, - - {0x0a ,KEY_POWER }, - {0x0b ,KEY_PROG1 },/* app */ - {0x0c ,KEY_ZOOM },/* zoom/fullscreen */ - {0x0d ,KEY_CHANNELUP },/* channel */ - {0x0e ,KEY_CHANNELDOWN },/* channel- */ - {0x0f ,KEY_VOLUMEUP }, - {0x10 ,KEY_VOLUMEDOWN }, - {0x11 ,KEY_TUNER },/* AV */ - {0x12 ,KEY_NUMLOCK },/* -/-- */ - {0x13 ,KEY_AUDIO },/* audio */ - {0x14 ,KEY_MUTE }, - {0x15 ,KEY_UP }, - {0x16 ,KEY_DOWN }, - {0x17 ,KEY_LEFT }, - {0x18 ,KEY_RIGHT }, - {0x19 ,BTN_LEFT , }, - {0x1a ,BTN_RIGHT , }, - {0x1b ,KEY_WWW },/* text */ - {0x1c ,KEY_REWIND }, - {0x1d ,KEY_FORWARD }, - {0x1e ,KEY_RECORD }, - {0x1f ,KEY_PLAY }, - {0x20 ,KEY_PREVIOUSSONG }, - {0x21 ,KEY_NEXTSONG }, - {0x22 ,KEY_PAUSE }, - {0x23 ,KEY_STOP }, -}; -DEFINE_LEGACY_IR_KEYTABLE (cinergy); - -/* Alfons Geser <[email protected]> -* updates from Job D. R. Borges <[email protected]> */ -static struct ir_scancode eztv[] = { - {0x12 ,KEY_POWER }, - {0x01 ,KEY_TV },/* DVR */ - {0x15 ,KEY_DVD },/* DVD */ - {0x17 ,KEY_AUDIO },/* music */ -/* DVR mode / DVD mode / music mode */ - - {0x1b ,KEY_MUTE },/* mute */ - {0x02 ,KEY_LANGUAGE },/* MTS/SAP / audio / autoseek */ - {0x1e ,KEY_SUBTITLE },/* closed captioning / subtitle / seek */ - {0x16 ,KEY_ZOOM },/* full screen */ - {0x1c ,KEY_VIDEO },/* video source / eject / delall */ - {0x1d ,KEY_RESTART },/* playback / angle / del */ - {0x2f ,KEY_SEARCH },/* scan / menu / playlist */ - {0x30 ,KEY_CHANNEL },/* CH surfing / bookmark / memo */ - - {0x31 ,KEY_HELP },/* help */ - {0x32 ,KEY_MODE },/* num/memo */ - {0x33 ,KEY_ESC },/* cancel */ - - {0x0c ,KEY_UP },/* up */ - {0x10 ,KEY_DOWN },/* down */ - {0x08 ,KEY_LEFT },/* left */ - {0x04 ,KEY_RIGHT },/* right */ - {0x03 ,KEY_SELECT },/* select */ - - {0x1f ,KEY_REWIND },/* rewind */ - {0x20 ,KEY_PLAYPAUSE },/* play/pause */ - {0x29 ,KEY_FORWARD },/* forward */ - {0x14 ,KEY_AGAIN },/* repeat */ - {0x2b ,KEY_RECORD },/* recording */ - {0x2c ,KEY_STOP },/* stop */ - {0x2d ,KEY_PLAY },/* play */ - {0x2e ,KEY_CAMERA },/* snapshot / shuffle */ - - {0x00 ,KEY_0 }, - {0x05 ,KEY_1 }, - {0x06 ,KEY_2 }, - {0x07 ,KEY_3 }, - {0x09 ,KEY_4 }, - {0x0a ,KEY_5 }, - {0x0b ,KEY_6 }, - {0x0d ,KEY_7 }, - {0x0e ,KEY_8 }, - {0x0f ,KEY_9 }, - - {0x2a ,KEY_VOLUMEUP }, - {0x11 ,KEY_VOLUMEDOWN }, - {0x18 ,KEY_CHANNELUP },/* CH.tracking up */ - {0x19 ,KEY_CHANNELDOWN },/* CH.tracking down */ - - {0x13 ,KEY_ENTER },/* enter */ - {0x21 ,KEY_DOT },/* . (decimal dot) */ -}; -DEFINE_LEGACY_IR_KEYTABLE (eztv); - -/* Alex Hermann <[email protected]> */ -static struct ir_scancode avermedia[] = { - {0x28 ,KEY_1 }, - {0x18 ,KEY_2 }, - {0x38 ,KEY_3 }, - {0x24 ,KEY_4 }, - {0x14 ,KEY_5 }, - {0x34 ,KEY_6 }, - {0x2c ,KEY_7 }, - {0x1c ,KEY_8 }, - {0x3c ,KEY_9 }, - {0x22 ,KEY_0 }, - - {0x20 ,KEY_TV },/* TV/FM */ - {0x10 ,KEY_CD },/* CD */ - {0x30 ,KEY_TEXT },/* TELETEXT */ - {0x00 ,KEY_POWER },/* POWER */ - - {0x08 ,KEY_VIDEO },/* VIDEO */ - {0x04 ,KEY_AUDIO },/* AUDIO */ - {0x0c ,KEY_ZOOM },/* FULL SCREEN */ - - {0x12 ,KEY_SUBTITLE },/* DISPLAY */ - {0x32 ,KEY_REWIND },/* LOOP */ - {0x02 ,KEY_PRINT },/* PREVIEW */ - - {0x2a ,KEY_SEARCH },/* AUTOSCAN */ - {0x1a ,KEY_SLEEP },/* FREEZE */ - {0x3a ,KEY_CAMERA },/* SNAPSHOT */ - {0x0a ,KEY_MUTE },/* MUTE */ - - {0x26 ,KEY_RECORD },/* RECORD */ - {0x16 ,KEY_PAUSE },/* PAUSE */ - {0x36 ,KEY_STOP },/* STOP */ - {0x06 ,KEY_PLAY },/* PLAY */ - - {0x2e ,KEY_RED },/* RED */ - {0x21 ,KEY_GREEN },/* GREEN */ - {0x0e ,KEY_YELLOW },/* YELLOW */ - {0x01 ,KEY_BLUE },/* BLUE */ - - {0x1e ,KEY_VOLUMEDOWN },/* VOLUME- */ - {0x3e ,KEY_VOLUMEUP },/* VOLUME+ */ - {0x11 ,KEY_CHANNELDOWN },/* CHANNEL/PAGE- */ - {0x31 ,KEY_CHANNELUP }/* CHANNEL/PAGE+ */ -}; -DEFINE_LEGACY_IR_KEYTABLE (avermedia); - -static struct ir_scancode videomate_tv_pvr[] = { - {0x14 ,KEY_MUTE }, - {0x24 ,KEY_ZOOM }, - - {0x01 ,KEY_DVD }, - {0x23 ,KEY_RADIO }, - {0x00 ,KEY_TV }, - - {0x0a ,KEY_REWIND }, - {0x08 ,KEY_PLAYPAUSE }, - {0x0f ,KEY_FORWARD }, - - {0x02 ,KEY_PREVIOUS }, - {0x07 ,KEY_STOP }, - {0x06 ,KEY_NEXT }, - - {0x0c ,KEY_UP }, - {0x0e ,KEY_DOWN }, - {0x0b ,KEY_LEFT }, - {0x0d ,KEY_RIGHT }, - {0x11 ,KEY_OK }, - - {0x03 ,KEY_MENU }, - {0x09 ,KEY_SETUP }, - {0x05 ,KEY_VIDEO }, - {0x22 ,KEY_CHANNEL }, - - {0x12 ,KEY_VOLUMEUP }, - {0x15 ,KEY_VOLUMEDOWN }, - {0x10 ,KEY_CHANNELUP }, - {0x13 ,KEY_CHANNELDOWN }, - - {0x04 ,KEY_RECORD }, - - {0x16 ,KEY_1 }, - {0x17 ,KEY_2 }, - {0x18 ,KEY_3 }, - {0x19 ,KEY_4 }, - {0x1a ,KEY_5 }, - {0x1b ,KEY_6 }, - {0x1c ,KEY_7 }, - {0x1d ,KEY_8 }, - {0x1e ,KEY_9 }, - {0x1f ,KEY_0 }, - - {0x20 ,KEY_LANGUAGE }, - {0x21 ,KEY_SLEEP }, -}; -DEFINE_LEGACY_IR_KEYTABLE (videomate_tv_pvr); - -/* Michael Tokarev <[email protected]> -http://www.corpit.ru/mjt/beholdTV/remote_control.jpg -keytable is used by MANLI MTV00[0x0c] and BeholdTV 40[13] at -least, and probably other cards too. -The "ascii-art picture" below (in comments, first row -is the keycode in hex, and subsequent row(s) shows -the button labels (several variants when appropriate) -helps to descide which keycodes to assign to the buttons. +* All keytables got moved to include/media/keytables directory. +* This file is still needed - at least for now, as their data is +* dynamically inserted here by the media/ir-common.h, due to the +* #define IR_KEYMAPS line, at the beginning of this file. The +* plans are to get rid of this file completely in a near future. */ -static struct ir_scancode manli[] = { - -/* 0x1c 0x12 * -* FUNCTION POWER * -* FM (|) * -* */ - {0x1c ,KEY_RADIO },/*XXX*/ - {0x12 ,KEY_POWER }, - -/* 0x01 0x02 0x03 * -* 1 2 3 * -* * -* 0x04 0x05 0x06 * -* 4 5 6 * -* * -* 0x07 0x08 0x09 * -* 7 8 9 * -* */ - {0x01 ,KEY_1 }, - {0x02 ,KEY_2 }, - {0x03 ,KEY_3 }, - {0x04 ,KEY_4 }, - {0x05 ,KEY_5 }, - {0x06 ,KEY_6 }, - {0x07 ,KEY_7 }, - {0x08 ,KEY_8 }, - {0x09 ,KEY_9 }, - -/* 0x0a 0x00 0x17 * -* RECALL 0 +100 * -* PLUS * -* */ - {0x0a ,KEY_AGAIN },/*XXX KEY_REWIND? */ - {0x00 ,KEY_0 }, - {0x17 ,KEY_DIGITS },/*XXX*/ - -/* 0x14 0x10 * -* MENU INFO * -* OSD */ - {0x14 ,KEY_MENU }, - {0x10 ,KEY_INFO }, - -/* 0x0b * -* Up * -* * -* 0x18 0x16 0x0c * -* Left Ok Right * -* * -* 0x015 * -* Down * -* */ - {0x0b ,KEY_UP }, - {0x18 ,KEY_LEFT }, - {0x16 ,KEY_OK },/*XXX KEY_SELECT? KEY_ENTER? */ - {0x0c ,KEY_RIGHT }, - {0x15 ,KEY_DOWN }, - -/* 0x11 0x0d * -* TV/AV MODE * -* SOURCE STEREO * -* */ - {0x11 ,KEY_TV },/*XXX*/ - {0x0d ,KEY_MODE },/*XXX there's no KEY_STEREO */ - -/* 0x0f 0x1b 0x1a * -* AUDIO Vol+ Chan+ * -* TIMESHIFT??? * -* * -* 0x0e 0x1f 0x1e * -* SLEEP Vol- Chan- * -* */ - {0x0f ,KEY_AUDIO }, - {0x1b ,KEY_VOLUMEUP }, - {0x1a ,KEY_CHANNELUP }, - {0x0e ,KEY_TIME }, - {0x1f ,KEY_VOLUMEDOWN }, - {0x1e ,KEY_CHANNELDOWN }, - -/* 0x13 0x19 * -* MUTE SNAPSHOT* -* */ - {0x13 ,KEY_MUTE }, - {0x19 ,KEY_CAMERA }, - -/* 0x1d unused ? */ -}; -DEFINE_LEGACY_IR_KEYTABLE (manli); - -/* Mike Baikov <[email protected]> */ -static struct ir_scancode gotview7135[] = { - - {0x11 ,KEY_POWER }, - {0x35 ,KEY_TV }, - {0x1b ,KEY_0 }, - {0x29 ,KEY_1 }, - {0x19 ,KEY_2 }, - {0x39 ,KEY_3 }, - {0x1f ,KEY_4 }, - {0x2c ,KEY_5 }, - {0x21 ,KEY_6 }, - {0x24 ,KEY_7 }, - {0x18 ,KEY_8 }, - {0x2b ,KEY_9 }, - {0x3b ,KEY_AGAIN },/* LOOP */ - {0x06 ,KEY_AUDIO }, - {0x31 ,KEY_PRINT },/* PREVIEW */ - {0x3e ,KEY_VIDEO }, - {0x10 ,KEY_CHANNELUP }, - {0x20 ,KEY_CHANNELDOWN }, - {0x0c ,KEY_VOLUMEDOWN }, - {0x28 ,KEY_VOLUMEUP }, - {0x08 ,KEY_MUTE }, - {0x26 ,KEY_SEARCH },/* SCAN */ - {0x3f ,KEY_CAMERA },/* SNAPSHOT */ - {0x12 ,KEY_RECORD }, - {0x32 ,KEY_STOP }, - {0x3c ,KEY_PLAY }, - {0x1d ,KEY_REWIND }, - {0x2d ,KEY_PAUSE }, - {0x0d ,KEY_FORWARD }, - {0x05 ,KEY_ZOOM },/*FULL*/ - - {0x2a ,KEY_F21 },/* LIVE TIMESHIFT */ - {0x0e ,KEY_F22 },/* MIN TIMESHIFT */ - {0x1e ,KEY_TIME },/* TIMESHIFT */ - {0x38 ,KEY_F24 },/* NORMAL TIMESHIFT */ -}; -DEFINE_LEGACY_IR_KEYTABLE (gotview7135); - -static struct ir_scancode purpletv[] = { - {0x03 ,KEY_POWER }, - {0x6f ,KEY_MUTE }, - {0x10 ,KEY_BACKSPACE },/* Recall */ - - {0x11 ,KEY_0 }, - {0x04 ,KEY_1 }, - {0x05 ,KEY_2 }, - {0x06 ,KEY_3 }, - {0x08 ,KEY_4 }, - {0x09 ,KEY_5 }, - {0x0a ,KEY_6 }, - {0x0c ,KEY_7 }, - {0x0d ,KEY_8 }, - {0x0e ,KEY_9 }, - {0x12 ,KEY_DOT },/* 100+ */ - - {0x07 ,KEY_VOLUMEUP }, - {0x0b ,KEY_VOLUMEDOWN }, - {0x1a ,KEY_KPPLUS }, - {0x18 ,KEY_KPMINUS }, - {0x15 ,KEY_UP }, - {0x1d ,KEY_DOWN }, - {0x0f ,KEY_CHANNELUP }, - {0x13 ,KEY_CHANNELDOWN }, - {0x48 ,KEY_ZOOM }, - - {0x1b ,KEY_VIDEO },/* Video source */ - {0x1f ,KEY_CAMERA },/* Snapshot */ - {0x49 ,KEY_LANGUAGE },/* MTS Select */ - {0x19 ,KEY_SEARCH },/* Auto Scan */ - - {0x4b ,KEY_RECORD }, - {0x46 ,KEY_PLAY }, - {0x45 ,KEY_PAUSE },/* Pause */ - {0x44 ,KEY_STOP }, - {0x43 ,KEY_TIME },/* Time Shift */ - {0x17 ,KEY_CHANNEL },/* SURF CH */ - {0x40 ,KEY_FORWARD },/* Forward ? */ - {0x42 ,KEY_REWIND },/* Backward ? */ - -}; -DEFINE_LEGACY_IR_KEYTABLE (purpletv); - -/* Mapping for the 28 key remote control as seen at -http://www.sednacomputer.com/photo/cardbus-tv.jpg -Pavel Mihaylov <[email protected]> -Also for the remote bundled with Kozumi KTV-01C card */ -static struct ir_scancode pctv_sedna[] = { - {0x00 ,KEY_0 }, - {0x01 ,KEY_1 }, - {0x02 ,KEY_2 }, - {0x03 ,KEY_3 }, - {0x04 ,KEY_4 }, - {0x05 ,KEY_5 }, - {0x06 ,KEY_6 }, - {0x07 ,KEY_7 }, - {0x08 ,KEY_8 }, - {0x09 ,KEY_9 }, - - {0x0a ,KEY_AGAIN },/* Recall */ - {0x0b ,KEY_CHANNELUP }, - {0x0c ,KEY_VOLUMEUP }, - {0x0d ,KEY_MODE },/* Stereo */ - {0x0e ,KEY_STOP }, - {0x0f ,KEY_PREVIOUSSONG }, - {0x10 ,KEY_ZOOM }, - {0x11 ,KEY_TUNER },/* Source */ - {0x12 ,KEY_POWER }, - {0x13 ,KEY_MUTE }, - {0x15 ,KEY_CHANNELDOWN }, - {0x18 ,KEY_VOLUMEDOWN }, - {0x19 ,KEY_CAMERA },/* Snapshot */ - {0x1a ,KEY_NEXTSONG }, - {0x1b ,KEY_TIME },/* Time Shift */ - {0x1c ,KEY_RADIO },/* FM Radio */ - {0x1d ,KEY_RECORD }, - {0x1e ,KEY_PAUSE }, -/* additional codes for Kozumi's remote */ - {0x14 ,KEY_INFO },/* OSD */ - {0x16 ,KEY_OK },/* OK */ - {0x17 ,KEY_DIGITS },/* Plus */ - {0x1f ,KEY_PLAY },/* Play */ -}; -DEFINE_LEGACY_IR_KEYTABLE (pctv_sedna); - -/* Mark Phalan <[email protected]> */ -static struct ir_scancode pv951[] = { - {0x00 ,KEY_0 }, - {0x01 ,KEY_1 }, - {0x02 ,KEY_2 }, - {0x03 ,KEY_3 }, - {0x04 ,KEY_4 }, - {0x05 ,KEY_5 }, - {0x06 ,KEY_6 }, - {0x07 ,KEY_7 }, - {0x08 ,KEY_8 }, - {0x09 ,KEY_9 }, - - {0x12 ,KEY_POWER }, - {0x10 ,KEY_MUTE }, - {0x1f ,KEY_VOLUMEDOWN }, - {0x1b ,KEY_VOLUMEUP }, - {0x1a ,KEY_CHANNELUP }, - {0x1e ,KEY_CHANNELDOWN }, - {0x0e ,KEY_PAGEUP }, - {0x1d ,KEY_PAGEDOWN }, - {0x13 ,KEY_SOUND }, - - {0x18 ,KEY_KPPLUSMINUS },/* CH +/- */ - {0x16 ,KEY_SUBTITLE },/* CC */ - {0x0d ,KEY_TEXT },/* TTX */ - {0x0b ,KEY_TV },/* AIR/CBL */ - {0x11 ,KEY_PC },/* PC/TV */ - {0x17 ,KEY_OK },/* CH RTN */ - {0x19 ,KEY_MODE },/* FUNC */ - {0x0c ,KEY_SEARCH },/* AUTOSCAN */ - -/* Not sure what to do with these ones! */ - {0x0f ,KEY_SELECT },/* SOURCE */ - {0x0a ,KEY_KPPLUS },/* +100 */ - {0x14 ,KEY_EQUAL },/* SYNC */ - {0x1c ,KEY_MEDIA },/* PC/TV */ -}; -DEFINE_LEGACY_IR_KEYTABLE (pv951); - -/* generic RC5 keytable */ -/* see http://users.pandora.be/nenya/electronics/rc5/codes00.htm */ -/* used by old (black) Hauppauge remotes */ -static struct ir_scancode rc5_tv[] = { -/* Keys 0 to 9 */ - {0x00 ,KEY_0 }, - {0x01 ,KEY_1 }, - {0x02 ,KEY_2 }, - {0x03 ,KEY_3 }, - {0x04 ,KEY_4 }, - {0x05 ,KEY_5 }, - {0x06 ,KEY_6 }, - {0x07 ,KEY_7 }, - {0x08 ,KEY_8 }, - {0x09 ,KEY_9 }, - - {0x0b ,KEY_CHANNEL },/* channel / program (japan: 11) */ - {0x0c ,KEY_POWER },/* standby */ - {0x0d ,KEY_MUTE },/* mute / demute */ - {0x0f ,KEY_TV },/* display */ - {0x10 ,KEY_VOLUMEUP }, - {0x11 ,KEY_VOLUMEDOWN }, - {0x12 ,KEY_BRIGHTNESSUP }, - {0x13 ,KEY_BRIGHTNESSDOWN }, - {0x1e ,KEY_SEARCH },/* search + */ - {0x20 ,KEY_CHANNELUP },/* channel / program + */ - {0x21 ,KEY_CHANNELDOWN },/* channel / program - */ - {0x22 ,KEY_CHANNEL },/* alt / channel */ - {0x23 ,KEY_LANGUAGE },/* 1st / 2nd language */ - {0x26 ,KEY_SLEEP },/* sleeptimer */ - {0x2e ,KEY_MENU },/* 2nd controls (USA: menu) */ - {0x30 ,KEY_PAUSE }, - {0x32 ,KEY_REWIND }, - {0x33 ,KEY_GOTO }, - {0x35 ,KEY_PLAY }, - {0x36 ,KEY_STOP }, - {0x37 ,KEY_RECORD },/* recording */ - {0x3c ,KEY_TEXT },/* teletext submode (Japan: 12) */ - {0x3d ,KEY_SUSPEND },/* system standby */ - -}; -DEFINE_LEGACY_IR_KEYTABLE (rc5_tv); - -/* Table for Leadtek Winfast Remote Controls - used by both bttv and cx88 */ -static struct ir_scancode winfast[] = { -/* Keys 0 to 9 */ - {0x12 ,KEY_0 }, - {0x05 ,KEY_1 }, - {0x06 ,KEY_2 }, - {0x07 ,KEY_3 }, - {0x09 ,KEY_4 }, - {0x0a ,KEY_5 }, - {0x0b ,KEY_6 }, - {0x0d ,KEY_7 }, - {0x0e ,KEY_8 }, - {0x0f ,KEY_9 }, - - {0x00 ,KEY_POWER }, - {0x1b ,KEY_AUDIO },/* Audio Source */ - {0x02 ,KEY_TUNER },/* TV/FM, not on Y0400052 */ - {0x1e ,KEY_VIDEO },/* Video Source */ - {0x16 ,KEY_INFO },/* Display information */ - {0x04 ,KEY_VOLUMEUP }, - {0x08 ,KEY_VOLUMEDOWN }, - {0x0c ,KEY_CHANNELUP }, - {0x10 ,KEY_CHANNELDOWN }, - {0x03 ,KEY_ZOOM },/* fullscreen */ - {0x1f ,KEY_TEXT },/* closed caption/teletext */ - {0x20 ,KEY_SLEEP }, - {0x29 ,KEY_CLEAR },/* boss key */ - {0x14 ,KEY_MUTE }, - {0x2b ,KEY_RED }, - {0x2c ,KEY_GREEN }, - {0x2d ,KEY_YELLOW }, - {0x2e ,KEY_BLUE }, - {0x18 ,KEY_KPPLUS },/* fine tune + , not on Y040052 */ - {0x19 ,KEY_KPMINUS },/* fine tune - , not on Y040052 */ - {0x2a ,KEY_MEDIA },/* PIP (Picture in picture */ - {0x21 ,KEY_DOT }, - {0x13 ,KEY_ENTER }, - {0x11 ,KEY_LAST },/* Recall (last channel */ - {0x22 ,KEY_PREVIOUS }, - {0x23 ,KEY_PLAYPAUSE }, - {0x24 ,KEY_NEXT }, - {0x25 ,KEY_TIME },/* Time Shifting */ - {0x26 ,KEY_STOP }, - {0x27 ,KEY_RECORD }, - {0x28 ,KEY_SAVE },/* Screenshot */ - {0x2f ,KEY_MENU }, - {0x30 ,KEY_CANCEL }, - {0x31 ,KEY_CHANNEL },/* Channel Surf */ - {0x32 ,KEY_SUBTITLE }, - {0x33 ,KEY_LANGUAGE }, - {0x34 ,KEY_REWIND }, - {0x35 ,KEY_FASTFORWARD }, - {0x36 ,KEY_TV }, - {0x37 ,KEY_RADIO },/* FM */ - {0x38 ,KEY_DVD }, - - {0x1a ,KEY_MODE },/* change to MCE mode on Y04G0051 */ - {0x3e ,KEY_F21 },/* MCE +VOL, on Y04G0033 */ - {0x3a ,KEY_F22 },/* MCE -VOL, on Y04G0033 */ - {0x3b ,KEY_F23 },/* MCE +CH, on Y04G0033 */ - {0x3f ,KEY_F24 }/* MCE -CH, on Y04G0033 */ -}; -DEFINE_LEGACY_IR_KEYTABLE (winfast); - -static struct ir_scancode pinnacle_color[] = { - {0x59 ,KEY_MUTE }, - {0x4a ,KEY_POWER }, - - {0x18 ,KEY_TEXT }, - {0x26 ,KEY_TV }, - {0x3d ,KEY_PRINT }, - - {0x48 ,KEY_RED }, - {0x04 ,KEY_GREEN }, - {0x11 ,KEY_YELLOW }, - {0x00 ,KEY_BLUE }, - - {0x2d ,KEY_VOLUMEUP }, - {0x1e ,KEY_VOLUMEDOWN }, - - {0x49 ,KEY_MENU }, - - {0x16 ,KEY_CHANNELUP }, - {0x17 ,KEY_CHANNELDOWN }, - - {0x20 ,KEY_UP }, - {0x21 ,KEY_DOWN }, - {0x22 ,KEY_LEFT }, - {0x23 ,KEY_RIGHT }, - {0x0d ,KEY_SELECT }, - - {0x08 ,KEY_BACK }, - {0x07 ,KEY_REFRESH }, - - {0x2f ,KEY_ZOOM }, - {0x29 ,KEY_RECORD }, - - {0x4b ,KEY_PAUSE }, - {0x4d ,KEY_REWIND }, - {0x2e ,KEY_PLAY }, - {0x4e ,KEY_FORWARD }, - {0x53 ,KEY_PREVIOUS }, - {0x4c ,KEY_STOP }, - {0x54 ,KEY_NEXT }, - - {0x69 ,KEY_0 }, - {0x6a ,KEY_1 }, - {0x6b ,KEY_2 }, - {0x6c ,KEY_3 }, - {0x6d ,KEY_4 }, - {0x6e ,KEY_5 }, - {0x6f ,KEY_6 }, - {0x70 ,KEY_7 }, - {0x71 ,KEY_8 }, - {0x72 ,KEY_9 }, - - {0x74 ,KEY_CHANNEL }, - {0x0a ,KEY_BACKSPACE }, -}; -DEFINE_LEGACY_IR_KEYTABLE (pinnacle_color); - -/* Hauppauge: the newer, gray remotes (seems there are multiple -* slightly different versions), shipped with cx88+ivtv cards. -* almost rc5 coding, but some non-standard keys */ -static struct ir_scancode hauppauge_new[] = { -/* Keys 0 to 9 */ - {0x00 ,KEY_0 }, - {0x01 ,KEY_1 }, - {0x02 ,KEY_2 }, - {0x03 ,KEY_3 }, - {0x04 ,KEY_4 }, - {0x05 ,KEY_5 }, - {0x06 ,KEY_6 }, - {0x07 ,KEY_7 }, - {0x08 ,KEY_8 }, - {0x09 ,KEY_9 }, - - {0x0a ,KEY_TEXT },/* keypad asterisk as well */ - {0x0b ,KEY_RED },/* red button */ - {0x0c ,KEY_RADIO }, - {0x0d ,KEY_MENU }, - {0x0e ,KEY_SUBTITLE },/* also the # key */ - {0x0f ,KEY_MUTE }, - {0x10 ,KEY_VOLUMEUP }, - {0x11 ,KEY_VOLUMEDOWN }, - {0x12 ,KEY_PREVIOUS },/* previous channel */ - {0x14 ,KEY_UP }, - {0x15 ,KEY_DOWN }, - {0x16 ,KEY_LEFT }, - {0x17 ,KEY_RIGHT }, - {0x18 ,KEY_VIDEO },/* Videos */ - {0x19 ,KEY_AUDIO },/* Music */ -/* 0x1a: Pictures - presume this means -"Multimedia Home Platform" - -no "PICTURES" key in input.h -*/ - {0x1a ,KEY_MHP }, - - {0x1b ,KEY_EPG },/* Guide */ - {0x1c ,KEY_TV }, - {0x1e ,KEY_NEXTSONG },/* skip >| */ - {0x1f ,KEY_EXIT },/* back/exit */ - {0x20 ,KEY_CHANNELUP },/* channel / program + */ - {0x21 ,KEY_CHANNELDOWN },/* channel / program - */ - {0x22 ,KEY_CHANNEL },/* source (old black remote) */ - {0x24 ,KEY_PREVIOUSSONG },/* replay |< */ - {0x25 ,KEY_ENTER },/* OK */ - {0x26 ,KEY_SLEEP },/* minimize (old black remote) */ - {0x29 ,KEY_BLUE },/* blue key */ - {0x2e ,KEY_GREEN },/* green button */ - {0x30 ,KEY_PAUSE },/* pause */ - {0x32 ,KEY_REWIND },/* backward << */ - {0x34 ,KEY_FASTFORWARD },/* forward >> */ - {0x35 ,KEY_PLAY }, - {0x36 ,KEY_STOP }, - {0x37 ,KEY_RECORD },/* recording */ - {0x38 ,KEY_YELLOW },/* yellow key */ - {0x3b ,KEY_SELECT },/* top right button */ - {0x3c ,KEY_ZOOM },/* full */ - {0x3d ,KEY_POWER },/* system power (green button) */ -}; -DEFINE_LEGACY_IR_KEYTABLE (hauppauge_new); - -static struct ir_scancode npgtech[] = { - {0x1d ,KEY_SWITCHVIDEOMODE },/* switch inputs */ - {0x2a ,KEY_FRONT }, - - {0x3e ,KEY_1 }, - {0x02 ,KEY_2 }, - {0x06 ,KEY_3 }, - {0x0a ,KEY_4 }, - {0x0e ,KEY_5 }, - {0x12 ,KEY_6 }, - {0x16 ,KEY_7 }, - {0x1a ,KEY_8 }, - {0x1e ,KEY_9 }, - {0x3a ,KEY_0 }, - {0x22 ,KEY_NUMLOCK },/* -/-- */ - {0x20 ,KEY_REFRESH }, - - {0x03 ,KEY_BRIGHTNESSDOWN }, - {0x28 ,KEY_AUDIO }, - {0x3c ,KEY_CHANNELUP }, - {0x3f ,KEY_VOLUMEDOWN }, - {0x2e ,KEY_MUTE }, - {0x3b ,KEY_VOLUMEUP }, - {0x00 ,KEY_CHANNELDOWN }, - {0x07 ,KEY_BRIGHTNESSUP }, - {0x2c ,KEY_TEXT }, - - {0x37 ,KEY_RECORD }, - {0x17 ,KEY_PLAY }, - {0x13 ,KEY_PAUSE }, - {0x26 ,KEY_STOP }, - {0x18 ,KEY_FASTFORWARD }, - {0x14 ,KEY_REWIND }, - {0x33 ,KEY_ZOOM }, - {0x32 ,KEY_KEYBOARD }, - {0x30 ,KEY_GOTO },/* Pointing arrow */ - {0x36 ,KEY_MACRO },/* Maximize/Minimize (yellow) */ - {0x0b ,KEY_RADIO }, - {0x10 ,KEY_POWER }, - -}; -DEFINE_LEGACY_IR_KEYTABLE (npgtech); - -/* Norwood Micro (non-Pro) TV Tuner -By Peter Naulls <[email protected]> -Key comments are the functions given in the manual */ -static struct ir_scancode norwood[] = { -/* Keys 0 to 9 */ - {0x20 ,KEY_0 }, - {0x21 ,KEY_1 }, - {0x22 ,KEY_2 }, - {0x23 ,KEY_3 }, - {0x24 ,KEY_4 }, - {0x25 ,KEY_5 }, - {0x26 ,KEY_6 }, - {0x27 ,KEY_7 }, - {0x28 ,KEY_8 }, - {0x29 ,KEY_9 }, - - {0x78 ,KEY_TUNER },/* Video Source */ - {0x2c ,KEY_EXIT },/* Open/Close software */ - {0x2a ,KEY_SELECT },/* 2 Digit Select */ - {0x69 ,KEY_AGAIN },/* Recall */ - - {0x32 ,KEY_BRIGHTNESSUP },/* Brightness increase */ - {0x33 ,KEY_BRIGHTNESSDOWN },/* Brightness decrease */ - {0x6b ,KEY_KPPLUS },/* (not named >>>>>) */ - {0x6c ,KEY_KPMINUS },/* (not named <<<<<) */ - - {0x2d ,KEY_MUTE },/* Mute */ - {0x30 ,KEY_VOLUMEUP },/* Volume up */ - {0x31 ,KEY_VOLUMEDOWN },/* Volume down */ - {0x60 ,KEY_CHANNELUP },/* Channel up */ - {0x61 ,KEY_CHANNELDOWN },/* Channel down */ - - {0x3f ,KEY_RECORD },/* Record */ - {0x37 ,KEY_PLAY },/* Play */ - {0x36 ,KEY_PAUSE },/* Pause */ - {0x2b ,KEY_STOP },/* Stop */ - {0x67 ,KEY_FASTFORWARD },/* Foward */ - {0x66 ,KEY_REWIND },/* Rewind */ - {0x3e ,KEY_SEARCH },/* Auto Scan */ - {0x2e ,KEY_CAMERA },/* Capture Video */ - {0x6d ,KEY_MENU },/* Show/Hide Control */ - {0x2f ,KEY_ZOOM },/* Full Screen */ - {0x34 ,KEY_RADIO },/* FM */ - {0x65 ,KEY_POWER },/* Computer power */ -}; -DEFINE_LEGACY_IR_KEYTABLE (norwood); - -/* From reading the following remotes: -* Zenith Universal 7 / TV Mode 807 / VCR Mode 837 -* Hauppauge (from NOVA-CI-s box product) -* This is a "middle of the road" approach, differences are noted -*/ -static struct ir_scancode budget_ci_old[] = { - {0x00 ,KEY_0 }, - {0x01 ,KEY_1 }, - {0x02 ,KEY_2 }, - {0x03 ,KEY_3 }, - {0x04 ,KEY_4 }, - {0x05 ,KEY_5 }, - {0x06 ,KEY_6 }, - {0x07 ,KEY_7 }, - {0x08 ,KEY_8 }, - {0x09 ,KEY_9 }, - {0x0a ,KEY_ENTER }, - {0x0b ,KEY_RED }, - {0x0c ,KEY_POWER },/* RADIO on Hauppauge */ - {0x0d ,KEY_MUTE }, - {0x0f ,KEY_A },/* TV on Hauppauge */ - {0x10 ,KEY_VOLUMEUP }, - {0x11 ,KEY_VOLUMEDOWN }, - {0x14 ,KEY_B }, - {0x1c ,KEY_UP }, - {0x1d ,KEY_DOWN }, - {0x1e ,KEY_OPTION },/* RESERVED on Hauppauge */ - {0x1f ,KEY_BREAK }, - {0x20 ,KEY_CHANNELUP }, - {0x21 ,KEY_CHANNELDOWN }, - {0x22 ,KEY_PREVIOUS },/* Prev Ch on Zenith, SOURCE on Hauppauge */ - {0x24 ,KEY_RESTART }, - {0x25 ,KEY_OK }, - {0x26 ,KEY_CYCLEWINDOWS },/* MINIMIZE on Hauppauge */ - {0x28 ,KEY_ENTER },/* VCR mode on Zenith */ - {0x29 ,KEY_PAUSE }, - {0x2b ,KEY_RIGHT }, - {0x2c ,KEY_LEFT }, - {0x2e ,KEY_MENU },/* FULL SCREEN on Hauppauge */ - {0x30 ,KEY_SLOW }, - {0x31 ,KEY_PREVIOUS },/* VCR mode on Zenith */ - {0x32 ,KEY_REWIND }, - {0x34 ,KEY_FASTFORWARD }, - {0x35 ,KEY_PLAY }, - {0x36 ,KEY_STOP }, - {0x37 ,KEY_RECORD }, - {0x38 ,KEY_TUNER },/* TV/VCR on Zenith */ - {0x3a ,KEY_C }, - {0x3c ,KEY_EXIT }, - {0x3d ,KEY_POWER2 }, - {0x3e ,KEY_TUNER }, -}; -DEFINE_LEGACY_IR_KEYTABLE (budget_ci_old); - -/* -* Marc Fargas <[email protected]> -* this is the remote control that comes with the asus p7131 -* which has a label saying is "Model PC-39" -*/ -static struct ir_scancode asus_pc39[] = { -/* Keys 0 to 9 */ - {0x15 ,KEY_0 }, - {0x29 ,KEY_1 }, - {0x2d ,KEY_2 }, - {0x2b ,KEY_3 }, - {0x09 ,KEY_4 }, - {0x0d ,KEY_5 }, - {0x0b ,KEY_6 }, - {0x31 ,KEY_7 }, - {0x35 ,KEY_8 }, - {0x33 ,KEY_9 }, - - {0x3e ,KEY_RADIO },/* radio */ - {0x03 ,KEY_MENU },/* dvd/menu */ - {0x2a ,KEY_VOLUMEUP }, - {0x19 ,KEY_VOLUMEDOWN }, - {0x37 ,KEY_UP }, - {0x3b ,KEY_DOWN }, - {0x27 ,KEY_LEFT }, - {0x2f ,KEY_RIGHT }, - {0x25 ,KEY_VIDEO },/* video */ - {0x39 ,KEY_AUDIO },/* music */ - - {0x21 ,KEY_TV },/* tv */ - {0x1d ,KEY_EXIT },/* back */ - {0x0a ,KEY_CHANNELUP },/* channel / program + */ - {0x1b ,KEY_CHANNELDOWN },/* channel / program - */ - {0x1a ,KEY_ENTER },/* enter */ - - {0x06 ,KEY_PAUSE },/* play/pause */ - {0x1e ,KEY_PREVIOUS },/* rew */ - {0x26 ,KEY_NEXT },/* forward */ - {0x0e ,KEY_REWIND },/* backward << */ - {0x3a ,KEY_FASTFORWARD },/* forward >> */ - {0x36 ,KEY_STOP }, - {0x2e ,KEY_RECORD },/* recording */ - {0x16 ,KEY_POWER },/* the button that reads "close" */ - - {0x11 ,KEY_ZOOM },/* full screen */ - {0x13 ,KEY_MACRO },/* recall */ - {0x23 ,KEY_HOME },/* home */ - {0x05 ,KEY_PVR },/* picture */ - {0x3d ,KEY_MUTE },/* mute */ - {0x01 ,KEY_DVD },/* dvd */ -}; -DEFINE_LEGACY_IR_KEYTABLE (asus_pc39); - -/* Encore ENLTV-FM - black plastic, white front cover with white glowing buttons -Juan Pablo Sormani <[email protected]> */ -static struct ir_scancode encore_enltv[] = { - -/* Power button does nothing, neither in Windows app, -although it sends data (used for BIOS wakeup?) */ - {0x0d ,KEY_MUTE }, - - {0x1e ,KEY_TV }, - {0x00 ,KEY_VIDEO }, - {0x01 ,KEY_AUDIO },/* music */ - {0x02 ,KEY_MHP },/* picture */ - - {0x1f ,KEY_1 }, - {0x03 ,KEY_2 }, - {0x04 ,KEY_3 }, - {0x05 ,KEY_4 }, - {0x1c ,KEY_5 }, - {0x06 ,KEY_6 }, - {0x07 ,KEY_7 }, - {0x08 ,KEY_8 }, - {0x1d ,KEY_9 }, - {0x0a ,KEY_0 }, - - {0x09 ,KEY_LIST },/* -/-- */ - {0x0b ,KEY_LAST },/* recall */ - - {0x14 ,KEY_HOME },/* win start menu */ - {0x15 ,KEY_EXIT },/* exit */ - {0x16 ,KEY_CHANNELUP },/* UP */ - {0x12 ,KEY_CHANNELDOWN },/* DOWN */ - {0x0c ,KEY_VOLUMEUP },/* RIGHT */ - {0x17 ,KEY_VOLUMEDOWN },/* LEFT */ - - {0x18 ,KEY_ENTER },/* OK */ - - {0x0e ,KEY_ESC }, - {0x13 ,KEY_CYCLEWINDOWS },/* desktop */ - {0x11 ,KEY_TAB }, - {0x19 ,KEY_SWITCHVIDEOMODE },/* switch */ - - {0x1a ,KEY_MENU }, - {0x1b ,KEY_ZOOM },/* fullscreen */ - {0x44 ,KEY_TIME },/* time shift */ - {0x40 ,KEY_MODE },/* source */ - - {0x5a ,KEY_RECORD }, - {0x42 ,KEY_PLAY },/* play/pause */ - {0x45 ,KEY_STOP }, - {0x43 ,KEY_CAMERA },/* camera icon */ - - {0x48 ,KEY_REWIND }, - {0x4a ,KEY_FASTFORWARD }, - {0x49 ,KEY_PREVIOUS }, - {0x4b ,KEY_NEXT }, - - {0x4c ,KEY_FAVORITES },/* tv wall */ - {0x4d ,KEY_SOUND },/* DVD sound */ - {0x4e ,KEY_LANGUAGE },/* DVD lang */ - {0x4f ,KEY_TEXT },/* DVD text */ - - {0x50 ,KEY_SLEEP },/* shutdown */ - {0x51 ,KEY_MODE },/* stereo > main */ - {0x52 ,KEY_SELECT },/* stereo > sap */ - {0x53 ,KEY_PROG1 },/* teletext */ - - - {0x59 ,KEY_RED },/* AP1 */ - {0x41 ,KEY_GREEN },/* AP2 */ - {0x47 ,KEY_YELLOW },/* AP3 */ - {0x57 ,KEY_BLUE },/* AP4 */ -}; -DEFINE_LEGACY_IR_KEYTABLE (encore_enltv); - -/* Encore ENLTV2-FM - silver plastic - "Wand Media" written at the botton -Mauro Carvalho Chehab <[email protected]> */ -static struct ir_scancode encore_enltv2[] = { - {0x4c ,KEY_POWER2 }, - {0x4a ,KEY_TUNER }, - {0x40 ,KEY_1 }, - {0x60 ,KEY_2 }, - {0x50 ,KEY_3 }, - {0x70 ,KEY_4 }, - {0x48 ,KEY_5 }, - {0x68 ,KEY_6 }, - {0x58 ,KEY_7 }, - {0x78 ,KEY_8 }, - {0x44 ,KEY_9 }, - {0x54 ,KEY_0 }, - - {0x64 ,KEY_LAST },/* +100 */ - {0x4e ,KEY_AGAIN },/* Recall */ - - {0x6c ,KEY_SWITCHVIDEOMODE },/* Video Source */ - {0x5e ,KEY_MENU }, - {0x56 ,KEY_SCREEN }, - {0x7a ,KEY_SETUP }, - - {0x46 ,KEY_MUTE }, - {0x5c ,KEY_MODE },/* Stereo */ - {0x74 ,KEY_INFO }, - {0x7c ,KEY_CLEAR }, - - {0x55 ,KEY_UP }, - {0x49 ,KEY_DOWN }, - {0x7e ,KEY_LEFT }, - {0x59 ,KEY_RIGHT }, - {0x6a ,KEY_ENTER }, - - {0x42 ,KEY_VOLUMEUP }, - {0x62 ,KEY_VOLUMEDOWN }, - {0x52 ,KEY_CHANNELUP }, - {0x72 ,KEY_CHANNELDOWN }, - - {0x41 ,KEY_RECORD }, - {0x51 ,KEY_CAMERA },/* Snapshot */ - {0x75 ,KEY_TIME },/* Timeshift */ - {0x71 ,KEY_TV2 },/* PIP */ - - {0x45 ,KEY_REWIND }, - {0x6f ,KEY_PAUSE }, - {0x7d ,KEY_FORWARD }, - {0x79 ,KEY_STOP }, -}; -DEFINE_LEGACY_IR_KEYTABLE (encore_enltv2); - -/* for the Technotrend 1500 bundled remotes (grey and black): */ -static struct ir_scancode tt_1500[] = { - {0x01 ,KEY_POWER }, - {0x02 ,KEY_SHUFFLE },/* ? double-arrow key */ - {0x03 ,KEY_1 }, - {0x04 ,KEY_2 }, - {0x05 ,KEY_3 }, - {0x06 ,KEY_4 }, - {0x07 ,KEY_5 }, - {0x08 ,KEY_6 }, - {0x09 ,KEY_7 }, - {0x0a ,KEY_8 }, - {0x0b ,KEY_9 }, - {0x0c ,KEY_0 }, - {0x0d ,KEY_UP }, - {0x0e ,KEY_LEFT }, - {0x0f ,KEY_OK }, - {0x10 ,KEY_RIGHT }, - {0x11 ,KEY_DOWN }, - {0x12 ,KEY_INFO }, - {0x13 ,KEY_EXIT }, - {0x14 ,KEY_RED }, - {0x15 ,KEY_GREEN }, - {0x16 ,KEY_YELLOW }, - {0x17 ,KEY_BLUE }, - {0x18 ,KEY_MUTE }, - {0x19 ,KEY_TEXT }, - {0x1a ,KEY_MODE },/* ? TV/Radio */ - {0x21 ,KEY_OPTION }, - {0x22 ,KEY_EPG }, - {0x23 ,KEY_CHANNELUP }, - {0x24 ,KEY_CHANNELDOWN }, - {0x25 ,KEY_VOLUMEUP }, - {0x26 ,KEY_VOLUMEDOWN }, - {0x27 ,KEY_SETUP }, - {0x3a ,KEY_RECORD },/* these keys are only in the black remote */ - {0x3b ,KEY_PLAY }, - {0x3c ,KEY_STOP }, - {0x3d ,KEY_REWIND }, - {0x3e ,KEY_PAUSE }, - {0x3f ,KEY_FORWARD }, -}; -DEFINE_LEGACY_IR_KEYTABLE (tt_1500); - -/* DViCO FUSION HDTV MCE remote */ -static struct ir_scancode fusionhdtv_mce[] = { - - {0x0b ,KEY_1 }, - {0x17 ,KEY_2 }, - {0x1b ,KEY_3 }, - {0x07 ,KEY_4 }, - {0x50 ,KEY_5 }, - {0x54 ,KEY_6 }, - {0x48 ,KEY_7 }, - {0x4c ,KEY_8 }, - {0x58 ,KEY_9 }, - {0x03 ,KEY_0 }, - - {0x5e ,KEY_OK }, - {0x51 ,KEY_UP }, - {0x53 ,KEY_DOWN }, - {0x5b ,KEY_LEFT }, - {0x5f ,KEY_RIGHT }, - - {0x02 ,KEY_TV },/* Labeled DTV on remote */ - {0x0e ,KEY_MP3 }, - {0x1a ,KEY_DVD }, - {0x1e ,KEY_FAVORITES },/* Labeled CPF on remote */ - {0x16 ,KEY_SETUP }, - {0x46 ,KEY_POWER2 },/* TV On/Off button on remote */ - {0x0a ,KEY_EPG },/* Labeled Guide on remote */ - - {0x49 ,KEY_BACK }, - {0x59 ,KEY_INFO },/* Labeled MORE on remote */ - {0x4d ,KEY_MENU },/* Labeled DVDMENU on remote */ - {0x55 ,KEY_CYCLEWINDOWS },/* Labeled ALT-TAB on remote */ - - {0x0f ,KEY_PREVIOUSSONG },/* Labeled |<< REPLAY on remote */ - {0x12 ,KEY_NEXTSONG },/* Labeled >>| SKIP on remote */ - {0x42 ,KEY_ENTER },/* Labeled START with a green -MS windows logo on remote */ - - {0x15 ,KEY_VOLUMEUP }, - {0x05 ,KEY_VOLUMEDOWN }, - {0x11 ,KEY_CHANNELUP }, - {0x09 ,KEY_CHANNELDOWN }, - - {0x52 ,KEY_CAMERA }, - {0x5a ,KEY_TUNER }, - {0x19 ,KEY_OPEN }, - - {0x13 ,KEY_MODE },/* 4:3 16:9 select */ - {0x1f ,KEY_ZOOM }, - - {0x43 ,KEY_REWIND }, - {0x47 ,KEY_PLAYPAUSE }, - {0x4f ,KEY_FASTFORWARD }, - {0x57 ,KEY_MUTE }, - {0x0d ,KEY_STOP }, - {0x01 ,KEY_RECORD }, - {0x4e ,KEY_POWER }, -}; -DEFINE_LEGACY_IR_KEYTABLE (fusionhdtv_mce); - -/* Pinnacle PCTV HD 800i mini remote */ -static struct ir_scancode pinnacle_pctv_hd[] = { - - {0x0f ,KEY_1 }, - {0x15 ,KEY_2 }, - {0x10 ,KEY_3 }, - {0x18 ,KEY_4 }, - {0x1b ,KEY_5 }, - {0x1e ,KEY_6 }, - {0x11 ,KEY_7 }, - {0x21 ,KEY_8 }, - {0x12 ,KEY_9 }, - {0x27 ,KEY_0 }, - - {0x24 ,KEY_ZOOM }, - {0x2a ,KEY_SUBTITLE }, - - {0x00 ,KEY_MUTE }, - {0x01 ,KEY_ENTER },/* Pinnacle Logo */ - {0x39 ,KEY_POWER }, - - {0x03 ,KEY_VOLUMEUP }, - {0x09 ,KEY_VOLUMEDOWN }, - {0x06 ,KEY_CHANNELUP }, - {0x0c ,KEY_CHANNELDOWN }, - - {0x2d ,KEY_REWIND }, - {0x30 ,KEY_PLAYPAUSE }, - {0x33 ,KEY_FASTFORWARD }, - {0x3c ,KEY_STOP }, - {0x36 ,KEY_RECORD }, - {0x3f ,KEY_EPG },/* Labeled "?" */ -}; -DEFINE_LEGACY_IR_KEYTABLE (pinnacle_pctv_hd); - -/* -* Igor Kuznetsov <[email protected]> -* Andrey J. Melnikov <[email protected]> -* -* Keytable is used by BeholdTV 60x series, M6 series at -* least, and probably other cards too. -* The "ascii-art picture" below (in comments, first row -* is the keycode in hex, and subsequent row(s) shows -* the button labels (several variants when appropriate) -* helps to descide which keycodes to assign to the buttons. -*/ -static struct ir_scancode behold[] = { - -/* 0x1c 0x12 * -* TV/FM POWER * -* */ - {0x1c ,KEY_TUNER },/* XXX KEY_TV / KEY_RADIO */ - {0x12 ,KEY_POWER }, - -/* 0x01 0x02 0x03 * -* 1 2 3 * -* * -* 0x04 0x05 0x06 * -* 4 5 6 * -* * -* 0x07 0x08 0x09 * -* 7 8 9 * -* */ - {0x01 ,KEY_1 }, - {0x02 ,KEY_2 }, - {0x03 ,KEY_3 }, - {0x04 ,KEY_4 }, - {0x05 ,KEY_5 }, - {0x06 ,KEY_6 }, - {0x07 ,KEY_7 }, - {0x08 ,KEY_8 }, - {0x09 ,KEY_9 }, - -/* 0x0a 0x00 0x17 * -* RECALL 0 MODE * -* */ - {0x0a ,KEY_AGAIN }, - {0x00 ,KEY_0 }, - {0x17 ,KEY_MODE }, - -/* 0x14 0x10 * -* ASPECT FULLSCREEN * -* */ - {0x14 ,KEY_SCREEN }, - {0x10 ,KEY_ZOOM }, - -/* 0x0b * -* Up * -* * -* 0x18 0x16 0x0c * -* Left Ok Right * -* * -* 0x015 * -* Down * -* */ - {0x0b ,KEY_CHANNELUP }, - {0x18 ,KEY_VOLUMEDOWN }, - {0x16 ,KEY_OK },/* XXX KEY_ENTER */ - {0x0c ,KEY_VOLUMEUP }, - {0x15 ,KEY_CHANNELDOWN }, - -/* 0x11 0x0d * -* MUTE INFO * -* */ - {0x11 ,KEY_MUTE }, - {0x0d ,KEY_INFO }, - -/* 0x0f 0x1b 0x1a * -* RECORD PLAY/PAUSE STOP * -* * -* 0x0e 0x1f 0x1e * -*TELETEXT AUDIO SOURCE * -* RED YELLOW * -* */ - {0x0f ,KEY_RECORD }, - {0x1b ,KEY_PLAYPAUSE }, - {0x1a ,KEY_STOP }, - {0x0e ,KEY_TEXT }, - {0x1f ,KEY_RED },/*XXX KEY_AUDIO */ - {0x1e ,KEY_YELLOW },/*XXX KEY_SOURCE */ - -/* 0x1d 0x13 0x19 * -* SLEEP PREVIEW DVB * -* GREEN BLUE * -* */ - {0x1d ,KEY_SLEEP }, - {0x13 ,KEY_GREEN }, - {0x19 ,KEY_BLUE },/* XXX KEY_SAT */ - -/* 0x58 0x5c * -* FREEZE SNAPSHOT * -* */ - {0x58 ,KEY_SLOW }, - {0x5c ,KEY_CAMERA }, - -}; -DEFINE_LEGACY_IR_KEYTABLE (behold); - -/* Beholder Intl. Ltd. 2008 -* Dmitry Belimov [email protected] -* Keytable is used by BeholdTV Columbus -* The "ascii-art picture" below (in comments, first row -* is the keycode in hex, and subsequent row(s) shows -* the button labels (several variants when appropriate) -* helps to descide which keycodes to assign to the buttons. -*/ -static struct ir_scancode behold_columbus[] = { - -/* 0x13 0x11 0x1C 0x12 * -* Mute Source TV/FM Power * -* */ - - {0x13 ,KEY_MUTE }, - {0x11 ,KEY_PROPS }, - {0x1C ,KEY_TUNER },/* KEY_TV/KEY_RADIO */ - {0x12 ,KEY_POWER }, - -/* 0x01 0x02 0x03 0x0D * -* 1 2 3 Stereo * -* * -* 0x04 0x05 0x06 0x19 * -* 4 5 6 Snapshot * -* * -* 0x07 0x08 0x09 0x10 * -* 7 8 9 Zoom * -* */ - {0x01 ,KEY_1 }, - {0x02 ,KEY_2 }, - {0x03 ,KEY_3 }, - {0x0D ,KEY_SETUP },/* Setup key */ - {0x04 ,KEY_4 }, - {0x05 ,KEY_5 }, - {0x06 ,KEY_6 }, - {0x19 ,KEY_CAMERA },/* Snapshot key */ - {0x07 ,KEY_7 }, - {0x08 ,KEY_8 }, - {0x09 ,KEY_9 }, - {0x10 ,KEY_ZOOM }, - -/* 0x0A 0x00 0x0B 0x0C * -* RECALL 0 ChannelUp VolumeUp * -* */ - {0x0A ,KEY_AGAIN }, - {0x00 ,KEY_0 }, - {0x0B ,KEY_CHANNELUP }, - {0x0C ,KEY_VOLUMEUP }, - -/* 0x1B 0x1D 0x15 0x18 * -* Timeshift Record ChannelDown VolumeDown * -* */ - - {0x1B ,KEY_TIME }, - {0x1D ,KEY_RECORD }, - {0x15 ,KEY_CHANNELDOWN }, - {0x18 ,KEY_VOLUMEDOWN }, - -/* 0x0E 0x1E 0x0F 0x1A * -* Stop Pause Previouse Next * -* */ - - {0x0E ,KEY_STOP }, - {0x1E ,KEY_PAUSE }, - {0x0F ,KEY_PREVIOUS }, - {0x1A ,KEY_NEXT }, - -}; -DEFINE_LEGACY_IR_KEYTABLE (behold_columbus); - -/* -* Remote control for the Genius TVGO A11MCE -* Adrian Pardini <[email protected]> -*/ -static struct ir_scancode genius_tvgo_a11mce[] = { -/* Keys 0 to 9 */ - {0x48 ,KEY_0 }, - {0x09 ,KEY_1 }, - {0x1d ,KEY_2 }, - {0x1f ,KEY_3 }, - {0x19 ,KEY_4 }, - {0x1b ,KEY_5 }, - {0x11 ,KEY_6 }, - {0x17 ,KEY_7 }, - {0x12 ,KEY_8 }, - {0x16 ,KEY_9 }, - - {0x54 ,KEY_RECORD },/* recording */ - {0x06 ,KEY_MUTE },/* mute */ - {0x10 ,KEY_POWER }, - {0x40 ,KEY_LAST },/* recall */ - {0x4c ,KEY_CHANNELUP },/* channel / program + */ - {0x00 ,KEY_CHANNELDOWN },/* channel / program - */ - {0x0d ,KEY_VOLUMEUP }, - {0x15 ,KEY_VOLUMEDOWN }, - {0x4d ,KEY_OK },/* also labeled as Pause */ - {0x1c ,KEY_ZOOM },/* full screen and Stop*/ - {0x02 ,KEY_MODE },/* AV Source or Rewind*/ - {0x04 ,KEY_LIST },/* -/-- */ -/* small arrows above numbers */ - {0x1a ,KEY_NEXT },/* also Fast Forward */ - {0x0e ,KEY_PREVIOUS },/* also Rewind */ -/* these are in a rather non standard layout and have -an alternate name written */ - {0x1e ,KEY_UP },/* Video Setting */ - {0x0a ,KEY_DOWN },/* Video Default */ - {0x05 ,KEY_CAMERA },/* Snapshot */ - {0x0c ,KEY_RIGHT },/* Hide Panel */ -/* Four buttons without label */ - {0x49 ,KEY_RED }, - {0x0b ,KEY_GREEN }, - {0x13 ,KEY_YELLOW }, - {0x50 ,KEY_BLUE }, -}; -DEFINE_LEGACY_IR_KEYTABLE (genius_tvgo_a11mce); - -/* -* Remote control for Powercolor Real Angel 330 -* Daniel Fraga <[email protected]> -*/ -static struct ir_scancode powercolor_real_angel[] = { - {0x38 ,KEY_SWITCHVIDEOMODE },/* switch inputs */ - {0x0c ,KEY_MEDIA },/* Turn ON/OFF App */ - {0x00 ,KEY_0 }, - {0x01 ,KEY_1 }, - {0x02 ,KEY_2 }, - {0x03 ,KEY_3 }, - {0x04 ,KEY_4 }, - {0x05 ,KEY_5 }, - {0x06 ,KEY_6 }, - {0x07 ,KEY_7 }, - {0x08 ,KEY_8 }, - {0x09 ,KEY_9 }, - {0x0a ,KEY_DIGITS },/* single, double, tripple digit */ - {0x29 ,KEY_PREVIOUS },/* previous channel */ - {0x12 ,KEY_BRIGHTNESSUP }, - {0x13 ,KEY_BRIGHTNESSDOWN }, - {0x2b ,KEY_MODE },/* stereo/mono */ - {0x2c ,KEY_TEXT },/* teletext */ - {0x20 ,KEY_CHANNELUP },/* channel up */ - {0x21 ,KEY_CHANNELDOWN },/* channel down */ - {0x10 ,KEY_VOLUMEUP },/* volume up */ - {0x11 ,KEY_VOLUMEDOWN },/* volume down */ - {0x0d ,KEY_MUTE }, - {0x1f ,KEY_RECORD }, - {0x17 ,KEY_PLAY }, - {0x16 ,KEY_PAUSE }, - {0x0b ,KEY_STOP }, - {0x27 ,KEY_FASTFORWARD }, - {0x26 ,KEY_REWIND }, - {0x1e ,KEY_SEARCH },/* autoscan */ - {0x0e ,KEY_CAMERA },/* snapshot */ - {0x2d ,KEY_SETUP }, - {0x0f ,KEY_SCREEN },/* full screen */ - {0x14 ,KEY_RADIO },/* FM radio */ - {0x25 ,KEY_POWER },/* power */ -}; -DEFINE_LEGACY_IR_KEYTABLE (powercolor_real_angel); - -/* Kworld Plus TV Analog Lite PCI IR -Mauro Carvalho Chehab <[email protected]> -*/ -static struct ir_scancode kworld_plus_tv_analog[] = { - {0x0c ,KEY_PROG1 },/* Kworld key */ - {0x16 ,KEY_CLOSECD },/* -> ) */ - {0x1d ,KEY_POWER2 }, - - {0x00 ,KEY_1 }, - {0x01 ,KEY_2 }, - {0x02 ,KEY_3 },/* Two keys have the same code: 3 and left */ - {0x03 ,KEY_4 },/* Two keys have the same code: 3 and right */ - {0x04 ,KEY_5 }, - {0x05 ,KEY_6 }, - {0x06 ,KEY_7 }, - {0x07 ,KEY_8 }, - {0x08 ,KEY_9 }, - {0x0a ,KEY_0 }, - - {0x09 ,KEY_AGAIN }, - {0x14 ,KEY_MUTE }, - - {0x20 ,KEY_UP }, - {0x21 ,KEY_DOWN }, - {0x0b ,KEY_ENTER }, - - {0x10 ,KEY_CHANNELUP }, - {0x11 ,KEY_CHANNELDOWN }, - -/* Couldn't map key left/key right since those -conflict with '3' and '4' scancodes -I dunno what the original driver does -*/ - - {0x13 ,KEY_VOLUMEUP }, - {0x12 ,KEY_VOLUMEDOWN }, - -/* The lower part of the IR -There are several duplicated keycodes there. -Most of them conflict with digits. -Add mappings just to the unused scancodes. -Somehow, the original driver has a way to know, -but this doesn't seem to be on some GPIO. -Also, it is not related to the time between keyup -and keydown. -*/ - {0x19 ,KEY_TIME },/* Timeshift */ - {0x1a ,KEY_STOP }, - {0x1b ,KEY_RECORD }, - - {0x22 ,KEY_TEXT }, - - {0x15 ,KEY_AUDIO },/* ((*)) */ - {0x0f ,KEY_ZOOM }, - {0x1c ,KEY_CAMERA },/* snapshot */ - - {0x18 ,KEY_RED },/* B */ - {0x23 ,KEY_GREEN },/* C */ -}; -DEFINE_LEGACY_IR_KEYTABLE (kworld_plus_tv_analog); - -/* Kaiomy TVnPC U2 -Mauro Carvalho Chehab <[email protected]> -*/ -static struct ir_scancode kaiomy[] = { - {0x43 ,KEY_POWER2 }, - {0x01 ,KEY_LIST }, - {0x0b ,KEY_ZOOM }, - {0x03 ,KEY_POWER }, - - {0x04 ,KEY_1 }, - {0x08 ,KEY_2 }, - {0x02 ,KEY_3 }, - - {0x0f ,KEY_4 }, - {0x05 ,KEY_5 }, - {0x06 ,KEY_6 }, - - {0x0c ,KEY_7 }, - {0x0d ,KEY_8 }, - {0x0a ,KEY_9 }, - - {0x11 ,KEY_0 }, - - {0x09 ,KEY_CHANNELUP }, - {0x07 ,KEY_CHANNELDOWN }, - - {0x0e ,KEY_VOLUMEUP }, - {0x13 ,KEY_VOLUMEDOWN }, - - {0x10 ,KEY_HOME }, - {0x12 ,KEY_ENTER }, - - {0x14 ,KEY_RECORD }, - {0x15 ,KEY_STOP }, - {0x16 ,KEY_PLAY }, - {0x17 ,KEY_MUTE }, - - {0x18 ,KEY_UP }, - {0x19 ,KEY_DOWN }, - {0x1a ,KEY_LEFT }, - {0x1b ,KEY_RIGHT }, - - {0x1c ,KEY_RED }, - {0x1d ,KEY_GREEN }, - {0x1e ,KEY_YELLOW }, - {0x1f ,KEY_BLUE }, -}; -DEFINE_LEGACY_IR_KEYTABLE (kaiomy); - -static struct ir_scancode avermedia_a16d[] = { - {0x20 ,KEY_LIST }, - {0x00 ,KEY_POWER }, - {0x28 ,KEY_1 }, - {0x18 ,KEY_2 }, - {0x38 ,KEY_3 }, - {0x24 ,KEY_4 }, - {0x14 ,KEY_5 }, - {0x34 ,KEY_6 }, - {0x2c ,KEY_7 }, - {0x1c ,KEY_8 }, - {0x3c ,KEY_9 }, - {0x12 ,KEY_SUBTITLE }, - {0x22 ,KEY_0 }, - {0x32 ,KEY_REWIND }, - {0x3a ,KEY_SHUFFLE }, - {0x02 ,KEY_PRINT }, - {0x11 ,KEY_CHANNELDOWN }, - {0x31 ,KEY_CHANNELUP }, - {0x0c ,KEY_ZOOM }, - {0x1e ,KEY_VOLUMEDOWN }, - {0x3e ,KEY_VOLUMEUP }, - {0x0a ,KEY_MUTE }, - {0x04 ,KEY_AUDIO }, - {0x26 ,KEY_RECORD }, - {0x06 ,KEY_PLAY }, - {0x36 ,KEY_STOP }, - {0x16 ,KEY_PAUSE }, - {0x2e ,KEY_REWIND }, - {0x0e ,KEY_FASTFORWARD }, - {0x30 ,KEY_TEXT }, - {0x21 ,KEY_GREEN }, - {0x01 ,KEY_BLUE }, - {0x08 ,KEY_EPG }, - {0x2a ,KEY_MENU }, -}; -DEFINE_LEGACY_IR_KEYTABLE (avermedia_a16d); - -/* Encore ENLTV-FM v5.3 -Mauro Carvalho Chehab <[email protected]> -*/ -static struct ir_scancode encore_enltv_fm53[] = { - {0x10 ,KEY_POWER2 }, - {0x06 ,KEY_MUTE }, - - {0x09 ,KEY_1 }, - {0x1d ,KEY_2 }, - {0x1f ,KEY_3 }, - {0x19 ,KEY_4 }, - {0x1b ,KEY_5 }, - {0x11 ,KEY_6 }, - {0x17 ,KEY_7 }, - {0x12 ,KEY_8 }, - {0x16 ,KEY_9 }, - {0x48 ,KEY_0 }, - - {0x04 ,KEY_LIST },/* -/-- */ - {0x40 ,KEY_LAST },/* recall */ - - {0x02 ,KEY_MODE },/* TV/AV */ - {0x05 ,KEY_CAMERA },/* SNAPSHOT */ - - {0x4c ,KEY_CHANNELUP },/* UP */ - {0x00 ,KEY_CHANNELDOWN },/* DOWN */ - {0x0d ,KEY_VOLUMEUP },/* RIGHT */ - {0x15 ,KEY_VOLUMEDOWN },/* LEFT */ - {0x49 ,KEY_ENTER },/* OK */ - - {0x54 ,KEY_RECORD }, - {0x4d ,KEY_PLAY },/* pause */ - - {0x1e ,KEY_MENU },/* video setting */ - {0x0e ,KEY_RIGHT },/* <- */ - {0x1a ,KEY_LEFT },/* -> */ - - {0x0a ,KEY_CLEAR },/* video default */ - {0x0c ,KEY_ZOOM },/* hide pannel */ - {0x47 ,KEY_SLEEP },/* shutdown */ -}; -DEFINE_LEGACY_IR_KEYTABLE (encore_enltv_fm53); - -/* Zogis Real Audio 220 - 32 keys IR */ -static struct ir_scancode real_audio_220_32_keys[] = { - {0x1c ,KEY_RADIO }, - {0x12 ,KEY_POWER2 }, - - {0x01 ,KEY_1 }, - {0x02 ,KEY_2 }, - {0x03 ,KEY_3 }, - {0x04 ,KEY_4 }, - {0x05 ,KEY_5 }, - {0x06 ,KEY_6 }, - {0x07 ,KEY_7 }, - {0x08 ,KEY_8 }, - {0x09 ,KEY_9 }, - {0x00 ,KEY_0 }, - - {0x0c ,KEY_VOLUMEUP }, - {0x18 ,KEY_VOLUMEDOWN }, - {0x0b ,KEY_CHANNELUP }, - {0x15 ,KEY_CHANNELDOWN }, - {0x16 ,KEY_ENTER }, - - {0x11 ,KEY_LIST },/* Source */ - {0x0d ,KEY_AUDIO },/* stereo */ - - {0x0f ,KEY_PREVIOUS },/* Prev */ - {0x1b ,KEY_TIME },/* Timeshift */ - {0x1a ,KEY_NEXT },/* Next */ - - {0x0e ,KEY_STOP }, - {0x1f ,KEY_PLAY }, - {0x1e ,KEY_PLAYPAUSE },/* Pause */ - - {0x1d ,KEY_RECORD }, - {0x13 ,KEY_MUTE }, - {0x19 ,KEY_CAMERA },/* Snapshot */ - -}; -DEFINE_LEGACY_IR_KEYTABLE (real_audio_220_32_keys); - -/* ATI TV Wonder HD 600 USB -Devin Heitmueller <[email protected]> -*/ -static struct ir_scancode ati_tv_wonder_hd_600[] = { - {0x00 ,KEY_RECORD },/* Row 1 */ - {0x01 ,KEY_PLAYPAUSE }, - {0x02 ,KEY_STOP }, - {0x03 ,KEY_POWER }, - {0x04 ,KEY_PREVIOUS },/* Row 2 */ - {0x05 ,KEY_REWIND }, - {0x06 ,KEY_FORWARD }, - {0x07 ,KEY_NEXT }, - {0x08 ,KEY_EPG },/* Row 3 */ - {0x09 ,KEY_HOME }, - {0x0a ,KEY_MENU }, - {0x0b ,KEY_CHANNELUP }, - {0x0c ,KEY_BACK },/* Row 4 */ - {0x0d ,KEY_UP }, - {0x0e ,KEY_INFO }, - {0x0f ,KEY_CHANNELDOWN }, - {0x10 ,KEY_LEFT },/* Row 5 */ - {0x11 ,KEY_SELECT }, - {0x12 ,KEY_RIGHT }, - {0x13 ,KEY_VOLUMEUP }, - {0x14 ,KEY_LAST },/* Row 6 */ - {0x15 ,KEY_DOWN }, - {0x16 ,KEY_MUTE }, - {0x17 ,KEY_VOLUMEDOWN }, -}; -DEFINE_LEGACY_IR_KEYTABLE (ati_tv_wonder_hd_600); - -/* DVBWorld remotes -Igor M. Liplianin <[email protected]> -*/ -static struct ir_scancode dm1105_nec[] = { - {0x0a ,KEY_POWER2 },/* power */ - {0x0c ,KEY_MUTE },/* mute */ - {0x11 ,KEY_1 }, - {0x12 ,KEY_2 }, - {0x13 ,KEY_3 }, - {0x14 ,KEY_4 }, - {0x15 ,KEY_5 }, - {0x16 ,KEY_6 }, - {0x17 ,KEY_7 }, - {0x18 ,KEY_8 }, - {0x19 ,KEY_9 }, - {0x10 ,KEY_0 }, - {0x1c ,KEY_CHANNELUP },/* ch+ */ - {0x0f ,KEY_CHANNELDOWN },/* ch- */ - {0x1a ,KEY_VOLUMEUP },/* vol+ */ - {0x0e ,KEY_VOLUMEDOWN },/* vol- */ - {0x04 ,KEY_RECORD },/* rec */ - {0x09 ,KEY_CHANNEL },/* fav */ - {0x08 ,KEY_BACKSPACE },/* rewind */ - {0x07 ,KEY_FASTFORWARD },/* fast */ - {0x0b ,KEY_PAUSE },/* pause */ - {0x02 ,KEY_ESC },/* cancel */ - {0x03 ,KEY_TAB },/* tab */ - {0x00 ,KEY_UP },/* up */ - {0x1f ,KEY_ENTER },/* ok */ - {0x01 ,KEY_DOWN },/* down */ - {0x05 ,KEY_RECORD },/* cap */ - {0x06 ,KEY_STOP },/* stop */ - {0x40 ,KEY_ZOOM },/* full */ - {0x1e ,KEY_TV },/* tvmode */ - {0x1b ,KEY_B },/* recall */ -}; -DEFINE_LEGACY_IR_KEYTABLE (dm1105_nec); - -static struct ir_scancode tevii_nec[] = { - {0x0a ,KEY_POWER2 }, - {0x0c ,KEY_MUTE }, - {0x11 ,KEY_1 }, - {0x12 ,KEY_2 }, - {0x13 ,KEY_3 }, - {0x14 ,KEY_4 }, - {0x15 ,KEY_5 }, - {0x16 ,KEY_6 }, - {0x17 ,KEY_7 }, - {0x18 ,KEY_8 }, - {0x19 ,KEY_9 }, - {0x10 ,KEY_0 }, - {0x1c ,KEY_MENU }, - {0x0f ,KEY_VOLUMEDOWN }, - {0x1a ,KEY_LAST }, - {0x0e ,KEY_OPEN }, - {0x04 ,KEY_RECORD }, - {0x09 ,KEY_VOLUMEUP }, - {0x08 ,KEY_CHANNELUP }, - {0x07 ,KEY_PVR }, - {0x0b ,KEY_TIME }, - {0x02 ,KEY_RIGHT }, - {0x03 ,KEY_LEFT }, - {0x00 ,KEY_UP }, - {0x1f ,KEY_OK }, - {0x01 ,KEY_DOWN }, - {0x05 ,KEY_TUNER }, - {0x06 ,KEY_CHANNELDOWN }, - {0x40 ,KEY_PLAYPAUSE }, - {0x1e ,KEY_REWIND }, - {0x1b ,KEY_FAVORITES }, - {0x1d ,KEY_BACK }, - {0x4d ,KEY_FASTFORWARD }, - {0x44 ,KEY_EPG }, - {0x4c ,KEY_INFO }, - {0x41 ,KEY_AB }, - {0x43 ,KEY_AUDIO }, - {0x45 ,KEY_SUBTITLE }, - {0x4a ,KEY_LIST }, - {0x46 ,KEY_F1 }, - {0x47 ,KEY_F2 }, - {0x5e ,KEY_F3 }, - {0x5c ,KEY_F4 }, - {0x52 ,KEY_F5 }, - {0x5a ,KEY_F6 }, - {0x56 ,KEY_MODE }, - {0x58 ,KEY_SWITCHVIDEOMODE }, -}; -DEFINE_LEGACY_IR_KEYTABLE (tevii_nec); - -static struct ir_scancode tbs_nec[] = { - {0x04 ,KEY_POWER2 },/*power*/ - {0x14 ,KEY_MUTE },/*mute*/ - {0x07 ,KEY_1 }, - {0x06 ,KEY_2 }, - {0x05 ,KEY_3 }, - {0x0b ,KEY_4 }, - {0x0a ,KEY_5 }, - {0x09 ,KEY_6 }, - {0x0f ,KEY_7 }, - {0x0e ,KEY_8 }, - {0x0d ,KEY_9 }, - {0x12 ,KEY_0 }, - {0x16 ,KEY_CHANNELUP },/*ch+*/ - {0x11 ,KEY_CHANNELDOWN },/*ch-*/ - {0x13 ,KEY_VOLUMEUP },/*vol+*/ - {0x0c ,KEY_VOLUMEDOWN },/*vol-*/ - {0x03 ,KEY_RECORD },/*rec*/ - {0x18 ,KEY_PAUSE },/*pause*/ - {0x19 ,KEY_OK },/*ok*/ - {0x1a ,KEY_CAMERA },/* snapshot */ - {0x01 ,KEY_UP }, - {0x10 ,KEY_LEFT }, - {0x02 ,KEY_RIGHT }, - {0x08 ,KEY_DOWN }, - {0x15 ,KEY_FAVORITES }, - {0x17 ,KEY_SUBTITLE }, - {0x1d ,KEY_ZOOM }, - {0x1f ,KEY_EXIT }, - {0x1e ,KEY_MENU }, - {0x1c ,KEY_EPG }, - {0x00 ,KEY_PREVIOUS }, - {0x1b ,KEY_MODE }, -}; -DEFINE_LEGACY_IR_KEYTABLE (tbs_nec); - -/* Terratec Cinergy Hybrid T USB XS -Devin Heitmueller <[email protected]> -*/ -static struct ir_scancode terratec_cinergy_xs[] = { - {0x41 ,KEY_HOME }, - {0x01 ,KEY_POWER }, - {0x42 ,KEY_MENU }, - {0x02 ,KEY_1 }, - {0x03 ,KEY_2 }, - {0x04 ,KEY_3 }, - {0x43 ,KEY_SUBTITLE }, - {0x05 ,KEY_4 }, - {0x06 ,KEY_5 }, - {0x07 ,KEY_6 }, - {0x44 ,KEY_TEXT }, - {0x08 ,KEY_7 }, - {0x09 ,KEY_8 }, - {0x0a ,KEY_9 }, - {0x45 ,KEY_DELETE }, - {0x0b ,KEY_TUNER }, - {0x0c ,KEY_0 }, - {0x0d ,KEY_MODE }, - {0x46 ,KEY_TV }, - {0x47 ,KEY_DVD }, - {0x49 ,KEY_VIDEO }, - {0x4b ,KEY_AUX }, - {0x10 ,KEY_UP }, - {0x11 ,KEY_LEFT }, - {0x12 ,KEY_OK }, - {0x13 ,KEY_RIGHT }, - {0x14 ,KEY_DOWN }, - {0x0f ,KEY_EPG }, - {0x16 ,KEY_INFO }, - {0x4d ,KEY_BACKSPACE }, - {0x1c ,KEY_VOLUMEUP }, - {0x4c ,KEY_PLAY }, - {0x1b ,KEY_CHANNELUP }, - {0x1e ,KEY_VOLUMEDOWN }, - {0x1d ,KEY_MUTE }, - {0x1f ,KEY_CHANNELDOWN }, - {0x17 ,KEY_RED }, - {0x18 ,KEY_GREEN }, - {0x19 ,KEY_YELLOW }, - {0x1a ,KEY_BLUE }, - {0x58 ,KEY_RECORD }, - {0x48 ,KEY_STOP }, - {0x40 ,KEY_PAUSE }, - {0x54 ,KEY_LAST }, - {0x4e ,KEY_REWIND }, - {0x4f ,KEY_FASTFORWARD }, - {0x5c ,KEY_NEXT }, -}; -DEFINE_LEGACY_IR_KEYTABLE (terratec_cinergy_xs); - -/* EVGA inDtube -Devin Heitmueller <[email protected]> -*/ -static struct ir_scancode evga_indtube[] = { - {0x12 ,KEY_POWER }, - {0x02 ,KEY_MODE },/* TV */ - {0x14 ,KEY_MUTE }, - {0x1a ,KEY_CHANNELUP }, - {0x16 ,KEY_TV2 },/* PIP */ - {0x1d ,KEY_VOLUMEUP }, - {0x05 ,KEY_CHANNELDOWN }, - {0x0f ,KEY_PLAYPAUSE }, - {0x19 ,KEY_VOLUMEDOWN }, - {0x1c ,KEY_REWIND }, - {0x0d ,KEY_RECORD }, - {0x18 ,KEY_FORWARD }, - {0x1e ,KEY_PREVIOUS }, - {0x1b ,KEY_STOP }, - {0x1f ,KEY_NEXT }, - {0x13 ,KEY_CAMERA }, -}; -DEFINE_LEGACY_IR_KEYTABLE (evga_indtube); - -static struct ir_scancode videomate_s350[] = { - {0x00 ,KEY_TV }, - {0x01 ,KEY_DVD }, - {0x04 ,KEY_RECORD }, - {0x05 ,KEY_VIDEO },/* TV/Video */ - {0x07 ,KEY_STOP }, - {0x08 ,KEY_PLAYPAUSE }, - {0x0a ,KEY_REWIND }, - {0x0f ,KEY_FASTFORWARD }, - {0x10 ,KEY_CHANNELUP }, - {0x12 ,KEY_VOLUMEUP }, - {0x13 ,KEY_CHANNELDOWN }, - {0x14 ,KEY_MUTE }, - {0x15 ,KEY_VOLUMEDOWN }, - {0x16 ,KEY_1 }, - {0x17 ,KEY_2 }, - {0x18 ,KEY_3 }, - {0x19 ,KEY_4 }, - {0x1a ,KEY_5 }, - {0x1b ,KEY_6 }, - {0x1c ,KEY_7 }, - {0x1d ,KEY_8 }, - {0x1e ,KEY_9 }, - {0x1f ,KEY_0 }, - {0x21 ,KEY_SLEEP }, - {0x24 ,KEY_ZOOM }, - {0x25 ,KEY_LAST },/* Recall */ - {0x26 ,KEY_SUBTITLE },/* CC */ - {0x27 ,KEY_LANGUAGE },/* MTS */ - {0x29 ,KEY_CHANNEL },/* SURF */ - {0x2b ,KEY_A }, - {0x2c ,KEY_B }, - {0x2f ,KEY_CAMERA },/* Snapshot */ - {0x23 ,KEY_RADIO }, - {0x02 ,KEY_PREVIOUSSONG }, - {0x06 ,KEY_NEXTSONG }, - {0x03 ,KEY_EPG }, - {0x09 ,KEY_SETUP }, - {0x22 ,KEY_BACKSPACE }, - {0x0c ,KEY_UP }, - {0x0e ,KEY_DOWN }, - {0x0b ,KEY_LEFT }, - {0x0d ,KEY_RIGHT }, - {0x11 ,KEY_ENTER }, - {0x20 ,KEY_TEXT }, -}; -DEFINE_LEGACY_IR_KEYTABLE (videomate_s350); - -/* GADMEI UTV330+ RM008Z remote -Shine Liu <[email protected]> -*/ -static struct ir_scancode gadmei_rm008z[] = { - {0x14 ,KEY_POWER2 },/* POWER OFF */ - {0x0c ,KEY_MUTE },/* MUTE */ - - {0x18 ,KEY_TV },/* TV */ - {0x0e ,KEY_VIDEO },/* AV */ - {0x0b ,KEY_AUDIO },/* SV */ - {0x0f ,KEY_RADIO },/* FM */ - - {0x00 ,KEY_1 }, - {0x01 ,KEY_2 }, - {0x02 ,KEY_3 }, - {0x03 ,KEY_4 }, - {0x04 ,KEY_5 }, - {0x05 ,KEY_6 }, - {0x06 ,KEY_7 }, - {0x07 ,KEY_8 }, - {0x08 ,KEY_9 }, - {0x09 ,KEY_0 }, - {0x0a ,KEY_INFO },/* OSD */ - {0x1c ,KEY_BACKSPACE },/* LAST */ - - {0x0d ,KEY_PLAY },/* PLAY */ - {0x1e ,KEY_CAMERA },/* SNAPSHOT */ - {0x1a ,KEY_RECORD },/* RECORD */ - {0x17 ,KEY_STOP },/* STOP */ - - {0x1f ,KEY_UP },/* UP */ - {0x44 ,KEY_DOWN },/* DOWN */ - {0x46 ,KEY_TAB },/* BACK */ - {0x4a ,KEY_ZOOM },/* FULLSECREEN */ - - {0x10 ,KEY_VOLUMEUP },/* VOLUMEUP */ - {0x11 ,KEY_VOLUMEDOWN },/* VOLUMEDOWN */ - {0x12 ,KEY_CHANNELUP },/* CHANNELUP */ - {0x13 ,KEY_CHANNELDOWN },/* CHANNELDOWN */ - {0x15 ,KEY_ENTER },/* OK */ -}; -DEFINE_LEGACY_IR_KEYTABLE (gadmei_rm008z); - -/************************************************************* -* COMPLETE SCANCODE TABLES -* Instead of just a partial scancode, the tables bellow -* contains the complete scancode and the receiver protocol -*************************************************************/ - -/* -* Hauppauge:the newer, gray remotes (seems there are multiple -* slightly different versions), shipped with cx88+ivtv cards. -* -* This table contains the complete RC5 code, instead of just the data part -*/ -static struct ir_scancode rc5_hauppauge_new[] = { -/* Keys 0 to 9 */ - {0x1e00 ,KEY_0 }, - {0x1e01 ,KEY_1 }, - {0x1e02 ,KEY_2 }, - {0x1e03 ,KEY_3 }, - {0x1e04 ,KEY_4 }, - {0x1e05 ,KEY_5 }, - {0x1e06 ,KEY_6 }, - {0x1e07 ,KEY_7 }, - {0x1e08 ,KEY_8 }, - {0x1e09 ,KEY_9 }, - - {0x1e0a ,KEY_TEXT },/* keypad asterisk as well */ - {0x1e0b ,KEY_RED },/* red button */ - {0x1e0c ,KEY_RADIO }, - {0x1e0d ,KEY_MENU }, - {0x1e0e ,KEY_SUBTITLE },/* also the # key */ - {0x1e0f ,KEY_MUTE }, - {0x1e10 ,KEY_VOLUMEUP }, - {0x1e11 ,KEY_VOLUMEDOWN }, - {0x1e12 ,KEY_PREVIOUS },/* previous channel */ - {0x1e14 ,KEY_UP }, - {0x1e15 ,KEY_DOWN }, - {0x1e16 ,KEY_LEFT },
Lines of this file are not shown. View the raw message.
include/media/ir-common.h +65 -85
150 lines not on this page · raw message
include/media/keycodes/adstech-dvb-t-pci.h new file +65 -0
65 lines not on this page · raw message
include/media/keycodes/apac-viewcomp.h new file +56 -0
56 lines not on this page · raw message
include/media/keycodes/asus-pc39.h new file +67 -0
67 lines not on this page · raw message
include/media/keycodes/ati-tv-wonder-hd-600.h new file +45 -0
45 lines not on this page · raw message
include/media/keycodes/avermedia-a16d.h new file +52 -0
52 lines not on this page · raw message
include/media/keycodes/avermedia-cardbus.h new file +73 -0
73 lines not on this page · raw message
include/media/keycodes/avermedia-dvbt.h new file +54 -0
54 lines not on this page · raw message
include/media/keycodes/avermedia-m135a-rm-jx.h new file +66 -0
66 lines not on this page · raw message
include/media/keycodes/avermedia.h new file +62 -0
62 lines not on this page · raw message
include/media/keycodes/avertv-303.h new file +61 -0
61 lines not on this page · raw message
include/media/keycodes/behold-columbus.h new file +84 -0
84 lines not on this page · raw message
include/media/keycodes/behold.h new file +117 -0
117 lines not on this page · raw message
include/media/keycodes/budget-ci-old.h new file +68 -0
68 lines not on this page · raw message
include/media/keycodes/cinergy-1400.h new file +60 -0
60 lines not on this page · raw message
include/media/keycodes/cinergy.h new file +55 -0
55 lines not on this page · raw message
include/media/keycodes/dm1105-nec.h new file +52 -0
52 lines not on this page · raw message
include/media/keycodes/dntv-live-dvb-t.h new file +54 -0
54 lines not on this page · raw message
include/media/keycodes/dntv-live-dvbt-pro.h new file +73 -0
73 lines not on this page · raw message
include/media/keycodes/em-terratec.h new file +46 -0
46 lines not on this page · raw message
include/media/keycodes/empty.h new file +20 -0
Lines of this file are not shown. View the raw message.
include/media/keycodes/encore-enltv-fm53.h new file +57 -0
57 lines not on this page · raw message
include/media/keycodes/encore-enltv.h new file +88 -0
88 lines not on this page · raw message
include/media/keycodes/encore-enltv2.h new file +66 -0
66 lines not on this page · raw message
include/media/keycodes/evga-indtube.h new file +37 -0
Lines of this file are not shown. View the raw message.
include/media/keycodes/eztv.h new file +72 -0
72 lines not on this page · raw message
include/media/keycodes/flydvb.h new file +54 -0
54 lines not on this page · raw message
include/media/keycodes/flyvideo.h new file +47 -0
47 lines not on this page · raw message
include/media/keycodes/fusionhdtv-mce.h new file +74 -0
74 lines not on this page · raw message
include/media/keycodes/gadmei-rm008z.h new file +57 -0
57 lines not on this page · raw message
include/media/keycodes/genius-tvgo-a11mce.h new file +60 -0
60 lines not on this page · raw message
include/media/keycodes/gotview7135.h new file +55 -0
55 lines not on this page · raw message
include/media/keycodes/hauppauge-new.h new file +76 -0
76 lines not on this page · raw message
include/media/keycodes/iodata-bctv7e.h new file +64 -0
64 lines not on this page · raw message
include/media/keycodes/kaiomy.h new file +63 -0
63 lines not on this page · raw message
include/media/keycodes/kworld-315u.h new file +59 -0
59 lines not on this page · raw message
include/media/keycodes/kworld-plus-tv-analog.h new file +75 -0
75 lines not on this page · raw message
include/media/keycodes/manli.h new file +111 -0
111 lines not on this page · raw message
include/media/keycodes/msi-tvanywhere-plus.h new file +100 -0
100 lines not on this page · raw message
include/media/keycodes/msi-tvanywhere.h new file +44 -0
44 lines not on this page · raw message
include/media/keycodes/nebula.h new file +73 -0
73 lines not on this page · raw message
include/media/keycodes/nec-terratec-cinergy-xs.h new file +81 -0
81 lines not on this page · raw message
include/media/keycodes/norwood.h new file +61 -0
61 lines not on this page · raw message
include/media/keycodes/npgtech.h new file +57 -0
57 lines not on this page · raw message
include/media/keycodes/pctv-sedna.h new file +56 -0
56 lines not on this page · raw message
include/media/keycodes/pinnacle-color.h new file +71 -0
71 lines not on this page · raw message
include/media/keycodes/pinnacle-grey.h new file +66 -0
66 lines not on this page · raw message
include/media/keycodes/pinnacle-pctv-hd.h new file +49 -0
49 lines not on this page · raw message
include/media/keycodes/pixelview-new.h new file +59 -0
59 lines not on this page · raw message
include/media/keycodes/pixelview.h new file +59 -0
59 lines not on this page · raw message
include/media/keycodes/powercolor-real-angel.h new file +57 -0
57 lines not on this page · raw message
include/media/keycodes/proteus-2309.h new file +45 -0
45 lines not on this page · raw message
include/media/keycodes/purpletv.h new file +58 -0
58 lines not on this page · raw message
include/media/keycodes/pv951.h new file +54 -0
54 lines not on this page · raw message
include/media/keycodes/rc5-hauppauge-new.h new file +79 -0
79 lines not on this page · raw message
include/media/keycodes/rc5-tv.h new file +57 -0
57 lines not on this page · raw message
include/media/keycodes/real-audio-220-32-keys.h new file +54 -0
54 lines not on this page · raw message
include/media/keycodes/tbs-nec.h new file +50 -0
50 lines not on this page · raw message
include/media/keycodes/terratec-cinergy-xs.h new file +68 -0
68 lines not on this page · raw message
include/media/keycodes/tevii-nec.h new file +65 -0
65 lines not on this page · raw message
include/media/keycodes/tt-1500.h new file +58 -0
58 lines not on this page · raw message
include/media/keycodes/videomate-s350.h new file +62 -0
62 lines not on this page · raw message
include/media/keycodes/videomate-tv-pvr.h new file +64 -0
64 lines not on this page · raw message
include/media/keycodes/winfast-usbii-deluxe.h new file +58 -0
58 lines not on this page · raw message
include/media/keycodes/winfast.h new file +78 -0
78 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
1.6.6.1
Part of the diff is not shown here. View the raw message.
PATCH 14/26 V4L/DVB: drivers/media/IR - improve keytable code
In reply to a message not in the archiveFrom: David Härdeman <[email protected]>
The attached patch rewrites much of the keytable code in drivers/media/IR/ir-keytable.c.
The scancodes are now inserted into the array in sorted order which allows for a binary search on lookup.
The code has also been shrunk by about 150 lines.
In addition it fixes the following bugs:
Any use of ir_seek_table() was racy.
ir_dev->driver_name is leaked between ir_input_register() and ir_input_unregister().
ir_setkeycode() unconditionally does clear_bit() on dev->keybit when removing a mapping, but there might be another mapping with a different scancode and the same keycode.
This version has been updated to incorporate patch feedback from Mauro Carvalho Chehab.
[[email protected]: Fix a conflict with RC keytable breakup patches]
drivers/media/IR/ir-keytable.c +204 -346
@@ -16,344 +16,214 @@#include <linux/input.h> #include <media/ir-common.h> -#define IR_TAB_MIN_SIZE 32 -#define IR_TAB_MAX_SIZE 1024 +/* Sizes are in bytes, 256 bytes allows for 32 entries on x64 */ +#define IR_TAB_MIN_SIZE 256 +#define IR_TAB_MAX_SIZE 8192/** -* ir_seek_table() - returns the element order on the table -* @rc_tab: the ir_scancode_table with the keymap to be used -* @scancode: the scancode that we're seeking +* ir_resize_table() - resizes a scancode table if necessary +* @rc_tab: the ir_scancode_table to resize +* @return: zero on success or a negative error code * -* This routine is used by the input routines when a key is pressed at the -* IR. The scancode is received and needs to be converted into a keycode. -* If the key is not found, it returns KEY_UNKNOWN. Otherwise, returns the -* corresponding keycode from the table. +* This routine will shrink the ir_scancode_table if it has lots of +* unused entries and grow it if it is full. */ -static int ir_seek_table (struct ir_scancode_table *rc_tab,u32 scancode) +static int ir_resize_table (struct ir_scancode_table *rc_tab) { -int rc; -unsigned long flags; -struct ir_scancode *keymap = rc_tab->scan; +unsigned int oldalloc = rc_tab->alloc; +unsigned int newalloc = oldalloc; +struct ir_scancode *oldscan = rc_tab->scan; +struct ir_scancode *newscan; -spin_lock_irqsave (&rc_tab->lock, flags); +if (rc_tab->size == rc_tab->len) { +/* All entries in use -> grow keytable */ +if (rc_tab->alloc >=IR_TAB_MAX_SIZE ) +return -ENOMEM ; -/* FIXME: replace it by a binary search */ + newalloc *=2 ; +IR_dprintk (1 ,"Growing table to %u bytes\n" , newalloc); + } -for (rc =0 ; rc < rc_tab->size; rc++) -if (keymap[rc].scancode == scancode) - goto exit; +if ((rc_tab->len *3 < rc_tab->size) && (oldalloc >IR_TAB_MIN_SIZE )) { +/* Less than 1/3 of entries in use -> shrink keytable */ + newalloc /=2 ; +IR_dprintk (1 ,"Shrinking table to %u bytes\n" , newalloc); + } -/* Not found */ - rc = -EINVAL ; +if (newalloc == oldalloc) +return 0 ; -exit: -spin_unlock_irqrestore (&rc_tab->lock, flags); -return rc; -} - -/** -* ir_roundup_tablesize() - gets an optimum value for the table size -* @n_elems: minimum number of entries to store keycodes -* -* This routine is used to choose the keycode table size. -* -* In order to have some empty space for new keycodes, -* and knowing in advance that kmalloc allocates only power of two -* segments, it optimizes the allocated space to have some spare space -* for those new keycodes by using the maximum number of entries that -* will be effectively be allocated by kmalloc. -* In order to reduce the quantity of table resizes, it has a minimum -* table size of IR_TAB_MIN_SIZE. -*/ -static int ir_roundup_tablesize (int n_elems) -{ -size_t size; - -if (n_elems <IR_TAB_MIN_SIZE ) - n_elems =IR_TAB_MIN_SIZE ; + newscan =kmalloc (newalloc,GFP_ATOMIC ); +if (!newscan) { +IR_dprintk (1 ,"Failed to kmalloc %u bytes\n" , newalloc); +return -ENOMEM ; + } -/* -* As kmalloc only allocates sizes of power of two, get as -* much entries as possible for the allocated memory segment -*/ - size =roundup_pow_of_two (n_elems *sizeof (struct ir_scancode )); - n_elems = size /sizeof (struct ir_scancode ); - -return n_elems; +memcpy (newscan, rc_tab->scan, rc_tab->len *sizeof (struct ir_scancode )); + rc_tab->scan = newscan; + rc_tab->alloc = newalloc; + rc_tab->size = rc_tab->alloc /sizeof (struct ir_scancode ); +kfree (oldscan); +return 0 ; }/** -* ir_copy_table() - copies a keytable, discarding the unused entries -* @destin: destin table -* @origin: origin table +* ir_do_setkeycode() - internal function to set a keycode in the +* scancode->keycode table +* @dev: the struct input_dev device descriptor +* @rc_tab: the struct ir_scancode_table to set the keycode in +* @scancode: the scancode for the ir command +* @keycode: the keycode for the ir command +* @return: -EINVAL if the keycode could not be inserted, otherwise zero. * -* Copies all entries where the keycode is not KEY_UNKNOWN/KEY_RESERVED -* Also copies table size and table protocol. -* NOTE: It shouldn't copy the lock field +* This routine is used internally to manipulate the scancode->keycode table. +* The caller has to hold @rc_tab->lock. */ - -static int ir_copy_table (struct ir_scancode_table *destin, -const struct ir_scancode_table *origin) +static int ir_do_setkeycode (struct input_dev *dev, +struct ir_scancode_table *rc_tab, +int scancode,int keycode) { -int i, j =0 ; +unsigned int i; +int old_keycode =KEY_RESERVED ; -for (i =0 ; i < origin->size; i++) { -if (origin->scan[i].keycode ==KEY_UNKNOWN || - origin->scan[i].keycode ==KEY_RESERVED ) +/* First check if we already have a mapping for this ir command */ +for (i =0 ; i < rc_tab->len; i++) { +/* Keytable is sorted from lowest to highest scancode */ +if (rc_tab->scan[i].scancode > scancode) +break ; +else if (rc_tab->scan[i].scancode < scancode)continue ; -memcpy (&destin->scan[j], &origin->scan[i],sizeof (struct ir_scancode )); - j++; + old_keycode = rc_tab->scan[i].keycode; + rc_tab->scan[i].keycode = keycode; + +/* Did the user wish to remove the mapping? */ +if (keycode ==KEY_RESERVED || keycode ==KEY_UNKNOWN ) { + rc_tab->len--; +memmove (&rc_tab->scan[i], &rc_tab->scan[i +1 ], + (rc_tab->len - i) *sizeof (struct ir_scancode )); + } + +/* Possibly shrink the keytable, failure is not a problem */ +ir_resize_table (rc_tab); +break ; } - destin->size = j; - destin->ir_type = origin->ir_type; -IR_dprintk (1 ,"Copied %d scancodes to the new keycode table\n" , destin->size); - -return 0 ; -} - -/** -* ir_getkeycode() - get a keycode at the evdev scancode ->keycode table -* @dev: the struct input_dev device descriptor -* @scancode: the desired scancode -* @keycode: the keycode to be retorned. -* -* This routine is used to handle evdev EVIOCGKEY ioctl. -* If the key is not found, returns -EINVAL, otherwise, returns 0. -*/ -static int ir_getkeycode (struct input_dev *dev, -int scancode,int *keycode) -{ -int elem; -struct ir_input_dev *ir_dev =input_get_drvdata (dev); -struct ir_scancode_table *rc_tab = &ir_dev->rc_tab; - - elem =ir_seek_table (rc_tab, scancode); -if (elem >=0 ) { - *keycode = rc_tab->scan[elem].keycode; -return 0 ; - } - -/* -* Scancode not found and table can't be expanded -*/ -if (elem <0 && rc_tab->size ==IR_TAB_MAX_SIZE ) -return -EINVAL ; - -/* -* If is there extra space, returns KEY_RESERVED, -* otherwise, input core won't let ir_setkeycode to work -*/ - *keycode =KEY_RESERVED ; -return 0 ; -} - -/** -* ir_is_resize_needed() - Check if the table needs rezise -* @table: keycode table that may need to resize -* @n_elems: minimum number of entries to store keycodes -* -* Considering that kmalloc uses power of two storage areas, this -* routine detects if the real alloced size will change. If not, it -* just returns without doing nothing. Otherwise, it will extend or -* reduce the table size to meet the new needs. -* -* It returns 0 if no resize is needed, 1 otherwise. -*/ -static int ir_is_resize_needed (struct ir_scancode_table *table,int n_elems) -{ -int cur_size =ir_roundup_tablesize (table->size); -int new_size =ir_roundup_tablesize (n_elems); - -if (cur_size == new_size) -return 0 ; - -/* Resize is needed */ -return 1 ; -} - -/** -* ir_delete_key() - remove a keycode from the table -* @rc_tab: keycode table -* @elem: element to be removed -* -*/ -static void ir_delete_key (struct ir_scancode_table *rc_tab,int elem) -{ -unsigned long flags =0 ; -int newsize = rc_tab->size -1 ; -int resize =ir_is_resize_needed (rc_tab, newsize); -struct ir_scancode *oldkeymap = rc_tab->scan; -struct ir_scancode *newkeymap =NULL ; - -if (resize) - newkeymap =kzalloc (ir_roundup_tablesize (newsize) * -sizeof (*newkeymap),GFP_ATOMIC ); - -/* There's no memory for resize. Keep the old table */ -if (!resize || !newkeymap) { - newkeymap = oldkeymap; - -/* We'll modify the live table. Lock it */ -spin_lock_irqsave (&rc_tab->lock, flags); - } - -/* -* Copy the elements before the one that will be deleted -* if (!resize), both oldkeymap and newkeymap points -* to the same place, so, there's no need to copy -*/ -if (resize && elem >0 ) -memcpy (newkeymap, oldkeymap, - elem *sizeof (*newkeymap)); - -/* -* Copy the other elements overwriting the element to be removed -* This operation applies to both resize and non-resize case -*/ -if (elem < newsize) -memcpy (&newkeymap[elem], &oldkeymap[elem +1 ], - (newsize - elem) *sizeof (*newkeymap)); - -if (resize) { -/* -* As the copy happened to a temporary table, only here -* it needs to lock while replacing the table pointers -* to use the new table -*/ -spin_lock_irqsave (&rc_tab->lock, flags); - rc_tab->size = newsize; - rc_tab->scan = newkeymap; -spin_unlock_irqrestore (&rc_tab->lock, flags); - -/* Frees the old keytable */ -kfree (oldkeymap); +if (old_keycode ==KEY_RESERVED ) { +/* No previous mapping found, we might need to grow the table */ +if (ir_resize_table (rc_tab)) +return -ENOMEM ; + +/* i is the proper index to insert our new keycode */ +memmove (&rc_tab->scan[i +1 ], &rc_tab->scan[i], + (rc_tab->len - i) *sizeof (struct ir_scancode )); + rc_tab->scan[i].scancode = scancode; + rc_tab->scan[i].keycode = keycode; + rc_tab->len++; +set_bit (keycode, dev->keybit); }else { - rc_tab->size = newsize; -spin_unlock_irqrestore (&rc_tab->lock, flags); +/* A previous mapping was updated... */ +clear_bit (old_keycode, dev->keybit); +/* ...but another scancode might use the same keycode */ +for (i =0 ; i < rc_tab->len; i++) { +if (rc_tab->scan[i].keycode == old_keycode) { +set_bit (old_keycode, dev->keybit); +break ; + } + } } -} - -/** -* ir_insert_key() - insert a keycode at the table -* @rc_tab: keycode table -* @scancode: the desired scancode -* @keycode: the keycode to be retorned. -* -*/ -static int ir_insert_key (struct ir_scancode_table *rc_tab, -int scancode,int keycode) -{ -unsigned long flags; -int elem = rc_tab->size; -int newsize = rc_tab->size +1 ; -int resize =ir_is_resize_needed (rc_tab, newsize); -struct ir_scancode *oldkeymap = rc_tab->scan; -struct ir_scancode *newkeymap; - -if (resize) { - newkeymap =kzalloc (ir_roundup_tablesize (newsize) * -sizeof (*newkeymap),GFP_ATOMIC ); -if (!newkeymap) -return -ENOMEM ; - -memcpy (newkeymap, oldkeymap, - rc_tab->size *sizeof (*newkeymap)); - }else - newkeymap = oldkeymap; - -/* Stores the new code at the table */ -IR_dprintk (1 ,"#%d: New scan 0x%04x with key 0x%04x\n" , - rc_tab->size, scancode, keycode); - -spin_lock_irqsave (&rc_tab->lock, flags); - rc_tab->size = newsize; -if (resize) { - rc_tab->scan = newkeymap; -kfree (oldkeymap); - } - newkeymap[elem].scancode = scancode; - newkeymap[elem].keycode = keycode; -spin_unlock_irqrestore (&rc_tab->lock, flags);return 0 ; }/** -* ir_setkeycode() - set a keycode at the evdev scancode ->keycode table +* ir_setkeycode() - set a keycode in the scancode->keycode table * @dev: the struct input_dev device descriptor * @scancode: the desired scancode -* @keycode: the keycode to be retorned. +* @keycode: result +* @return: -EINVAL if the keycode could not be inserted, otherwise zero. * * This routine is used to handle evdev EVIOCSKEY ioctl. -* There's one caveat here: how can we increase the size of the table? -* If the key is not found, returns -EINVAL, otherwise, returns 0. */ static int ir_setkeycode (struct input_dev *dev,int scancode,int keycode) { +int rc; +unsigned long flags; +struct ir_input_dev *ir_dev =input_get_drvdata (dev); +struct ir_scancode_table *rc_tab = &ir_dev->rc_tab; + +spin_lock_irqsave (&rc_tab->lock, flags); + rc =ir_do_setkeycode (dev, rc_tab, scancode, keycode); +spin_unlock_irqrestore (&rc_tab->lock, flags); +return rc; +} + +/** +* ir_setkeytable() - sets several entries in the scancode->keycode table +* @dev: the struct input_dev device descriptor +* @to: the struct ir_scancode_table to copy entries to +* @from: the struct ir_scancode_table to copy entries from +* @return: -EINVAL if all keycodes could not be inserted, otherwise zero. +* +* This routine is used to handle table initialization. +*/ +static int ir_setkeytable (struct input_dev *dev, +struct ir_scancode_table *to, +const struct ir_scancode_table *from) +{ +struct ir_input_dev *ir_dev =input_get_drvdata (dev); +struct ir_scancode_table *rc_tab = &ir_dev->rc_tab; +unsigned long flags; +unsigned int i;int rc =0 ; + +spin_lock_irqsave (&rc_tab->lock, flags); +for (i =0 ; i < from->size; i++) { + rc =ir_do_setkeycode (dev, to, from->scan[i].scancode, + from->scan[i].keycode); +if (rc) +break ; + } +spin_unlock_irqrestore (&rc_tab->lock, flags); +return rc; +} + +/** +* ir_getkeycode() - get a keycode from the scancode->keycode table +* @dev: the struct input_dev device descriptor +* @scancode: the desired scancode +* @keycode: used to return the keycode, if found, or KEY_RESERVED +* @return: always returns zero. +* +* This routine is used to handle evdev EVIOCGKEY ioctl. +*/ +static int ir_getkeycode (struct input_dev *dev, +int scancode,int *keycode) +{ +int start, end, mid; +unsigned long flags; +int key =KEY_RESERVED ;struct ir_input_dev *ir_dev =input_get_drvdata (dev);struct ir_scancode_table *rc_tab = &ir_dev->rc_tab; -struct ir_scancode *keymap = rc_tab->scan; -unsigned long flags; -/* -* Handle keycode table deletions -* -* If userspace is adding a KEY_UNKNOWN or KEY_RESERVED, -* deal as a trial to remove an existing scancode attribution -* if table become too big, reduce it to save space -*/ -if (keycode ==KEY_UNKNOWN || keycode ==KEY_RESERVED ) { - rc =ir_seek_table (rc_tab, scancode); -if (rc <0 ) -return 0 ; - -IR_dprintk (1 ,"#%d: Deleting scan 0x%04x\n" , rc, scancode); -clear_bit (keymap[rc].keycode, dev->keybit); -ir_delete_key (rc_tab, rc); - -return 0 ; +spin_lock_irqsave (&rc_tab->lock, flags); + start =0 ; + end = rc_tab->len -1 ; +while (start <= end) { + mid = (start + end) /2 ; +if (rc_tab->scan[mid].scancode < scancode) + start = mid +1 ; +else if (rc_tab->scan[mid].scancode > scancode) + end = mid -1 ; +else { + key = rc_tab->scan[mid].keycode; +break ; + } } +spin_unlock_irqrestore (&rc_tab->lock, flags); -/* -* Handle keycode replacements -* -* If the scancode exists, just replace by the new value -*/ - rc =ir_seek_table (rc_tab, scancode); -if (rc >=0 ) { -IR_dprintk (1 ,"#%d: Replacing scan 0x%04x with key 0x%04x\n" , - rc, scancode, keycode); - -clear_bit (keymap[rc].keycode, dev->keybit); - -spin_lock_irqsave (&rc_tab->lock, flags); - keymap[rc].keycode = keycode; -spin_unlock_irqrestore (&rc_tab->lock, flags); - -set_bit (keycode, dev->keybit); - -return 0 ; - } - -/* -* Handle new scancode inserts -* -* reallocate table if needed and insert a new keycode -*/ - -/* Avoid growing the table indefinitely */ -if (rc_tab->size +1 >IR_TAB_MAX_SIZE ) -return -EINVAL ; - - rc =ir_insert_key (rc_tab, scancode, keycode); -if (rc <0 ) -return rc; -set_bit (keycode, dev->keybit); - + *keycode = key;return 0 ; }
@@ -369,24 +239,12 @@ static int ir_setkeycode(struct input_dev *dev,*/ u32 ir_g_keycode_from_table (struct input_dev *dev,u32 scancode) { -struct ir_input_dev *ir_dev =input_get_drvdata (dev); -struct ir_scancode_table *rc_tab = &ir_dev->rc_tab; -struct ir_scancode *keymap = rc_tab->scan; -int elem; +int keycode; - elem =ir_seek_table (rc_tab, scancode); -if (elem >=0 ) { -IR_dprintk (1 ,"%s: scancode 0x%04x keycode 0x%02x\n" , - dev->name, scancode, keymap[elem].keycode); - -return rc_tab->scan[elem].keycode; - } - -printk (KERN_INFO "%s: unknown key for scancode 0x%04x\n" , - dev->name, scancode); - -/* Reports userspace that an unknown keycode were got */ -return KEY_RESERVED ; +ir_getkeycode (dev, scancode, &keycode); +IR_dprintk (1 ,"%s: scancode 0x%04x keycode 0x%02x\n" , + dev->name, scancode, keycode); +return keycode; }EXPORT_SYMBOL_GPL (ir_g_keycode_from_table);
@@ -476,8 +334,7 @@ int __ir_input_register(struct input_dev *input_dev, const char *driver_name) {struct ir_input_dev *ir_dev; -struct ir_scancode *keymap = rc_tab->scan; -int i, rc; +int rc;if (rc_tab->scan ==NULL || !rc_tab->size)return -EINVAL ;
@@ -486,55 +343,55 @@ int __ir_input_register(struct input_dev *input_dev,if (!ir_dev)return -ENOMEM ; + ir_dev->driver_name =kasprintf (GFP_KERNEL ,"%s" , driver_name); +if (!ir_dev->driver_name) { + rc = -ENOMEM ; + goto out_dev; + } + + input_dev->getkeycode = ir_getkeycode; + input_dev->setkeycode = ir_setkeycode; +input_set_drvdata (input_dev, ir_dev); +spin_lock_init (&ir_dev->rc_tab.lock); - - ir_dev->driver_name =kmalloc (strlen (driver_name) +1 ,GFP_KERNEL ); -if (!ir_dev->driver_name) -return -ENOMEM ; -strcpy (ir_dev->driver_name, driver_name); ir_dev->rc_tab.name = rc_tab->name; - ir_dev->rc_tab.size =ir_roundup_tablesize (rc_tab->size); - ir_dev->rc_tab.scan =kzalloc (ir_dev->rc_tab.size * -sizeof (struct ir_scancode ),GFP_KERNEL ); + ir_dev->rc_tab.ir_type = rc_tab->ir_type; + ir_dev->rc_tab.alloc =roundup_pow_of_two (rc_tab->size * +sizeof (struct ir_scancode )); + ir_dev->rc_tab.scan =kmalloc (ir_dev->rc_tab.alloc,GFP_KERNEL ); + ir_dev->rc_tab.size = ir_dev->rc_tab.alloc /sizeof (struct ir_scancode ); +if (!ir_dev->rc_tab.scan) { -kfree (ir_dev); -return -ENOMEM ; + rc = -ENOMEM ; + goto out_name; } -IR_dprintk (1 ,"Allocated space for %d keycode entries (%zd bytes)\n" , - ir_dev->rc_tab.size, - ir_dev->rc_tab.size *sizeof (ir_dev->rc_tab.scan)); +IR_dprintk (1 ,"Allocated space for %u keycode entries (%u bytes)\n" , + ir_dev->rc_tab.size, ir_dev->rc_tab.alloc); + +set_bit (EV_KEY , input_dev->evbit); +if (ir_setkeytable (input_dev, &ir_dev->rc_tab, rc_tab)) { + rc = -ENOMEM ; + goto out_table; + } -ir_copy_table (&ir_dev->rc_tab, rc_tab); ir_dev->props = props;if (props && props->open) input_dev->open = ir_open;if (props && props->close) input_dev->close = ir_close; -/* set the bits for the keys */ -IR_dprintk (1 ,"key map size: %d\n" , rc_tab->size); -for (i =0 ; i < rc_tab->size; i++) { -IR_dprintk (1 ,"#%d: setting bit for keycode 0x%04x\n" , - i, keymap[i].keycode); -set_bit (keymap[i].keycode, input_dev->keybit); - } -clear_bit (0 , input_dev->keybit); - -set_bit (EV_KEY , input_dev->evbit); - - input_dev->getkeycode = ir_getkeycode; - input_dev->setkeycode = ir_setkeycode; -input_set_drvdata (input_dev, ir_dev); - rc =ir_register_class (input_dev);if (rc <0 ) - goto err; + goto out_table;return 0 ; -err: -kfree (rc_tab->scan); +out_table: +kfree (ir_dev->rc_tab.scan); +out_name: +kfree (ir_dev->driver_name); +out_dev:kfree (ir_dev);return rc; }
@@ -563,6 +420,7 @@ void ir_input_unregister(struct input_dev *dev)ir_unregister_class (dev); +kfree (ir_dev->driver_name);kfree (ir_dev); }EXPORT_SYMBOL_GPL (ir_input_unregister);
include/media/ir-core.h +3 -1
@@ -47,7 +47,9 @@ struct ir_scancode {struct ir_scancode_table {struct ir_scancode *scan; -int size; +unsigned int size;/* Max number of entries */ +unsigned int len;/* Used number of entries */ +unsigned int alloc;/* Size of *scan in bytes */ u64 ir_type;char *name;spinlock_t lock;
Signature · 1 line
1.6.6.1
PATCH 17/26 V4L/DVB: Convert drivers/media/dvb/ttpci/budget-ci.c to use ir-core
In reply to a message not in the archiveFrom: David Härdeman <[email protected]>
Converts drivers/media/dvb/ttpci/budget-ci.c to use ir-core rather than rolling its own keydown timeout handler and reporting keys via drivers/media/IR/ir-functions.c.
drivers/media/dvb/ttpci/budget-ci.c +3 -35
@@ -35,7 +35,7 @@#include <linux/interrupt.h> #include <linux/input.h> #include <linux/spinlock.h> -#include <media/ir-common.h> +#include <media/ir-core.h> #include "budget.h"
@@ -82,12 +82,6 @@#define SLOTSTATUS_READY 8#define SLOTSTATUS_OCCUPIED (SLOTSTATUS_PRESENT|SLOTSTATUS_RESET|SLOTSTATUS_READY) -/* -* Milliseconds during which a key is regarded as pressed. -* If an identical command arrives within this time, the timer will start over. -*/ -#define IR_KEYPRESS_TIMEOUT 250 -/* RC5 device wildcard */ #define IR_DEVICE_ANY 255
@@ -104,12 +98,9 @@ DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);struct budget_ci_ir {struct input_dev *dev;struct tasklet_struct msp430_irq_tasklet; -struct timer_list timer_keyup;char name[72 ];/* 40 + 32 for (struct saa7146_dev).name */ char phys[32 ]; -struct ir_input_state state;int rc5_device; -u32 last_raw;u32 ir_key;bool have_command; };
@@ -124,18 +115,11 @@ struct budget_ci {u8 tuner_pll_address;/* used for philips_tdm1316l configs */ }; -static void msp430_ir_keyup (unsigned long data) -{ -struct budget_ci_ir *ir = (struct budget_ci_ir *) data; -ir_input_nokey (ir->dev, &ir->state); -} -static void msp430_ir_interrupt (unsigned long data) {struct budget_ci *budget_ci = (struct budget_ci *) data;struct input_dev *dev = budget_ci->ir.dev;u32 command =ttpci_budget_debiread (&budget_ci->budget,DEBINOSWAP ,DEBIADDR_IR ,2 ,1 ,0 ) >>8 ; -u32 raw;/* * The msp430 chip can generate two different bytes, command and device
@@ -171,20 +155,12 @@ static void msp430_ir_interrupt(unsigned long data)return ; budget_ci->ir.have_command = false; +/* FIXME: We should generate complete scancodes with device info */ if (budget_ci->ir.rc5_device !=IR_DEVICE_ANY && budget_ci->ir.rc5_device != (command &0x1f ))return ; -/* Is this a repeated key sequence? (same device, command, toggle) */ - raw = budget_ci->ir.ir_key | (command <<8 ); -if (budget_ci->ir.last_raw != raw || !timer_pending (&budget_ci->ir.timer_keyup)) { -ir_input_nokey (dev, &budget_ci->ir.state); -ir_input_keydown (dev, &budget_ci->ir.state, - budget_ci->ir.ir_key); - budget_ci->ir.last_raw = raw; - } - -mod_timer (&budget_ci->ir.timer_keyup, jiffies +msecs_to_jiffies (IR_KEYPRESS_TIMEOUT )); +ir_keydown (dev, budget_ci->ir.ir_key, (command &0x20 ) ?1 :0 ); }static int msp430_ir_init (struct budget_ci *budget_ci)
@@ -251,11 +227,6 @@ static int msp430_ir_init(struct budget_ci *budget_ci)ir_input_init (input_dev, &budget_ci->ir.state,IR_TYPE_RC5 ); -/* initialise the key-up timeout handler */ -init_timer (&budget_ci->ir.timer_keyup); - budget_ci->ir.timer_keyup.function = msp430_ir_keyup; - budget_ci->ir.timer_keyup.data = (unsigned long ) &budget_ci->ir; - budget_ci->ir.last_raw =0xffff ;/* An impossible value */ error =ir_input_register (input_dev, ir_codes,NULL ,MODULE_NAME );if (error) {printk (KERN_ERR "budget_ci: could not init driver for IR device (code %d)\n" , error);
@@ -284,9 +255,6 @@ static void msp430_ir_deinit(struct budget_ci *budget_ci)saa7146_setgpio (saa,3 ,SAA7146_GPIO_INPUT );tasklet_kill (&budget_ci->ir.msp430_irq_tasklet); -del_timer_sync (&dev->timer); -ir_input_nokey (dev, &budget_ci->ir.state); -ir_input_unregister (dev); }
Signature · 1 line
1.6.6.1
PATCH 16/26 V4L/DVB: ir-core: improve keyup/keydown logic
In reply to a message not in the archiveFrom: David Härdeman <[email protected]>
Rewrites the keyup/keydown logic in drivers/media/IR/ir-keytable.c.
All knowledge of keystates etc is now internal to ir-keytable.c and not scattered around ir-raw-event.c and ir-nec-decoder.c (where it doesn't belong).
In addition, I've changed the API slightly so that ir_input_dev is passed as the first argument rather than input_dev. If we're ever going to support multiple keytables we need to move towards making ir_input_dev the main interface from a driver POV and obscure away the input_dev as an implementational detail in ir-core.
drivers/media/IR/ir-keytable.c +102 -25
@@ -20,6 +20,9 @@#define IR_TAB_MIN_SIZE 256#define IR_TAB_MAX_SIZE 8192 +/* FIXME: IR_KEYPRESS_TIMEOUT should be protocol specific */ +#define IR_KEYPRESS_TIMEOUT 250 +/** * ir_resize_table() - resizes a scancode table if necessary * @rc_tab: the ir_scancode_table to resize
@@ -262,56 +265,124 @@ EXPORT_SYMBOL_GPL(ir_g_keycode_from_table);/** * ir_keyup() - generates input event to cleanup a key press -* @input_dev: the struct input_dev descriptor of the device +* @ir: the struct ir_input_dev descriptor of the device * -* This routine is used by the input routines when a key is pressed at the -* IR. It reports a keyup input event via input_report_key(). +* This routine is used to signal that a key has been released on the +* remote control. It reports a keyup input event via input_report_key(). */ -void ir_keyup (struct input_dev *dev) +static void ir_keyup (struct ir_input_dev *ir) { -struct ir_input_dev *ir =input_get_drvdata (dev); -if (!ir->keypressed)return ; -IR_dprintk (1 ,"keyup key 0x%04x\n" , ir->keycode); -input_report_key (dev, ir->keycode,0 ); -input_sync (dev); - ir->keypressed =0 ; +IR_dprintk (1 ,"keyup key 0x%04x\n" , ir->last_keycode); +input_report_key (ir->input_dev, ir->last_keycode,0 ); +input_sync (ir->input_dev); + ir->keypressed = false; } -EXPORT_SYMBOL_GPL (ir_keyup); + +/** +* ir_timer_keyup() - generates a keyup event after a timeout +* @cookie: a pointer to struct ir_input_dev passed to setup_timer() +* +* This routine will generate a keyup event some time after a keydown event +* is generated when no further activity has been detected. +*/ +static void ir_timer_keyup (unsigned long cookie) +{ +struct ir_input_dev *ir = (struct ir_input_dev *)cookie; +unsigned long flags; + +/* +* ir->keyup_jiffies is used to prevent a race condition if a +* hardware interrupt occurs at this point and the keyup timer +* event is moved further into the future as a result. +* +* The timer will then be reactivated and this function called +* again in the future. We need to exit gracefully in that case +* to allow the input subsystem to do its auto-repeat magic or +* a keyup event might follow immediately after the keydown. +*/ +spin_lock_irqsave (&ir->keylock, flags); +if (time_is_after_eq_jiffies (ir->keyup_jiffies)) +ir_keyup (ir); +spin_unlock_irqrestore (&ir->keylock, flags); +} + +/** +* ir_repeat() - notifies the IR core that a key is still pressed +* @dev: the struct input_dev descriptor of the device +* +* This routine is used by IR decoders when a repeat message which does +* not include the necessary bits to reproduce the scancode has been +* received. +*/ +void ir_repeat (struct input_dev *dev) +{ +unsigned long flags; +struct ir_input_dev *ir =input_get_drvdata (dev); + +spin_lock_irqsave (&ir->keylock, flags); + +if (!ir->keypressed) + goto out; + + ir->keyup_jiffies = jiffies +msecs_to_jiffies (IR_KEYPRESS_TIMEOUT ); +mod_timer (&ir->timer_keyup, ir->keyup_jiffies); + +out: +spin_unlock_irqrestore (&ir->keylock, flags); +} +EXPORT_SYMBOL_GPL (ir_repeat);/** * ir_keydown() - generates input event for a key press -* @input_dev: the struct input_dev descriptor of the device -* @scancode: the scancode that we're seeking +* @dev: the struct input_dev descriptor of the device +* @scancode: the scancode that we're seeking +* @toggle: the toggle value (protocol dependent, if the protocol doesn't +* support toggle values, this should be set to zero) * * This routine is used by the input routines when a key is pressed at the * IR. It gets the keycode for a scancode and reports an input event via * input_report_key(). */ -void ir_keydown (struct input_dev *dev,int scancode) +void ir_keydown (struct input_dev *dev,int scancode,u8 toggle) { +unsigned long flags;struct ir_input_dev *ir =input_get_drvdata (dev);u32 keycode =ir_g_keycode_from_table (dev, scancode); -/* If already sent a keydown, do a keyup */ -if (ir->keypressed) -ir_keyup (dev); +spin_lock_irqsave (&ir->keylock, flags); -if (KEY_RESERVED == keycode) -return ; +/* Repeat event? */ +if (ir->keypressed && + ir->last_scancode == scancode && + ir->last_toggle == toggle) + goto set_timer; - ir->keycode = keycode; - ir->keypressed =1 ; +/* Release old keypress */ +ir_keyup (ir); + ir->last_scancode = scancode; + ir->last_toggle = toggle; + ir->last_keycode = keycode; + +if (keycode ==KEY_RESERVED ) + goto out; + +/* Register a keypress */ + ir->keypressed = true;IR_dprintk (1 ,"%s: key down event, key 0x%04x, scancode 0x%04x\n" , - dev->name, keycode, scancode); - -input_report_key (dev, ir->keycode,1 ); + dev->name, keycode, scancode); +input_report_key (dev, ir->last_keycode,1 );input_sync (dev); +set_timer: + ir->keyup_jiffies = jiffies +msecs_to_jiffies (IR_KEYPRESS_TIMEOUT ); +mod_timer (&ir->timer_keyup, ir->keyup_jiffies); +out: +spin_unlock_irqrestore (&ir->keylock, flags); }EXPORT_SYMBOL_GPL (ir_keydown);
@@ -364,8 +435,12 @@ int __ir_input_register(struct input_dev *input_dev, input_dev->getkeycode = ir_getkeycode; input_dev->setkeycode = ir_setkeycode;input_set_drvdata (input_dev, ir_dev); + ir_dev->input_dev = input_dev;spin_lock_init (&ir_dev->rc_tab.lock); +spin_lock_init (&ir_dev->keylock); +setup_timer (&ir_dev->timer_keyup, ir_timer_keyup, (unsigned long )ir_dev); + ir_dev->rc_tab.name = rc_tab->name; ir_dev->rc_tab.ir_type = rc_tab->ir_type; ir_dev->rc_tab.alloc = roundup_pow_of_two(rc_tab->size *
@@ -382,6 +457,8 @@ int __ir_input_register(struct input_dev *input_dev, ir_dev->rc_tab.size, ir_dev->rc_tab.alloc);set_bit (EV_KEY , input_dev->evbit); +set_bit (EV_REP , input_dev->evbit); +if (ir_setkeytable (input_dev, &ir_dev->rc_tab, rc_tab)) { rc = -ENOMEM ; goto out_table;
@@ -427,7 +504,7 @@ void ir_input_unregister(struct input_dev *dev)return ;IR_dprintk (1 ,"Freed keycode table\n" ); - +del_timer_sync (&ir_dev->timer_keyup); rc_tab = &ir_dev->rc_tab; rc_tab->size =0 ;kfree (rc_tab->scan);
drivers/media/IR/ir-nec-decoder.c +2 -5
@@ -180,8 +180,7 @@ static int __ir_nec_decode(struct input_dev *input_dev,if (is_repeat (evs, len, *pos)) { *pos +=2 ;if (ir->keypressed) { -mod_timer (&ir->raw->timer_keyup, - jiffies +msecs_to_jiffies (REPEAT_TIME )); +ir_repeat (input_dev);IR_dprintk (1 ,"NEC repeat event\n" );return 1 ; }else {
@@ -238,9 +237,7 @@ static int __ir_nec_decode(struct input_dev *input_dev, }IR_dprintk (1 ,"NEC scancode 0x%04x\n" , ircode); -ir_keydown (input_dev, ircode); -mod_timer (&ir->raw->timer_keyup, - jiffies +msecs_to_jiffies (REPEAT_TIME )); +ir_keydown (input_dev, ircode,0 );return 1 ; err:
drivers/media/IR/ir-raw-event.c +0 -14
@@ -53,13 +53,6 @@ static spinlock_t ir_raw_handler_lock;/* Used to load the decoders */ static struct work_struct wq_load; -static void ir_keyup_timer (unsigned long data) -{ -struct input_dev *input_dev = (struct input_dev *)data; - -ir_keyup (input_dev); -} -int ir_raw_event_register (struct input_dev *input_dev) {struct ir_input_dev *ir =input_get_drvdata (input_dev);
@@ -72,11 +65,6 @@ int ir_raw_event_register(struct input_dev *input_dev) size =sizeof (struct ir_raw_event ) *MAX_IR_EVENT_SIZE *2 ; size =roundup_pow_of_two (size); -init_timer (&ir->raw->timer_keyup); - ir->raw->timer_keyup.function = ir_keyup_timer; - ir->raw->timer_keyup.data = (unsigned long )input_dev; -set_bit (EV_REP , input_dev->evbit); - rc =kfifo_alloc (&ir->raw->kfifo, size,GFP_KERNEL );if (rc <0 ) {kfree (ir->raw);
@@ -103,8 +91,6 @@ void ir_raw_event_unregister(struct input_dev *input_dev)if (!ir->raw)return ; -del_timer_sync (&ir->raw->timer_keyup); -RUN_DECODER (raw_unregister, input_dev);kfifo_free (&ir->raw->kfifo);
include/media/ir-core.h +10 -5
@@ -76,7 +76,6 @@ struct ir_raw_event {struct ir_raw_event_ctrl {struct kfifo kfifo;/* fifo for the pulse/space events */ struct timespec last_event;/* when last event occurred */ -struct timer_list timer_keyup;/* timer for key release */ };struct ir_input_dev {
@@ -86,10 +85,16 @@ struct ir_input_dev {unsigned long devno;/* device number */ const struct ir_dev_props *props;/* Device properties */ struct ir_raw_event_ctrl *raw;/* for raw pulse/space events */ +struct input_dev *input_dev;/* the input device associated with this device */ /* key info - needed by IR keycode handlers */ -u32 keycode;/* linux key code */ -int keypressed;/* current state */ +spinlock_t keylock;/* protects the below members */ +bool keypressed;/* current state */ +unsigned long keyup_jiffies;/* when should the current keypress be released? */ +struct timer_list timer_keyup;/* timer for releasing a keypress */ +u32 last_keycode;/* keycode of last command */ +u32 last_scancode;/* scancode of last command */ +u8 last_toggle;/* toggle of last command */ };struct ir_raw_handler {
@@ -115,8 +120,8 @@ void rc_map_init(void);u32 ir_g_keycode_from_table (struct input_dev *input_dev,u32 scancode); -void ir_keyup (struct input_dev *dev); -void ir_keydown (struct input_dev *dev,int scancode); +void ir_repeat (struct input_dev *dev); +void ir_keydown (struct input_dev *dev,int scancode,u8 toggle);int __ir_input_register (struct input_dev *dev,const struct ir_scancode_table *ir_codes, const struct ir_dev_props *props
Signature · 2 lines
Cheers, Mauro
Re: [PATCH 08/26] V4L/DVB: Break Remote Controller keymaps into modules
In reply to Mauro Carvalho ChehabQuoted 11 lines · Mauro Carvalho Chehab
The original Remote Controller approach were very messy: a big file, that were part of ir-common kernel module, containing 64 different RC keymap tables, used by the V4L/DVB drivers.
Better to break each RC keymap table into a separate module, registering them into rc core on a process similar to the fs/nls tables.
As an userspace program is now in charge of loading those tables, adds an option to allow the complete removal of those tables from kernelspace.
Quoted 6 lines
Yet, on embedded devices like Set Top Boxes and TV sets, maybe the only available input device is the IR. So, we should keep allowing the usage of in-kernel tables, but a latter patch should change the default to 'n', after giving some time for distros to add the v4l-utils with the ir-keytable program, to allow the table load via userspace.
I know I'm probably late on commenting on this.
Although this is interesting, it seems like overkill.
1. How will this help move us to the "just works" case, if now userspace has to help the kernel. Every distro is likely just going to bundle a script which loads them all into the kernel and forgets about them.
2. How is a driver, which knows the bundled remote, supposed to convey to userspace "load this map by default for my IR receiver"? Is that covered in another portion of the patch?
3. If you're going to be so remote specific, why not add protocol information in these regarding the remotes? You can tell the core everything to expect from this remote: raw vs. hardware decoder and the RC-5/NEC/RC-6/JVC/whatever raw protocol decoder to use. That gets us closer to "just works" and avoids false input events from two of the raw deoders both thinking they got a valid code.
4. /sbin/lsmod is now going to give a very long listing with lots of noise. When these things are registered with the core, is the module's use count incremented when the core knows a driver is using one of them?
5. Each module is going to consume a page of vmalloc address space and ram, and an addtional page of vmalloc address as a gap behind it. These maps are rather small in comparison. Is it really worth all the page table entries to load all these as individual modules? Memory is cheap, and small allocations can fill in fragmentation gaps in the vmalloc address space, but page table entries are spent on better things.
I guess I'm not aware of what the return is here for the costs.
Regards,
Andy
Quoted 6,125 lines
Signed-off-by Mauro Carvalho Chehab <[email protected]>create mode 100644 drivers/media/IR/keymaps/Kconfig create mode 100644 drivers/media/IR/keymaps/Makefile create mode 100644 drivers/media/IR/keymaps/rc-adstech-dvb-t-pci.c create mode 100644 drivers/media/IR/keymaps/rc-apac-viewcomp.c create mode 100644 drivers/media/IR/keymaps/rc-asus-pc39.c create mode 100644 drivers/media/IR/keymaps/rc-ati-tv-wonder-hd-600.c create mode 100644 drivers/media/IR/keymaps/rc-avermedia-a16d.c create mode 100644 drivers/media/IR/keymaps/rc-avermedia-cardbus.c create mode 100644 drivers/media/IR/keymaps/rc-avermedia-dvbt.c create mode 100644 drivers/media/IR/keymaps/rc-avermedia-m135a-rm-jx.c create mode 100644 drivers/media/IR/keymaps/rc-avermedia.c create mode 100644 drivers/media/IR/keymaps/rc-avertv-303.c create mode 100644 drivers/media/IR/keymaps/rc-behold-columbus.c create mode 100644 drivers/media/IR/keymaps/rc-behold.c create mode 100644 drivers/media/IR/keymaps/rc-budget-ci-old.c create mode 100644 drivers/media/IR/keymaps/rc-cinergy-1400.c create mode 100644 drivers/media/IR/keymaps/rc-cinergy.c create mode 100644 drivers/media/IR/keymaps/rc-dm1105-nec.c create mode 100644 drivers/media/IR/keymaps/rc-dntv-live-dvb-t.c create mode 100644 drivers/media/IR/keymaps/rc-dntv-live-dvbt-pro.c create mode 100644 drivers/media/IR/keymaps/rc-em-terratec.c create mode 100644 drivers/media/IR/keymaps/rc-empty.c create mode 100644 drivers/media/IR/keymaps/rc-encore-enltv-fm53.c create mode 100644 drivers/media/IR/keymaps/rc-encore-enltv.c create mode 100644 drivers/media/IR/keymaps/rc-encore-enltv2.c create mode 100644 drivers/media/IR/keymaps/rc-evga-indtube.c create mode 100644 drivers/media/IR/keymaps/rc-eztv.c create mode 100644 drivers/media/IR/keymaps/rc-flydvb.c create mode 100644 drivers/media/IR/keymaps/rc-flyvideo.c create mode 100644 drivers/media/IR/keymaps/rc-fusionhdtv-mce.c create mode 100644 drivers/media/IR/keymaps/rc-gadmei-rm008z.c create mode 100644 drivers/media/IR/keymaps/rc-genius-tvgo-a11mce.c create mode 100644 drivers/media/IR/keymaps/rc-gotview7135.c create mode 100644 drivers/media/IR/keymaps/rc-hauppauge-new.c create mode 100644 drivers/media/IR/keymaps/rc-iodata-bctv7e.c create mode 100644 drivers/media/IR/keymaps/rc-kaiomy.c create mode 100644 drivers/media/IR/keymaps/rc-kworld-315u.c create mode 100644 drivers/media/IR/keymaps/rc-kworld-plus-tv-analog.c create mode 100644 drivers/media/IR/keymaps/rc-manli.c create mode 100644 drivers/media/IR/keymaps/rc-msi-tvanywhere-plus.c create mode 100644 drivers/media/IR/keymaps/rc-msi-tvanywhere.c create mode 100644 drivers/media/IR/keymaps/rc-nebula.c create mode 100644 drivers/media/IR/keymaps/rc-nec-terratec-cinergy-xs.c create mode 100644 drivers/media/IR/keymaps/rc-norwood.c create mode 100644 drivers/media/IR/keymaps/rc-npgtech.c create mode 100644 drivers/media/IR/keymaps/rc-pctv-sedna.c create mode 100644 drivers/media/IR/keymaps/rc-pinnacle-color.c create mode 100644 drivers/media/IR/keymaps/rc-pinnacle-grey.c create mode 100644 drivers/media/IR/keymaps/rc-pinnacle-pctv-hd.c create mode 100644 drivers/media/IR/keymaps/rc-pixelview-new.c create mode 100644 drivers/media/IR/keymaps/rc-pixelview.c create mode 100644 drivers/media/IR/keymaps/rc-powercolor-real-angel.c create mode 100644 drivers/media/IR/keymaps/rc-proteus-2309.c create mode 100644 drivers/media/IR/keymaps/rc-purpletv.c create mode 100644 drivers/media/IR/keymaps/rc-pv951.c create mode 100644 drivers/media/IR/keymaps/rc-rc5-hauppauge-new.c create mode 100644 drivers/media/IR/keymaps/rc-rc5-tv.c create mode 100644 drivers/media/IR/keymaps/rc-real-audio-220-32-keys.c create mode 100644 drivers/media/IR/keymaps/rc-tbs-nec.c create mode 100644 drivers/media/IR/keymaps/rc-terratec-cinergy-xs.c create mode 100644 drivers/media/IR/keymaps/rc-tevii-nec.c create mode 100644 drivers/media/IR/keymaps/rc-tt-1500.c create mode 100644 drivers/media/IR/keymaps/rc-videomate-s350.c create mode 100644 drivers/media/IR/keymaps/rc-videomate-tv-pvr.c create mode 100644 drivers/media/IR/keymaps/rc-winfast-usbii-deluxe.c create mode 100644 drivers/media/IR/keymaps/rc-winfast.cdrivers/media/IR/Kconfig +2
-0@@ -8,6 +8,8 @@ config VIDEO_IR depends on IR_CORE default IR_CORE +source "drivers/media/IR/keymaps/Kconfig" + config IR_NEC_DECODER tristate "Enable IR raw decoder for NEC protocol" depends on IR_COREdrivers/media/IR/keymaps/Kconfig new file +15
-0@@ -0,0 +1,15 @@ +config RC_MAP + tristate "Compile Remote Controller keymap modules" + depends on IR_CORE + default y + + ---help--- + This option enables the compilation of lots of Remote + Controller tables. They are short tables, but if you + don't use a remote controller, or prefer to load the + tables on userspace, you should disable it. + + The ir-keytable program, available at v4l-utils package + provide the tool and the same RC maps for load from + userspace. Its available at + http://git.linuxtv.org/v4l-utilsdrivers/media/IR/keymaps/Makefile new file +64
-0@@ -0,0 +1,64 @@ +obj-$(CONFIG_RC_MAP) += rc-adstech-dvb-t-pci.o \ + rc-apac-viewcomp.o \ + rc-asus-pc39.o \ + rc-ati-tv-wonder-hd-600.o \ + rc-avermedia-a16d.o \ + rc-avermedia.o \ + rc-avermedia-cardbus.o \ + rc-avermedia-dvbt.o \ + rc-avermedia-m135a-rm-jx.o \ + rc-avertv-303.o \ + rc-behold.o \ + rc-behold-columbus.o \ + rc-budget-ci-old.o \ + rc-cinergy-1400.o \ + rc-cinergy.o \ + rc-dm1105-nec.o \ + rc-dntv-live-dvb-t.o \ + rc-dntv-live-dvbt-pro.o \ + rc-empty.o \ + rc-em-terratec.o \ + rc-encore-enltv2.o \ + rc-encore-enltv.o \ + rc-encore-enltv-fm53.o \ + rc-evga-indtube.o \ + rc-eztv.o \ + rc-flydvb.o \ + rc-flyvideo.o \ + rc-fusionhdtv-mce.o \ + rc-gadmei-rm008z.o \ + rc-genius-tvgo-a11mce.o \ + rc-gotview7135.o \ + rc-hauppauge-new.o \ + rc-iodata-bctv7e.o \ + rc-kaiomy.o \ + rc-kworld-315u.o \ + rc-kworld-plus-tv-analog.o \ + rc-manli.o \ + rc-msi-tvanywhere.o \ + rc-msi-tvanywhere-plus.o \ + rc-nebula.o \ + rc-nec-terratec-cinergy-xs.o \ + rc-norwood.o \ + rc-npgtech.o \ + rc-pctv-sedna.o \ + rc-pinnacle-color.o \ + rc-pinnacle-grey.o \ + rc-pinnacle-pctv-hd.o \ + rc-pixelview.o \ + rc-pixelview-new.o \ + rc-powercolor-real-angel.o \ + rc-proteus-2309.o \ + rc-purpletv.o \ + rc-pv951.o \ + rc-rc5-hauppauge-new.o \ + rc-rc5-tv.o \ + rc-real-audio-220-32-keys.o \ + rc-tbs-nec.o \ + rc-terratec-cinergy-xs.o \ + rc-tevii-nec.o \ + rc-tt-1500.o \ + rc-videomate-s350.o \ + rc-videomate-tv-pvr.o \ + rc-winfast.o \ + rc-winfast-usbii-deluxe.odrivers/media/IR/keymaps/rc-adstech-dvb-t-pci.c new file +89
-0@@ -0,0 +1,89 @@ +/* adstech-dvb-t-pci.h - Keytable for adstech_dvb_t_pci Remote Controller +* +* keymap imported from ir-keymaps.c +* +* Copyright (c) 2010 by Mauro Carvalho Chehab <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +*/ + +#include <media/rc-map.h> + +/* ADS Tech Instant TV DVB-T PCI Remote */ + +static struct ir_scancode adstech_dvb_t_pci[] = { +/* Keys 0 to 9 */ + {0x4d ,KEY_0 }, + {0x57 ,KEY_1 }, + {0x4f ,KEY_2 }, + {0x53 ,KEY_3 }, + {0x56 ,KEY_4 }, + {0x4e ,KEY_5 }, + {0x5e ,KEY_6 }, + {0x54 ,KEY_7 }, + {0x4c ,KEY_8 }, + {0x5c ,KEY_9 }, + + {0x5b ,KEY_POWER }, + {0x5f ,KEY_MUTE }, + {0x55 ,KEY_GOTO }, + {0x5d ,KEY_SEARCH }, + {0x17 ,KEY_EPG },/* Guide */ + {0x1f ,KEY_MENU }, + {0x0f ,KEY_UP }, + {0x46 ,KEY_DOWN }, + {0x16 ,KEY_LEFT }, + {0x1e ,KEY_RIGHT }, + {0x0e ,KEY_SELECT },/* Enter */ + {0x5a ,KEY_INFO }, + {0x52 ,KEY_EXIT }, + {0x59 ,KEY_PREVIOUS }, + {0x51 ,KEY_NEXT }, + {0x58 ,KEY_REWIND }, + {0x50 ,KEY_FORWARD }, + {0x44 ,KEY_PLAYPAUSE }, + {0x07 ,KEY_STOP }, + {0x1b ,KEY_RECORD }, + {0x13 ,KEY_TUNER },/* Live */ + {0x0a ,KEY_A }, + {0x12 ,KEY_B }, + {0x03 ,KEY_PROG1 },/* 1 */ + {0x01 ,KEY_PROG2 },/* 2 */ + {0x00 ,KEY_PROG3 },/* 3 */ + {0x06 ,KEY_DVD }, + {0x48 ,KEY_AUX },/* Photo */ + {0x40 ,KEY_VIDEO }, + {0x19 ,KEY_AUDIO },/* Music */ + {0x0b ,KEY_CHANNELUP }, + {0x08 ,KEY_CHANNELDOWN }, + {0x15 ,KEY_VOLUMEUP }, + {0x1c ,KEY_VOLUMEDOWN }, +}; + +static struct rc_keymap adstech_dvb_t_pci_map = { + .map = { + .scan = adstech_dvb_t_pci, + .size =ARRAY_SIZE (adstech_dvb_t_pci), + .ir_type =IR_TYPE_UNKNOWN ,/* Legacy IR type */ + .name =RC_MAP_ADSTECH_DVB_T_PCI , + } +}; + +static int __init init_rc_map_adstech_dvb_t_pci (void ) +{ +return ir_register_map (&adstech_dvb_t_pci_map); +} + +static void __exit exit_rc_map_adstech_dvb_t_pci(void) +{ +ir_unregister_map (&adstech_dvb_t_pci_map); +} + +module_init(init_rc_map_adstech_dvb_t_pci) +module_exit(exit_rc_map_adstech_dvb_t_pci) + +MODULE_LICENSE("GPL"); +MODULE_AUTHOR ("Mauro Carvalho Chehab <[email protected]>" );drivers/media/IR/keymaps/rc-apac-viewcomp.c new file +80
-0@@ -0,0 +1,80 @@ +/* apac-viewcomp.h - Keytable for apac_viewcomp Remote Controller +* +* keymap imported from ir-keymaps.c +* +* Copyright (c) 2010 by Mauro Carvalho Chehab <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +*/ + +#include <media/rc-map.h> + +/* Attila Kondoros <[email protected]> */ + +static struct ir_scancode apac_viewcomp[] = { + + {0x01 ,KEY_1 }, + {0x02 ,KEY_2 }, + {0x03 ,KEY_3 }, + {0x04 ,KEY_4 }, + {0x05 ,KEY_5 }, + {0x06 ,KEY_6 }, + {0x07 ,KEY_7 }, + {0x08 ,KEY_8 }, + {0x09 ,KEY_9 }, + {0x00 ,KEY_0 }, + {0x17 ,KEY_LAST },/* +100 */ + {0x0a ,KEY_LIST },/* recall */ + + + {0x1c ,KEY_TUNER },/* TV/FM */ + {0x15 ,KEY_SEARCH },/* scan */ + {0x12 ,KEY_POWER },/* power */ + {0x1f ,KEY_VOLUMEDOWN },/* vol up */ + {0x1b ,KEY_VOLUMEUP },/* vol down */ + {0x1e ,KEY_CHANNELDOWN },/* chn up */ + {0x1a ,KEY_CHANNELUP },/* chn down */ + + {0x11 ,KEY_VIDEO },/* video */ + {0x0f ,KEY_ZOOM },/* full screen */ + {0x13 ,KEY_MUTE },/* mute/unmute */ + {0x10 ,KEY_TEXT },/* min */ + + {0x0d ,KEY_STOP },/* freeze */ + {0x0e ,KEY_RECORD },/* record */ + {0x1d ,KEY_PLAYPAUSE },/* stop */ + {0x19 ,KEY_PLAY },/* play */ + + {0x16 ,KEY_GOTO },/* osd */ + {0x14 ,KEY_REFRESH },/* default */ + {0x0c ,KEY_KPPLUS },/* fine tune >>>> */ + {0x18 ,KEY_KPMINUS },/* fine tune <<<< */ +}; + +static struct rc_keymap apac_viewcomp_map = { + .map = { + .scan = apac_viewcomp, + .size =ARRAY_SIZE (apac_viewcomp), + .ir_type =IR_TYPE_UNKNOWN ,/* Legacy IR type */ + .name =RC_MAP_APAC_VIEWCOMP , + } +}; + +static int __init init_rc_map_apac_viewcomp (void ) +{ +return ir_register_map (&apac_viewcomp_map); +} + +static void __exit exit_rc_map_apac_viewcomp(void) +{ +ir_unregister_map (&apac_viewcomp_map); +} + +module_init(init_rc_map_apac_viewcomp) +module_exit(exit_rc_map_apac_viewcomp) + +MODULE_LICENSE("GPL"); +MODULE_AUTHOR ("Mauro Carvalho Chehab <[email protected]>" );drivers/media/IR/keymaps/rc-asus-pc39.c new file +91
-0@@ -0,0 +1,91 @@ +/* asus-pc39.h - Keytable for asus_pc39 Remote Controller +* +* keymap imported from ir-keymaps.c +* +* Copyright (c) 2010 by Mauro Carvalho Chehab <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +*/ + +#include <media/rc-map.h> + +/* +* Marc Fargas <[email protected]> +* this is the remote control that comes with the asus p7131 +* which has a label saying is "Model PC-39" +*/ + +static struct ir_scancode asus_pc39[] = { +/* Keys 0 to 9 */ + {0x15 ,KEY_0 }, + {0x29 ,KEY_1 }, + {0x2d ,KEY_2 }, + {0x2b ,KEY_3 }, + {0x09 ,KEY_4 }, + {0x0d ,KEY_5 }, + {0x0b ,KEY_6 }, + {0x31 ,KEY_7 }, + {0x35 ,KEY_8 }, + {0x33 ,KEY_9 }, + + {0x3e ,KEY_RADIO },/* radio */ + {0x03 ,KEY_MENU },/* dvd/menu */ + {0x2a ,KEY_VOLUMEUP }, + {0x19 ,KEY_VOLUMEDOWN }, + {0x37 ,KEY_UP }, + {0x3b ,KEY_DOWN }, + {0x27 ,KEY_LEFT }, + {0x2f ,KEY_RIGHT }, + {0x25 ,KEY_VIDEO },/* video */ + {0x39 ,KEY_AUDIO },/* music */ + + {0x21 ,KEY_TV },/* tv */ + {0x1d ,KEY_EXIT },/* back */ + {0x0a ,KEY_CHANNELUP },/* channel / program + */ + {0x1b ,KEY_CHANNELDOWN },/* channel / program - */ + {0x1a ,KEY_ENTER },/* enter */ + + {0x06 ,KEY_PAUSE },/* play/pause */ + {0x1e ,KEY_PREVIOUS },/* rew */ + {0x26 ,KEY_NEXT },/* forward */ + {0x0e ,KEY_REWIND },/* backward << */ + {0x3a ,KEY_FASTFORWARD },/* forward >> */ + {0x36 ,KEY_STOP }, + {0x2e ,KEY_RECORD },/* recording */ + {0x16 ,KEY_POWER },/* the button that reads "close" */ + + {0x11 ,KEY_ZOOM },/* full screen */ + {0x13 ,KEY_MACRO },/* recall */ + {0x23 ,KEY_HOME },/* home */ + {0x05 ,KEY_PVR },/* picture */ + {0x3d ,KEY_MUTE },/* mute */ + {0x01 ,KEY_DVD },/* dvd */ +}; + +static struct rc_keymap asus_pc39_map = { + .map = { + .scan = asus_pc39, + .size =ARRAY_SIZE (asus_pc39), + .ir_type =IR_TYPE_UNKNOWN ,/* Legacy IR type */ + .name =RC_MAP_ASUS_PC39 , + } +}; + +static int __init init_rc_map_asus_pc39 (void ) +{ +return ir_register_map (&asus_pc39_map); +} + +static void __exit exit_rc_map_asus_pc39(void) +{ +ir_unregister_map (&asus_pc39_map); +} + +module_init(init_rc_map_asus_pc39) +module_exit(exit_rc_map_asus_pc39) + +MODULE_LICENSE("GPL"); +MODULE_AUTHOR ("Mauro Carvalho Chehab <[email protected]>" );drivers/media/IR/keymaps/rc-ati-tv-wonder-hd-600.c new file +69
-0@@ -0,0 +1,69 @@ +/* ati-tv-wonder-hd-600.h - Keytable for ati_tv_wonder_hd_600 Remote Controller +* +* keymap imported from ir-keymaps.c +* +* Copyright (c) 2010 by Mauro Carvalho Chehab <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +*/ + +#include <media/rc-map.h> + +/* ATI TV Wonder HD 600 USB +Devin Heitmueller <[email protected]> +*/ + +static struct ir_scancode ati_tv_wonder_hd_600[] = { + {0x00 ,KEY_RECORD },/* Row 1 */ + {0x01 ,KEY_PLAYPAUSE }, + {0x02 ,KEY_STOP }, + {0x03 ,KEY_POWER }, + {0x04 ,KEY_PREVIOUS },/* Row 2 */ + {0x05 ,KEY_REWIND }, + {0x06 ,KEY_FORWARD }, + {0x07 ,KEY_NEXT }, + {0x08 ,KEY_EPG },/* Row 3 */ + {0x09 ,KEY_HOME }, + {0x0a ,KEY_MENU }, + {0x0b ,KEY_CHANNELUP }, + {0x0c ,KEY_BACK },/* Row 4 */ + {0x0d ,KEY_UP }, + {0x0e ,KEY_INFO }, + {0x0f ,KEY_CHANNELDOWN }, + {0x10 ,KEY_LEFT },/* Row 5 */ + {0x11 ,KEY_SELECT }, + {0x12 ,KEY_RIGHT }, + {0x13 ,KEY_VOLUMEUP }, + {0x14 ,KEY_LAST },/* Row 6 */ + {0x15 ,KEY_DOWN }, + {0x16 ,KEY_MUTE }, + {0x17 ,KEY_VOLUMEDOWN }, +}; + +static struct rc_keymap ati_tv_wonder_hd_600_map = { + .map = { + .scan = ati_tv_wonder_hd_600, + .size =ARRAY_SIZE (ati_tv_wonder_hd_600), + .ir_type =IR_TYPE_UNKNOWN ,/* Legacy IR type */ + .name =RC_MAP_ATI_TV_WONDER_HD_600 , + } +}; + +static int __init init_rc_map_ati_tv_wonder_hd_600 (void ) +{ +return ir_register_map (&ati_tv_wonder_hd_600_map); +} + +static void __exit exit_rc_map_ati_tv_wonder_hd_600(void) +{ +ir_unregister_map (&ati_tv_wonder_hd_600_map); +} + +module_init(init_rc_map_ati_tv_wonder_hd_600) +module_exit(exit_rc_map_ati_tv_wonder_hd_600) + +MODULE_LICENSE("GPL"); +MODULE_AUTHOR ("Mauro Carvalho Chehab <[email protected]>" );drivers/media/IR/keymaps/rc-avermedia-a16d.c new file +75
-0@@ -0,0 +1,75 @@ +/* avermedia-a16d.h - Keytable for avermedia_a16d Remote Controller +* +* keymap imported from ir-keymaps.c +* +* Copyright (c) 2010 by Mauro Carvalho Chehab <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +*/ + +#include <media/rc-map.h> + +static struct ir_scancode avermedia_a16d[] = { + {0x20 ,KEY_LIST }, + {0x00 ,KEY_POWER }, + {0x28 ,KEY_1 }, + {0x18 ,KEY_2 }, + {0x38 ,KEY_3 }, + {0x24 ,KEY_4 }, + {0x14 ,KEY_5 }, + {0x34 ,KEY_6 }, + {0x2c ,KEY_7 }, + {0x1c ,KEY_8 }, + {0x3c ,KEY_9 }, + {0x12 ,KEY_SUBTITLE }, + {0x22 ,KEY_0 }, + {0x32 ,KEY_REWIND }, + {0x3a ,KEY_SHUFFLE }, + {0x02 ,KEY_PRINT }, + {0x11 ,KEY_CHANNELDOWN }, + {0x31 ,KEY_CHANNELUP }, + {0x0c ,KEY_ZOOM }, + {0x1e ,KEY_VOLUMEDOWN }, + {0x3e ,KEY_VOLUMEUP }, + {0x0a ,KEY_MUTE }, + {0x04 ,KEY_AUDIO }, + {0x26 ,KEY_RECORD }, + {0x06 ,KEY_PLAY }, + {0x36 ,KEY_STOP }, + {0x16 ,KEY_PAUSE }, + {0x2e ,KEY_REWIND }, + {0x0e ,KEY_FASTFORWARD }, + {0x30 ,KEY_TEXT }, + {0x21 ,KEY_GREEN }, + {0x01 ,KEY_BLUE }, + {0x08 ,KEY_EPG }, + {0x2a ,KEY_MENU }, +}; + +static struct rc_keymap avermedia_a16d_map = { + .map = { + .scan = avermedia_a16d, + .size =ARRAY_SIZE (avermedia_a16d), + .ir_type =IR_TYPE_UNKNOWN ,/* Legacy IR type */ + .name =RC_MAP_AVERMEDIA_A16D , + } +}; + +static int __init init_rc_map_avermedia_a16d (void ) +{ +return ir_register_map (&avermedia_a16d_map); +} + +static void __exit exit_rc_map_avermedia_a16d(void) +{ +ir_unregister_map (&avermedia_a16d_map); +} + +module_init(init_rc_map_avermedia_a16d) +module_exit(exit_rc_map_avermedia_a16d) + +MODULE_LICENSE("GPL"); +MODULE_AUTHOR ("Mauro Carvalho Chehab <[email protected]>" );drivers/media/IR/keymaps/rc-avermedia-cardbus.c new file +97
-0@@ -0,0 +1,97 @@ +/* avermedia-cardbus.h - Keytable for avermedia_cardbus Remote Controller +* +* keymap imported from ir-keymaps.c +* +* Copyright (c) 2010 by Mauro Carvalho Chehab <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +*/ + +#include <media/rc-map.h> + +/* Oldrich Jedlicka <[email protected]> */ + +static struct ir_scancode avermedia_cardbus[] = { + {0x00 ,KEY_POWER }, + {0x01 ,KEY_TUNER },/* TV/FM */ + {0x03 ,KEY_TEXT },/* Teletext */ + {0x04 ,KEY_EPG }, + {0x05 ,KEY_1 }, + {0x06 ,KEY_2 }, + {0x07 ,KEY_3 }, + {0x08 ,KEY_AUDIO }, + {0x09 ,KEY_4 }, + {0x0a ,KEY_5 }, + {0x0b ,KEY_6 }, + {0x0c ,KEY_ZOOM },/* Full screen */ + {0x0d ,KEY_7 }, + {0x0e ,KEY_8 }, + {0x0f ,KEY_9 }, + {0x10 ,KEY_PAGEUP },/* 16-CH PREV */ + {0x11 ,KEY_0 }, + {0x12 ,KEY_INFO }, + {0x13 ,KEY_AGAIN },/* CH RTN - channel return */ + {0x14 ,KEY_MUTE }, + {0x15 ,KEY_EDIT },/* Autoscan */ + {0x17 ,KEY_SAVE },/* Screenshot */ + {0x18 ,KEY_PLAYPAUSE }, + {0x19 ,KEY_RECORD }, + {0x1a ,KEY_PLAY }, + {0x1b ,KEY_STOP }, + {0x1c ,KEY_FASTFORWARD }, + {0x1d ,KEY_REWIND }, + {0x1e ,KEY_VOLUMEDOWN }, + {0x1f ,KEY_VOLUMEUP }, + {0x22 ,KEY_SLEEP },/* Sleep */ + {0x23 ,KEY_ZOOM },/* Aspect */ + {0x26 ,KEY_SCREEN },/* Pos */ + {0x27 ,KEY_ANGLE },/* Size */ + {0x28 ,KEY_SELECT },/* Select */ + {0x29 ,KEY_BLUE },/* Blue/Picture */ + {0x2a ,KEY_BACKSPACE },/* Back */ + {0x2b ,KEY_MEDIA },/* PIP (Picture-in-picture) */ + {0x2c ,KEY_DOWN }, + {0x2e ,KEY_DOT }, + {0x2f ,KEY_TV },/* Live TV */ + {0x32 ,KEY_LEFT }, + {0x33 ,KEY_CLEAR },/* Clear */ + {0x35 ,KEY_RED },/* Red/TV */ + {0x36 ,KEY_UP }, + {0x37 ,KEY_HOME },/* Home */ + {0x39 ,KEY_GREEN },/* Green/Video */ + {0x3d ,KEY_YELLOW },/* Yellow/Music */ + {0x3e ,KEY_OK },/* Ok */ + {0x3f ,KEY_RIGHT }, + {0x40 ,KEY_NEXT },/* Next */ + {0x41 ,KEY_PREVIOUS },/* Previous */ + {0x42 ,KEY_CHANNELDOWN },/* Channel down */ + {0x43 ,KEY_CHANNELUP },/* Channel up */ +}; + +static struct rc_keymap avermedia_cardbus_map = { + .map = { + .scan = avermedia_cardbus, + .size =ARRAY_SIZE (avermedia_cardbus), + .ir_type =IR_TYPE_UNKNOWN ,/* Legacy IR type */ + .name =RC_MAP_AVERMEDIA_CARDBUS , + } +}; + +static int __init init_rc_map_avermedia_cardbus (void ) +{ +return ir_register_map (&avermedia_cardbus_map); +} + +static void __exit exit_rc_map_avermedia_cardbus(void) +{ +ir_unregister_map (&avermedia_cardbus_map); +} + +module_init(init_rc_map_avermedia_cardbus) +module_exit(exit_rc_map_avermedia_cardbus) + +MODULE_LICENSE("GPL"); +MODULE_AUTHOR ("Mauro Carvalho Chehab <[email protected]>" );drivers/media/IR/keymaps/rc-avermedia-dvbt.c new file +78
-0@@ -0,0 +1,78 @@ +/* avermedia-dvbt.h - Keytable for avermedia_dvbt Remote Controller +* +* keymap imported from ir-keymaps.c +* +* Copyright (c) 2010 by Mauro Carvalho Chehab <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +*/ + +#include <media/rc-map.h> + +/* Matt Jesson <[email protected] */ + +static struct ir_scancode avermedia_dvbt[] = { + {0x28 ,KEY_0 },/* '0' / 'enter' */ + {0x22 ,KEY_1 },/* '1' */ + {0x12 ,KEY_2 },/* '2' / 'up arrow' */ + {0x32 ,KEY_3 },/* '3' */ + {0x24 ,KEY_4 },/* '4' / 'left arrow' */ + {0x14 ,KEY_5 },/* '5' */ + {0x34 ,KEY_6 },/* '6' / 'right arrow' */ + {0x26 ,KEY_7 },/* '7' */ + {0x16 ,KEY_8 },/* '8' / 'down arrow' */ + {0x36 ,KEY_9 },/* '9' */ + + {0x20 ,KEY_LIST },/* 'source' */ + {0x10 ,KEY_TEXT },/* 'teletext' */ + {0x00 ,KEY_POWER },/* 'power' */ + {0x04 ,KEY_AUDIO },/* 'audio' */ + {0x06 ,KEY_ZOOM },/* 'full screen' */ + {0x18 ,KEY_VIDEO },/* 'display' */ + {0x38 ,KEY_SEARCH },/* 'loop' */ + {0x08 ,KEY_INFO },/* 'preview' */ + {0x2a ,KEY_REWIND },/* 'backward <<' */ + {0x1a ,KEY_FASTFORWARD },/* 'forward >>' */ + {0x3a ,KEY_RECORD },/* 'capture' */ + {0x0a ,KEY_MUTE },/* 'mute' */ + {0x2c ,KEY_RECORD },/* 'record' */ + {0x1c ,KEY_PAUSE },/* 'pause' */ + {0x3c ,KEY_STOP },/* 'stop' */ + {0x0c ,KEY_PLAY },/* 'play' */ + {0x2e ,KEY_RED },/* 'red' */ + {0x01 ,KEY_BLUE },/* 'blue' / 'cancel' */ + {0x0e ,KEY_YELLOW },/* 'yellow' / 'ok' */ + {0x21 ,KEY_GREEN },/* 'green' */ + {0x11 ,KEY_CHANNELDOWN },/* 'channel -' */ + {0x31 ,KEY_CHANNELUP },/* 'channel +' */ + {0x1e ,KEY_VOLUMEDOWN },/* 'volume -' */ + {0x3e ,KEY_VOLUMEUP },/* 'volume +' */ +}; + +static struct rc_keymap avermedia_dvbt_map = { + .map = { + .scan = avermedia_dvbt, + .size =ARRAY_SIZE (avermedia_dvbt), + .ir_type =IR_TYPE_UNKNOWN ,/* Legacy IR type */ + .name =RC_MAP_AVERMEDIA_DVBT , + } +}; + +static int __init init_rc_map_avermedia_dvbt (void ) +{ +return ir_register_map (&avermedia_dvbt_map); +} + +static void __exit exit_rc_map_avermedia_dvbt(void) +{ +ir_unregister_map (&avermedia_dvbt_map); +} + +module_init(init_rc_map_avermedia_dvbt) +module_exit(exit_rc_map_avermedia_dvbt) + +MODULE_LICENSE("GPL"); +MODULE_AUTHOR ("Mauro Carvalho Chehab <[email protected]>" );drivers/media/IR/keymaps/rc-avermedia-m135a-rm-jx.c new file +90
-0@@ -0,0 +1,90 @@ +/* avermedia-m135a-rm-jx.h - Keytable for avermedia_m135a_rm_jx Remote Controller +* +* keymap imported from ir-keymaps.c +* +* Copyright (c) 2010 by Mauro Carvalho Chehab <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +*/ + +#include <media/rc-map.h> + +/* +* Avermedia M135A with IR model RM-JX +* The same codes exist on both Positivo (BR) and original IR +* Mauro Carvalho Chehab <[email protected]> +*/ + +static struct ir_scancode avermedia_m135a_rm_jx[] = { + {0x0200 ,KEY_POWER2 }, + {0x022e ,KEY_DOT },/* '.' */ + {0x0201 ,KEY_MODE },/* TV/FM or SOURCE */ + + {0x0205 ,KEY_1 }, + {0x0206 ,KEY_2 }, + {0x0207 ,KEY_3 }, + {0x0209 ,KEY_4 }, + {0x020a ,KEY_5 }, + {0x020b ,KEY_6 }, + {0x020d ,KEY_7 }, + {0x020e ,KEY_8 }, + {0x020f ,KEY_9 }, + {0x0211 ,KEY_0 }, + + {0x0213 ,KEY_RIGHT },/* -> or L */ + {0x0212 ,KEY_LEFT },/* <- or R */ + + {0x0217 ,KEY_SLEEP },/* Capturar Imagem or Snapshot */ + {0x0210 ,KEY_SHUFFLE },/* Amostra or 16 chan prev */ + + {0x0303 ,KEY_CHANNELUP }, + {0x0302 ,KEY_CHANNELDOWN }, + {0x021f ,KEY_VOLUMEUP }, + {0x021e ,KEY_VOLUMEDOWN }, + {0x020c ,KEY_ENTER },/* Full Screen */ + + {0x0214 ,KEY_MUTE }, + {0x0208 ,KEY_AUDIO }, + + {0x0203 ,KEY_TEXT },/* Teletext */ + {0x0204 ,KEY_EPG }, + {0x022b ,KEY_TV2 },/* TV2 or PIP */ + + {0x021d ,KEY_RED }, + {0x021c ,KEY_YELLOW }, + {0x0301 ,KEY_GREEN }, + {0x0300 ,KEY_BLUE }, + + {0x021a ,KEY_PLAYPAUSE }, + {0x0219 ,KEY_RECORD }, + {0x0218 ,KEY_PLAY }, + {0x021b ,KEY_STOP }, +}; + +static struct rc_keymap avermedia_m135a_rm_jx_map = { + .map = { + .scan = avermedia_m135a_rm_jx, + .size =ARRAY_SIZE (avermedia_m135a_rm_jx), + .ir_type =IR_TYPE_NEC , + .name =RC_MAP_AVERMEDIA_M135A_RM_JX , + } +}; + +static int __init init_rc_map_avermedia_m135a_rm_jx (void ) +{ +return ir_register_map (&avermedia_m135a_rm_jx_map); +} + +static void __exit exit_rc_map_avermedia_m135a_rm_jx(void) +{ +ir_unregister_map (&avermedia_m135a_rm_jx_map); +} + +module_init(init_rc_map_avermedia_m135a_rm_jx) +module_exit(exit_rc_map_avermedia_m135a_rm_jx) + +MODULE_LICENSE("GPL"); +MODULE_AUTHOR ("Mauro Carvalho Chehab <[email protected]>" );drivers/media/IR/keymaps/rc-avermedia.c new file +86
-0@@ -0,0 +1,86 @@ +/* avermedia.h - Keytable for avermedia Remote Controller +* +* keymap imported from ir-keymaps.c +* +* Copyright (c) 2010 by Mauro Carvalho Chehab <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +*/ + +#include <media/rc-map.h> + +/* Alex Hermann <[email protected]> */ + +static struct ir_scancode avermedia[] = { + {0x28 ,KEY_1 }, + {0x18 ,KEY_2 }, + {0x38 ,KEY_3 }, + {0x24 ,KEY_4 }, + {0x14 ,KEY_5 }, + {0x34 ,KEY_6 }, + {0x2c ,KEY_7 }, + {0x1c ,KEY_8 }, + {0x3c ,KEY_9 }, + {0x22 ,KEY_0 }, + + {0x20 ,KEY_TV },/* TV/FM */ + {0x10 ,KEY_CD },/* CD */ + {0x30 ,KEY_TEXT },/* TELETEXT */ + {0x00 ,KEY_POWER },/* POWER */ + + {0x08 ,KEY_VIDEO },/* VIDEO */ + {0x04 ,KEY_AUDIO },/* AUDIO */ + {0x0c ,KEY_ZOOM },/* FULL SCREEN */ + + {0x12 ,KEY_SUBTITLE },/* DISPLAY */ + {0x32 ,KEY_REWIND },/* LOOP */ + {0x02 ,KEY_PRINT },/* PREVIEW */ + + {0x2a ,KEY_SEARCH },/* AUTOSCAN */ + {0x1a ,KEY_SLEEP },/* FREEZE */ + {0x3a ,KEY_CAMERA },/* SNAPSHOT */ + {0x0a ,KEY_MUTE },/* MUTE */ + + {0x26 ,KEY_RECORD },/* RECORD */ + {0x16 ,KEY_PAUSE },/* PAUSE */ + {0x36 ,KEY_STOP },/* STOP */ + {0x06 ,KEY_PLAY },/* PLAY */ + + {0x2e ,KEY_RED },/* RED */ + {0x21 ,KEY_GREEN },/* GREEN */ + {0x0e ,KEY_YELLOW },/* YELLOW */ + {0x01 ,KEY_BLUE },/* BLUE */ + + {0x1e ,KEY_VOLUMEDOWN },/* VOLUME- */ + {0x3e ,KEY_VOLUMEUP },/* VOLUME+ */ + {0x11 ,KEY_CHANNELDOWN },/* CHANNEL/PAGE- */ + {0x31 ,KEY_CHANNELUP }/* CHANNEL/PAGE+ */ +}; + +static struct rc_keymap avermedia_map = { + .map = { + .scan = avermedia, + .size =ARRAY_SIZE (avermedia), + .ir_type =IR_TYPE_UNKNOWN ,/* Legacy IR type */ + .name =RC_MAP_AVERMEDIA , + } +}; + +static int __init init_rc_map_avermedia (void ) +{ +return ir_register_map (&avermedia_map); +} + +static void __exit exit_rc_map_avermedia(void) +{ +ir_unregister_map (&avermedia_map); +} + +module_init(init_rc_map_avermedia) +module_exit(exit_rc_map_avermedia) + +MODULE_LICENSE("GPL"); +MODULE_AUTHOR ("Mauro Carvalho Chehab <[email protected]>" );drivers/media/IR/keymaps/rc-avertv-303.c new file +85
-0@@ -0,0 +1,85 @@ +/* avertv-303.h - Keytable for avertv_303 Remote Controller +* +* keymap imported from ir-keymaps.c +* +* Copyright (c) 2010 by Mauro Carvalho Chehab <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +*/ + +#include <media/rc-map.h> + +/* AVERTV STUDIO 303 Remote */ + +static struct ir_scancode avertv_303[] = { + {0x2a ,KEY_1 }, + {0x32 ,KEY_2 }, + {0x3a ,KEY_3 }, + {0x4a ,KEY_4 }, + {0x52 ,KEY_5 }, + {0x5a ,KEY_6 }, + {0x6a ,KEY_7 }, + {0x72 ,KEY_8 }, + {0x7a ,KEY_9 }, + {0x0e ,KEY_0 }, + + {0x02 ,KEY_POWER }, + {0x22 ,KEY_VIDEO }, + {0x42 ,KEY_AUDIO }, + {0x62 ,KEY_ZOOM }, + {0x0a ,KEY_TV }, + {0x12 ,KEY_CD }, + {0x1a ,KEY_TEXT }, + + {0x16 ,KEY_SUBTITLE }, + {0x1e ,KEY_REWIND }, + {0x06 ,KEY_PRINT }, + + {0x2e ,KEY_SEARCH }, + {0x36 ,KEY_SLEEP }, + {0x3e ,KEY_SHUFFLE }, + {0x26 ,KEY_MUTE }, + + {0x4e ,KEY_RECORD }, + {0x56 ,KEY_PAUSE }, + {0x5e ,KEY_STOP }, + {0x46 ,KEY_PLAY }, + + {0x6e ,KEY_RED }, + {0x0b ,KEY_GREEN }, + {0x66 ,KEY_YELLOW }, + {0x03 ,KEY_BLUE }, + + {0x76 ,KEY_LEFT }, + {0x7e ,KEY_RIGHT }, + {0x13 ,KEY_DOWN }, + {0x1b ,KEY_UP }, +}; + +static struct rc_keymap avertv_303_map = { + .map = { + .scan = avertv_303, + .size =ARRAY_SIZE (avertv_303), + .ir_type =IR_TYPE_UNKNOWN ,/* Legacy IR type */ + .name =RC_MAP_AVERTV_303 , + } +}; + +static int __init init_rc_map_avertv_303 (void ) +{ +return ir_register_map (&avertv_303_map); +} + +static void __exit exit_rc_map_avertv_303(void) +{ +ir_unregister_map (&avertv_303_map); +} + +module_init(init_rc_map_avertv_303) +module_exit(exit_rc_map_avertv_303) + +MODULE_LICENSE("GPL"); +MODULE_AUTHOR ("Mauro Carvalho Chehab <[email protected]>" );drivers/media/IR/keymaps/rc-behold-columbus.c new file +108
-0@@ -0,0 +1,108 @@ +/* behold-columbus.h - Keytable for behold_columbus Remote Controller +* +* keymap imported from ir-keymaps.c +* +* Copyright (c) 2010 by Mauro Carvalho Chehab <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +*/ + +#include <media/rc-map.h> + +/* Beholder Intl. Ltd. 2008 +* Dmitry Belimov [email protected] +* Keytable is used by BeholdTV Columbus +* The "ascii-art picture" below (in comments, first row +* is the keycode in hex, and subsequent row(s) shows +* the button labels (several variants when appropriate) +* helps to descide which keycodes to assign to the buttons. +*/ + +static struct ir_scancode behold_columbus[] = { + +/* 0x13 0x11 0x1C 0x12 * +* Mute Source TV/FM Power * +* */ + + {0x13 ,KEY_MUTE }, + {0x11 ,KEY_PROPS }, + {0x1C ,KEY_TUNER },/* KEY_TV/KEY_RADIO */ + {0x12 ,KEY_POWER }, + +/* 0x01 0x02 0x03 0x0D * +* 1 2 3 Stereo * +* * +* 0x04 0x05 0x06 0x19 * +* 4 5 6 Snapshot * +* * +* 0x07 0x08 0x09 0x10 * +* 7 8 9 Zoom * +* */ + {0x01 ,KEY_1 }, + {0x02 ,KEY_2 }, + {0x03 ,KEY_3 }, + {0x0D ,KEY_SETUP },/* Setup key */ + {0x04 ,KEY_4 }, + {0x05 ,KEY_5 }, + {0x06 ,KEY_6 }, + {0x19 ,KEY_CAMERA },/* Snapshot key */ + {0x07 ,KEY_7 }, + {0x08 ,KEY_8 }, + {0x09 ,KEY_9 }, + {0x10 ,KEY_ZOOM }, + +/* 0x0A 0x00 0x0B 0x0C * +* RECALL 0 ChannelUp VolumeUp * +* */ + {0x0A ,KEY_AGAIN }, + {0x00 ,KEY_0 }, + {0x0B ,KEY_CHANNELUP }, + {0x0C ,KEY_VOLUMEUP }, + +/* 0x1B 0x1D 0x15 0x18 * +* Timeshift Record ChannelDown VolumeDown * +* */ + + {0x1B ,KEY_TIME }, + {0x1D ,KEY_RECORD }, + {0x15 ,KEY_CHANNELDOWN }, + {0x18 ,KEY_VOLUMEDOWN }, + +/* 0x0E 0x1E 0x0F 0x1A * +* Stop Pause Previouse Next * +* */ + + {0x0E ,KEY_STOP }, + {0x1E ,KEY_PAUSE }, + {0x0F ,KEY_PREVIOUS }, + {0x1A ,KEY_NEXT }, + +}; + +static struct rc_keymap behold_columbus_map = { + .map = { + .scan = behold_columbus, + .size =ARRAY_SIZE (behold_columbus), + .ir_type =IR_TYPE_UNKNOWN ,/* Legacy IR type */ + .name =RC_MAP_BEHOLD_COLUMBUS , + } +}; + +static int __init init_rc_map_behold_columbus (void ) +{ +return ir_register_map (&behold_columbus_map); +} + +static void __exit exit_rc_map_behold_columbus(void) +{ +ir_unregister_map (&behold_columbus_map); +} + +module_init(init_rc_map_behold_columbus) +module_exit(exit_rc_map_behold_columbus) + +MODULE_LICENSE("GPL"); +MODULE_AUTHOR ("Mauro Carvalho Chehab <[email protected]>" );drivers/media/IR/keymaps/rc-behold.c new file +141
-0@@ -0,0 +1,141 @@ +/* behold.h - Keytable for behold Remote Controller +* +* keymap imported from ir-keymaps.c +* +* Copyright (c) 2010 by Mauro Carvalho Chehab <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +*/ + +#include <media/rc-map.h> + +/* +* Igor Kuznetsov <[email protected]> +* Andrey J. Melnikov <[email protected]> +* +* Keytable is used by BeholdTV 60x series, M6 series at +* least, and probably other cards too. +* The "ascii-art picture" below (in comments, first row +* is the keycode in hex, and subsequent row(s) shows +* the button labels (several variants when appropriate) +* helps to descide which keycodes to assign to the buttons. +*/ + +static struct ir_scancode behold[] = { + +/* 0x1c 0x12 * +* TV/FM POWER * +* */ + {0x1c ,KEY_TUNER },/* XXX KEY_TV / KEY_RADIO */ + {0x12 ,KEY_POWER }, + +/* 0x01 0x02 0x03 * +* 1 2 3 * +* * +* 0x04 0x05 0x06 * +* 4 5 6 * +* * +* 0x07 0x08 0x09 * +* 7 8 9 * +* */ + {0x01 ,KEY_1 }, + {0x02 ,KEY_2 }, + {0x03 ,KEY_3 }, + {0x04 ,KEY_4 }, + {0x05 ,KEY_5 }, + {0x06 ,KEY_6 }, + {0x07 ,KEY_7 }, + {0x08 ,KEY_8 }, + {0x09 ,KEY_9 }, + +/* 0x0a 0x00 0x17 * +* RECALL 0 MODE * +* */ + {0x0a ,KEY_AGAIN }, + {0x00 ,KEY_0 }, + {0x17 ,KEY_MODE }, + +/* 0x14 0x10 * +* ASPECT FULLSCREEN * +* */ + {0x14 ,KEY_SCREEN }, + {0x10 ,KEY_ZOOM }, + +/* 0x0b * +* Up * +* * +* 0x18 0x16 0x0c * +* Left Ok Right * +* * +* 0x015 * +* Down * +* */ + {0x0b ,KEY_CHANNELUP }, + {0x18 ,KEY_VOLUMEDOWN }, + {0x16 ,KEY_OK },/* XXX KEY_ENTER */ + {0x0c ,KEY_VOLUMEUP }, + {0x15 ,KEY_CHANNELDOWN }, + +/* 0x11 0x0d * +* MUTE INFO * +* */ + {0x11 ,KEY_MUTE }, + {0x0d ,KEY_INFO }, + +/* 0x0f 0x1b 0x1a * +* RECORD PLAY/PAUSE STOP * +* * +* 0x0e 0x1f 0x1e * +*TELETEXT AUDIO SOURCE * +* RED YELLOW * +* */ + {0x0f ,KEY_RECORD }, + {0x1b ,KEY_PLAYPAUSE }, + {0x1a ,KEY_STOP }, + {0x0e ,KEY_TEXT }, + {0x1f ,KEY_RED },/*XXX KEY_AUDIO */ + {0x1e ,KEY_YELLOW },/*XXX KEY_SOURCE */ + +/* 0x1d 0x13 0x19 * +* SLEEP PREVIEW DVB * +* GREEN BLUE * +* */ + {0x1d ,KEY_SLEEP }, + {0x13 ,KEY_GREEN }, + {0x19 ,KEY_BLUE },/* XXX KEY_SAT */ + +/* 0x58 0x5c * +* FREEZE SNAPSHOT * +* */ + {0x58 ,KEY_SLOW }, + {0x5c ,KEY_CAMERA }, + +}; + +static struct rc_keymap behold_map = { + .map = { + .scan = behold, + .size =ARRAY_SIZE (behold), + .ir_type =IR_TYPE_UNKNOWN ,/* Legacy IR type */ + .name =RC_MAP_BEHOLD , + } +}; + +static int __init init_rc_map_behold (void ) +{ +return ir_register_map (&behold_map); +} + +static void __exit exit_rc_map_behold(void) +{ +ir_unregister_map (&behold_map); +} + +module_init(init_rc_map_behold) +module_exit(exit_rc_map_behold) + +MODULE_LICENSE("GPL"); +MODULE_AUTHOR ("Mauro Carvalho Chehab <[email protected]>" );drivers/media/IR/keymaps/rc-budget-ci-old.c new file +92
-0@@ -0,0 +1,92 @@ +/* budget-ci-old.h - Keytable for budget_ci_old Remote Controller +* +* keymap imported from ir-keymaps.c +* +* Copyright (c) 2010 by Mauro Carvalho Chehab <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +*/ + +#include <media/rc-map.h> + +/* From reading the following remotes: +* Zenith Universal 7 / TV Mode 807 / VCR Mode 837 +* Hauppauge (from NOVA-CI-s box product) +* This is a "middle of the road" approach, differences are noted +*/ + +static struct ir_scancode budget_ci_old[] = { + {0x00 ,KEY_0 }, + {0x01 ,KEY_1 }, + {0x02 ,KEY_2 }, + {0x03 ,KEY_3 }, + {0x04 ,KEY_4 }, + {0x05 ,KEY_5 }, + {0x06 ,KEY_6 }, + {0x07 ,KEY_7 }, + {0x08 ,KEY_8 }, + {0x09 ,KEY_9 }, + {0x0a ,KEY_ENTER }, + {0x0b ,KEY_RED }, + {0x0c ,KEY_POWER },/* RADIO on Hauppauge */ + {0x0d ,KEY_MUTE }, + {0x0f ,KEY_A },/* TV on Hauppauge */ + {0x10 ,KEY_VOLUMEUP }, + {0x11 ,KEY_VOLUMEDOWN }, + {0x14 ,KEY_B }, + {0x1c ,KEY_UP }, + {0x1d ,KEY_DOWN }, + {0x1e ,KEY_OPTION },/* RESERVED on Hauppauge */ + {0x1f ,KEY_BREAK }, + {0x20 ,KEY_CHANNELUP }, + {0x21 ,KEY_CHANNELDOWN }, + {0x22 ,KEY_PREVIOUS },/* Prev Ch on Zenith, SOURCE on Hauppauge */ + {0x24 ,KEY_RESTART }, + {0x25 ,KEY_OK }, + {0x26 ,KEY_CYCLEWINDOWS },/* MINIMIZE on Hauppauge */ + {0x28 ,KEY_ENTER },/* VCR mode on Zenith */ + {0x29 ,KEY_PAUSE }, + {0x2b ,KEY_RIGHT }, + {0x2c ,KEY_LEFT }, + {0x2e ,KEY_MENU },/* FULL SCREEN on Hauppauge */ + {0x30 ,KEY_SLOW }, + {0x31 ,KEY_PREVIOUS },/* VCR mode on Zenith */ + {0x32 ,KEY_REWIND }, + {0x34 ,KEY_FASTFORWARD }, + {0x35 ,KEY_PLAY }, + {0x36 ,KEY_STOP }, + {0x37 ,KEY_RECORD }, + {0x38 ,KEY_TUNER },/* TV/VCR on Zenith */ + {0x3a ,KEY_C }, + {0x3c ,KEY_EXIT }, + {0x3d ,KEY_POWER2 }, + {0x3e ,KEY_TUNER }, +}; + +static struct rc_keymap budget_ci_old_map = { + .map = { + .scan = budget_ci_old, + .size =ARRAY_SIZE (budget_ci_old), + .ir_type =IR_TYPE_UNKNOWN ,/* Legacy IR type */ + .name =RC_MAP_BUDGET_CI_OLD , + } +}; + +static int __init init_rc_map_budget_ci_old (void ) +{ +return ir_register_map (&budget_ci_old_map); +} + +static void __exit exit_rc_map_budget_ci_old(void) +{ +ir_unregister_map (&budget_ci_old_map); +} + +module_init(init_rc_map_budget_ci_old) +module_exit(exit_rc_map_budget_ci_old) + +MODULE_LICENSE("GPL"); +MODULE_AUTHOR ("Mauro Carvalho Chehab <[email protected]>" );drivers/media/IR/keymaps/rc-cinergy-1400.c new file +84
-0@@ -0,0 +1,84 @@ +/* cinergy-1400.h - Keytable for cinergy_1400 Remote Controller +* +* keymap imported from ir-keymaps.c +* +* Copyright (c) 2010 by Mauro Carvalho Chehab <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +*/ + +#include <media/rc-map.h> + +/* Cinergy 1400 DVB-T */ + +static struct ir_scancode cinergy_1400[] = { + {0x01 ,KEY_POWER }, + {0x02 ,KEY_1 }, + {0x03 ,KEY_2 }, + {0x04 ,KEY_3 }, + {0x05 ,KEY_4 }, + {0x06 ,KEY_5 }, + {0x07 ,KEY_6 }, + {0x08 ,KEY_7 }, + {0x09 ,KEY_8 }, + {0x0a ,KEY_9 }, + {0x0c ,KEY_0 }, + + {0x0b ,KEY_VIDEO }, + {0x0d ,KEY_REFRESH }, + {0x0e ,KEY_SELECT }, + {0x0f ,KEY_EPG }, + {0x10 ,KEY_UP }, + {0x11 ,KEY_LEFT }, + {0x12 ,KEY_OK }, + {0x13 ,KEY_RIGHT }, + {0x14 ,KEY_DOWN }, + {0x15 ,KEY_TEXT }, + {0x16 ,KEY_INFO }, + + {0x17 ,KEY_RED }, + {0x18 ,KEY_GREEN }, + {0x19 ,KEY_YELLOW }, + {0x1a ,KEY_BLUE }, + + {0x1b ,KEY_CHANNELUP }, + {0x1c ,KEY_VOLUMEUP }, + {0x1d ,KEY_MUTE }, + {0x1e ,KEY_VOLUMEDOWN }, + {0x1f ,KEY_CHANNELDOWN }, + + {0x40 ,KEY_PAUSE }, + {0x4c ,KEY_PLAY }, + {0x58 ,KEY_RECORD }, + {0x54 ,KEY_PREVIOUS }, + {0x48 ,KEY_STOP }, + {0x5c ,KEY_NEXT }, +}; + +static struct rc_keymap cinergy_1400_map = { + .map = { + .scan = cinergy_1400, + .size =ARRAY_SIZE (cinergy_1400), + .ir_type =IR_TYPE_UNKNOWN ,/* Legacy IR type */ + .name =RC_MAP_CINERGY_1400 , + } +}; + +static int __init init_rc_map_cinergy_1400 (void ) +{ +return ir_register_map (&cinergy_1400_map); +} + +static void __exit exit_rc_map_cinergy_1400(void) +{ +ir_unregister_map (&cinergy_1400_map); +} + +module_init(init_rc_map_cinergy_1400) +module_exit(exit_rc_map_cinergy_1400) + +MODULE_LICENSE("GPL"); +MODULE_AUTHOR ("Mauro Carvalho Chehab <[email protected]>" );drivers/media/IR/keymaps/rc-cinergy.c new file +78
-0@@ -0,0 +1,78 @@ +/* cinergy.h - Keytable for cinergy Remote Controller +* +* keymap imported from ir-keymaps.c +* +* Copyright (c) 2010 by Mauro Carvalho Chehab <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +*/ + +#include <media/rc-map.h> + +static struct ir_scancode cinergy[] = { + {0x00 ,KEY_0 }, + {0x01 ,KEY_1 }, + {0x02 ,KEY_2 }, + {0x03 ,KEY_3 }, + {0x04 ,KEY_4 }, + {0x05 ,KEY_5 }, + {0x06 ,KEY_6 }, + {0x07 ,KEY_7 }, + {0x08 ,KEY_8 }, + {0x09 ,KEY_9 }, + + {0x0a ,KEY_POWER }, + {0x0b ,KEY_PROG1 },/* app */ + {0x0c ,KEY_ZOOM },/* zoom/fullscreen */ + {0x0d ,KEY_CHANNELUP },/* channel */ + {0x0e ,KEY_CHANNELDOWN },/* channel- */ + {0x0f ,KEY_VOLUMEUP }, + {0x10 ,KEY_VOLUMEDOWN }, + {0x11 ,KEY_TUNER },/* AV */ + {0x12 ,KEY_NUMLOCK },/* -/-- */ + {0x13 ,KEY_AUDIO },/* audio */ + {0x14 ,KEY_MUTE }, + {0x15 ,KEY_UP }, + {0x16 ,KEY_DOWN }, + {0x17 ,KEY_LEFT }, + {0x18 ,KEY_RIGHT }, + {0x19 ,BTN_LEFT , }, + {0x1a ,BTN_RIGHT , }, + {0x1b ,KEY_WWW },/* text */ + {0x1c ,KEY_REWIND }, + {0x1d ,KEY_FORWARD }, + {0x1e ,KEY_RECORD }, + {0x1f ,KEY_PLAY }, + {0x20 ,KEY_PREVIOUSSONG }, + {0x21 ,KEY_NEXTSONG }, + {0x22 ,KEY_PAUSE }, + {0x23 ,KEY_STOP }, +}; + +static struct rc_keymap cinergy_map = { + .map = { + .scan = cinergy, + .size =ARRAY_SIZE (cinergy), + .ir_type =IR_TYPE_UNKNOWN ,/* Legacy IR type */ + .name =RC_MAP_CINERGY , + } +}; + +static int __init init_rc_map_cinergy (void ) +{ +return ir_register_map (&cinergy_map); +} + +static void __exit exit_rc_map_cinergy(void) +{ +ir_unregister_map (&cinergy_map); +} + +module_init(init_rc_map_cinergy) +module_exit(exit_rc_map_cinergy) + +MODULE_LICENSE("GPL"); +MODULE_AUTHOR ("Mauro Carvalho Chehab <[email protected]>" );drivers/media/IR/keymaps/rc-dm1105-nec.c new file +76
-0@@ -0,0 +1,76 @@ +/* dm1105-nec.h - Keytable for dm1105_nec Remote Controller +* +* keymap imported from ir-keymaps.c +* +* Copyright (c) 2010 by Mauro Carvalho Chehab <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +*/ + +#include <media/rc-map.h> + +/* DVBWorld remotes +Igor M. Liplianin <[email protected]> +*/ + +static struct ir_scancode dm1105_nec[] = { + {0x0a ,KEY_POWER2 },/* power */ + {0x0c ,KEY_MUTE },/* mute */ + {0x11 ,KEY_1 }, + {0x12 ,KEY_2 }, + {0x13 ,KEY_3 }, + {0x14 ,KEY_4 }, + {0x15 ,KEY_5 }, + {0x16 ,KEY_6 }, + {0x17 ,KEY_7 }, + {0x18 ,KEY_8 }, + {0x19 ,KEY_9 }, + {0x10 ,KEY_0 }, + {0x1c ,KEY_CHANNELUP },/* ch+ */ + {0x0f ,KEY_CHANNELDOWN },/* ch- */ + {0x1a ,KEY_VOLUMEUP },/* vol+ */ + {0x0e ,KEY_VOLUMEDOWN },/* vol- */ + {0x04 ,KEY_RECORD },/* rec */ + {0x09 ,KEY_CHANNEL },/* fav */ + {0x08 ,KEY_BACKSPACE },/* rewind */ + {0x07 ,KEY_FASTFORWARD },/* fast */ + {0x0b ,KEY_PAUSE },/* pause */ + {0x02 ,KEY_ESC },/* cancel */ + {0x03 ,KEY_TAB },/* tab */ + {0x00 ,KEY_UP },/* up */ + {0x1f ,KEY_ENTER },/* ok */ + {0x01 ,KEY_DOWN },/* down */ + {0x05 ,KEY_RECORD },/* cap */ + {0x06 ,KEY_STOP },/* stop */ + {0x40 ,KEY_ZOOM },/* full */ + {0x1e ,KEY_TV },/* tvmode */ + {0x1b ,KEY_B },/* recall */ +}; + +static struct rc_keymap dm1105_nec_map = { + .map = { + .scan = dm1105_nec, + .size =ARRAY_SIZE (dm1105_nec), + .ir_type =IR_TYPE_UNKNOWN ,/* Legacy IR type */ + .name =RC_MAP_DM1105_NEC , + } +}; + +static int __init init_rc_map_dm1105_nec (void ) +{ +return ir_register_map (&dm1105_nec_map); +} + +static void __exit exit_rc_map_dm1105_nec(void) +{ +ir_unregister_map (&dm1105_nec_map); +} + +module_init(init_rc_map_dm1105_nec) +module_exit(exit_rc_map_dm1105_nec) + +MODULE_LICENSE("GPL"); +MODULE_AUTHOR ("Mauro Carvalho Chehab <[email protected]>" );drivers/media/IR/keymaps/rc-dntv-live-dvb-t.c new file +78
-0@@ -0,0 +1,78 @@ +/* dntv-live-dvb-t.h - Keytable for dntv_live_dvb_t Remote Controller +* +* keymap imported from ir-keymaps.c +* +* Copyright (c) 2010 by Mauro Carvalho Chehab <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +*/ + +#include <media/rc-map.h> + +/* DigitalNow DNTV Live DVB-T Remote */ + +static struct ir_scancode dntv_live_dvb_t[] = { + {0x00 ,KEY_ESC },/* 'go up a level?' */ +/* Keys 0 to 9 */ + {0x0a ,KEY_0 }, + {0x01 ,KEY_1 }, + {0x02 ,KEY_2 }, + {0x03 ,KEY_3 }, + {0x04 ,KEY_4 }, + {0x05 ,KEY_5 }, + {0x06 ,KEY_6 }, + {0x07 ,KEY_7 }, + {0x08 ,KEY_8 }, + {0x09 ,KEY_9 }, + + {0x0b ,KEY_TUNER },/* tv/fm */ + {0x0c ,KEY_SEARCH },/* scan */ + {0x0d ,KEY_STOP }, + {0x0e ,KEY_PAUSE }, + {0x0f ,KEY_LIST },/* source */ + + {0x10 ,KEY_MUTE }, + {0x11 ,KEY_REWIND },/* backward << */ + {0x12 ,KEY_POWER }, + {0x13 ,KEY_CAMERA },/* snap */ + {0x14 ,KEY_AUDIO },/* stereo */ + {0x15 ,KEY_CLEAR },/* reset */ + {0x16 ,KEY_PLAY }, + {0x17 ,KEY_ENTER }, + {0x18 ,KEY_ZOOM },/* full screen */ + {0x19 ,KEY_FASTFORWARD },/* forward >> */ + {0x1a ,KEY_CHANNELUP }, + {0x1b ,KEY_VOLUMEUP }, + {0x1c ,KEY_INFO },/* preview */ + {0x1d ,KEY_RECORD },/* record */ + {0x1e ,KEY_CHANNELDOWN }, + {0x1f ,KEY_VOLUMEDOWN }, +}; + +static struct rc_keymap dntv_live_dvb_t_map = { + .map = { + .scan = dntv_live_dvb_t, + .size =ARRAY_SIZE (dntv_live_dvb_t), + .ir_type =IR_TYPE_UNKNOWN ,/* Legacy IR type */ + .name =RC_MAP_DNTV_LIVE_DVB_T , + } +}; + +static int __init init_rc_map_dntv_live_dvb_t (void ) +{ +return ir_register_map (&dntv_live_dvb_t_map); +} + +static void __exit exit_rc_map_dntv_live_dvb_t(void) +{ +ir_unregister_map (&dntv_live_dvb_t_map); +} + +module_init(init_rc_map_dntv_live_dvb_t) +module_exit(exit_rc_map_dntv_live_dvb_t) + +MODULE_LICENSE("GPL"); +MODULE_AUTHOR ("Mauro Carvalho Chehab <[email protected]>" );drivers/media/IR/keymaps/rc-dntv-live-dvbt-pro.c new file +97
-0@@ -0,0 +1,97 @@ +/* dntv-live-dvbt-pro.h - Keytable for dntv_live_dvbt_pro Remote Controller +* +* keymap imported from ir-keymaps.c +* +* Copyright (c) 2010 by Mauro Carvalho Chehab <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +*/ + +#include <media/rc-map.h> + +/* DigitalNow DNTV Live! DVB-T Pro Remote */ + +static struct ir_scancode dntv_live_dvbt_pro[] = { + {0x16 ,KEY_POWER }, + {0x5b ,KEY_HOME }, + + {0x55 ,KEY_TV },/* live tv */ + {0x58 ,KEY_TUNER },/* digital Radio */ + {0x5a ,KEY_RADIO },/* FM radio */ + {0x59 ,KEY_DVD },/* dvd menu */ + {0x03 ,KEY_1 }, + {0x01 ,KEY_2 }, + {0x06 ,KEY_3 }, + {0x09 ,KEY_4 }, + {0x1d ,KEY_5 }, + {0x1f ,KEY_6 }, + {0x0d ,KEY_7 }, + {0x19 ,KEY_8 }, + {0x1b ,KEY_9 }, + {0x0c ,KEY_CANCEL }, + {0x15 ,KEY_0 }, + {0x4a ,KEY_CLEAR }, + {0x13 ,KEY_BACK }, + {0x00 ,KEY_TAB }, + {0x4b ,KEY_UP }, + {0x4e ,KEY_LEFT }, + {0x4f ,KEY_OK }, + {0x52 ,KEY_RIGHT }, + {0x51 ,KEY_DOWN }, + {0x1e ,KEY_VOLUMEUP }, + {0x0a ,KEY_VOLUMEDOWN }, + {0x02 ,KEY_CHANNELDOWN }, + {0x05 ,KEY_CHANNELUP }, + {0x11 ,KEY_RECORD }, + {0x14 ,KEY_PLAY }, + {0x4c ,KEY_PAUSE }, + {0x1a ,KEY_STOP }, + {0x40 ,KEY_REWIND }, + {0x12 ,KEY_FASTFORWARD }, + {0x41 ,KEY_PREVIOUSSONG },/* replay |< */ + {0x42 ,KEY_NEXTSONG },/* skip >| */ + {0x54 ,KEY_CAMERA },/* capture */ + {0x50 ,KEY_LANGUAGE },/* sap */ + {0x47 ,KEY_TV2 },/* pip */ + {0x4d ,KEY_SCREEN }, + {0x43 ,KEY_SUBTITLE }, + {0x10 ,KEY_MUTE }, + {0x49 ,KEY_AUDIO },/* l/r */ + {0x07 ,KEY_SLEEP }, + {0x08 ,KEY_VIDEO },/* a/v */ + {0x0e ,KEY_PREVIOUS },/* recall */ + {0x45 ,KEY_ZOOM },/* zoom + */ + {0x46 ,KEY_ANGLE },/* zoom - */ + {0x56 ,KEY_RED }, + {0x57 ,KEY_GREEN }, + {0x5c ,KEY_YELLOW }, + {0x5d ,KEY_BLUE }, +}; + +static struct rc_keymap dntv_live_dvbt_pro_map = { + .map = { + .scan = dntv_live_dvbt_pro, + .size =ARRAY_SIZE (dntv_live_dvbt_pro), + .ir_type =IR_TYPE_UNKNOWN ,/* Legacy IR type */ + .name =RC_MAP_DNTV_LIVE_DVBT_PRO , + } +}; + +static int __init init_rc_map_dntv_live_dvbt_pro (void ) +{ +return ir_register_map (&dntv_live_dvbt_pro_map); +} + +static void __exit exit_rc_map_dntv_live_dvbt_pro(void) +{ +ir_unregister_map (&dntv_live_dvbt_pro_map); +} + +module_init(init_rc_map_dntv_live_dvbt_pro) +module_exit(exit_rc_map_dntv_live_dvbt_pro) + +MODULE_LICENSE("GPL"); +MODULE_AUTHOR ("Mauro Carvalho Chehab <[email protected]>" );drivers/media/IR/keymaps/rc-em-terratec.c new file +69
-0@@ -0,0 +1,69 @@ +/* em-terratec.h - Keytable for em_terratec Remote Controller +* +* keymap imported from ir-keymaps.c +* +* Copyright (c) 2010 by Mauro Carvalho Chehab <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +*/ + +#include <media/rc-map.h> + +static struct ir_scancode em_terratec[] = { + {0x01 ,KEY_CHANNEL }, + {0x02 ,KEY_SELECT }, + {0x03 ,KEY_MUTE }, + {0x04 ,KEY_POWER }, + {0x05 ,KEY_1 }, + {0x06 ,KEY_2 }, + {0x07 ,KEY_3 }, + {0x08 ,KEY_CHANNELUP }, + {0x09 ,KEY_4 }, + {0x0a ,KEY_5 }, + {0x0b ,KEY_6 }, + {0x0c ,KEY_CHANNELDOWN }, + {0x0d ,KEY_7 }, + {0x0e ,KEY_8 }, + {0x0f ,KEY_9 }, + {0x10 ,KEY_VOLUMEUP }, + {0x11 ,KEY_0 }, + {0x12 ,KEY_MENU }, + {0x13 ,KEY_PRINT }, + {0x14 ,KEY_VOLUMEDOWN }, + {0x16 ,KEY_PAUSE }, + {0x18 ,KEY_RECORD }, + {0x19 ,KEY_REWIND }, + {0x1a ,KEY_PLAY }, + {0x1b ,KEY_FORWARD }, + {0x1c ,KEY_BACKSPACE }, + {0x1e ,KEY_STOP }, + {0x40 ,KEY_ZOOM }, +}; + +static struct rc_keymap em_terratec_map = { + .map = { + .scan = em_terratec, + .size =ARRAY_SIZE (em_terratec), + .ir_type =IR_TYPE_UNKNOWN ,/* Legacy IR type */ + .name =RC_MAP_EM_TERRATEC , + } +}; + +static int __init init_rc_map_em_terratec (void ) +{ +return ir_register_map (&em_terratec_map); +} + +static void __exit exit_rc_map_em_terratec(void) +{ +ir_unregister_map (&em_terratec_map); +} + +module_init(init_rc_map_em_terratec) +module_exit(exit_rc_map_em_terratec) + +MODULE_LICENSE("GPL"); +MODULE_AUTHOR ("Mauro Carvalho Chehab <[email protected]>" );drivers/media/IR/keymaps/rc-empty.c new file +44
-0@@ -0,0 +1,44 @@ +/* empty.h - Keytable for empty Remote Controller +* +* keymap imported from ir-keymaps.c +* +* Copyright (c) 2010 by Mauro Carvalho Chehab <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +*/ + +#include <media/rc-map.h> + +/* empty keytable, can be used as placeholder for not-yet created keytables */ + +static struct ir_scancode empty[] = { + {0x2a ,KEY_COFFEE }, +}; + +static struct rc_keymap empty_map = { + .map = { + .scan = empty, + .size =ARRAY_SIZE (empty), + .ir_type =IR_TYPE_UNKNOWN ,/* Legacy IR type */ + .name =RC_MAP_EMPTY , + } +}; + +static int __init init_rc_map_empty (void ) +{ +return ir_register_map (&empty_map); +} + +static void __exit exit_rc_map_empty(void) +{ +ir_unregister_map (&empty_map); +} + +module_init(init_rc_map_empty) +module_exit(exit_rc_map_empty) + +MODULE_LICENSE("GPL"); +MODULE_AUTHOR ("Mauro Carvalho Chehab <[email protected]>" );drivers/media/IR/keymaps/rc-encore-enltv-fm53.c new file +81
-0@@ -0,0 +1,81 @@ +/* encore-enltv-fm53.h - Keytable for encore_enltv_fm53 Remote Controller +* +* keymap imported from ir-keymaps.c +* +* Copyright (c) 2010 by Mauro Carvalho Chehab <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +*/ + +#include <media/rc-map.h> + +/* Encore ENLTV-FM v5.3 +Mauro Carvalho Chehab <[email protected]> +*/ + +static struct ir_scancode encore_enltv_fm53[] = { + {0x10 ,KEY_POWER2 }, + {0x06 ,KEY_MUTE }, + + {0x09 ,KEY_1 }, + {0x1d ,KEY_2 }, + {0x1f ,KEY_3 }, + {0x19 ,KEY_4 }, + {0x1b ,KEY_5 }, + {0x11 ,KEY_6 }, + {0x17 ,KEY_7 }, + {0x12 ,KEY_8 }, + {0x16 ,KEY_9 }, + {0x48 ,KEY_0 }, + + {0x04 ,KEY_LIST },/* -/-- */ + {0x40 ,KEY_LAST },/* recall */ + + {0x02 ,KEY_MODE },/* TV/AV */ + {0x05 ,KEY_CAMERA },/* SNAPSHOT */ + + {0x4c ,KEY_CHANNELUP },/* UP */ + {0x00 ,KEY_CHANNELDOWN },/* DOWN */ + {0x0d ,KEY_VOLUMEUP },/* RIGHT */ + {0x15 ,KEY_VOLUMEDOWN },/* LEFT */ + {0x49 ,KEY_ENTER },/* OK */ + + {0x54 ,KEY_RECORD }, + {0x4d ,KEY_PLAY },/* pause */ + + {0x1e ,KEY_MENU },/* video setting */ + {0x0e ,KEY_RIGHT },/* <- */ + {0x1a ,KEY_LEFT },/* -> */ + + {0x0a ,KEY_CLEAR },/* video default */ + {0x0c ,KEY_ZOOM },/* hide pannel */ + {0x47 ,KEY_SLEEP },/* shutdown */ +}; + +static struct rc_keymap encore_enltv_fm53_map = { + .map = { + .scan = encore_enltv_fm53, + .size =ARRAY_SIZE (encore_enltv_fm53), + .ir_type =IR_TYPE_UNKNOWN ,/* Legacy IR type */ + .name =RC_MAP_ENCORE_ENLTV_FM53 , + } +}; + +static int __init init_rc_map_encore_enltv_fm53 (void ) +{ +return ir_register_map (&encore_enltv_fm53_map); +} + +static void __exit exit_rc_map_encore_enltv_fm53(void) +{ +ir_unregister_map (&encore_enltv_fm53_map); +} + +module_init(init_rc_map_encore_enltv_fm53) +module_exit(exit_rc_map_encore_enltv_fm53) + +MODULE_LICENSE("GPL"); +MODULE_AUTHOR ("Mauro Carvalho Chehab <[email protected]>" );drivers/media/IR/keymaps/rc-encore-enltv.c new file +112
-0@@ -0,0 +1,112 @@ +/* encore-enltv.h - Keytable for encore_enltv Remote Controller +* +* keymap imported from ir-keymaps.c +* +* Copyright (c) 2010 by Mauro Carvalho Chehab <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +*/ + +#include <media/rc-map.h> + +/* Encore ENLTV-FM - black plastic, white front cover with white glowing buttons +Juan Pablo Sormani <[email protected]> */ + +static struct ir_scancode encore_enltv[] = { + +/* Power button does nothing, neither in Windows app, +although it sends data (used for BIOS wakeup?) */ + {0x0d ,KEY_MUTE }, + + {0x1e ,KEY_TV }, + {0x00 ,KEY_VIDEO }, + {0x01 ,KEY_AUDIO },/* music */ + {0x02 ,KEY_MHP },/* picture */ + + {0x1f ,KEY_1 }, + {0x03 ,KEY_2 }, + {0x04 ,KEY_3 }, + {0x05 ,KEY_4 }, + {0x1c ,KEY_5 }, + {0x06 ,KEY_6 }, + {0x07 ,KEY_7 }, + {0x08 ,KEY_8 }, + {0x1d ,KEY_9 }, + {0x0a ,KEY_0 }, + + {0x09 ,KEY_LIST },/* -/-- */ + {0x0b ,KEY_LAST },/* recall */ + + {0x14 ,KEY_HOME },/* win start menu */ + {0x15 ,KEY_EXIT },/* exit */ + {0x16 ,KEY_CHANNELUP },/* UP */ + {0x12 ,KEY_CHANNELDOWN },/* DOWN */ + {0x0c ,KEY_VOLUMEUP },/* RIGHT */ + {0x17 ,KEY_VOLUMEDOWN },/* LEFT */ + + {0x18 ,KEY_ENTER },/* OK */ + + {0x0e ,KEY_ESC }, + {0x13 ,KEY_CYCLEWINDOWS },/* desktop */ + {0x11 ,KEY_TAB }, + {0x19 ,KEY_SWITCHVIDEOMODE },/* switch */ + + {0x1a ,KEY_MENU }, + {0x1b ,KEY_ZOOM },/* fullscreen */ + {0x44 ,KEY_TIME },/* time shift */ + {0x40 ,KEY_MODE },/* source */ + + {0x5a ,KEY_RECORD }, + {0x42 ,KEY_PLAY },/* play/pause */ + {0x45 ,KEY_STOP }, + {0x43 ,KEY_CAMERA },/* camera icon */ + + {0x48 ,KEY_REWIND }, + {0x4a ,KEY_FASTFORWARD }, + {0x49 ,KEY_PREVIOUS }, + {0x4b ,KEY_NEXT }, + + {0x4c ,KEY_FAVORITES },/* tv wall */ + {0x4d ,KEY_SOUND },/* DVD sound */ + {0x4e ,KEY_LANGUAGE },/* DVD lang */ + {0x4f ,KEY_TEXT },/* DVD text */ + + {0x50 ,KEY_SLEEP },/* shutdown */ + {0x51 ,KEY_MODE },/* stereo > main */ + {0x52 ,KEY_SELECT },/* stereo > sap */ + {0x53 ,KEY_PROG1 },/* teletext */ + + + {0x59 ,KEY_RED },/* AP1 */ + {0x41 ,KEY_GREEN },/* AP2 */ + {0x47 ,KEY_YELLOW },/* AP3 */ + {0x57 ,KEY_BLUE },/* AP4 */ +}; + +static struct rc_keymap encore_enltv_map = { + .map = { + .scan = encore_enltv, + .size =ARRAY_SIZE (encore_enltv), + .ir_type =IR_TYPE_UNKNOWN ,/* Legacy IR type */ + .name =RC_MAP_ENCORE_ENLTV , + } +}; + +static int __init init_rc_map_encore_enltv (void ) +{ +return ir_register_map (&encore_enltv_map); +} + +static void __exit exit_rc_map_encore_enltv(void) +{ +ir_unregister_map (&encore_enltv_map); +} + +module_init(init_rc_map_encore_enltv) +module_exit(exit_rc_map_encore_enltv) + +MODULE_LICENSE("GPL"); +MODULE_AUTHOR ("Mauro Carvalho Chehab <[email protected]>" );drivers/media/IR/keymaps/rc-encore-enltv2.c new file +90
-0@@ -0,0 +1,90 @@ +/* encore-enltv2.h - Keytable for encore_enltv2 Remote Controller +* +* keymap imported from ir-keymaps.c +* +* Copyright (c) 2010 by Mauro Carvalho Chehab <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +*/ + +#include <media/rc-map.h> + +/* Encore ENLTV2-FM - silver plastic - "Wand Media" written at the botton +Mauro Carvalho Chehab <[email protected]> */ + +static struct ir_scancode encore_enltv2[] = { + {0x4c ,KEY_POWER2 }, + {0x4a ,KEY_TUNER }, + {0x40 ,KEY_1 }, + {0x60 ,KEY_2 }, + {0x50 ,KEY_3 }, + {0x70 ,KEY_4 }, + {0x48 ,KEY_5 }, + {0x68 ,KEY_6 }, + {0x58 ,KEY_7 }, + {0x78 ,KEY_8 }, + {0x44 ,KEY_9 }, + {0x54 ,KEY_0 }, + + {0x64 ,KEY_LAST },/* +100 */ + {0x4e ,KEY_AGAIN },/* Recall */ + + {0x6c ,KEY_SWITCHVIDEOMODE },/* Video Source */ + {0x5e ,KEY_MENU }, + {0x56 ,KEY_SCREEN }, + {0x7a ,KEY_SETUP }, + + {0x46 ,KEY_MUTE }, + {0x5c ,KEY_MODE },/* Stereo */ + {0x74 ,KEY_INFO }, + {0x7c ,KEY_CLEAR }, + + {0x55 ,KEY_UP }, + {0x49 ,KEY_DOWN }, + {0x7e ,KEY_LEFT }, + {0x59 ,KEY_RIGHT }, + {0x6a ,KEY_ENTER }, + + {0x42 ,KEY_VOLUMEUP }, + {0x62 ,KEY_VOLUMEDOWN }, + {0x52 ,KEY_CHANNELUP }, + {0x72 ,KEY_CHANNELDOWN }, + + {0x41 ,KEY_RECORD }, + {0x51 ,KEY_CAMERA },/* Snapshot */ + {0x75 ,KEY_TIME },/* Timeshift */ + {0x71 ,KEY_TV2 },/* PIP */ + + {0x45 ,KEY_REWIND }, + {0x6f ,KEY_PAUSE }, + {0x7d ,KEY_FORWARD }, + {0x79 ,KEY_STOP }, +}; + +static struct rc_keymap encore_enltv2_map = { + .map = { + .scan = encore_enltv2, + .size =ARRAY_SIZE (encore_enltv2), + .ir_type =IR_TYPE_UNKNOWN ,/* Legacy IR type */ + .name =RC_MAP_ENCORE_ENLTV2 , + } +}; + +static int __init init_rc_map_encore_enltv2 (void ) +{ +return ir_register_map (&encore_enltv2_map); +} + +static void __exit exit_rc_map_encore_enltv2(void) +{ +ir_unregister_map (&encore_enltv2_map); +} + +module_init(init_rc_map_encore_enltv2) +module_exit(exit_rc_map_encore_enltv2) + +MODULE_LICENSE("GPL"); +MODULE_AUTHOR ("Mauro Carvalho Chehab <[email protected]>" );drivers/media/IR/keymaps/rc-evga-indtube.c new file +61
-0@@ -0,0 +1,61 @@ +/* evga-indtube.h - Keytable for evga_indtube Remote Controller +* +* keymap imported from ir-keymaps.c +* +* Copyright (c) 2010 by Mauro Carvalho Chehab <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +*/ + +#include <media/rc-map.h> + +/* EVGA inDtube +Devin Heitmueller <[email protected]> +*/ + +static struct ir_scancode evga_indtube[] = { + {0x12 ,KEY_POWER }, + {0x02 ,KEY_MODE },/* TV */ + {0x14 ,KEY_MUTE }, + {0x1a ,KEY_CHANNELUP }, + {0x16 ,KEY_TV2 },/* PIP */ + {0x1d ,KEY_VOLUMEUP }, + {0x05 ,KEY_CHANNELDOWN }, + {0x0f ,KEY_PLAYPAUSE }, + {0x19 ,KEY_VOLUMEDOWN }, + {0x1c ,KEY_REWIND }, + {0x0d ,KEY_RECORD }, + {0x18 ,KEY_FORWARD }, + {0x1e ,KEY_PREVIOUS }, + {0x1b ,KEY_STOP }, + {0x1f ,KEY_NEXT }, + {0x13 ,KEY_CAMERA }, +}; + +static struct rc_keymap evga_indtube_map = { + .map = { + .scan = evga_indtube, + .size =ARRAY_SIZE (evga_indtube), + .ir_type =IR_TYPE_UNKNOWN ,/* Legacy IR type */ + .name =RC_MAP_EVGA_INDTUBE , + } +}; + +static int __init init_rc_map_evga_indtube (void ) +{ +return ir_register_map (&evga_indtube_map); +} + +static void __exit exit_rc_map_evga_indtube(void) +{ +ir_unregister_map (&evga_indtube_map); +} + +module_init(init_rc_map_evga_indtube) +module_exit(exit_rc_map_evga_indtube) + +MODULE_LICENSE("GPL"); +MODULE_AUTHOR ("Mauro Carvalho Chehab <[email protected]>" );drivers/media/IR/keymaps/rc-eztv.c new file +96
-0@@ -0,0 +1,96 @@ +/* eztv.h - Keytable for eztv Remote Controller +* +* keymap imported from ir-keymaps.c +* +* Copyright (c) 2010 by Mauro Carvalho Chehab <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +*/ + +#include <media/rc-map.h> + +/* Alfons Geser <[email protected]> +* updates from Job D. R. Borges <[email protected]> */ + +static struct ir_scancode eztv[] = { + {0x12 ,KEY_POWER }, + {0x01 ,KEY_TV },/* DVR */ + {0x15 ,KEY_DVD },/* DVD */ + {0x17 ,KEY_AUDIO },/* music */ +/* DVR mode / DVD mode / music mode */ + + {0x1b ,KEY_MUTE },/* mute */ + {0x02 ,KEY_LANGUAGE },/* MTS/SAP / audio / autoseek */ + {0x1e ,KEY_SUBTITLE },/* closed captioning / subtitle / seek */ + {0x16 ,KEY_ZOOM },/* full screen */ + {0x1c ,KEY_VIDEO },/* video source / eject / delall */ + {0x1d ,KEY_RESTART },/* playback / angle / del */ + {0x2f ,KEY_SEARCH },/* scan / menu / playlist */ + {0x30 ,KEY_CHANNEL },/* CH surfing / bookmark / memo */ + + {0x31 ,KEY_HELP },/* help */ + {0x32 ,KEY_MODE },/* num/memo */ + {0x33 ,KEY_ESC },/* cancel */ + + {0x0c ,KEY_UP },/* up */ + {0x10 ,KEY_DOWN },/* down */ + {0x08 ,KEY_LEFT },/* left */ + {0x04 ,KEY_RIGHT },/* right */ + {0x03 ,KEY_SELECT },/* select */ + + {0x1f ,KEY_REWIND },/* rewind */ + {0x20 ,KEY_PLAYPAUSE },/* play/pause */ + {0x29 ,KEY_FORWARD },/* forward */ + {0x14 ,KEY_AGAIN },/* repeat */ + {0x2b ,KEY_RECORD },/* recording */ + {0x2c ,KEY_STOP },/* stop */ + {0x2d ,KEY_PLAY },/* play */ + {0x2e ,KEY_CAMERA },/* snapshot / shuffle */ + + {0x00 ,KEY_0 }, + {0x05 ,KEY_1 }, + {0x06 ,KEY_2 }, + {0x07 ,KEY_3 }, + {0x09 ,KEY_4 }, + {0x0a ,KEY_5 }, + {0x0b ,KEY_6 }, + {0x0d ,KEY_7 }, + {0x0e ,KEY_8 }, + {0x0f ,KEY_9 }, + + {0x2a ,KEY_VOLUMEUP }, + {0x11 ,KEY_VOLUMEDOWN }, + {0x18 ,KEY_CHANNELUP },/* CH.tracking up */ + {0x19 ,KEY_CHANNELDOWN },/* CH.tracking down */ + + {0x13 ,KEY_ENTER },/* enter */ + {0x21 ,KEY_DOT },/* . (decimal dot) */ +}; + +static struct rc_keymap eztv_map = { + .map = { + .scan = eztv, + .size =ARRAY_SIZE (eztv), + .ir_type =IR_TYPE_UNKNOWN ,/* Legacy IR type */ + .name =RC_MAP_EZTV , + } +}; + +static int __init init_rc_map_eztv (void ) +{ +return ir_register_map (&eztv_map); +} + +static void __exit exit_rc_map_eztv(void) +{ +ir_unregister_map (&eztv_map); +} + +module_init(init_rc_map_eztv) +module_exit(exit_rc_map_eztv) + +MODULE_LICENSE("GPL"); +MODULE_AUTHOR ("Mauro Carvalho Chehab <[email protected]>" );drivers/media/IR/keymaps/rc-flydvb.c new file +77
-0@@ -0,0 +1,77 @@ +/* flydvb.h - Keytable for flydvb Remote Controller +* +* keymap imported from ir-keymaps.c +* +* Copyright (c) 2010 by Mauro Carvalho Chehab <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +*/ + +#include <media/rc-map.h> + +static struct ir_scancode flydvb[] = { + {0x01 ,KEY_ZOOM },/* Full Screen */ + {0x00 ,KEY_POWER },/* Power */ + + {0x03 ,KEY_1 }, + {0x04 ,KEY_2 }, + {0x05 ,KEY_3 }, + {0x07 ,KEY_4 }, + {0x08 ,KEY_5 }, + {0x09 ,KEY_6 }, + {0x0b ,KEY_7 }, + {0x0c ,KEY_8 }, + {0x0d ,KEY_9 }, + {0x06 ,KEY_AGAIN },/* Recall */ + {0x0f ,KEY_0 }, + {0x10 ,KEY_MUTE },/* Mute */ + {0x02 ,KEY_RADIO },/* TV/Radio */ + {0x1b ,KEY_LANGUAGE },/* SAP (Second Audio Program) */ + + {0x14 ,KEY_VOLUMEUP },/* VOL+ */ + {0x17 ,KEY_VOLUMEDOWN },/* VOL- */ + {0x12 ,KEY_CHANNELUP },/* CH+ */ + {0x13 ,KEY_CHANNELDOWN },/* CH- */ + {0x1d ,KEY_ENTER },/* Enter */ + + {0x1a ,KEY_MODE },/* PIP */ + {0x18 ,KEY_TUNER },/* Source */ + + {0x1e ,KEY_RECORD },/* Record/Pause */ + {0x15 ,KEY_ANGLE },/* Swap (no label on key) */ + {0x1c ,KEY_PAUSE },/* Timeshift/Pause */ + {0x19 ,KEY_BACK },/* Rewind << */ + {0x0a ,KEY_PLAYPAUSE },/* Play/Pause */ + {0x1f ,KEY_FORWARD },/* Forward >> */ + {0x16 ,KEY_PREVIOUS },/* Back |<< */ + {0x11 ,KEY_STOP },/* Stop */ + {0x0e ,KEY_NEXT },/* End >>| */ +}; + +static struct rc_keymap flydvb_map = { + .map = { + .scan = flydvb, + .size =ARRAY_SIZE (flydvb), + .ir_type =IR_TYPE_UNKNOWN ,/* Legacy IR type */ + .name =RC_MAP_FLYDVB , + } +}; + +static int __init init_rc_map_flydvb (void ) +{ +return ir_register_map (&flydvb_map); +} + +static void __exit exit_rc_map_flydvb(void) +{ +ir_unregister_map (&flydvb_map); +} + +module_init(init_rc_map_flydvb) +module_exit(exit_rc_map_flydvb) + +MODULE_LICENSE("GPL"); +MODULE_AUTHOR ("Mauro Carvalho Chehab <[email protected]>" );drivers/media/IR/keymaps/rc-flyvideo.c new file +70
-0@@ -0,0 +1,70 @@ +/* flyvideo.h - Keytable for flyvideo Remote Controller +* +* keymap imported from ir-keymaps.c +* +* Copyright (c) 2010 by Mauro Carvalho Chehab <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +*/ + +#include <media/rc-map.h> + +static struct ir_scancode flyvideo[] = { + {0x0f ,KEY_0 }, + {0x03 ,KEY_1 }, + {0x04 ,KEY_2 }, + {0x05 ,KEY_3 }, + {0x07 ,KEY_4 }, + {0x08 ,KEY_5 }, + {0x09 ,KEY_6 }, + {0x0b ,KEY_7 }, + {0x0c ,KEY_8 }, + {0x0d ,KEY_9 }, + + {0x0e ,KEY_MODE },/* Air/Cable */ + {0x11 ,KEY_VIDEO },/* Video */ + {0x15 ,KEY_AUDIO },/* Audio */ + {0x00 ,KEY_POWER },/* Power */ + {0x18 ,KEY_TUNER },/* AV Source */ + {0x02 ,KEY_ZOOM },/* Fullscreen */ + {0x1a ,KEY_LANGUAGE },/* Stereo */ + {0x1b ,KEY_MUTE },/* Mute */ + {0x14 ,KEY_VOLUMEUP },/* Volume + */ + {0x17 ,KEY_VOLUMEDOWN },/* Volume - */ + {0x12 ,KEY_CHANNELUP },/* Channel + */ + {0x13 ,KEY_CHANNELDOWN },/* Channel - */ + {0x06 ,KEY_AGAIN },/* Recall */ + {0x10 ,KEY_ENTER },/* Enter */ + + {0x19 ,KEY_BACK },/* Rewind ( <<< ) */ + {0x1f ,KEY_FORWARD },/* Forward ( >>> ) */ + {0x0a ,KEY_ANGLE },/* no label, may be used as the PAUSE button */ +}; + +static struct rc_keymap flyvideo_map = { + .map = { + .scan = flyvideo, + .size =ARRAY_SIZE (flyvideo), + .ir_type =IR_TYPE_UNKNOWN ,/* Legacy IR type */ + .name =RC_MAP_FLYVIDEO , + } +}; + +static int __init init_rc_map_flyvideo (void ) +{ +return ir_register_map (&flyvideo_map); +} + +static void __exit exit_rc_map_flyvideo(void) +{ +ir_unregister_map (&flyvideo_map); +} + +module_init(init_rc_map_flyvideo) +module_exit(exit_rc_map_flyvideo) + +MODULE_LICENSE("GPL"); +MODULE_AUTHOR ("Mauro Carvalho Chehab <[email protected]>" );drivers/media/IR/keymaps/rc-fusionhdtv-mce.c new file +98
-0@@ -0,0 +1,98 @@ +/* fusionhdtv-mce.h - Keytable for fusionhdtv_mce Remote Controller +* +* keymap imported from ir-keymaps.c +* +* Copyright (c) 2010 by Mauro Carvalho Chehab <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +*/ + +#include <media/rc-map.h> + +/* DViCO FUSION HDTV MCE remote */ + +static struct ir_scancode fusionhdtv_mce[] = { + + {0x0b ,KEY_1 }, + {0x17 ,KEY_2 }, + {0x1b ,KEY_3 }, + {0x07 ,KEY_4 }, + {0x50 ,KEY_5 }, + {0x54 ,KEY_6 }, + {0x48 ,KEY_7 }, + {0x4c ,KEY_8 }, + {0x58 ,KEY_9 }, + {0x03 ,KEY_0 }, + + {0x5e ,KEY_OK }, + {0x51 ,KEY_UP }, + {0x53 ,KEY_DOWN }, + {0x5b ,KEY_LEFT }, + {0x5f ,KEY_RIGHT }, + + {0x02 ,KEY_TV },/* Labeled DTV on remote */ + {0x0e ,KEY_MP3 }, + {0x1a ,KEY_DVD }, + {0x1e ,KEY_FAVORITES },/* Labeled CPF on remote */ + {0x16 ,KEY_SETUP }, + {0x46 ,KEY_POWER2 },/* TV On/Off button on remote */ + {0x0a ,KEY_EPG },/* Labeled Guide on remote */ + + {0x49 ,KEY_BACK }, + {0x59 ,KEY_INFO },/* Labeled MORE on remote */ + {0x4d ,KEY_MENU },/* Labeled DVDMENU on remote */ + {0x55 ,KEY_CYCLEWINDOWS },/* Labeled ALT-TAB on remote */ + + {0x0f ,KEY_PREVIOUSSONG },/* Labeled |<< REPLAY on remote */ + {0x12 ,KEY_NEXTSONG },/* Labeled >>| SKIP on remote */ + {0x42 ,KEY_ENTER },/* Labeled START with a green +MS windows logo on remote */ + + {0x15 ,KEY_VOLUMEUP }, + {0x05 ,KEY_VOLUMEDOWN }, + {0x11 ,KEY_CHANNELUP }, + {0x09 ,KEY_CHANNELDOWN }, + + {0x52 ,KEY_CAMERA }, + {0x5a ,KEY_TUNER }, + {0x19 ,KEY_OPEN }, + + {0x13 ,KEY_MODE },/* 4:3 16:9 select */ + {0x1f ,KEY_ZOOM }, + + {0x43 ,KEY_REWIND }, + {0x47 ,KEY_PLAYPAUSE }, + {0x4f ,KEY_FASTFORWARD }, + {0x57 ,KEY_MUTE }, + {0x0d ,KEY_STOP }, + {0x01 ,KEY_RECORD }, + {0x4e ,KEY_POWER }, +}; + +static struct rc_keymap fusionhdtv_mce_map = { + .map = { + .scan = fusionhdtv_mce, + .size =ARRAY_SIZE (fusionhdtv_mce), + .ir_type =IR_TYPE_UNKNOWN ,/* Legacy IR type */ + .name =RC_MAP_FUSIONHDTV_MCE , + } +}; + +static int __init init_rc_map_fusionhdtv_mce (void ) +{ +return ir_register_map (&fusionhdtv_mce_map); +} + +static void __exit exit_rc_map_fusionhdtv_mce(void) +{ +ir_unregister_map (&fusionhdtv_mce_map); +} + +module_init(init_rc_map_fusionhdtv_mce) +module_exit(exit_rc_map_fusionhdtv_mce) + +MODULE_LICENSE("GPL"); +MODULE_AUTHOR ("Mauro Carvalho Chehab <[email protected]>" );drivers/media/IR/keymaps/rc-gadmei-rm008z.c new file +81
-0@@ -0,0 +1,81 @@ +/* gadmei-rm008z.h - Keytable for gadmei_rm008z Remote Controller +* +* keymap imported from ir-keymaps.c +* +* Copyright (c) 2010 by Mauro Carvalho Chehab <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +*/ + +#include <media/rc-map.h> + +/* GADMEI UTV330+ RM008Z remote +Shine Liu <[email protected]> +*/ + +static struct ir_scancode gadmei_rm008z[] = { + {0x14 ,KEY_POWER2 },/* POWER OFF */ + {0x0c ,KEY_MUTE },/* MUTE */ + + {0x18 ,KEY_TV },/* TV */ + {0x0e ,KEY_VIDEO },/* AV */ + {0x0b ,KEY_AUDIO },/* SV */ + {0x0f ,KEY_RADIO },/* FM */ + + {0x00 ,KEY_1 }, + {0x01 ,KEY_2 }, + {0x02 ,KEY_3 }, + {0x03 ,KEY_4 }, + {0x04 ,KEY_5 }, + {0x05 ,KEY_6 }, + {0x06 ,KEY_7 }, + {0x07 ,KEY_8 }, + {0x08 ,KEY_9 }, + {0x09 ,KEY_0 }, + {0x0a ,KEY_INFO },/* OSD */ + {0x1c ,KEY_BACKSPACE },/* LAST */ + + {0x0d ,KEY_PLAY },/* PLAY */ + {0x1e ,KEY_CAMERA },/* SNAPSHOT */ + {0x1a ,KEY_RECORD },/* RECORD */ + {0x17 ,KEY_STOP },/* STOP */ + + {0x1f ,KEY_UP },/* UP */ + {0x44 ,KEY_DOWN },/* DOWN */ + {0x46 ,KEY_TAB },/* BACK */ + {0x4a ,KEY_ZOOM },/* FULLSECREEN */ + + {0x10 ,KEY_VOLUMEUP },/* VOLUMEUP */ + {0x11 ,KEY_VOLUMEDOWN },/* VOLUMEDOWN */ + {0x12 ,KEY_CHANNELUP },/* CHANNELUP */ + {0x13 ,KEY_CHANNELDOWN },/* CHANNELDOWN */ + {0x15 ,KEY_ENTER },/* OK */ +}; + +static struct rc_keymap gadmei_rm008z_map = { + .map = { + .scan = gadmei_rm008z, + .size =ARRAY_SIZE (gadmei_rm008z), + .ir_type =IR_TYPE_UNKNOWN ,/* Legacy IR type */ + .name =RC_MAP_GADMEI_RM008Z , + } +}; + +static int __init init_rc_map_gadmei_rm008z (void ) +{ +return ir_register_map (&gadmei_rm008z_map); +} + +static void __exit exit_rc_map_gadmei_rm008z(void) +{ +ir_unregister_map (&gadmei_rm008z_map); +} + +module_init(init_rc_map_gadmei_rm008z) +module_exit(exit_rc_map_gadmei_rm008z) + +MODULE_LICENSE("GPL"); +MODULE_AUTHOR ("Mauro Carvalho Chehab <[email protected]>" );drivers/media/IR/keymaps/rc-genius-tvgo-a11mce.c new file +84
-0@@ -0,0 +1,84 @@ +/* genius-tvgo-a11mce.h - Keytable for genius_tvgo_a11mce Remote Controller +* +* keymap imported from ir-keymaps.c +* +* Copyright (c) 2010 by Mauro Carvalho Chehab <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +*/ + +#include <media/rc-map.h> + +/* +* Remote control for the Genius TVGO A11MCE +* Adrian Pardini <[email protected]> +*/ + +static struct ir_scancode genius_tvgo_a11mce[] = { +/* Keys 0 to 9 */ + {0x48 ,KEY_0 }, + {0x09 ,KEY_1 }, + {0x1d ,KEY_2 }, + {0x1f ,KEY_3 }, + {0x19 ,KEY_4 }, + {0x1b ,KEY_5 }, + {0x11 ,KEY_6 }, + {0x17 ,KEY_7 }, + {0x12 ,KEY_8 }, + {0x16 ,KEY_9 }, + + {0x54 ,KEY_RECORD },/* recording */ + {0x06 ,KEY_MUTE },/* mute */ + {0x10 ,KEY_POWER }, + {0x40 ,KEY_LAST },/* recall */ + {0x4c ,KEY_CHANNELUP },/* channel / program + */ + {0x00 ,KEY_CHANNELDOWN },/* channel / program - */ + {0x0d ,KEY_VOLUMEUP }, + {0x15 ,KEY_VOLUMEDOWN }, + {0x4d ,KEY_OK },/* also labeled as Pause */ + {0x1c ,KEY_ZOOM },/* full screen and Stop*/ + {0x02 ,KEY_MODE },/* AV Source or Rewind*/ + {0x04 ,KEY_LIST },/* -/-- */ +/* small arrows above numbers */ + {0x1a ,KEY_NEXT },/* also Fast Forward */ + {0x0e ,KEY_PREVIOUS },/* also Rewind */ +/* these are in a rather non standard layout and have +an alternate name written */ + {0x1e ,KEY_UP },/* Video Setting */ + {0x0a ,KEY_DOWN },/* Video Default */ + {0x05 ,KEY_CAMERA },/* Snapshot */ + {0x0c ,KEY_RIGHT },/* Hide Panel */ +/* Four buttons without label */ + {0x49 ,KEY_RED }, + {0x0b ,KEY_GREEN }, + {0x13 ,KEY_YELLOW }, + {0x50 ,KEY_BLUE }, +}; + +static struct rc_keymap genius_tvgo_a11mce_map = { + .map = { + .scan = genius_tvgo_a11mce, + .size =ARRAY_SIZE (genius_tvgo_a11mce), + .ir_type =IR_TYPE_UNKNOWN ,/* Legacy IR type */ + .name =RC_MAP_GENIUS_TVGO_A11MCE , + } +}; + +static int __init init_rc_map_genius_tvgo_a11mce (void ) +{ +return ir_register_map (&genius_tvgo_a11mce_map); +} + +static void __exit exit_rc_map_genius_tvgo_a11mce(void) +{ +ir_unregister_map (&genius_tvgo_a11mce_map); +} + +module_init(init_rc_map_genius_tvgo_a11mce) +module_exit(exit_rc_map_genius_tvgo_a11mce) + +MODULE_LICENSE("GPL"); +MODULE_AUTHOR ("Mauro Carvalho Chehab <[email protected]>" );drivers/media/IR/keymaps/rc-gotview7135.c new file +79
-0@@ -0,0 +1,79 @@ +/* gotview7135.h - Keytable for gotview7135 Remote Controller +* +* keymap imported from ir-keymaps.c +* +* Copyright (c) 2010 by Mauro Carvalho Chehab <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +*/ + +#include <media/rc-map.h> + +/* Mike Baikov <[email protected]> */ + +static struct ir_scancode gotview7135[] = { + + {0x11 ,KEY_POWER }, + {0x35 ,KEY_TV }, + {0x1b ,KEY_0 }, + {0x29 ,KEY_1 }, + {0x19 ,KEY_2 }, + {0x39 ,KEY_3 }, + {0x1f ,KEY_4 }, + {0x2c ,KEY_5 }, + {0x21 ,KEY_6 }, + {0x24 ,KEY_7 }, + {0x18 ,KEY_8 }, + {0x2b ,KEY_9 }, + {0x3b ,KEY_AGAIN },/* LOOP */ + {0x06 ,KEY_AUDIO }, + {0x31 ,KEY_PRINT },/* PREVIEW */ + {0x3e ,KEY_VIDEO }, + {0x10 ,KEY_CHANNELUP }, + {0x20 ,KEY_CHANNELDOWN }, + {0x0c ,KEY_VOLUMEDOWN }, + {0x28 ,KEY_VOLUMEUP }, + {0x08 ,KEY_MUTE }, + {0x26 ,KEY_SEARCH },/* SCAN */ + {0x3f ,KEY_CAMERA },/* SNAPSHOT */ + {0x12 ,KEY_RECORD }, + {0x32 ,KEY_STOP }, + {0x3c ,KEY_PLAY }, + {0x1d ,KEY_REWIND }, + {0x2d ,KEY_PAUSE }, + {0x0d ,KEY_FORWARD }, + {0x05 ,KEY_ZOOM },/*FULL*/ + + {0x2a ,KEY_F21 },/* LIVE TIMESHIFT */ + {0x0e ,KEY_F22 },/* MIN TIMESHIFT */ + {0x1e ,KEY_TIME },/* TIMESHIFT */ + {0x38 ,KEY_F24 },/* NORMAL TIMESHIFT */ +}; + +static struct rc_keymap gotview7135_map = { + .map = { + .scan = gotview7135, + .size =ARRAY_SIZE (gotview7135), + .ir_type =IR_TYPE_UNKNOWN ,/* Legacy IR type */ + .name =RC_MAP_GOTVIEW7135 , + } +}; + +static int __init init_rc_map_gotview7135 (void ) +{ +return ir_register_map (&gotview7135_map); +} + +static void __exit exit_rc_map_gotview7135(void) +{ +ir_unregister_map (&gotview7135_map); +} + +module_init(init_rc_map_gotview7135) +module_exit(exit_rc_map_gotview7135) + +MODULE_LICENSE("GPL"); +MODULE_AUTHOR ("Mauro Carvalho Chehab <[email protected]>" );drivers/media/IR/keymaps/rc-hauppauge-new.c new file +100
-0@@ -0,0 +1,100 @@ +/* hauppauge-new.h - Keytable for hauppauge_new Remote Controller +* +* keymap imported from ir-keymaps.c +* +* Copyright (c) 2010 by Mauro Carvalho Chehab <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +*/ + +#include <media/rc-map.h> + +/* Hauppauge: the newer, gray remotes (seems there are multiple +* slightly different versions), shipped with cx88+ivtv cards. +* almost rc5 coding, but some non-standard keys */ + +static struct ir_scancode hauppauge_new[] = { +/* Keys 0 to 9 */ + {0x00 ,KEY_0 }, + {0x01 ,KEY_1 }, + {0x02 ,KEY_2 }, + {0x03 ,KEY_3 }, + {0x04 ,KEY_4 }, + {0x05 ,KEY_5 }, + {0x06 ,KEY_6 }, + {0x07 ,KEY_7 }, + {0x08 ,KEY_8 }, + {0x09 ,KEY_9 }, + + {0x0a ,KEY_TEXT },/* keypad asterisk as well */ + {0x0b ,KEY_RED },/* red button */ + {0x0c ,KEY_RADIO }, + {0x0d ,KEY_MENU }, + {0x0e ,KEY_SUBTITLE },/* also the # key */ + {0x0f ,KEY_MUTE }, + {0x10 ,KEY_VOLUMEUP }, + {0x11 ,KEY_VOLUMEDOWN }, + {0x12 ,KEY_PREVIOUS },/* previous channel */ + {0x14 ,KEY_UP }, + {0x15 ,KEY_DOWN }, + {0x16 ,KEY_LEFT }, + {0x17 ,KEY_RIGHT }, + {0x18 ,KEY_VIDEO },/* Videos */ + {0x19 ,KEY_AUDIO },/* Music */ +/* 0x1a: Pictures - presume this means +"Multimedia Home Platform" - +no "PICTURES" key in input.h +*/ + {0x1a ,KEY_MHP }, + + {0x1b ,KEY_EPG },/* Guide */ + {0x1c ,KEY_TV }, + {0x1e ,KEY_NEXTSONG },/* skip >| */ + {0x1f ,KEY_EXIT },/* back/exit */ + {0x20 ,KEY_CHANNELUP },/* channel / program + */ + {0x21 ,KEY_CHANNELDOWN },/* channel / program - */ + {0x22 ,KEY_CHANNEL },/* source (old black remote) */ + {0x24 ,KEY_PREVIOUSSONG },/* replay |< */ + {0x25 ,KEY_ENTER },/* OK */ + {0x26 ,KEY_SLEEP },/* minimize (old black remote) */ + {0x29 ,KEY_BLUE },/* blue key */ + {0x2e ,KEY_GREEN },/* green button */ + {0x30 ,KEY_PAUSE },/* pause */ + {0x32 ,KEY_REWIND },/* backward << */ + {0x34 ,KEY_FASTFORWARD },/* forward >> */ + {0x35 ,KEY_PLAY }, + {0x36 ,KEY_STOP }, + {0x37 ,KEY_RECORD },/* recording */ + {0x38 ,KEY_YELLOW },/* yellow key */ + {0x3b ,KEY_SELECT },/* top right button */ + {0x3c ,KEY_ZOOM },/* full */ + {0x3d ,KEY_POWER },/* system power (green button) */ +}; + +static struct rc_keymap hauppauge_new_map = { + .map = { + .scan = hauppauge_new, + .size =ARRAY_SIZE (hauppauge_new), + .ir_type =IR_TYPE_UNKNOWN ,/* Legacy IR type */ + .name =RC_MAP_HAUPPAUGE_NEW , + } +}; + +static int __init init_rc_map_hauppauge_new (void ) +{ +return ir_register_map (&hauppauge_new_map); +} + +static void __exit exit_rc_map_hauppauge_new(void) +{ +ir_unregister_map (&hauppauge_new_map); +} + +module_init(init_rc_map_hauppauge_new) +module_exit(exit_rc_map_hauppauge_new) + +MODULE_LICENSE("GPL"); +MODULE_AUTHOR ("Mauro Carvalho Chehab <[email protected]>" );drivers/media/IR/keymaps/rc-iodata-bctv7e.c new file +88
-0@@ -0,0 +1,88 @@ +/* iodata-bctv7e.h - Keytable for iodata_bctv7e Remote Controller +* +* keymap imported from ir-keymaps.c +* +* Copyright (c) 2010 by Mauro Carvalho Chehab <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +*/ + +#include <media/rc-map.h> + +/* IO-DATA BCTV7E Remote */ + +static struct ir_scancode iodata_bctv7e[] = { + {0x40 ,KEY_TV }, + {0x20 ,KEY_RADIO },/* FM */ + {0x60 ,KEY_EPG }, + {0x00 ,KEY_POWER }, + +/* Keys 0 to 9 */ + {0x44 ,KEY_0 },/* 10 */ + {0x50 ,KEY_1 }, + {0x30 ,KEY_2 }, + {0x70 ,KEY_3 }, + {0x48 ,KEY_4 }, + {0x28 ,KEY_5 }, + {0x68 ,KEY_6 }, + {0x58 ,KEY_7 }, + {0x38 ,KEY_8 }, + {0x78 ,KEY_9 }, + + {0x10 ,KEY_L },/* Live */ + {0x08 ,KEY_TIME },/* Time Shift */ + + {0x18 ,KEY_PLAYPAUSE },/* Play */ + + {0x24 ,KEY_ENTER },/* 11 */ + {0x64 ,KEY_ESC },/* 12 */ + {0x04 ,KEY_M },/* Multi */ + + {0x54 ,KEY_VIDEO }, + {0x34 ,KEY_CHANNELUP }, + {0x74 ,KEY_VOLUMEUP }, + {0x14 ,KEY_MUTE }, + + {0x4c ,KEY_VCR },/* SVIDEO */ + {0x2c ,KEY_CHANNELDOWN }, + {0x6c ,KEY_VOLUMEDOWN }, + {0x0c ,KEY_ZOOM }, + + {0x5c ,KEY_PAUSE }, + {0x3c ,KEY_RED },/* || (red) */ + {0x7c ,KEY_RECORD },/* recording */ + {0x1c ,KEY_STOP }, + + {0x41 ,KEY_REWIND },/* backward << */ + {0x21 ,KEY_PLAY }, + {0x61 ,KEY_FASTFORWARD },/* forward >> */ + {0x01 ,KEY_NEXT },/* skip >| */ +}; + +static struct rc_keymap iodata_bctv7e_map = { + .map = { + .scan = iodata_bctv7e, + .size =ARRAY_SIZE (iodata_bctv7e), + .ir_type =IR_TYPE_UNKNOWN ,/* Legacy IR type */ + .name =RC_MAP_IODATA_BCTV7E , + } +}; + +static int __init init_rc_map_iodata_bctv7e (void ) +{ +return ir_register_map (&iodata_bctv7e_map); +} + +static void __exit exit_rc_map_iodata_bctv7e(void) +{ +ir_unregister_map (&iodata_bctv7e_map); +} + +module_init(init_rc_map_iodata_bctv7e) +module_exit(exit_rc_map_iodata_bctv7e) + +MODULE_LICENSE("GPL"); +MODULE_AUTHOR ("Mauro Carvalho Chehab <[email protected]>" );drivers/media/IR/keymaps/rc-kaiomy.c new file +87
-0@@ -0,0 +1,87 @@ +/* kaiomy.h - Keytable for kaiomy Remote Controller +* +* keymap imported from ir-keymaps.c +* +* Copyright (c) 2010 by Mauro Carvalho Chehab <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +*/ + +#include <media/rc-map.h> + +/* Kaiomy TVnPC U2 +Mauro Carvalho Chehab <[email protected]> +*/ + +static struct ir_scancode kaiomy[] = { + {0x43 ,KEY_POWER2 }, + {0x01 ,KEY_LIST }, + {0x0b ,KEY_ZOOM }, + {0x03 ,KEY_POWER }, + + {0x04 ,KEY_1 }, + {0x08 ,KEY_2 }, + {0x02 ,KEY_3 }, + + {0x0f ,KEY_4 }, + {0x05 ,KEY_5 }, + {0x06 ,KEY_6 }, + + {0x0c ,KEY_7 }, + {0x0d ,KEY_8 }, + {0x0a ,KEY_9 }, + + {0x11 ,KEY_0 }, + + {0x09 ,KEY_CHANNELUP }, + {0x07 ,KEY_CHANNELDOWN }, + + {0x0e ,KEY_VOLUMEUP }, + {0x13 ,KEY_VOLUMEDOWN }, + + {0x10 ,KEY_HOME }, + {0x12 ,KEY_ENTER }, + + {0x14 ,KEY_RECORD }, + {0x15 ,KEY_STOP }, + {0x16 ,KEY_PLAY }, + {0x17 ,KEY_MUTE }, + + {0x18 ,KEY_UP }, + {0x19 ,KEY_DOWN }, + {0x1a ,KEY_LEFT }, + {0x1b ,KEY_RIGHT }, + + {0x1c ,KEY_RED }, + {0x1d ,KEY_GREEN }, + {0x1e ,KEY_YELLOW }, + {0x1f ,KEY_BLUE }, +}; + +static struct rc_keymap kaiomy_map = { + .map = { + .scan = kaiomy, + .size =ARRAY_SIZE (kaiomy), + .ir_type =IR_TYPE_UNKNOWN ,/* Legacy IR type */ + .name =RC_MAP_KAIOMY , + } +}; + +static int __init init_rc_map_kaiomy (void ) +{ +return ir_register_map (&kaiomy_map); +} + +static void __exit exit_rc_map_kaiomy(void) +{ +ir_unregister_map (&kaiomy_map); +} + +module_init(init_rc_map_kaiomy) +module_exit(exit_rc_map_kaiomy) + +MODULE_LICENSE("GPL"); +MODULE_AUTHOR ("Mauro Carvalho Chehab <[email protected]>" );drivers/media/IR/keymaps/rc-kworld-315u.c new file +83
-0@@ -0,0 +1,83 @@ +/* kworld-315u.h - Keytable for kworld_315u Remote Controller +* Lines of this file are not shown. View the raw message.
drivers/media/IR/keymaps/rc-kworld-plus-tv-analog.c new file +99
-0Lines of this file are not shown. View the raw message.
drivers/media/IR/keymaps/rc-manli.c new file +135
-0Lines of this file are not shown. View the raw message.
drivers/media/IR/keymaps/rc-msi-tvanywhere-plus.c new file +123
-0Lines of this file are not shown. View the raw message.
drivers/media/IR/keymaps/rc-msi-tvanywhere.c new file +69
-0Lines of this file are not shown. View the raw message.
drivers/media/IR/keymaps/rc-nebula.c new file +96
-0Lines of this file are not shown. View the raw message.
drivers/media/IR/keymaps/rc-nec-terratec-cinergy-xs.c new file +105
-0Lines of this file are not shown. View the raw message.
drivers/media/IR/keymaps/rc-norwood.c new file +85
-0Lines of this file are not shown. View the raw message.
drivers/media/IR/keymaps/rc-npgtech.c new file +80
-0Lines of this file are not shown. View the raw message.
drivers/media/IR/keymaps/rc-pctv-sedna.c new file +80
-0Lines of this file are not shown. View the raw message.
drivers/media/IR/keymaps/rc-pinnacle-color.c new file +94
-0Lines of this file are not shown. View the raw message.
drivers/media/IR/keymaps/rc-pinnacle-grey.c new file +89
-0Lines of this file are not shown. View the raw message.
drivers/media/IR/keymaps/rc-pinnacle-pctv-hd.c new file +73
-0Lines of this file are not shown. View the raw message.
drivers/media/IR/keymaps/rc-pixelview-new.c new file +83
-0Lines of this file are not shown. View the raw message.
drivers/media/IR/keymaps/rc-pixelview.c new file +82
-0Lines of this file are not shown. View the raw message.
drivers/media/IR/keymaps/rc-powercolor-real-angel.c new file +81
-0Lines of this file are not shown. View the raw message.
drivers/media/IR/keymaps/rc-proteus-2309.c new file +69
-0Lines of this file are not shown. View the raw message.
drivers/media/IR/keymaps/rc-purpletv.c new file +81
-0Lines of this file are not shown. View the raw message.
drivers/media/IR/keymaps/rc-pv951.c new file +78
-0Lines of this file are not shown. View the raw message.
drivers/media/IR/keymaps/rc-rc5-hauppauge-new.c new file +103
-0Lines of this file are not shown. View the raw message.
drivers/media/IR/keymaps/rc-rc5-tv.c new file +81
-0Lines of this file are not shown. View the raw message.
drivers/media/IR/keymaps/rc-real-audio-220-32-keys.c new file +78
-0Lines of this file are not shown. View the raw message.
drivers/media/IR/keymaps/rc-tbs-nec.c new file +73
-0Lines of this file are not shown. View the raw message.
drivers/media/IR/keymaps/rc-terratec-cinergy-xs.c new file +92
-0Lines of this file are not shown. View the raw message.
drivers/media/IR/keymaps/rc-tevii-nec.c new file +88
-0Lines of this file are not shown. View the raw message.
drivers/media/IR/keymaps/rc-tt-1500.c new file +82
-0Lines of this file are not shown. View the raw message.
drivers/media/IR/keymaps/rc-videomate-s350.c new file +85
-0Lines of this file are not shown. View the raw message.
drivers/media/IR/keymaps/rc-videomate-tv-pvr.c new file +87
-0Lines of this file are not shown. View the raw message.
drivers/media/IR/keymaps/rc-winfast-usbii-deluxe.c new file +82
-0Lines of this file are not shown. View the raw message.
drivers/media/IR/keymaps/rc-winfast.c new file +102
-0Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
Part of the diff is not shown here. View the raw message.
Re: [PATCH 08/26] V4L/DVB: Break Remote Controller keymaps into modules
Quoted 19 lines · Andy Walls
Quoted 11 lines · Mauro Carvalho Chehab
The original Remote Controller approach were very messy: a big file, that were part of ir-common kernel module, containing 64 different RC keymap tables, used by the V4L/DVB drivers.
Better to break each RC keymap table into a separate module, registering them into rc core on a process similar to the fs/nls tables.
As an userspace program is now in charge of loading those tables, adds an option to allow the complete removal of those tables from kernelspace.
Quoted 6 lines
Yet, on embedded devices like Set Top Boxes and TV sets, maybe the only available input device is the IR. So, we should keep allowing the usage of in-kernel tables, but a latter patch should change the default to 'n', after giving some time for distros to add the v4l-utils with the ir-keytable program, to allow the table load via userspace.
Quoted 8 lines
I know I'm probably late on commenting on this.
Although this is interesting, it seems like overkill.
1. How will this help move us to the "just works" case, if now userspace has to help the kernel. Every distro is likely just going to bundle a script which loads them all into the kernel and forgets about them.
No. They will either use userspace or kernelspace keymaps. For in-kernel keymaps, there's nothing needed on userspace.
Quoted 3 lines
2. How is a driver, which knows the bundled remote, supposed to convey to userspace "load this map by default for my IR receiver"? Is that covered in another portion of the patch?
It is on a separate patch. Basically, by the name. The table name is stored on each IR map entry on kernel. If the table is in kernel, the table will be dynamically loaded, when needed.
Userspace can always replace it by another one.
For example, this is my current test setup:
$ ./ir-keytable
Found /sys/class/rc/rc0/ (/dev/input/event8) with:
Driver "saa7134", raw software decoder, table "rc-avermedia-m135a-rm-jx"
Supported protocols: NEC RC-5 RC-6
Found /sys/class/rc/rc1/ (/dev/input/event9) with:
Driver "cx88xx", hardware decoder, table "rc-pixelview-mk12"
Supported protocols: other
Current protocols: NEC
Found /sys/class/rc/rc2/ (/dev/input/event10) with:
Driver "em28xx", hardware decoder, table "rc-rc5-hauppauge-new"
Supported protocols: NEC RC-5
Current protocols: RC-5 When ready, ir-keytable udev option will get driver and table info and seek on some files for the proper keymap, if the user wants to replace it by a customized one, or if the kernel keymap is disabled.
Quoted 7 lines
3. If you're going to be so remote specific, why not add protocol information in these regarding the remotes? You can tell the core everything to expect from this remote: raw vs. hardware decoder and the RC-5/NEC/RC-6/JVC/whatever raw protocol decoder to use. That gets us closer to "just works" and avoids false input events from two of the raw deoders both thinking they got a valid code.
The table contains the info.
Quoted 3 lines
4.
/sbin/lsmodis now going to give a very long listing with lots of noise. When these things are registered with the core, is the module's use count incremented when the core knows a driver is using one of them?
No. It will just show the used modules, as they're dynamically loaded. For example, with my 3 test device driver loaded, it shows:
rc_rc5_hauppauge_new 1100 0rc_pixelview_mk12 953 0rc_avermedia_m135a_rm_jx 1016 0
Quoted 7 lines
5. Each module is going to consume a page of vmalloc address space and ram, and an addtional page of vmalloc address as a gap behind it. These maps are rather small in comparison. Is it really worth all the page table entries to load all these as individual modules? Memory is cheap, and small allocations can fill in fragmentation gaps in the vmalloc address space, but page table entries are spent on better things.
My plan is to merge several keymaps. I'm currently trying to obtain some RC's to write the correct keymaps and try to merge them.
Quoted 1 line
I guess I'm not aware of what the return is here for the costs.
Signature · 2 lines
Cheers, Mauro