Skip to contentSkip to conversation

media: rc: add common keymap for Dreambox RC10 and RC20/RC-BT remotes

PATCH Superseded Christian Hewitt 3 participants 3 messages Jan 28, 2023 – Jan 31, 2023

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 media: rc: add common keymap for Dreambox RC10 and RC20/RC-BT remotes

From: Emanuel Strobel <[email protected]>

Add a common keymap and bindings for the RC10 and RC20/RC-BT remotes used with the Dreambox One and Dreambox Two DVB-S/T boxes. The maps are combined since the IR codes do not conflict and both boxes have shipped with both remote designs.

---
 .../devicetree/bindings/media/rc.yaml         |   1 +
 drivers/media/rc/keymaps/Makefile             |   1 +
 drivers/media/rc/keymaps/rc-dreambox.c        | 147 ++++++++++++++++++
 include/media/rc-map.h                        |   1 +
 4 files changed, 150 insertions(+)
 create mode 100644 drivers/media/rc/keymaps/rc-dreambox.c
Documentation/devicetree/bindings/media/rc.yaml +1 -0
index d4ef523cb3d5..f390a5d2c82d 100644
@@ -56,6 +56,7 @@ properties:
       - rc-dm1105-nec
       - rc-dntv-live-dvb-t
       - rc-dntv-live-dvbt-pro
+      - rc-dreambox
       - rc-dtt200u
       - rc-dvbsky
       - rc-dvico-mce
drivers/media/rc/keymaps/Makefile +1 -0
index 77d8b5a69815..03bc9a8d355e 100644
@@ -38,6 +38,7 @@ obj-$(CONFIG_RC_MAP) += \
 			rc-dm1105-nec.o \
 			rc-dntv-live-dvb-t.o \
 			rc-dntv-live-dvbt-pro.o \
+			rc-dreambox.o \
 			rc-dtt200u.o \
 			rc-dvbsky.o \
 			rc-dvico-mce.o \
drivers/media/rc/keymaps/rc-dreambox.c new file +147 -0

147 lines not on this page · raw message

include/media/rc-map.h +1 -0
index 43d254930daa..dadd4d27a760 100644
@@ -242,6 +242,7 @@ struct rc_map *rc_map_get(const char *name);
 #define RC_MAP_DM1105_NEC                "rc-dm1105-nec"
 #define RC_MAP_DNTV_LIVE_DVB_T           "rc-dntv-live-dvb-t"
 #define RC_MAP_DNTV_LIVE_DVBT_PRO        "rc-dntv-live-dvbt-pro"
+#define RC_MAP_DREAMBOX                  "rc-dreambox"
 #define RC_MAP_DTT200U                   "rc-dtt200u"
 #define RC_MAP_DVBSKY                    "rc-dvbsky"
 #define RC_MAP_DVICO_MCE		 "rc-dvico-mce"
Signature · 1 line
2.34.1
#1 lore raw
Quoted 22 lines · Christian Hewitt

From: Emanuel Strobel <[email protected]>

Add a common keymap and bindings for the RC10 and RC20/RC-BT remotes used with the Dreambox One and Dreambox Two DVB-S/T boxes. The maps are combined since the IR codes do not conflict and both boxes have shipped with both remote designs.

---
 .../devicetree/bindings/media/rc.yaml         |   1 +
 drivers/media/rc/keymaps/Makefile             |   1 +
 drivers/media/rc/keymaps/rc-dreambox.c        | 147 ++++++++++++++++++
 include/media/rc-map.h                        |   1 +
 4 files changed, 150 insertions(+)
 create mode 100644 drivers/media/rc/keymaps/rc-dreambox.c
Documentation/devicetree/bindings/media/rc.yaml +0 -0
index d4ef523cb3d5..f390a5d2c82d 100644

Documentation/devicetree/bindings/media/rc.yaml properties: · line 58

Quoted 3 lines
Documentation/devicetree/bindings/media/rc.yaml +0 -0
@@ -56,6 +56,7 @@ properties:
       - rc-dm1105-nec
       - rc-dntv-live-dvb-t
       - rc-dntv-live-dvbt-pro

Bindings are separate patches.

Best regards,
Krzysztof

maintainer
#2 lore raw
In reply to Christian Hewitt
Quoted 47 lines · Christian Hewitt

From: Emanuel Strobel <[email protected]>

Add a common keymap and bindings for the RC10 and RC20/RC-BT remotes used with the Dreambox One and Dreambox Two DVB-S/T boxes. The maps are combined since the IR codes do not conflict and both boxes have shipped with both remote designs.

---
 .../devicetree/bindings/media/rc.yaml         |   1 +
 drivers/media/rc/keymaps/Makefile             |   1 +
 drivers/media/rc/keymaps/rc-dreambox.c        | 147 ++++++++++++++++++
 include/media/rc-map.h                        |   1 +
 4 files changed, 150 insertions(+)
 create mode 100644 drivers/media/rc/keymaps/rc-dreambox.c
