1
0
mirror of https://github.com/libretro/Lakka-LibreELEC.git synced 2024-11-28 03:54:36 +00:00
Lakka-LibreELEC/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0112-WIP-media-rc-add-keymap-for-Sunvell-T95Z-Plus.patch
2023-03-14 11:10:30 +00:00

122 lines
3.5 KiB
Diff

From 2e8380078a0b306ba9f71dcfca1f8c5ccf0152f0 Mon Sep 17 00:00:00 2001
From: Christian Hewitt <christianshewitt@gmail.com>
Date: Mon, 13 Feb 2023 19:03:10 +0000
Subject: [PATCH 112/120] WIP: media: rc: add keymap for Sunvell T95Z Plus
Signed-off-by: Christian Hewitt <christianshewitt@gmail.com>
---
drivers/media/rc/keymaps/Makefile | 1 +
.../media/rc/keymaps/rc-sunvell-t95z-plus.c | 75 +++++++++++++++++++
include/media/rc-map.h | 1 +
3 files changed, 77 insertions(+)
create mode 100644 drivers/media/rc/keymaps/rc-sunvell-t95z-plus.c
diff --git a/drivers/media/rc/keymaps/Makefile b/drivers/media/rc/keymaps/Makefile
index 03bc9a8d355e..17547c0bcbde 100644
--- a/drivers/media/rc/keymaps/Makefile
+++ b/drivers/media/rc/keymaps/Makefile
@@ -109,6 +109,7 @@ obj-$(CONFIG_RC_MAP) += \
rc-reddo.o \
rc-snapstream-firefly.o \
rc-streamzap.o \
+ rc-sunvell-t95z-plus.o \
rc-su3000.o \
rc-tanix-tx3mini.o \
rc-tanix-tx5max.o \
diff --git a/drivers/media/rc/keymaps/rc-sunvell-t95z-plus.c b/drivers/media/rc/keymaps/rc-sunvell-t95z-plus.c
new file mode 100644
index 000000000000..aaaf6b1c0045
--- /dev/null
+++ b/drivers/media/rc/keymaps/rc-sunvell-t95z-plus.c
@@ -0,0 +1,75 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (c) 2023 Christian Hewitt <christianshewitt@gmail.com
+ */
+
+#include <media/rc-map.h>
+#include <linux/module.h>
+
+/*
+ * Keytable for Sunvell T95Z Plus remote control
+ *
+ */
+
+static struct rc_map_table sunvell_t95z_plus[] = {
+ { 0xdf1c, KEY_POWER },
+ // TV CONTROLS
+
+ { 0xdf4b, KEY_PREVIOUS },
+ { 0xdf01, KEY_SCREEN }, // TV
+ { 0xdf5d, KEY_VOLUMEUP },
+
+ { 0xdf4f, KEY_NEXT },
+ { 0xdf5f, KEY_FAVORITES }, // KODI
+ { 0xdf5c, KEY_VOLUMEDOWN },
+
+ { 0xdf42, KEY_HOME },
+ { 0xdf0a, KEY_BACK },
+
+ { 0xdf1a, KEY_UP },
+ { 0xdf47, KEY_LEFT },
+ { 0xdf06, KEY_ENTER },
+ { 0xdf07, KEY_RIGHT },
+ { 0xdf48, KEY_DOWN },
+
+ { 0xdf03, KEY_INFO }, // MOUSE
+ { 0xdf18, KEY_MENU },
+
+ { 0xdf54, KEY_1 },
+ { 0xdf16, KEY_2 },
+ { 0xdf15, KEY_3 },
+ { 0xdf50, KEY_4 },
+ { 0xdf12, KEY_5 },
+ { 0xdf11, KEY_6 },
+ { 0xdf4c, KEY_7 },
+ { 0xdf0e, KEY_8 },
+ { 0xdf0d, KEY_9 },
+ { 0xdf41, KEY_WWW }, // WORLD
+ { 0xdf0c, KEY_0 },
+ { 0xdf10, KEY_DELETE },
+};
+
+static struct rc_map_list sunvell_t95z_plus_map = {
+ .map = {
+ .scan = sunvell_t95z_plus,
+ .size = ARRAY_SIZE(sunvell_t95z_plus),
+ .rc_proto = RC_PROTO_NEC,
+ .name = RC_MAP_SUNVELL_T95Z_PLUS,
+ }
+};
+
+static int __init init_rc_map_sunvell_t95z_plus(void)
+{
+ return rc_map_register(&sunvell_t95z_plus_map);
+}
+
+static void __exit exit_rc_map_sunvell_t95z_plus(void)
+{
+ rc_map_unregister(&sunvell_t95z_plus_map);
+}
+
+module_init(init_rc_map_sunvell_t95z_plus)
+module_exit(exit_rc_map_sunvell_t95z_plus)
+
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("Christian Hewitt <christianshewitt@gmail.com>");
diff --git a/include/media/rc-map.h b/include/media/rc-map.h
index dadd4d27a760..b561b122e498 100644
--- a/include/media/rc-map.h
+++ b/include/media/rc-map.h
@@ -315,6 +315,7 @@ struct rc_map *rc_map_get(const char *name);
#define RC_MAP_REDDO "rc-reddo"
#define RC_MAP_SNAPSTREAM_FIREFLY "rc-snapstream-firefly"
#define RC_MAP_STREAMZAP "rc-streamzap"
+#define RC_MAP_SUNVELL_T95Z_PLUS "rc-sunvell-t95z-plus"
#define RC_MAP_SU3000 "rc-su3000"
#define RC_MAP_TANIX_TX3MINI "rc-tanix-tx3mini"
#define RC_MAP_TANIX_TX5MAX "rc-tanix-tx5max"
--
2.34.1