diff --git a/arch/arm/boot/dts/amlogic/meson8b.dtsi b/arch/arm/boot/dts/amlogic/meson8b.dtsi index 747478d7df29..cd4976ed2ea8 100644 --- a/arch/arm/boot/dts/amlogic/meson8b.dtsi +++ b/arch/arm/boot/dts/amlogic/meson8b.dtsi @@ -19,6 +19,8 @@ #include #include #include +#include +#include #include #include "skeleton.dtsi" @@ -567,7 +569,12 @@ interrupt-controller; #interrupt-cells = <2>; }; - + remote_pins:remote_pin { + mux { + groups = "remote_input"; + function = "remote"; + }; + }; uart_ao_a_pins: uart_ao_a { mux { groups = "uart_tx_ao_a", "uart_rx_ao_a"; @@ -701,5 +708,163 @@ dwc2_b { clock-names = "saradc_clk"; reg = <0xc1108680 0x30>; }; + remote:rc@c8100580 { + compatible = "amlogic, aml_remote"; + dev_name = "meson-remote"; + reg = <0xc8100580 0x44>, /*Multi-format IR controller*/ + <0xc8100480 0x20>; /*Legacy IR controller*/ + status = "okay"; + protocol = ; + interrupts = <0 15 1>; + pinctrl-names = "default"; + pinctrl-0 = <&remote_pins>; + map = <&custom_maps>; + max_frame_time = <200>; /*set software decoder max frame time*/ + }; + + custom_maps:custom_maps { + mapnum = <3>; + map0 = <&map_0>; + map1 = <&map_1>; + map2 = <&map_2>; + map_0: map_0{ + mapname = "amlogic-remote-1"; + customcode = <0xfb04>; + release_delay = <80>; + size = <50>; /*keymap size*/ + keymap = ; + }; + map_1: map_1{ + mapname = "amlogic-remote-2"; + customcode = <0xfe01>; + release_delay = <80>; + size = <53>; + keymap = ; + }; + map_2: map_2{ + mapname = "amlogic-remote-3"; + customcode = <0xbd02>; + release_delay = <80>; + size = <17>; + keymap = ; + }; + }; }; }; /* end of / */ diff --git a/arch/arm/configs/meson32_defconfig b/arch/arm/configs/meson32_defconfig index b259ba15c512..8fe79300484f 100644 --- a/arch/arm/configs/meson32_defconfig +++ b/arch/arm/configs/meson32_defconfig @@ -64,6 +64,8 @@ CONFIG_AMLOGIC_CRYPTO=y CONFIG_AMLOGIC_CRYPTO_BLKMV=y CONFIG_AMLOGIC_INPUT=y CONFIG_AMLOGIC_SARADC=y +CONFIG_AMLOGIC_REMOTE=y +CONFIG_AMLOGIC_MESON_REMOTE=y CONFIG_AMLOGIC_EFUSE=y CONFIG_AMLOGIC_CPU_HOTPLUG=y CONFIG_AMLOGIC_PWM=y diff --git a/drivers/amlogic/input/remote/remote_meson.c b/drivers/amlogic/input/remote/remote_meson.c index 4061e2148c6b..fa37f34b5d66 100644 --- a/drivers/amlogic/input/remote/remote_meson.c +++ b/drivers/amlogic/input/remote/remote_meson.c @@ -173,7 +173,7 @@ static bool is_valid_custom(struct remote_dev *dev) static bool is_next_repeat(struct remote_dev *dev) { - unsigned int val; + unsigned int val = 0; unsigned char fbusy = 0; unsigned char cnt; @@ -228,7 +228,7 @@ static void amlremote_tasklet(unsigned long data) static irqreturn_t ir_interrupt(int irq, void *dev_id) { struct remote_chip *rc = (struct remote_chip *)dev_id; - int contr_status; + int contr_status = 0; int val = 0; u32 duration; char buf[50];