From: Jarod Wilson <jarod@redhat.com>
To: linux-media@vger.kernel.org
Subject: [PATCH 2/3] IR: add an empty lirc "protocol" keymap
Date: Tue, 1 Jun 2010 16:52:27 -0400 [thread overview]
Message-ID: <20100601205227.GB31616@redhat.com> (raw)
In-Reply-To: <20100601205005.GA28322@redhat.com>
This keymap can be specified for loading for a setup where the user
wants to bypass in-kernel decoding and only use the lirc interface.
Signed-off-by: Jarod Wilson <jarod@redhat.com>
---
drivers/media/IR/keymaps/Makefile | 1 +
drivers/media/IR/keymaps/rc-lirc.c | 41 ++++++++++++++++++++++++++++++++++++
include/media/rc-map.h | 5 +++-
3 files changed, 46 insertions(+), 1 deletions(-)
create mode 100644 drivers/media/IR/keymaps/rc-lirc.c
diff --git a/drivers/media/IR/keymaps/Makefile b/drivers/media/IR/keymaps/Makefile
index 08e5a10..7dffd41 100644
--- a/drivers/media/IR/keymaps/Makefile
+++ b/drivers/media/IR/keymaps/Makefile
@@ -36,6 +36,7 @@ obj-$(CONFIG_RC_MAP) += rc-adstech-dvb-t-pci.o \
rc-kaiomy.o \
rc-kworld-315u.o \
rc-kworld-plus-tv-analog.o \
+ rc-lirc.o \
rc-manli.o \
rc-msi-tvanywhere.o \
rc-msi-tvanywhere-plus.o \
diff --git a/drivers/media/IR/keymaps/rc-lirc.c b/drivers/media/IR/keymaps/rc-lirc.c
new file mode 100644
index 0000000..63c0a33
--- /dev/null
+++ b/drivers/media/IR/keymaps/rc-lirc.c
@@ -0,0 +1,41 @@
+/* rc-lirc.c - Empty dummy keytable, for use when its preferred to pass
+ * all raw IR data to the lirc userspace decoder.
+ *
+ * Copyright (c) 2010 by Jarod Wilson <jarod@redhat.com>
+ *
+ * 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 lirc[] = {
+ { },
+};
+
+static struct rc_keymap lirc_map = {
+ .map = {
+ .scan = lirc,
+ .size = ARRAY_SIZE(lirc),
+ .ir_type = IR_TYPE_LIRC,
+ .name = RC_MAP_LIRC,
+ }
+};
+
+static int __init init_rc_map_lirc(void)
+{
+ return ir_register_map(&lirc_map);
+}
+
+static void __exit exit_rc_map_lirc(void)
+{
+ ir_unregister_map(&lirc_map);
+}
+
+module_init(init_rc_map_lirc)
+module_exit(exit_rc_map_lirc)
+
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("Jarod Wilson <jarod@redhat.com>");
diff --git a/include/media/rc-map.h b/include/media/rc-map.h
index 7abe12e..056d0e4 100644
--- a/include/media/rc-map.h
+++ b/include/media/rc-map.h
@@ -17,10 +17,12 @@
#define IR_TYPE_RC6 (1 << 2) /* Philips RC6 protocol */
#define IR_TYPE_JVC (1 << 3) /* JVC protocol */
#define IR_TYPE_SONY (1 << 4) /* Sony12/15/20 protocol */
+#define IR_TYPE_LIRC (1 << 30) /* Pass raw IR to lirc userspace */
#define IR_TYPE_OTHER (1u << 31)
#define IR_TYPE_ALL (IR_TYPE_RC5 | IR_TYPE_NEC | IR_TYPE_RC6 | \
- IR_TYPE_JVC | IR_TYPE_SONY | IR_TYPE_OTHER)
+ IR_TYPE_JVC | IR_TYPE_SONY | IR_TYPE_LIRC | \
+ IR_TYPE_OTHER)
struct ir_scancode {
u32 scancode;
@@ -89,6 +91,7 @@ void rc_map_init(void);
#define RC_MAP_KAIOMY "rc-kaiomy"
#define RC_MAP_KWORLD_315U "rc-kworld-315u"
#define RC_MAP_KWORLD_PLUS_TV_ANALOG "rc-kworld-plus-tv-analog"
+#define RC_MAP_LIRC "rc-lirc"
#define RC_MAP_MANLI "rc-manli"
#define RC_MAP_MSI_TVANYWHERE_PLUS "rc-msi-tvanywhere-plus"
#define RC_MAP_MSI_TVANYWHERE "rc-msi-tvanywhere"
--
1.6.5.2
--
Jarod Wilson
jarod@redhat.com
next prev parent reply other threads:[~2010-06-01 20:52 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-01 20:50 [PATCH 0/3] IR: add lirc support to ir-core Jarod Wilson
2010-06-01 20:51 ` [PATCH 1/3] IR: add core lirc device interface Jarod Wilson
2010-06-03 6:02 ` Mauro Carvalho Chehab
2010-06-03 22:06 ` Jarod Wilson
2010-06-04 4:10 ` Mauro Carvalho Chehab
2010-06-04 15:51 ` Christoph Bartelmus
2010-06-04 18:38 ` Mauro Carvalho Chehab
2010-06-04 18:57 ` Jon Smirl
2010-06-04 20:17 ` Jarod Wilson
2010-06-04 21:17 ` Jarod Wilson
2010-06-04 23:16 ` Jon Smirl
2010-06-05 2:45 ` Jarod Wilson
2010-06-05 12:43 ` Jarod Wilson
2010-06-05 17:43 ` Stefan Richter
2010-06-05 17:24 ` Andy Walls
2010-06-05 17:52 ` Jon Smirl
2010-06-07 18:44 ` David Härdeman
2010-06-07 19:45 ` Jarod Wilson
2010-06-08 17:40 ` David Härdeman
2010-07-03 3:27 ` Jarod Wilson
2010-06-01 20:52 ` Jarod Wilson [this message]
2010-06-01 20:52 ` [PATCH 3/3] IR: add ir-core to lirc interface bridge driver Jarod Wilson
2010-07-03 4:05 ` [PATCH v2 0/3] IR: add lirc support to ir-core Jarod Wilson
2010-07-03 4:06 ` [PATCH 1/3] IR: add lirc device interface Jarod Wilson
2010-07-03 4:07 ` [PATCH v2 2/3] IR: add ir-core to lirc userspace decoder bridge driver Jarod Wilson
2010-07-03 4:08 ` [PATCH v2 3/3] IR: add empty lirc pseudo-keymap Jarod Wilson
2010-07-03 4:10 ` [PATCH 4/3] IR/lirc: add docbook info covering lirc device interface Jarod Wilson
2010-07-04 15:31 ` Mauro Carvalho Chehab
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100601205227.GB31616@redhat.com \
--to=jarod@redhat.com \
--cc=linux-media@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).