Skip to contentSkip to conversation

media: rc: sunxi-cir: support the A523/H728/T527 IR receiver

PATCH Superseded Justin Suess 4 participants 9 messages Jul 22 – Jul 24

Subsystems (3)

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

v3 cover media: rc: sunxi-cir: support the A523/H728/T527 IR receiver

Hi,

Quick series respin for easier application.

This series adds support for the CIR receiver on the Allwinner A523/T527/H728 family (sun55i).

One-line function name change s_cir -> s_cir_rx at Andre's suggestion, with his patch for the Avaota A1 applied on top for convenience.

v2: https://lore.kernel.org/linux-sunxi/[email protected]/
v1: https://lore.kernel.org/linux-sunxi/[email protected]/

Andre Przywara (1):
arm64: dts: allwinner: a523: enable IR on the Avaota A1

Justin Suess (3):
media: dt-bindings: allwinner,sun4i-a10-ir: add A523 compatible
arm64: dts: allwinner: a523: add IR receiver nodes
arm64: dts: allwinner: a523: enable IR receiver on the X96Q Pro+

 .../media/allwinner,sun4i-a10-ir.yaml         |  8 +++--
 .../arm64/boot/dts/allwinner/sun55i-a523.dtsi | 35 +++++++++++++++++++
 .../dts/allwinner/sun55i-h728-x96qpro+.dts    |  6 ++++
 .../dts/allwinner/sun55i-t527-avaota-a1.dts   |  6 ++++
 4 files changed, 52 insertions(+), 3 deletions(-)

base-commit: 1590cf0329716306e948a8fc29f1d3ee87d3989f

Signature · 1 line
2.54.0
#1 lore raw

PATCH v3 1/4 media: dt-bindings: allwinner,sun4i-a10-ir: add A523 compatible

The A523 (sun55i) contains a newer revision of the sunxi CIR receiver. The reset defaults match the fixed behaviour of the older IP, so the device works fine when driven as an A31 CIR receiver.

Add the A523 compatible, with allwinner,sun6i-a31-ir as the fallback.

While at it, merge the standalone compatible entries into a single enum.

Cc Krzysztof Kozlowski <[email protected]>
---
 .../devicetree/bindings/media/allwinner,sun4i-a10-ir.yaml | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
Documentation/devicetree/bindings/media/allwinner,sun4i-a10-ir.yaml +5 -3
index 42dfe22ad5f1..18b28feacf83 100644
@@ -16,9 +16,10 @@ allOf:
 properties:
   compatible:
     oneOf:
-      - const: allwinner,sun4i-a10-ir
-      - const: allwinner,sun5i-a13-ir
-      - const: allwinner,sun6i-a31-ir
+      - enum:
+          - allwinner,sun4i-a10-ir
+          - allwinner,sun5i-a13-ir
+          - allwinner,sun6i-a31-ir
       - items:
           - enum:
               - allwinner,suniv-f1c100s-ir
@@ -27,6 +28,7 @@ properties:
               - allwinner,sun50i-a64-ir
               - allwinner,sun50i-h6-ir
               - allwinner,sun50i-h616-ir
+              - allwinner,sun55i-a523-ir
           - const: allwinner,sun6i-a31-ir
 
   reg:
Signature · 1 line
2.54.0
Acked-by on v3 1/4
#2 lore raw

Re: [PATCH v3 1/4] media: dt-bindings: allwinner,sun4i-a10-ir: add A523 compatible

Quoted 4 lines · Justin Suess

The A523 (sun55i) contains a newer revision of the sunxi CIR receiver. The reset defaults match the fixed behaviour of the older IP, so the device works fine when driven as an A31 CIR receiver.

Quoted 8 lines

Add the A523 compatible, with allwinner,sun6i-a31-ir as the fallback.

While at it, merge the standalone compatible entries into a single enum.

Cc Krzysztof Kozlowski <[email protected]>

---

Your changelog must mention that you dropped tag and explain WHY.

Please add Acked-by/Reviewed-by/Tested-by tags when posting new versions of patchset, under or above your Signed-off-by tag, unless patch changed significantly (e.g. new properties added to the DT bindings). Tag is "received", when provided in a message replied to you on the mailing list. Tools like b4 can help here. However, there's no need to repost patches *only* to add the tags. The upstream maintainer will do that for tags received on the version they apply.

Please read:
https://elixir.bootlin.com/linux/v6.12-rc3/source/Documentation/process/submitting-patches.rst#L577

If a tag was not added on purpose, please state in the patch changelog or cover letter why and what changed.

Best regards,
Krzysztof

#3 lore raw

