112 lines
2.5 KiB
Diff
112 lines
2.5 KiB
Diff
--- a/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dtsi
|
|
+++ b/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dtsi
|
|
@@ -207,6 +207,14 @@
|
|
regulator-max-microvolt = <1400000>;
|
|
pwm-supply = <&vcc3v3_sys>;
|
|
};
|
|
+
|
|
+ ir-receivet {
|
|
+ compatible = "gpio-ir-receiver";
|
|
+ gpios = <&gpio0 RK_PA6 GPIO_ACTIVE_LOW>;
|
|
+ linux,rc-map-name = "rc-station";
|
|
+ pinctrl-names = "default";
|
|
+ pinctrl-0 = <&ir_int>;
|
|
+ };
|
|
};
|
|
|
|
&cpu_l0 {
|
|
@@ -676,6 +684,12 @@
|
|
rockchip,pins = <1 RK_PA1 RK_FUNC_GPIO &pcfg_pull_up>;
|
|
};
|
|
};
|
|
+
|
|
+ ir {
|
|
+ ir_int: ir-int {
|
|
+ rockchip,pins = <0 RK_PA6 RK_FUNC_GPIO &pcfg_pull_none>;
|
|
+ };
|
|
+ };
|
|
};
|
|
|
|
&pwm0 {
|
|
|
|
--- /dev/null
|
|
+++ b/drivers/media/rc/keymaps/rc-station.c
|
|
@@ -0,0 +1,54 @@
|
|
+// SPDX-License-Identifier: GPL-2.0+
|
|
+//
|
|
+// Copyright (C) 2021 Oleg Ivanov <balbes-150@yandex.ru>
|
|
+
|
|
+/*
|
|
+ * Keytable for the Firefly Station SBC remote control
|
|
+ */
|
|
+
|
|
+#include <media/rc-map.h>
|
|
+#include <linux/module.h>
|
|
+
|
|
+static struct rc_map_table station[] = {
|
|
+ { 0x14, KEY_POWER },
|
|
+
|
|
+ { 0x03, KEY_UP },
|
|
+ { 0x02, KEY_DOWN },
|
|
+ { 0x0e, KEY_LEFT },
|
|
+ { 0x1a, KEY_RIGHT },
|
|
+ { 0x07, KEY_ENTER },
|
|
+
|
|
+ { 0x01, KEY_BACK },
|
|
+ { 0x5b, KEY_MUTE },
|
|
+ { 0x13, KEY_MENU },
|
|
+
|
|
+ { 0x58, KEY_VOLUMEDOWN },
|
|
+ { 0x0b, KEY_VOLUMEUP },
|
|
+
|
|
+ { 0x48, KEY_HOME },
|
|
+};
|
|
+
|
|
+static struct rc_map_list station_map = {
|
|
+ .map = {
|
|
+ .scan = station,
|
|
+ .size = ARRAY_SIZE(station),
|
|
+ .rc_proto = RC_PROTO_NEC,
|
|
+ .name = RC_MAP_STATION,
|
|
+ }
|
|
+};
|
|
+
|
|
+static int __init init_rc_map_station(void)
|
|
+{
|
|
+ return rc_map_register(&station_map);
|
|
+}
|
|
+
|
|
+static void __exit exit_rc_map_station(void)
|
|
+{
|
|
+ rc_map_unregister(&station_map);
|
|
+}
|
|
+
|
|
+module_init(init_rc_map_station)
|
|
+module_exit(exit_rc_map_station)
|
|
+
|
|
+MODULE_LICENSE("GPL");
|
|
+MODULE_AUTHOR("Oleg Ivanov <balbes-150@yandex.ru>");
|
|
|
|
--- a/drivers/media/rc/keymaps/Makefile
|
|
+++ b/drivers/media/rc/keymaps/Makefile
|
|
@@ -94,6 +94,7 @@
|
|
rc-real-audio-220-32-keys.o \
|
|
rc-reddo.o \
|
|
rc-snapstream-firefly.o \
|
|
+ rc-station.o \
|
|
rc-streamzap.o \
|
|
rc-tango.o \
|
|
rc-tanix-tx3mini.o \
|
|
|
|
--- a/include/media/rc-map.h
|
|
+++ b/include/media/rc-map.h
|
|
@@ -305,6 +305,7 @@
|
|
#define RC_MAP_REAL_AUDIO_220_32_KEYS "rc-real-audio-220-32-keys"
|
|
#define RC_MAP_REDDO "rc-reddo"
|
|
#define RC_MAP_SNAPSTREAM_FIREFLY "rc-snapstream-firefly"
|
|
+#define RC_MAP_STATION "rc-station"
|
|
#define RC_MAP_STREAMZAP "rc-streamzap"
|
|
#define RC_MAP_SU3000 "rc-su3000"
|
|
#define RC_MAP_TANGO "rc-tango"
|
|
|