Documentation/devicetree/bindings/media/rc.yaml +1 -0
index d4ef523cb3d5..f390a5d2c82d 100644
@@ -56,6 +56,7 @@ properties:
       - rc-dm1105-nec
       - rc-dntv-live-dvb-t
       - rc-dntv-live-dvbt-pro
+      - rc-dreambox
       - rc-dtt200u
       - rc-dvbsky
       - rc-dvico-mce
drivers/media/rc/keymaps/Makefile +1 -0
index 77d8b5a69815..03bc9a8d355e 100644
@@ -38,6 +38,7 @@ obj-$(CONFIG_RC_MAP) += \
 			rc-dm1105-nec.o \
 			rc-dntv-live-dvb-t.o \
 			rc-dntv-live-dvbt-pro.o \
+			rc-dreambox.o \
 			rc-dtt200u.o \
 			rc-dvbsky.o \
 			rc-dvico-mce.o \
drivers/media/rc/keymaps/rc-dreambox.c new file +0 -0
new file mode 100644
index 000000000000..0ccbed367ea3

drivers/media/rc/keymaps/rc-dreambox.c line 9

Quoted 9 lines
drivers/media/rc/keymaps/rc-dreambox.c new file +9 -0
@@ -0,0 +1,147 @@
+// SPDX-License-Identifier: GPL-2.0+
+//
+// Copyright (c) 2021 Emanuel Strobel <[email protected]>
+
+#include <media/rc-map.h>
+#include <linux/module.h>
+
+//
+// Keytable for the Dreabox RC10 and RC20/RC-BT remote controls

Dreambox

drivers/media/rc/keymaps/rc-dreambox.c line 13

