aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <m.chehab@samsung.com>2014-07-25 22:39:57 -0300
committerMauro Carvalho Chehab <m.chehab@samsung.com>2014-07-25 22:49:04 -0300
commit022117b431288cdecbcd3646d385b3a761e831b7 (patch)
treec47fac8d63509c8742bd06a3baaf1a5e6599a9e8
parent635c08f445f8c766a4958eb7c96fb5cd6ea6b03b (diff)
keytable: add support for sharp and mce-kbd protocols
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
-rw-r--r--utils/keytable/ir-keytable.12
-rw-r--r--utils/keytable/keytable.c36
2 files changed, 36 insertions, 2 deletions
diff --git a/utils/keytable/ir-keytable.1 b/utils/keytable/ir-keytable.1
index 54d8e176..d7aaed62 100644
--- a/utils/keytable/ir-keytable.1
+++ b/utils/keytable/ir-keytable.1
@@ -78,7 +78,7 @@ a file wit a set of scancode=keycode value pairs
.IP \fISCANKEY\fR
a set of scancode1=keycode1,scancode2=keycode2.. value pairs
.IP \fIPROTOCOL\fR
-protocol name to be enabled (case insensitive). Supported protocols are: NEC, RC-5, RC-6, JVC, SONY, SANYO, LIRC, RC-5-SZ, other, all.
+protocol name to be enabled (case insensitive). Supported protocols are: NEC, RC-5, RC-6, JVC, SONY, SANYO, LIRC, RC-5-SZ, SHARP, MCE-KBD, other, all.
.IP \fIDELAY\fR
Delay before repeating a keystroke
.IP \fIPERIOD\fR
diff --git a/utils/keytable/keytable.c b/utils/keytable/keytable.c
index ceca7615..6a8deeef 100644
--- a/utils/keytable/keytable.c
+++ b/utils/keytable/keytable.c
@@ -86,6 +86,8 @@ enum ir_protocols {
LIRC = 1 << 5,
SANYO = 1 << 6,
RC_5_SZ = 1 << 7,
+ SHARP = 1 << 8,
+ MCE_KBD = 1 << 9,
OTHER = 1 << 31,
};
@@ -110,7 +112,7 @@ static const char doc[] = "\nAllows get/set IR keycode/scancode tables\n"
" SYSDEV - the ir class as found at /sys/class/rc\n"
" TABLE - a file with a set of scancode=keycode value pairs\n"
" SCANKEY - a set of scancode1=keycode1,scancode2=keycode2.. value pairs\n"
- " PROTOCOL - protocol name (nec, rc-5, rc-6, jvc, sony, sanyo, rc-5-sz, lirc, other) to be enabled\n"
+ " PROTOCOL - protocol name (nec, rc-5, rc-6, jvc, sony, sanyo, rc-5-sz, lirc, sharp, mce_kbd, other, all) to be enabled\n"
" DELAY - Delay before repeating a keystroke\n"
" PERIOD - Period to repeat a keystroke\n"
" CFGFILE - configuration file that associates a driver/table name with a keymap file\n"
@@ -234,6 +236,10 @@ static error_t parse_keyfile(char *fname, char **table)
ch_proto |= SANYO;
else if (!strcasecmp(p,"rc-5-sz"))
ch_proto |= RC_5_SZ;
+ else if (!strcasecmp(p,"sharp"))
+ ch_proto |= SHARP;
+ else if (!strcasecmp(p,"mce-kbd"))
+ ch_proto |= MCE_KBD;
else if (!strcasecmp(p,"other") || !strcasecmp(p,"unknown"))
ch_proto |= OTHER;
else {
@@ -471,6 +477,10 @@ static error_t parse_opt(int k, char *arg, struct argp_state *state)
ch_proto |= LIRC;
else if (!strcasecmp(p,"rc-5-sz"))
ch_proto |= RC_5_SZ;
+ else if (!strcasecmp(p,"sharp"))
+ ch_proto |= RC_5_SZ;
+ else if (!strcasecmp(p,"mce-kbd"))
+ ch_proto |= RC_5_SZ;
else if (!strcasecmp(p,"all"))
ch_proto |= ~0;
else
@@ -746,6 +756,10 @@ static enum ir_protocols v1_get_hw_protocols(char *name)
proto |= SANYO;
else if (!strcmp(p, "rc-5-sz"))
proto |= RC_5_SZ;
+ else if (!strcmp(p, "sharp"))
+ proto |= SHARP;
+ else if (!strcmp(p, "mce-kbd"))
+ proto |= MCE_KBD;
else
proto |= OTHER;
@@ -792,6 +806,12 @@ static int v1_set_hw_protocols(struct rc_device *rc_dev)
if (rc_dev->current & RC_5_SZ)
fprintf(fp, "rc-5-sz ");
+ if (rc_dev->current & SHARP)
+ fprintf(fp, "sharp ");
+
+ if (rc_dev->current & MCE_KBD)
+ fprintf(fp, "mce_kbd ");
+
if (rc_dev->current & OTHER)
fprintf(fp, "unknown ");
@@ -923,6 +943,10 @@ static enum ir_protocols v2_get_protocols(struct rc_device *rc_dev, char *name)
proto = LIRC;
else if (!strcmp(p, "rc-5-sz"))
proto = RC_5_SZ;
+ else if (!strcmp(p, "sharp"))
+ proto = SHARP;
+ else if (!strcmp(p, "mce-kbd"))
+ proto = MCE_KBD;
else
proto = OTHER;
@@ -979,6 +1003,12 @@ static int v2_set_protocols(struct rc_device *rc_dev)
if (rc_dev->current & RC_5_SZ)
fprintf(fp, "+rc-5-sz\n");
+ if (rc_dev->current & SHARP)
+ fprintf(fp, "+sharp\n");
+
+ if (rc_dev->current & MCE_KBD)
+ fprintf(fp, "+mce-kbd\n");
+
if (rc_dev->current & OTHER)
fprintf(fp, "+unknown\n");
@@ -1008,6 +1038,10 @@ static void show_proto( enum ir_protocols proto)
fprintf (stderr, "LIRC ");
if (proto & RC_5_SZ)
fprintf (stderr, "RC-5-SZ ");
+ if (proto & SHARP)
+ fprintf (stderr, "SHARP ");
+ if (proto & MCE_KBD)
+ fprintf (stderr, "MCE_KBD ");
if (proto & OTHER)
fprintf (stderr, "other ");
}

Privacy Policy