PATCH v3 2/4 arm64: dts: allwinner: a523: add IR receiver nodes

In reply to Justin Suess

The A523 has two CIR receivers, both compatible with the A31 CIR: one in the CPUX domain, clocked from the main CCU, and one in the RTC power domain, clocked from the R-CCU.

Add nodes for both instances, disabled by default. Since the RX signal of each instance can be routed to more than one pin, boards with an IR receiver are expected to add the pinctrl properties next to where they enable the node. Keep the PL11 pin description in the dtsi, as boards commonly use that pin for the RTC domain instance.

---
 .../arm64/boot/dts/allwinner/sun55i-a523.dtsi | 28 +++++++++++++++++++
 1 file changed, 28 insertions(+)
arch/arm64/boot/dts/allwinner/sun55i-a523.dtsi +28 -0
index ca6a16807049..c2de662140ce 100644
@@ -327,6 +327,17 @@ ccu: clock-controller@2001000 {
 			#reset-cells = <1>;
 		};
 
+		ir: ir@2005000 {
+			compatible = "allwinner,sun55i-a523-ir",
+				     "allwinner,sun6i-a31-ir";
+			reg = <0x02005000 0x400>;
+			interrupts = <GIC_SPI 27 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&ccu CLK_BUS_IR_RX>, <&ccu CLK_IR_RX>;
+			clock-names = "apb", "ir";
+			resets = <&ccu RST_BUS_IR_RX>;
+			status = "disabled";
+		};
+
 		ledc: led-controller@2008000 {
 			compatible = "allwinner,sun55i-a523-ledc",
 				     "allwinner,sun50i-a100-ledc";
@@ -927,6 +938,23 @@ r_i2c_pins: r-i2c-pins {
 				allwinner,pinmux = <2>;
 				function = "r_i2c0";
 			};
+
+			r_ir_rx_pin: r-ir-rx-pin {
+				pins = "PL11";
+				allwinner,pinmux = <2>;
+				function = "s_cir_rx";
+			};
+		};
+
+		r_ir: ir@7040000 {
+			compatible = "allwinner,sun55i-a523-ir",
+				     "allwinner,sun6i-a31-ir";
+			reg = <0x07040000 0x400>;
+			interrupts = <GIC_SPI 167 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&r_ccu CLK_BUS_R_IR_RX>, <&r_ccu CLK_R_IR_RX>;
+			clock-names = "apb", "ir";
+			resets = <&r_ccu RST_BUS_R_IR_RX>;
+			status = "disabled";
 		};
 
 		pck600: power-controller@7060000 {
Signature · 1 line
2.54.0
maintainer
#4 lore raw

Re: [PATCH v3 2/4] arm64: dts: allwinner: a523: add IR receiver nodes

Quoted 40 lines · Justin Suess

The A523 has two CIR receivers, both compatible with the A31 CIR: one in the CPUX domain, clocked from the main CCU, and one in the RTC power domain, clocked from the R-CCU.

Add nodes for both instances, disabled by default. Since the RX signal of each instance can be routed to more than one pin, boards with an IR receiver are expected to add the pinctrl properties next to where they enable the node. Keep the PL11 pin description in the dtsi, as boards commonly use that pin for the RTC domain instance.

---
 .../arm64/boot/dts/allwinner/sun55i-a523.dtsi | 28 +++++++++++++++++++
 1 file changed, 28 insertions(+)
arch/arm64/boot/dts/allwinner/sun55i-a523.dtsi +11 -0
index ca6a16807049..c2de662140ce 100644
@@ -327,6 +327,17 @@ ccu: clock-controller@2001000 {
                        #reset-cells = <1>;
                };
 
+               ir: ir@2005000 {
+                       compatible = "allwinner,sun55i-a523-ir",
+                                    "allwinner,sun6i-a31-ir";
+                       reg = <0x02005000 0x400>;
+                       interrupts = <GIC_SPI 27 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&ccu CLK_BUS_IR_RX>, <&ccu CLK_IR_RX>;
+                       clock-names = "apb", "ir";
+                       resets = <&ccu RST_BUS_IR_RX>;
+                       status = "disabled";
+               };
+
                ledc: led-controller@2008000 {
                        compatible = "allwinner,sun55i-a523-ledc",
                                     "allwinner,sun50i-a100-ledc";

arch/arm64/boot/dts/allwinner/sun55i-a523.dtsi r_i2c_pins: r-i2c-pins { · line 941

Quoted 4 lines
arch/arm64/boot/dts/allwinner/sun55i-a523.dtsi +1 -0
@@ -927,6 +938,23 @@ r_i2c_pins: r-i2c-pins {
                                allwinner,pinmux = <2>;
                                function = "r_i2c0";
                        };
+

Please add /omit-if-no-ref/.

arch/arm64/boot/dts/allwinner/sun55i-a523.dtsi r_i2c_pins: r-i2c-pins { · line 942

Quoted 1 line
arch/arm64/boot/dts/allwinner/sun55i-a523.dtsi +1 -0
+                       r_ir_rx_pin: r-ir-rx-pin {

There are two pin mux possibilities for r-ir-rx. Please name it accordingly, like "r-ir-rx-pl-pin".

Quoted 21 lines
arch/arm64/boot/dts/allwinner/sun55i-a523.dtsi +15 -1
+                               pins = "PL11";
+                               allwinner,pinmux = <2>;
+                               function = "s_cir_rx";
+                       };
+               };
+
+               r_ir: ir@7040000 {
+                       compatible = "allwinner,sun55i-a523-ir",
+                                    "allwinner,sun6i-a31-ir";
+                       reg = <0x07040000 0x400>;
+                       interrupts = <GIC_SPI 167 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&r_ccu CLK_BUS_R_IR_RX>, <&r_ccu CLK_R_IR_RX>;
+                       clock-names = "apb", "ir";
+                       resets = <&r_ccu RST_BUS_R_IR_RX>;
+                       status = "disabled";
                };
 
                pck600: power-controller@7060000 {
--

2.54.0

#5 lore raw

PATCH v3 3/4 arm64: dts: allwinner: a523: enable IR receiver on the X96Q Pro+

In reply to Justin Suess

The X96Q Pro+ TV box has an IR receiver window on the front panel, wired to the SoC CIR input on PL11.

Enable the CIR receiver in the RTC power domain and mux its RX signal to PL11.

Tested on an X96 Pro+ with ir-keytable and nec keybindings with the remote that it came with in the box.

---
 arch/arm64/boot/dts/allwinner/sun55i-h728-x96qpro+.dts | 6 ++++++
 1 file changed, 6 insertions(+)
arch/arm64/boot/dts/allwinner/sun55i-h728-x96qpro+.dts +6 -0
index a96927fbdadd..1eaee20acaab 100644
@@ -266,6 +266,12 @@ reg_dcdc3_323: dcdc3 {
 	};
 };
 
+&r_ir {
+	pinctrl-names = "default";
+	pinctrl-0 = <&r_ir_rx_pin>;
+	status = "okay";
+};
+
 &r_pio {
 /*
  * Specifying the supply would create a circular dependency.
Signature · 1 line
2.54.0
#6 lore raw

PATCH v3 4/4 arm64: dts: allwinner: a523: enable IR on the Avaota A1

In reply to Justin Suess

From: Andre Przywara <[email protected]>

The Avaota A1 board has an IR receiver chip on the PCB (next to the Ethernet jacks), wired to the PI8 pin on the SoC.

Add the pin description to the PIO DT node, and enable the CIR receiver in the main power domain.

Tested on the board with evtest and some random TV remote control.

---
 arch/arm64/boot/dts/allwinner/sun55i-a523.dtsi          | 7 +++++++
 arch/arm64/boot/dts/allwinner/sun55i-t527-avaota-a1.dts | 6 ++++++
 2 files changed, 13 insertions(+)
arch/arm64/boot/dts/allwinner/sun55i-a523.dtsi +7 -0
index c2de662140ce..219fd76a4710 100644
@@ -155,6 +155,13 @@ i2s2_pi_pins: i2s2-pi-pins {
 				bias-disable;
 			};
 
+			/omit-if-no-ref/
+			ir_rx_pin: ir-rx-pin {
+				pins = "PI8";
+				allwinner,pinmux = <3>;
+				function = "cir_rx";
+			};
+
 			/omit-if-no-ref/
 			ledc_ph_pin: ledc-ph-pin {
 				pins = "PH19";
arch/arm64/boot/dts/allwinner/sun55i-t527-avaota-a1.dts +6 -0
index 474354fbfcec..994f1e4f0ce7 100644
@@ -100,6 +100,12 @@ &gpu {
 	status = "okay";
 };
 
+&ir {
+	pinctrl-names = "default";
+	pinctrl-0 = <&ir_rx_pin>;
+	status = "okay";
+};
+
 &ledc {
 	pinctrl-names = "default";
 	pinctrl-0 = <&ledc_ph_pin>;
Signature · 1 line
2.54.0
maintainer
#7 lore raw

Re: [PATCH v3 4/4] arm64: dts: allwinner: a523: enable IR on the Avaota A1

Quoted 6 lines · Justin Suess

From: Andre Przywara <[email protected]>

The Avaota A1 board has an IR receiver chip on the PCB (next to the Ethernet jacks), wired to the PI8 pin on the SoC.

Quoted 6 lines

Add the pin description to the PIO DT node, and enable the CIR receiver in the main power domain.

Tested on the board with evtest and some random TV remote control.

You need to add your own Signed-off-by, since you are resending other people's work.

ChenYu

Quoted 10 lines
---
 arch/arm64/boot/dts/allwinner/sun55i-a523.dtsi          | 7 +++++++
 arch/arm64/boot/dts/allwinner/sun55i-t527-avaota-a1.dts | 6 ++++++
 2 files changed, 13 insertions(+)
arch/arm64/boot/dts/allwinner/sun55i-a523.dtsi +0 -0
index c2de662140ce..219fd76a4710 100644

arch/arm64/boot/dts/allwinner/sun55i-a523.dtsi i2s2_pi_pins: i2s2-pi-pins { · line 164

Quoted 10 lines
arch/arm64/boot/dts/allwinner/sun55i-a523.dtsi +7 -0
@@ -155,6 +155,13 @@ i2s2_pi_pins: i2s2-pi-pins {
                                bias-disable;
                        };
 
+                       /omit-if-no-ref/
+                       ir_rx_pin: ir-rx-pin {
+                               pins = "PI8";
+                               allwinner,pinmux = <3>;
+                               function = "cir_rx";
+                       };
+

This hunk should be in the .dtsi patch. And there are two pin mux possibilities for ir-rx. Please name it accordingly, like "ir-rx-pi-pin".

ChenYu

Quoted 23 lines
arch/arm64/boot/dts/allwinner/sun55i-a523.dtsi +0 -0
                        /omit-if-no-ref/
                        ledc_ph_pin: ledc-ph-pin {
                                pins = "PH19";
arch/arm64/boot/dts/allwinner/sun55i-t527-avaota-a1.dts +6 -1
index 474354fbfcec..994f1e4f0ce7 100644
@@ -100,6 +100,12 @@ &gpu {
        status = "okay";
 };
 
+&ir {
+       pinctrl-names = "default";
+       pinctrl-0 = <&ir_rx_pin>;
+       status = "okay";
+};
+
 &ledc {
        pinctrl-names = "default";
        pinctrl-0 = <&ledc_ph_pin>;
--

2.54.0

#8 lore raw
In reply to Justin Suess

Hi Justin,

thanks for the update, but ...

Quoted 3 lines · Justin Suess

Hi,

Quick series respin for easier application.

please try to avoid that. Leave *at least* 24 hours between revisions, to give all reviewers at least a chance to look at the series. Otherwise they might get frustrated if they started reviewing a series, and get ambushed by an updated version in the middle of the process. And in this case here you are probably waiting for a DT maintainer review still.
Also maintainers can fix up minor issues when doing the merge, so there is no pressing need to send a whole new series for just a minor hiccup or just for adding the tags.

Quoted 6 lines

This series adds support for the CIR receiver on the Allwinner A523/T527/H728 family (sun55i).

One-line function name change s_cir -> s_cir_rx at Andre's suggestion, with his patch for the Avaota A1 applied on top for convenience.

Thanks for taking that in, but please note that you would need add your Signed-off-by: on top of the author's in this case, to document the flow of patches, and for legal reasons.

Nothing worth to a respin again ;-), just wait for the DT approval and for what Chen-Yu suggests.

Cheers,
Andre

Quoted 19 lines

v2: https://lore.kernel.org/linux-sunxi/[email protected]/
v1: https://lore.kernel.org/linux-sunxi/[email protected]/

Andre Przywara (1):
arm64: dts: allwinner: a523: enable IR on the Avaota A1

Justin Suess (3):
media: dt-bindings: allwinner,sun4i-a10-ir: add A523 compatible
arm64: dts: allwinner: a523: add IR receiver nodes
arm64: dts: allwinner: a523: enable IR receiver on the X96Q Pro+

  .../media/allwinner,sun4i-a10-ir.yaml         |  8 +++--
  .../arm64/boot/dts/allwinner/sun55i-a523.dtsi | 35 +++++++++++++++++++
  .../dts/allwinner/sun55i-h728-x96qpro+.dts    |  6 ++++
  .../dts/allwinner/sun55i-t527-avaota-a1.dts   |  6 ++++
  4 files changed, 52 insertions(+), 3 deletions(-)

base-commit: 1590cf0329716306e948a8fc29f1d3ee87d3989f