Quoted 4 lines
drivers/media/rc/keymaps/rc-dreambox.c new file +4 -0
+//
+
+static struct rc_map_table dreambox[] = {
+

checkpatch.pl --strict says:

Blank lines aren't necessary after an open brace '{'

drivers/media/rc/keymaps/rc-dreambox.c line 18

Quoted 5 lines
drivers/media/rc/keymaps/rc-dreambox.c new file +5 -0
+	/* Dreambox RC10 remote */
+
+	{ 0x3401, KEY_POWER },
+
+	// DREAM

KEY_MEDIA?

drivers/media/rc/keymaps/rc-dreambox.c line 20

Quoted 2 lines
drivers/media/rc/keymaps/rc-dreambox.c new file +2 -0
+	{ 0x3426, KEY_HELP },
+	// TV

How about KEY_TV for this button?

Quoted 24 lines
drivers/media/rc/keymaps/rc-dreambox.c new file +24 -0
+
+	{ 0x3404, KEY_1 },
+	{ 0x3405, KEY_2 },
+	{ 0x3406, KEY_3 },
+	{ 0x3408, KEY_4 },
+	{ 0x3409, KEY_5 },
+	{ 0x340a, KEY_6 },
+	{ 0x340c, KEY_7 },
+	{ 0x340d, KEY_8 },
+	{ 0x340e, KEY_9 },
+	{ 0x340b, KEY_PREVIOUS },
+	{ 0x3410, KEY_0 },
+	{ 0x340f, KEY_NEXT },
+
+	{ 0x341f, KEY_RED },
+	{ 0x3420, KEY_GREEN },
+	{ 0x3421, KEY_YELLOW },
+	{ 0x3422, KEY_BLUE },
+
+	{ 0x341b, KEY_INFO },
+	{ 0x341c, KEY_MENU },
+	{ 0x3430, KEY_AUDIO },
+	{ 0x3431, KEY_PVR },
+

drivers/media/rc/keymaps/rc-dreambox.c line 54

Quoted 10 lines
drivers/media/rc/keymaps/rc-dreambox.c new file +10 -0
+	{ 0x3414, KEY_LEFT },
+	{ 0x3411, KEY_UP },
+	{ 0x3416, KEY_RIGHT },
+	{ 0x3419, KEY_DOWN },
+	{ 0x3415, KEY_OK },
+
+	{ 0x3413, KEY_VOLUMEUP },
+	{ 0x3418, KEY_VOLUMEDOWN },
+
+	{ 0x3412, KEY_ESC }, // EXIT

KEY_EXIT?

drivers/media/rc/keymaps/rc-dreambox.c line 65

Quoted 11 lines
drivers/media/rc/keymaps/rc-dreambox.c new file +11 -0
+	{ 0x3407, KEY_MUTE },
+
+	{ 0x3417, KEY_PAGEUP },
+	{ 0x341a, KEY_PAGEDOWN },
+
+	{ 0x3432, KEY_PREVIOUSSONG },
+	{ 0x3433, KEY_PLAYPAUSE },
+	{ 0x3434, KEY_STOP },
+	{ 0x3435, KEY_NEXTSONG },
+
+	// TV

KEY_TV?

drivers/media/rc/keymaps/rc-dreambox.c line 66

Quoted 1 line
drivers/media/rc/keymaps/rc-dreambox.c new file +1 -0
+	// RADIO

KEY_RADIO?

drivers/media/rc/keymaps/rc-dreambox.c line 73

Quoted 7 lines
drivers/media/rc/keymaps/rc-dreambox.c new file +7 -0
+	{ 0x3425, KEY_TEXT },
+	{ 0x3436, KEY_RECORD },
+
+	/* Dreambox RC20/RC-BT */
+
+	{ 0x321a, KEY_MUTE },
+	// MODE

KEY_MODE?

Quoted 20 lines
drivers/media/rc/keymaps/rc-dreambox.c new file +20 -0
+	{ 0x3200, KEY_POWER },
+
+	{ 0x3223, KEY_PREVIOUSSONG },
+	{ 0x3224, KEY_PLAYPAUSE },
+	{ 0x3226, KEY_NEXTSONG },
+
+	{ 0x322a, KEY_RECORD },
+	{ 0x3225, KEY_STOP },
+	{ 0x3229, KEY_TEXT },
+
+	{ 0x321f, KEY_RED },
+	{ 0x3220, KEY_GREEN },
+	{ 0x3221, KEY_YELLOW },
+	{ 0x3222, KEY_BLUE },
+
+	{ 0x3210, KEY_INFO },
+	{ 0x3212, KEY_MENU },
+	{ 0x320e, KEY_AUDIO },
+	{ 0x3218, KEY_PVR },
+

drivers/media/rc/keymaps/rc-dreambox.c line 103

Quoted 10 lines
drivers/media/rc/keymaps/rc-dreambox.c new file +10 -0
+	{ 0x3213, KEY_LEFT },
+	{ 0x3211, KEY_UP },
+	{ 0x3215, KEY_RIGHT },
+	{ 0x3217, KEY_DOWN },
+	{ 0x3214, KEY_OK },
+
+	{ 0x3219, KEY_VOLUMEUP },
+	{ 0x321c, KEY_VOLUMEDOWN },
+
+	{ 0x321d, KEY_ESC }, // EXIT

KEY_EXIT?

Quoted 8 lines
drivers/media/rc/keymaps/rc-dreambox.c new file +8 -0
+	{ 0x3290, KEY_HELP },
+
+	{ 0x321b, KEY_PAGEUP },
+	{ 0x321e, KEY_PAGEDOWN },
+
+	{ 0x3201, KEY_1 },
+	{ 0x3202, KEY_2 },
+	{ 0x3203, KEY_3 },

drivers/media/rc/keymaps/rc-dreambox.c line 121

Quoted 10 lines
drivers/media/rc/keymaps/rc-dreambox.c new file +10 -0
+	{ 0x3204, KEY_4 },
+	{ 0x3205, KEY_5 },
+	{ 0x3206, KEY_6 },
+	{ 0x3207, KEY_7 },
+	{ 0x3208, KEY_8 },
+	{ 0x3209, KEY_9 },
+	{ 0x320a, KEY_PREVIOUS },
+	{ 0x320b, KEY_0 },
+	{ 0x320c, KEY_NEXT },
+

Unnecessary blank line.

Thanks
Sean

Quoted 40 lines
drivers/media/rc/keymaps/rc-dreambox.c new file +26 -0
+};
+
+static struct rc_map_list dreambox_map = {
+	.map = {
+		.scan     = dreambox,
+		.size     = ARRAY_SIZE(dreambox),
+		.rc_proto = RC_PROTO_NEC,
+		.name     = RC_MAP_DREAMBOX,
+	}
+};
+
+static int __init init_rc_map_dreambox(void)
+{
+	return rc_map_register(&dreambox_map);
+}
+
+static void __exit exit_rc_map_dreambox(void)
+{
+	rc_map_unregister(&dreambox_map);
+}
+
+module_init(init_rc_map_dreambox)
+module_exit(exit_rc_map_dreambox)
+
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("Emanuel Strobel <[email protected]>");
include/media/rc-map.h +1 -0
index 43d254930daa..dadd4d27a760 100644
@@ -242,6 +242,7 @@ struct rc_map *rc_map_get(const char *name);
 #define RC_MAP_DM1105_NEC                "rc-dm1105-nec"
 #define RC_MAP_DNTV_LIVE_DVB_T           "rc-dntv-live-dvb-t"
 #define RC_MAP_DNTV_LIVE_DVBT_PRO        "rc-dntv-live-dvbt-pro"
+#define RC_MAP_DREAMBOX                  "rc-dreambox"
 #define RC_MAP_DTT200U                   "rc-dtt200u"
 #define RC_MAP_DVBSKY                    "rc-dvbsky"
 #define RC_MAP_DVICO_MCE		 "rc-dvico-mce"
Signature · 1 line
2.34.1