From 77ffaefbd4cfc296aefa85fbba7e3eb530dd56da Mon Sep 17 00:00:00 2001 From: Ravi Kumar V Date: Tue, 10 Apr 2012 16:33:46 +0530 Subject: [PATCH] media: rc: Add support for RC6 philips IR remote control keymap RC6 philips remote control uses RC6 protocol to send the user control data through IR. Change-Id: I53f93c679c08a2b2aca154a761f84dae2f1c52e9 Signed-off-by: Ravi Kumar V --- drivers/media/rc/keymaps/Makefile | 1 + drivers/media/rc/keymaps/rc-philips.c | 81 +++++++++++++++++++++++++++ include/media/rc-map.h | 1 + 3 files changed, 83 insertions(+) create mode 100644 drivers/media/rc/keymaps/rc-philips.c diff --git a/drivers/media/rc/keymaps/Makefile b/drivers/media/rc/keymaps/Makefile index 45b01347c37..198298b2454 100644 --- a/drivers/media/rc/keymaps/Makefile +++ b/drivers/media/rc/keymaps/Makefile @@ -56,6 +56,7 @@ obj-$(CONFIG_RC_MAP) += rc-adstech-dvb-t-pci.o \ rc-norwood.o \ rc-npgtech.o \ rc-pctv-sedna.o \ + rc-philips.o \ rc-pinnacle-color.o \ rc-pinnacle-grey.o \ rc-pinnacle-pctv-hd.o \ diff --git a/drivers/media/rc/keymaps/rc-philips.c b/drivers/media/rc/keymaps/rc-philips.c new file mode 100644 index 00000000000..ff2caf92f5f --- /dev/null +++ b/drivers/media/rc/keymaps/rc-philips.c @@ -0,0 +1,81 @@ +/* Copyright (c) 2012, Code Aurora Forum. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 and + * only version 2 as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#include + +static struct rc_map_table philips[] = { + + { 0x00, KEY_NUMERIC_0 }, + { 0x01, KEY_NUMERIC_1 }, + { 0x02, KEY_NUMERIC_2 }, + { 0x03, KEY_NUMERIC_3 }, + { 0x04, KEY_NUMERIC_4 }, + { 0x05, KEY_NUMERIC_5 }, + { 0x06, KEY_NUMERIC_6 }, + { 0x07, KEY_NUMERIC_7 }, + { 0x08, KEY_NUMERIC_8 }, + { 0x09, KEY_NUMERIC_9 }, + { 0xF4, KEY_SOUND }, + { 0xF3, KEY_SCREEN }, /* Picture */ + + { 0x10, KEY_VOLUMEUP }, + { 0x11, KEY_VOLUMEDOWN }, + { 0x0d, KEY_MUTE }, + { 0x20, KEY_CHANNELUP }, + { 0x21, KEY_CHANNELDOWN }, + { 0x0A, KEY_BACK }, + { 0x0f, KEY_INFO }, + { 0x5c, KEY_OK }, + { 0x58, KEY_UP }, + { 0x59, KEY_DOWN }, + { 0x5a, KEY_LEFT }, + { 0x5b, KEY_RIGHT }, + { 0xcc, KEY_PAUSE }, + { 0x6d, KEY_PVR }, /* Demo */ + { 0x40, KEY_EXIT }, + { 0x6e, KEY_PROG1 }, /* Scenea */ + { 0x6f, KEY_MODE }, /* Dual */ + { 0x70, KEY_SLEEP }, + { 0xf5, KEY_TUNER }, /* Format */ + + { 0x4f, KEY_TV }, + { 0x3c, KEY_NEW }, /* USB */ + { 0x38, KEY_COMPOSE }, /* Source */ + { 0x54, KEY_MENU }, + + { 0x0C, KEY_POWER }, +}; + +static struct rc_map_list rc6_philips_map = { + .map = { + .scan = philips, + .size = ARRAY_SIZE(philips), + .rc_type = RC_TYPE_RC6, + .name = RC_MAP_RC6_PHILIPS, + } +}; + +static int __init init_rc_map_rc6_philips(void) +{ + return rc_map_register(&rc6_philips_map); +} + +static void __exit exit_rc_map_rc6_philips(void) +{ + rc_map_unregister(&rc6_philips_map); +} + +module_init(init_rc_map_rc6_philips) +module_exit(exit_rc_map_rc6_philips) + +MODULE_DESCRIPTION("Philips Remote Keymap "); +MODULE_LICENSE("GPL v2"); diff --git a/include/media/rc-map.h b/include/media/rc-map.h index 226ea6871c5..2114287807a 100644 --- a/include/media/rc-map.h +++ b/include/media/rc-map.h @@ -114,6 +114,7 @@ void rc_map_init(void); #define RC_MAP_NORWOOD "rc-norwood" #define RC_MAP_NPGTECH "rc-npgtech" #define RC_MAP_PCTV_SEDNA "rc-pctv-sedna" +#define RC_MAP_RC6_PHILIPS "rc-philips" #define RC_MAP_PINNACLE_COLOR "rc-pinnacle-color" #define RC_MAP_PINNACLE_GREY "rc-pinnacle-grey" #define RC_MAP_PINNACLE_PCTV_HD "rc-pinnacle-pctv-hd"