media: rc: add new imon protocol decoder and encoder
Subsystems (2)
Sean Young
maintainerPATCH v2 1/1 media: rc: add new imon protocol decoder and encoder
This makes it possible to use the various iMON remotes with any raw IR RC device.
Signed-off-by Sean Young <[email protected]>
--- drivers/media/rc/Kconfig | 9 ++ drivers/media/rc/Makefile | 1 + drivers/media/rc/ir-imon-decoder.c | 193 +++++++++++++++++++++++++++++++++ drivers/media/rc/keymaps/rc-imon-pad.c | 3 +- drivers/media/rc/rc-core-priv.h | 6 + drivers/media/rc/rc-main.c | 3 + include/media/rc-map.h | 8 +- include/uapi/linux/lirc.h | 2 + 8 files changed, 220 insertions(+), 5 deletions(-) create mode 100644 drivers/media/rc/ir-imon-decoder.c
drivers/media/rc/Kconfig +9 -0
@@ -111,6 +111,15 @@ config IR_XMP_DECODER ---help--- Enable this option if you have IR with XMP protocol, and if the IR is decoded in software + +config IR_IMON_DECODER + tristate "Enable IR raw decoder for the iMON protocol" + depends on RC_CORE + ---help--- + Enable this option if you have iMON PAD or Antec Veris infrared + remote control and you would like to use it with a raw IR + receiver, or if you wish to use an encoder to transmit this IR. + endif #RC_DECODERS menuconfig RC_DEVICES
drivers/media/rc/Makefile +1 -0
@@ -14,6 +14,7 @@ obj-$(CONFIG_IR_SANYO_DECODER) += ir-sanyo-decoder.o obj-$(CONFIG_IR_SHARP_DECODER) += ir-sharp-decoder.o obj-$(CONFIG_IR_MCE_KBD_DECODER) += ir-mce_kbd-decoder.o obj-$(CONFIG_IR_XMP_DECODER) += ir-xmp-decoder.o +obj-$(CONFIG_IR_IMON_DECODER) += ir-imon-decoder.o # stand-alone IR receivers/transmitters obj-$(CONFIG_RC_ATI_REMOTE) += ati_remote.o
drivers/media/rc/ir-imon-decoder.c new file +193 -0
193 lines not on this page · raw message
drivers/media/rc/keymaps/rc-imon-pad.c +1 -2
@@ -134,8 +134,7 @@ static struct rc_map_list imon_pad_map = { .map = { .scan = imon_pad, .size = ARRAY_SIZE(imon_pad), - /* actual protocol details unknown, hardware decoder */ - .rc_proto = RC_PROTO_OTHER, + .rc_proto = RC_PROTO_IMON, .name = RC_MAP_IMON_PAD, } };
drivers/media/rc/rc-core-priv.h +6 -0
@@ -118,6 +118,12 @@ struct ir_raw_event_ctrl {unsigned count;u32 durations[16 ]; } xmp; +struct imon_dec { +int state; +int count; +int last_chk; +unsigned int bits; + } imon; };/* macros for IR decoders */
drivers/media/rc/rc-main.c +3 -0
@@ -68,6 +68,8 @@ static const struct { .scancode_bits = 0x1fff, .repeat_period = 250 }, [RC_PROTO_XMP] = { .name = "xmp", .repeat_period = 250 }, [RC_PROTO_CEC] = { .name = "cec", .repeat_period = 550 }, + [RC_PROTO_IMON] = { .name = "imon", + .scancode_bits = 0x7fffffff, .repeat_period = 250 }, };/* Used to keep track of known keymaps */
@@ -1004,6 +1006,7 @@ static const struct { RC_PROTO_BIT_MCIR2_MSE, "mce_kbd", "ir-mce_kbd-decoder" }, { RC_PROTO_BIT_XMP, "xmp", "ir-xmp-decoder" }, { RC_PROTO_BIT_CEC, "cec", NULL }, + { RC_PROTO_BIT_IMON, "imon", "ir-imon-decoder" }, }; /**
include/media/rc-map.h +5 -3
@@ -36,6 +36,7 @@#define RC_PROTO_BIT_SHARP BIT_ULL(RC_PROTO_SHARP)#define RC_PROTO_BIT_XMP BIT_ULL(RC_PROTO_XMP)#define RC_PROTO_BIT_CEC BIT_ULL(RC_PROTO_CEC) +#define RC_PROTO_BIT_IMON BIT_ULL(RC_PROTO_IMON)#define RC_PROTO_BIT_ALL \ (RC_PROTO_BIT_UNKNOWN | RC_PROTO_BIT_OTHER | \
@@ -49,7 +50,8 @@ RC_PROTO_BIT_RC6_0 | RC_PROTO_BIT_RC6_6A_20 | \ RC_PROTO_BIT_RC6_6A_24 | RC_PROTO_BIT_RC6_6A_32 | \ RC_PROTO_BIT_RC6_MCE | RC_PROTO_BIT_SHARP | \ - RC_PROTO_BIT_XMP | RC_PROTO_BIT_CEC) + RC_PROTO_BIT_XMP | RC_PROTO_BIT_CEC | \ + RC_PROTO_BIT_IMON)/* All rc protocols for which we have decoders */ #define RC_PROTO_BIT_ALL_IR_DECODER \ (RC_PROTO_BIT_RC5 | RC_PROTO_BIT_RC5X_20 | \
@@ -62,7 +64,7 @@ RC_PROTO_BIT_RC6_0 | RC_PROTO_BIT_RC6_6A_20 | \ RC_PROTO_BIT_RC6_6A_24 | RC_PROTO_BIT_RC6_6A_32 | \ RC_PROTO_BIT_RC6_MCE | RC_PROTO_BIT_SHARP | \ - RC_PROTO_BIT_XMP) + RC_PROTO_BIT_XMP | RC_PROTO_BIT_IMON)#define RC_PROTO_BIT_ALL_IR_ENCODER \ (RC_PROTO_BIT_RC5 | RC_PROTO_BIT_RC5X_20 | \
@@ -75,7 +77,7 @@ RC_PROTO_BIT_RC6_0 | RC_PROTO_BIT_RC6_6A_20 | \ RC_PROTO_BIT_RC6_6A_24 | \ RC_PROTO_BIT_RC6_6A_32 | RC_PROTO_BIT_RC6_MCE | \ - RC_PROTO_BIT_SHARP) + RC_PROTO_BIT_SHARP | RC_PROTO_BIT_IMON)#define RC_SCANCODE_UNKNOWN (x) (x)#define RC_SCANCODE_OTHER (x) (x)
include/uapi/linux/lirc.h +2 -0
@@ -186,6 +186,7 @@ struct lirc_scancode {* @RC_PROTO_SHARP: Sharp protocol * @RC_PROTO_XMP: XMP protocol * @RC_PROTO_CEC: CEC protocol +* @RC_PROTO_IMON: iMon Pad protocol */ enum rc_proto {RC_PROTO_UNKNOWN =0 ,
@@ -211,6 +212,7 @@ enum rc_proto {RC_PROTO_SHARP =20 ,RC_PROTO_XMP =21 ,RC_PROTO_CEC =22 , + RC_PROTO_IMON = 23, };#endif
Signature · 1 line
2.14.3