From 2031709371a600b1b803ec928cc1adb2e9b5a4c1 Mon Sep 17 00:00:00 2001
From: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Date: Thu, 19 Nov 2015 11:41:36 -0200
Subject: [PATCH] UPSTREAM: smsir.h: remove a now duplicated definition
 (IR_DEFAULT_TIMEOUT)

This macro is now part of the core. Remove from Siano driver.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
(cherry picked from commit 850c8a7d68a761b5f11d5b443b5ece185e8068f4)
---
 drivers/media/common/siano/smsir.h | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/media/common/siano/smsir.h b/drivers/media/common/siano/smsir.h
index fc8b7925c532..d9abd96ef48b 100644
--- a/drivers/media/common/siano/smsir.h
+++ b/drivers/media/common/siano/smsir.h
@@ -30,8 +30,6 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #include <linux/input.h>
 #include <media/rc-core.h>
 
-#define IR_DEFAULT_TIMEOUT		100
-
 struct smscore_device_t;
 
 struct ir_t {

From 3b533a5c5f7880759fcad51e9400851a80295764 Mon Sep 17 00:00:00 2001
From: Jonas Karlman <jonas@kwiboo.se>
Date: Wed, 6 Sep 2017 18:39:09 +0200
Subject: [PATCH] [media] rc/keymaps: add keytable for Pine64 IR Remote
 Controller

---
 drivers/media/rc/keymaps/Makefile    |  1 +
 drivers/media/rc/keymaps/rc-pine64.c | 65 ++++++++++++++++++++++++++++++++++++
 include/media/rc-map.h               |  1 +
 3 files changed, 67 insertions(+)
 create mode 100644 drivers/media/rc/keymaps/rc-pine64.c

diff --git a/drivers/media/rc/keymaps/Makefile b/drivers/media/rc/keymaps/Makefile
index fbbd3bbcd252..8816520600f7 100644
--- a/drivers/media/rc/keymaps/Makefile
+++ b/drivers/media/rc/keymaps/Makefile
@@ -66,6 +66,7 @@ obj-$(CONFIG_RC_MAP) += rc-adstech-dvb-t-pci.o \
 			rc-norwood.o \
 			rc-npgtech.o \
 			rc-pctv-sedna.o \
+			rc-pine64.o \
 			rc-pinnacle-color.o \
 			rc-pinnacle-grey.o \
 			rc-pinnacle-pctv-hd.o \
diff --git a/drivers/media/rc/keymaps/rc-pine64.c b/drivers/media/rc/keymaps/rc-pine64.c
new file mode 100644
index 000000000000..bdf3975e7445
--- /dev/null
+++ b/drivers/media/rc/keymaps/rc-pine64.c
@@ -0,0 +1,65 @@
+/* Keytable for Pine64 IR Remote Controller
+ *
+ * Copyright (c) 2017 PINE64
+ *
+ * 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>
+#include <linux/module.h>
+
+static struct rc_map_table pine64[] = {
+	{ 0x404000, KEY_NUMERIC_0 },
+	{ 0x404001, KEY_NUMERIC_1 },
+	{ 0x404002, KEY_NUMERIC_2 },
+	{ 0x404003, KEY_NUMERIC_3 },
+	{ 0x404004, KEY_NUMERIC_4 },
+	{ 0x404005, KEY_NUMERIC_5 },
+	{ 0x404006, KEY_NUMERIC_6 },
+	{ 0x404007, KEY_NUMERIC_7 },
+	{ 0x404008, KEY_NUMERIC_8 },
+	{ 0x404009, KEY_NUMERIC_9 },
+	{ 0x40400a, KEY_MUTE },
+	{ 0x40400b, KEY_UP },
+	{ 0x40400c, KEY_BACKSPACE },
+	{ 0x40400d, KEY_OK },
+	{ 0x40400e, KEY_DOWN },
+	{ 0x404010, KEY_LEFT },
+	{ 0x404011, KEY_RIGHT },
+	{ 0x404017, KEY_VOLUMEDOWN },
+	{ 0x404018, KEY_VOLUMEUP },
+	{ 0x40401a, KEY_HOME },
+	{ 0x40401d, KEY_MENU },
+	{ 0x40401f, KEY_WWW },
+	{ 0x404045, KEY_BACK },
+	{ 0x404047, KEY_INFO },
+	{ 0x40404d, KEY_POWER },
+};
+
+static struct rc_map_list pine64_map = {
+	.map = {
+		.scan    = pine64,
+		.size    = ARRAY_SIZE(pine64),
+		.rc_type = RC_TYPE_NEC,
+		.name    = RC_MAP_PINE64,
+	}
+};
+
+static int __init init_rc_map_pine64(void)
+{
+	return rc_map_register(&pine64_map);
+}
+
+static void __exit exit_rc_map_pine64(void)
+{
+	rc_map_unregister(&pine64_map);
+}
+
+module_init(init_rc_map_pine64)
+module_exit(exit_rc_map_pine64)
+
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("PINE64");
diff --git a/include/media/rc-map.h b/include/media/rc-map.h
index 7c4bbc4dfab4..3a34a9631dd1 100644
--- a/include/media/rc-map.h
+++ b/include/media/rc-map.h
@@ -173,6 +173,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_PINE64                    "rc-pine64"
 #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"

From 21e2e6f847c6e1d0f98ce3770e6d380b20af3064 Mon Sep 17 00:00:00 2001
From: Jonas Karlman <jonas@kwiboo.se>
Date: Wed, 6 Sep 2017 18:39:09 +0200
Subject: [PATCH] [media] rc/keymaps: add keytable for ODROID IR Remote
 Controller

---
 drivers/media/rc/keymaps/Makefile    |  1 +
 drivers/media/rc/keymaps/rc-odroid.c | 52 ++++++++++++++++++++++++++++++++++++
 include/media/rc-map.h               |  1 +
 3 files changed, 54 insertions(+)
 create mode 100644 drivers/media/rc/keymaps/rc-odroid.c

diff --git a/drivers/media/rc/keymaps/Makefile b/drivers/media/rc/keymaps/Makefile
index 8816520600f7..f4321cfbbc79 100644
--- a/drivers/media/rc/keymaps/Makefile
+++ b/drivers/media/rc/keymaps/Makefile
@@ -65,6 +65,7 @@ obj-$(CONFIG_RC_MAP) += rc-adstech-dvb-t-pci.o \
 			rc-nec-terratec-cinergy-xs.o \
 			rc-norwood.o \
 			rc-npgtech.o \
+			rc-odroid.o \
 			rc-pctv-sedna.o \
 			rc-pine64.o \
 			rc-pinnacle-color.o \
diff --git a/drivers/media/rc/keymaps/rc-odroid.c b/drivers/media/rc/keymaps/rc-odroid.c
new file mode 100644
index 000000000000..52089f0b7c1d
--- /dev/null
+++ b/drivers/media/rc/keymaps/rc-odroid.c
@@ -0,0 +1,52 @@
+/* Keytable for ODROID IR Remote Controller
+ *
+ * Copyright (c) 2017 Hardkernel co., Ltd.
+ *
+ * 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>
+#include <linux/module.h>
+
+static struct rc_map_table odroid[] = {
+	{ 0xb2dc, KEY_POWER },
+	{ 0xb288, KEY_MUTE },
+	{ 0xb282, KEY_HOME },
+	{ 0xb2ce, KEY_OK },
+	{ 0xb2ca, KEY_UP },
+	{ 0xb299, KEY_LEFT },
+	{ 0xb2c1, KEY_RIGHT },
+	{ 0xb2d2, KEY_DOWN },
+	{ 0xb2c5, KEY_MENU },
+	{ 0xb29a, KEY_BACK },
+	{ 0xb281, KEY_VOLUMEDOWN },
+	{ 0xb280, KEY_VOLUMEUP },
+};
+
+static struct rc_map_list odroid_map = {
+	.map = {
+		.scan    = odroid,
+		.size    = ARRAY_SIZE(odroid),
+		.rc_type = RC_TYPE_NEC,
+		.name    = RC_MAP_ODROID,
+	}
+};
+
+static int __init init_rc_map_odroid(void)
+{
+	return rc_map_register(&odroid_map);
+}
+
+static void __exit exit_rc_map_odroid(void)
+{
+	rc_map_unregister(&odroid_map);
+}
+
+module_init(init_rc_map_odroid)
+module_exit(exit_rc_map_odroid)
+
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("Hardkernel co., Ltd.");
diff --git a/include/media/rc-map.h b/include/media/rc-map.h
index 3a34a9631dd1..f1badbfbca90 100644
--- a/include/media/rc-map.h
+++ b/include/media/rc-map.h
@@ -172,6 +172,7 @@ void rc_map_init(void);
 #define RC_MAP_NEC_TERRATEC_CINERGY_XS   "rc-nec-terratec-cinergy-xs"
 #define RC_MAP_NORWOOD                   "rc-norwood"
 #define RC_MAP_NPGTECH                   "rc-npgtech"
+#define RC_MAP_ODROID                    "rc-odroid"
 #define RC_MAP_PCTV_SEDNA                "rc-pctv-sedna"
 #define RC_MAP_PINE64                    "rc-pine64"
 #define RC_MAP_PINNACLE_COLOR            "rc-pinnacle-color"

From 0cb159b68f91fb352861a23241a24611201e0d05 Mon Sep 17 00:00:00 2001
From: Jonas Karlman <jonas@kwiboo.se>
Date: Wed, 6 Sep 2017 18:39:09 +0200
Subject: [PATCH] [media] rc/keymaps: add keytable for WeTek Hub Remote
 Controller

---
 drivers/media/rc/keymaps/Makefile       |  1 +
 drivers/media/rc/keymaps/rc-wetek-hub.c | 52 +++++++++++++++++++++++++++++++++
 include/media/rc-map.h                  |  1 +
 3 files changed, 54 insertions(+)
 create mode 100644 drivers/media/rc/keymaps/rc-wetek-hub.c

diff --git a/drivers/media/rc/keymaps/Makefile b/drivers/media/rc/keymaps/Makefile
index f4321cfbbc79..e8e6434cbc13 100644
--- a/drivers/media/rc/keymaps/Makefile
+++ b/drivers/media/rc/keymaps/Makefile
@@ -101,6 +101,7 @@ obj-$(CONFIG_RC_MAP) += rc-adstech-dvb-t-pci.o \
 			rc-tt-1500.o \
 			rc-twinhan-dtv-cab-ci.o \
 			rc-twinhan1027.o \
+			rc-wetek-hub.o \
 			rc-videomate-m1f.o \
 			rc-videomate-s350.o \
 			rc-videomate-tv-pvr.o \
diff --git a/drivers/media/rc/keymaps/rc-wetek-hub.c b/drivers/media/rc/keymaps/rc-wetek-hub.c
new file mode 100644
index 000000000000..0955ecfcb77c
--- /dev/null
+++ b/drivers/media/rc/keymaps/rc-wetek-hub.c
@@ -0,0 +1,52 @@
+/* Keytable for WeTek Hub Remote Controller
+ *
+ * Copyright (c) 2017 WeTek
+ *
+ * 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>
+#include <linux/module.h>
+
+static struct rc_map_table wetek_hub[] = {
+	{ 0x77f1, KEY_POWER },
+	{ 0x77f2, KEY_HOME },
+	{ 0x77f3, KEY_MUTE },
+	{ 0x77f4, KEY_UP },
+	{ 0x77f5, KEY_DOWN },
+	{ 0x77f6, KEY_LEFT },
+	{ 0x77f7, KEY_RIGHT },
+	{ 0x77f8, KEY_OK },
+	{ 0x77f9, KEY_BACK },
+	{ 0x77fa, KEY_MENU },
+	{ 0x77fb, KEY_VOLUMEUP },
+	{ 0x77fc, KEY_VOLUMEDOWN },
+};
+
+static struct rc_map_list wetek_hub_map = {
+	.map = {
+		.scan    = wetek_hub,
+		.size    = ARRAY_SIZE(wetek_hub),
+		.rc_type = RC_TYPE_NEC,
+		.name    = RC_MAP_WETEK_HUB,
+	}
+};
+
+static int __init init_rc_map_wetek_hub(void)
+{
+	return rc_map_register(&wetek_hub_map);
+}
+
+static void __exit exit_rc_map_wetek_hub(void)
+{
+	rc_map_unregister(&wetek_hub_map);
+}
+
+module_init(init_rc_map_wetek_hub)
+module_exit(exit_rc_map_wetek_hub)
+
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("WeTek");
diff --git a/include/media/rc-map.h b/include/media/rc-map.h
index f1badbfbca90..cd8590c99e22 100644
--- a/include/media/rc-map.h
+++ b/include/media/rc-map.h
@@ -209,6 +209,7 @@ void rc_map_init(void);
 #define RC_MAP_TT_1500                   "rc-tt-1500"
 #define RC_MAP_TWINHAN_DTV_CAB_CI        "rc-twinhan-dtv-cab-ci"
 #define RC_MAP_TWINHAN_VP1027_DVBS       "rc-twinhan1027"
+#define RC_MAP_WETEK_HUB                 "rc-wetek-hub"
 #define RC_MAP_VIDEOMATE_K100            "rc-videomate-k100"
 #define RC_MAP_VIDEOMATE_S350            "rc-videomate-s350"
 #define RC_MAP_VIDEOMATE_TV_PVR          "rc-videomate-tv-pvr"

From d81bc903c323311f09eb3f8a298c10d99c62f601 Mon Sep 17 00:00:00 2001
From: Jonas Karlman <jonas@kwiboo.se>
Date: Wed, 6 Sep 2017 18:39:09 +0200
Subject: [PATCH] [media] rc/keymaps: add keytable for WeTek Play 2 Remote
 Controller

---
 drivers/media/rc/keymaps/Makefile          |  1 +
 drivers/media/rc/keymaps/rc-wetek-play-2.c | 83 ++++++++++++++++++++++++++++++
 include/media/rc-map.h                     |  1 +
 3 files changed, 85 insertions(+)
 create mode 100644 drivers/media/rc/keymaps/rc-wetek-play-2.c

diff --git a/drivers/media/rc/keymaps/Makefile b/drivers/media/rc/keymaps/Makefile
index e8e6434cbc13..650481039f00 100644
--- a/drivers/media/rc/keymaps/Makefile
+++ b/drivers/media/rc/keymaps/Makefile
@@ -102,6 +102,7 @@ obj-$(CONFIG_RC_MAP) += rc-adstech-dvb-t-pci.o \
 			rc-twinhan-dtv-cab-ci.o \
 			rc-twinhan1027.o \
 			rc-wetek-hub.o \
+			rc-wetek-play-2.o \
 			rc-videomate-m1f.o \
 			rc-videomate-s350.o \
 			rc-videomate-tv-pvr.o \
diff --git a/drivers/media/rc/keymaps/rc-wetek-play-2.c b/drivers/media/rc/keymaps/rc-wetek-play-2.c
new file mode 100644
index 000000000000..37586cedbb8a
--- /dev/null
+++ b/drivers/media/rc/keymaps/rc-wetek-play-2.c
@@ -0,0 +1,83 @@
+/* Keytable for WeTek Play 2 Remote Controller
+ *
+ * Copyright (c) 2017 WeTek
+ *
+ * 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>
+#include <linux/module.h>
+
+static struct rc_map_table wetek_play_2[] = {
+	{ 0x5e5f02, KEY_POWER },
+	{ 0x5e5f46, KEY_POWER2 },
+	{ 0x5e5f10, KEY_MUTE },
+	{ 0x5e5f22, KEY_NUMERIC_1 },
+	{ 0x5e5f23, KEY_NUMERIC_2 },
+	{ 0x5e5f24, KEY_NUMERIC_3 },
+	{ 0x5e5f25, KEY_NUMERIC_4 },
+	{ 0x5e5f26, KEY_NUMERIC_5 },
+	{ 0x5e5f27, KEY_NUMERIC_6 },
+	{ 0x5e5f28, KEY_NUMERIC_7 },
+	{ 0x5e5f29, KEY_NUMERIC_8 },
+	{ 0x5e5f30, KEY_NUMERIC_9 },
+	{ 0x5e5f71, KEY_BACKSPACE },
+	{ 0x5e5f21, KEY_NUMERIC_0 },
+	{ 0x5e5f72, KEY_CAPSLOCK },
+	{ 0x5e5f03, KEY_HOME },
+	{ 0x5e5f48, KEY_MENU },
+	{ 0x5e5f61, KEY_BACK },
+	{ 0x5e5f83, KEY_INFO },
+	{ 0x5e5f84, KEY_COMPOSE },
+	{ 0x5e5f77, KEY_HELP },
+	{ 0x5e5f50, KEY_UP },
+	{ 0x5e5f4b, KEY_DOWN },
+	{ 0x5e5f4c, KEY_LEFT },
+	{ 0x5e5f4d, KEY_RIGHT },
+	{ 0x5e5f47, KEY_OK },
+	{ 0x5e5f44, KEY_VOLUMEUP },
+	{ 0x5e5f43, KEY_VOLUMEDOWN },
+	{ 0x5e5f41, KEY_CHANNELUP },
+	{ 0x5e5f42, KEY_CHANNELDOWN },
+	{ 0x5e5f4f, KEY_ZENKAKUHANKAKU },
+	{ 0x5e5f82, KEY_TEXT },
+	{ 0x5e5f73, KEY_RED },
+	{ 0x5e5f74, KEY_GREEN },
+	{ 0x5e5f75, KEY_YELLOW },
+	{ 0x5e5f76, KEY_BLUE },
+	{ 0x5e5f67, KEY_PREVIOUS },
+	{ 0x5e5f79, KEY_REWIND },
+	{ 0x5e5f80, KEY_FASTFORWARD },
+	{ 0x5e5f81, KEY_NEXT },
+	{ 0x5e5f04, KEY_RECORD },
+	{ 0x5e5f2c, KEY_PLAYPAUSE },
+	{ 0x5e5f2b, KEY_STOP },
+};
+
+static struct rc_map_list wetek_play_2_map = {
+	.map = {
+		.scan    = wetek_play_2,
+		.size    = ARRAY_SIZE(wetek_play_2),
+		.rc_type = RC_TYPE_NEC,
+		.name    = RC_MAP_WETEK_PLAY_2,
+	}
+};
+
+static int __init init_rc_map_wetek_play_2(void)
+{
+	return rc_map_register(&wetek_play_2_map);
+}
+
+static void __exit exit_rc_map_wetek_play_2(void)
+{
+	rc_map_unregister(&wetek_play_2_map);
+}
+
+module_init(init_rc_map_wetek_play_2)
+module_exit(exit_rc_map_wetek_play_2)
+
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("WeTek");
diff --git a/include/media/rc-map.h b/include/media/rc-map.h
index cd8590c99e22..93cac05a5170 100644
--- a/include/media/rc-map.h
+++ b/include/media/rc-map.h
@@ -210,6 +210,7 @@ void rc_map_init(void);
 #define RC_MAP_TWINHAN_DTV_CAB_CI        "rc-twinhan-dtv-cab-ci"
 #define RC_MAP_TWINHAN_VP1027_DVBS       "rc-twinhan1027"
 #define RC_MAP_WETEK_HUB                 "rc-wetek-hub"
+#define RC_MAP_WETEK_PLAY_2              "rc-wetek-play-2"
 #define RC_MAP_VIDEOMATE_K100            "rc-videomate-k100"
 #define RC_MAP_VIDEOMATE_S350            "rc-videomate-s350"
 #define RC_MAP_VIDEOMATE_TV_PVR          "rc-videomate-tv-pvr"

From 6518b8acbe53a153740bad1e93c9d361fed136fd Mon Sep 17 00:00:00 2001
From: hzq <hzq@t-firefly.com>
Date: Mon, 19 Mar 2018 16:47:24 +0800
Subject: [PATCH] [media] rc/keymaps: add keytable for ROC-RK3328-CC Remote
 Controller

---
 drivers/media/rc/keymaps/Makefile    |  1 +
 drivers/media/rc/keymaps/rc-roc-cc.c | 52 ++++++++++++++++++++++++++++++++++++
 include/media/rc-map.h               |  1 +
 3 files changed, 54 insertions(+)
 create mode 100644 drivers/media/rc/keymaps/rc-roc-cc.c

diff --git a/drivers/media/rc/keymaps/Makefile b/drivers/media/rc/keymaps/Makefile
index 650481039f00..b743914487a5 100644
--- a/drivers/media/rc/keymaps/Makefile
+++ b/drivers/media/rc/keymaps/Makefile
@@ -83,6 +83,7 @@ obj-$(CONFIG_RC_MAP) += rc-adstech-dvb-t-pci.o \
 			rc-rc6-mce.o \
 			rc-real-audio-220-32-keys.o \
 			rc-reddo.o \
+			rc-roc-cc.o \
 			rc-snapstream-firefly.o \
 			rc-streamzap.o \
 			rc-tbs-nec.o \
diff --git a/drivers/media/rc/keymaps/rc-roc-cc.c b/drivers/media/rc/keymaps/rc-roc-cc.c
new file mode 100644
index 000000000000..3a2a255d5723
--- /dev/null
+++ b/drivers/media/rc/keymaps/rc-roc-cc.c
@@ -0,0 +1,52 @@
+/* Keytable for ROC-RK3328-CC IR Remote Controller
+ *
+ * Copyright (c) 2017 ROC-RK3328-CC
+ *
+ * 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>
+#include <linux/module.h>
+
+static struct rc_map_table roc_cc[] = {
+	{ 0x28d7, KEY_POWER },
+	{ 0xc837, KEY_MUTE },
+	{ 0xe01f, KEY_ENTER},
+	{ 0xc03f, KEY_UP },
+	{ 0x40bf, KEY_DOWN },
+	{ 0x708f, KEY_LEFT },
+	{ 0x58a7, KEY_RIGHT },
+	{ 0x1ae5, KEY_VOLUMEDOWN },
+	{ 0xd02f, KEY_VOLUMEUP },
+	{ 0x3ac5, KEY_WWW },
+	{ 0x807f, KEY_BACK },
+	{ 0x12ed, KEY_HOME },
+};
+
+static struct rc_map_list roc_cc_map = {
+	.map = {
+		.scan    = roc_cc,
+		.size    = ARRAY_SIZE(roc_cc),
+		.rc_type = RC_TYPE_NEC,
+		.name    = RC_MAP_ROC_CC,
+	}
+};
+
+static int __init init_rc_map_roc_cc(void)
+{
+	return rc_map_register(&roc_cc_map);
+}
+
+static void __exit exit_rc_map_roc_cc(void)
+{
+	rc_map_unregister(&roc_cc_map);
+}
+
+module_init(init_rc_map_roc_cc)
+module_exit(exit_rc_map_roc_cc)
+
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("ROC-RK3328-CC");
diff --git a/include/media/rc-map.h b/include/media/rc-map.h
index 93cac05a5170..8bbe335e650c 100644
--- a/include/media/rc-map.h
+++ b/include/media/rc-map.h
@@ -191,6 +191,7 @@ void rc_map_init(void);
 #define RC_MAP_RC6_MCE                   "rc-rc6-mce"
 #define RC_MAP_REAL_AUDIO_220_32_KEYS    "rc-real-audio-220-32-keys"
 #define RC_MAP_REDDO                     "rc-reddo"
+#define RC_MAP_ROC_CC                    "rc-roc-cc"
 #define RC_MAP_SNAPSTREAM_FIREFLY        "rc-snapstream-firefly"
 #define RC_MAP_STREAMZAP                 "rc-streamzap"
 #define RC_MAP_TBS_NEC                   "rc-tbs-nec"

From c0220800efec28f6a59eae563f4f083ceedff6cc Mon Sep 17 00:00:00 2001
From: Jonas Karlman <jonas@kwiboo.se>
Date: Tue, 3 Jul 2018 21:55:56 +0200
Subject: [PATCH] [media] rc/keymaps: add keytable for T-Chip TRN9 IR Remote
 Controller

---
 drivers/media/rc/keymaps/Makefile  |  1 +
 drivers/media/rc/keymaps/rc-trn9.c | 52 ++++++++++++++++++++++++++++++++++++++
 include/media/rc-map.h             |  1 +
 3 files changed, 54 insertions(+)
 create mode 100644 drivers/media/rc/keymaps/rc-trn9.c

diff --git a/drivers/media/rc/keymaps/Makefile b/drivers/media/rc/keymaps/Makefile
index b743914487a5..2aaa1b33ddca 100644
--- a/drivers/media/rc/keymaps/Makefile
+++ b/drivers/media/rc/keymaps/Makefile
@@ -102,6 +102,7 @@ obj-$(CONFIG_RC_MAP) += rc-adstech-dvb-t-pci.o \
 			rc-tt-1500.o \
 			rc-twinhan-dtv-cab-ci.o \
 			rc-twinhan1027.o \
+			rc-trn9.o \
 			rc-wetek-hub.o \
 			rc-wetek-play-2.o \
 			rc-videomate-m1f.o \
diff --git a/drivers/media/rc/keymaps/rc-trn9.c b/drivers/media/rc/keymaps/rc-trn9.c
new file mode 100644
index 000000000000..f81bc3a419b3
--- /dev/null
+++ b/drivers/media/rc/keymaps/rc-trn9.c
@@ -0,0 +1,52 @@
+/* Keytable for T-Chip TRN9 IR Remote Controller
+ *
+ * Copyright (c) 2018 Omegamoon
+ *
+ * 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>
+#include <linux/module.h>
+
+static struct rc_map_table trn9[] = {
+	{ 0x0014, KEY_POWER },
+	{ 0x0013, KEY_MENU },
+	{ 0x0003, KEY_UP },
+	{ 0x0002, KEY_DOWN },
+	{ 0x000e, KEY_LEFT },
+	{ 0x001a, KEY_RIGHT },
+	{ 0x0007, KEY_OK },
+	{ 0x0058, KEY_VOLUMEDOWN },
+	{ 0x005c, KEY_MUTE },
+	{ 0x000b, KEY_VOLUMEUP },
+	{ 0x0001, KEY_BACK },
+	{ 0x0048, KEY_HOME },
+};
+
+static struct rc_map_list trn9_map = {
+	.map = {
+		.scan    = trn9,
+		.size    = ARRAY_SIZE(trn9),
+		.rc_type = RC_TYPE_NEC,
+		.name    = RC_MAP_TRN9,
+	}
+};
+
+static int __init init_rc_map_trn9(void)
+{
+	return rc_map_register(&trn9_map);
+}
+
+static void __exit exit_rc_map_trn9(void)
+{
+	rc_map_unregister(&trn9_map);
+}
+
+module_init(init_rc_map_trn9)
+module_exit(exit_rc_map_trn9)
+
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("Omegamoon");
diff --git a/include/media/rc-map.h b/include/media/rc-map.h
index 8bbe335e650c..66e1c50b38fc 100644
--- a/include/media/rc-map.h
+++ b/include/media/rc-map.h
@@ -210,6 +210,7 @@ void rc_map_init(void);
 #define RC_MAP_TT_1500                   "rc-tt-1500"
 #define RC_MAP_TWINHAN_DTV_CAB_CI        "rc-twinhan-dtv-cab-ci"
 #define RC_MAP_TWINHAN_VP1027_DVBS       "rc-twinhan1027"
+#define RC_MAP_TRN9                 	  "rc-trn9"
 #define RC_MAP_WETEK_HUB                 "rc-wetek-hub"
 #define RC_MAP_WETEK_PLAY_2              "rc-wetek-play-2"
 #define RC_MAP_VIDEOMATE_K100            "rc-videomate-k100"

From 312b78202feca8f3966343b0362466e9c6ff2297 Mon Sep 17 00:00:00 2001
From: Jonas Karlman <jonas@kwiboo.se>
Date: Mon, 17 Dec 2018 07:41:16 +0100
Subject: [PATCH] [media] rc/keymaps: add keytable for Khadas IR Remote
 Controller

---
 drivers/media/rc/keymaps/Makefile    |  1 +
 drivers/media/rc/keymaps/rc-khadas.c | 52 ++++++++++++++++++++++++++++++++++++
 include/media/rc-map.h               |  1 +
 3 files changed, 54 insertions(+)
 create mode 100644 drivers/media/rc/keymaps/rc-khadas.c

diff --git a/drivers/media/rc/keymaps/Makefile b/drivers/media/rc/keymaps/Makefile
index 2aaa1b33ddca..fc0207d322a0 100644
--- a/drivers/media/rc/keymaps/Makefile
+++ b/drivers/media/rc/keymaps/Makefile
@@ -47,6 +47,7 @@ obj-$(CONFIG_RC_MAP) += rc-adstech-dvb-t-pci.o \
 			rc-it913x-v1.o \
 			rc-it913x-v2.o \
 			rc-kaiomy.o \
+			rc-khadas.o \
 			rc-kworld-315u.o \
 			rc-kworld-pc150u.o \
 			rc-kworld-plus-tv-analog.o \
diff --git a/drivers/media/rc/keymaps/rc-khadas.c b/drivers/media/rc/keymaps/rc-khadas.c
new file mode 100644
index 000000000000..492368db75d9
--- /dev/null
+++ b/drivers/media/rc/keymaps/rc-khadas.c
@@ -0,0 +1,52 @@
+/* Keytable for Khadas IR Remote Controller
+ *
+ * Copyright (c) 2018 Shenzhen Wesion Technology Co., Ltd
+ *
+ * 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>
+#include <linux/module.h>
+
+static struct rc_map_table khadas[] = {
+	{ 0x14, KEY_POWER },
+	{ 0x07, KEY_OK },
+	{ 0x03, KEY_UP },
+	{ 0x02, KEY_DOWN },
+	{ 0x0e, KEY_LEFT },
+	{ 0x1a, KEY_RIGHT },
+	{ 0x13, KEY_MENU },
+	{ 0x01, KEY_BACK },
+	{ 0x0b, KEY_VOLUMEUP },
+	{ 0x58, KEY_VOLUMEDOWN },
+	{ 0x48, KEY_HOME },
+	{ 0x5b, KEY_CONTEXT_MENU },
+};
+
+static struct rc_map_list khadas_map = {
+	.map = {
+		.scan    = khadas,
+		.size    = ARRAY_SIZE(khadas),
+		.rc_type = RC_TYPE_NEC,
+		.name    = RC_MAP_KHADAS,
+	}
+};
+
+static int __init init_rc_map_khadas(void)
+{
+	return rc_map_register(&khadas_map);
+}
+
+static void __exit exit_rc_map_khadas(void)
+{
+	rc_map_unregister(&khadas_map);
+}
+
+module_init(init_rc_map_khadas)
+module_exit(exit_rc_map_khadas)
+
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("Khadas");
diff --git a/include/media/rc-map.h b/include/media/rc-map.h
index 66e1c50b38fc..6b2db526fac0 100644
--- a/include/media/rc-map.h
+++ b/include/media/rc-map.h
@@ -154,6 +154,7 @@ void rc_map_init(void);
 #define RC_MAP_IT913X_V1                 "rc-it913x-v1"
 #define RC_MAP_IT913X_V2                 "rc-it913x-v2"
 #define RC_MAP_KAIOMY                    "rc-kaiomy"
+#define RC_MAP_KHADAS                    "rc-khadas"
 #define RC_MAP_KWORLD_315U               "rc-kworld-315u"
 #define RC_MAP_KWORLD_PC150U             "rc-kworld-pc150u"
 #define RC_MAP_KWORLD_PLUS_TV_ANALOG     "rc-kworld-plus-tv-analog"
--- a/drivers/media/rc/keymaps/rc-rktvbox.c
+++ b/drivers/media/rc/keymaps/rc-rktvbox.c
@@ -0,0 +1,65 @@
+/* Keytable for Rockchip TV Box IR Remote Controller
+ *
+ * Copyright (c) 2018 knaerzche
+ *
+ * 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>
+#include <linux/module.h>
+
+static struct rc_map_table rktvbox[] = {
+	{ 0xcc1d49, KEY_NUMERIC_0 },
+	{ 0xcc1d41, KEY_NUMERIC_1 },
+	{ 0xcc1d45, KEY_NUMERIC_2 },
+	{ 0xcc1d4d, KEY_NUMERIC_3 },
+	{ 0xcc1d42, KEY_NUMERIC_4 },
+	{ 0xcc1d46, KEY_NUMERIC_5 },
+	{ 0xcc1d4e, KEY_NUMERIC_6 },
+	{ 0xcc1d43, KEY_NUMERIC_7 },
+	{ 0xcc1d47, KEY_NUMERIC_8 },
+	{ 0xcc1d4f, KEY_NUMERIC_9 },
+	{ 0xcc1d0c, KEY_MUTE },
+	{ 0xcc1d07, KEY_UP },
+	{ 0xcc1d4a, KEY_BACKSPACE },
+	{ 0xcc1d11, KEY_OK },
+	{ 0xcc1d44, KEY_DOWN },
+	{ 0xcc1d10, KEY_LEFT },
+	{ 0xcc1d12, KEY_RIGHT },
+	{ 0xcc1d02, KEY_VOLUMEDOWN },
+	{ 0xcc1d0e, KEY_VOLUMEUP },
+	{ 0xcc1d03, KEY_HOME },
+	{ 0xcc1d40, KEY_MENU },
+	{ 0xcc1d09, KEY_WWW },
+	{ 0xcc1d0f, KEY_BACK },
+	{ 0xcc1d4c, KEY_INFO },
+	{ 0xcc1d00, KEY_POWER },
+};
+
+static struct rc_map_list rktvbox_map = {
+	.map = {
+		.scan     = rktvbox,
+		.size     = ARRAY_SIZE(rktvbox),
+               .rc_proto = RC_PROTO_NEC,
+		.name     = RC_MAP_RKTVBOX,
+	}
+};
+
+static int __init init_rc_map_rktvbox(void)
+{
+	return rc_map_register(&rktvbox_map);
+}
+
+static void __exit exit_rc_map_rktvbox(void)
+{
+	rc_map_unregister(&rktvbox_map);
+}
+
+module_init(init_rc_map_rktvbox)
+module_exit(exit_rc_map_rktvbox)
+
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("knaerzche");
--- a/drivers/media/rc/keymaps/Makefile
+++ b/drivers/media/rc/keymaps/Makefile
@@ -69,6 +69,7 @@
 			rc-odroid.o \
 			rc-pctv-sedna.o \
 			rc-pine64.o \
+			rc-rktvbox.o \
 			rc-pinnacle-color.o \
 			rc-pinnacle-grey.o \
 			rc-pinnacle-pctv-hd.o \
--- a/include/media/rc-map.h
+++ b/include/media/rc-map.h
@@ -178,6 +178,7 @@
 #define RC_MAP_ODROID                    "rc-odroid"
 #define RC_MAP_PCTV_SEDNA                "rc-pctv-sedna"
 #define RC_MAP_PINE64                    "rc-pine64"
+#define RC_MAP_RKTVBOX                   "rc-rktvbox"
 #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"
