Allwiner A64/H6 IR support
Subsystems (4)
cover Allwiner A64/H6 IR support
Hi,
A64 IR support series[1] pointed out that an A31 bindinds should be introduced.
This series introduce the A31 compatible bindings, then switch it on the already existing board.
Finally introduce A64 and H6 support.
Regards,
Clément
[1] https://lore.kernel.org/patchwork/patch/1031390/#1221464
Clément Péron (8):
dt-bindings: media: A31 compatible
media: rc: sunxi: Add A31 compatible
ARM: dts: sunxi: prefer A31 instead of A13 for ir
dt-bindings: media: sunxi-ir: Add A64 compatible
dt-bindings: media: sunxi-ir: Add H6 compatible
arm64: dts: allwiner: h6: Add IR receiver node
arm64: dts: allwinner: h6: Enable IR on H6 boards
arm64: defconfig: enable IR SUNXI option
Igors Makejevs (1):
arm64: dts: allwinner: a64: Add IR node
Jernej Skrabec (1):
arm64: dts: allwinner: a64: Enable IR on Orange Pi Win
.../devicetree/bindings/media/sunxi-ir.txt | 7 ++++++- arch/arm/boot/dts/sun6i-a31.dtsi | 2 +- arch/arm/boot/dts/sun8i-a83t.dtsi | 2 +- arch/arm/boot/dts/sun9i-a80.dtsi | 2 +- arch/arm/boot/dts/sunxi-h3-h5.dtsi | 2 +- .../dts/allwinner/sun50i-a64-orangepi-win.dts | 4 ++++ arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 18 ++++++++++++++++++ .../dts/allwinner/sun50i-h6-beelink-gs1.dts | 4 ++++ .../dts/allwinner/sun50i-h6-orangepi.dtsi | 4 ++++ .../boot/dts/allwinner/sun50i-h6-pine-h64.dts | 4 ++++ arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi | 19 +++++++++++++++++++ arch/arm64/configs/defconfig | 1 + drivers/media/rc/sunxi-cir.c | 1 + 13 files changed, 65 insertions(+), 5 deletions(-)
Signature · 1 line
2.20.1
PATCH 1/10 dt-bindings: media: A31 compatible
Since Allwiner A31 all the SoC have a differente memory mapping.
Introduce this bindings to make a difference since this generation.
--- Documentation/devicetree/bindings/media/sunxi-ir.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/media/sunxi-ir.txt +4 -1
@@ -1,7 +1,10 @@ Device-Tree bindings for SUNXI IR controller found in sunXi SoC family Required properties: -- compatible : "allwinner,sun4i-a10-ir" or "allwinner,sun5i-a13-ir" +- compatible : + "allwinner,sun4i-a10-ir" + "allwinner,sun5i-a13-ir" + "allwinner,sun6i-a31-ir" - clocks : list of clock specifiers, corresponding to entries in clock-names property; - clock-names : should contain "apb" and "ir" entries;
Signature · 1 line
2.20.1
PATCH 2/10 media: rc: sunxi: Add A31 compatible
In reply to Clément PéronA31 have a different memory mapping so add the compatible we will need it later.
--- drivers/media/rc/sunxi-cir.c | 1 + 1 file changed, 1 insertion(+)
drivers/media/rc/sunxi-cir.c +1 -0
@@ -319,6 +319,7 @@ static int sunxi_ir_remove(struct platform_device *pdev)static const struct of_device_id sunxi_ir_match[] = { { .compatible ="allwinner,sun4i-a10-ir" , }, { .compatible ="allwinner,sun5i-a13-ir" , }, + { .compatible ="allwinner,sun6i-a31-ir" , }, {}, };MODULE_DEVICE_TABLE (of, sunxi_ir_match);
Signature · 7 lines
2.20.1 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
PATCH 3/10 ARM: dts: sunxi: prefer A31 instead of A13 for ir
In reply to Clément PéronSince A31 memory mapping of the IR driver has changed.
Prefer the A31 bindings instead of A13.
--- arch/arm/boot/dts/sun6i-a31.dtsi | 2 +- arch/arm/boot/dts/sun8i-a83t.dtsi | 2 +- arch/arm/boot/dts/sun9i-a80.dtsi | 2 +- arch/arm/boot/dts/sunxi-h3-h5.dtsi | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-)
arch/arm/boot/dts/sun6i-a31.dtsi +1 -1
@@ -1351,7 +1351,7 @@ }; ir: ir@1f02000 { - compatible = "allwinner,sun5i-a13-ir"; + compatible = "allwinner,sun6i-a31-ir"; clocks = <&apb0_gates 1>, <&ir_clk>; clock-names = "apb", "ir"; resets = <&apb0_rst 1>;
arch/arm/boot/dts/sun8i-a83t.dtsi +1 -1
@@ -1067,7 +1067,7 @@ r_cir: ir@1f02000 { compatible = "allwinner,sun8i-a83t-ir", - "allwinner,sun5i-a13-ir"; + "allwinner,sun6i-a31-ir"; clocks = <&r_ccu CLK_APB0_IR>, <&r_ccu CLK_IR>; clock-names = "apb", "ir"; resets = <&r_ccu RST_APB0_IR>;
arch/arm/boot/dts/sun9i-a80.dtsi +1 -1
@@ -1167,7 +1167,7 @@ }; r_ir: ir@8002000 { - compatible = "allwinner,sun5i-a13-ir"; + compatible = "allwinner,sun6i-a31-ir"; interrupts = <GIC_SPI 37 IRQ_TYPE_LEVEL_HIGH>; pinctrl-names = "default"; pinctrl-0 = <&r_ir_pins>;
arch/arm/boot/dts/sunxi-h3-h5.dtsi +1 -1
@@ -822,7 +822,7 @@ }; ir: ir@1f02000 { - compatible = "allwinner,sun5i-a13-ir"; + compatible = "allwinner,sun6i-a31-ir"; clocks = <&r_ccu CLK_APB0_IR>, <&r_ccu CLK_IR>; clock-names = "apb", "ir"; resets = <&r_ccu RST_APB0_IR>;
Signature · 7 lines
2.20.1 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
PATCH 4/10 dt-bindings: media: sunxi-ir: Add A64 compatible
In reply to Clément PéronThere is some minor differences between A31 and A64 driver.
But A31 IR driver is compatible with A64.
--- Documentation/devicetree/bindings/media/sunxi-ir.txt | 1 + 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/media/sunxi-ir.txt +1 -0
@@ -5,6 +5,7 @@ Required properties: "allwinner,sun4i-a10-ir" "allwinner,sun5i-a13-ir" "allwinner,sun6i-a31-ir" + "allwinner,sun50i-a64-ir", "allwinner,sun6i-a31-ir" - clocks : list of clock specifiers, corresponding to entries in clock-names property; - clock-names : should contain "apb" and "ir" entries;
Signature · 7 lines
2.20.1 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
PATCH 5/10 arm64: dts: allwinner: a64: Add IR node
In reply to Clément PéronFrom: Igors Makejevs <[email protected]>
IR peripheral is completely compatible with A31 one.
--- arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+)
arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi +18 -0
@@ -1072,6 +1072,19 @@ #size-cells = <0>; }; + r_ir: ir@1f02000 { + compatible = "allwinner,sun50i-a64-ir", + "allwinner,sun6i-a31-ir"; + reg = <0x01f02000 0x400>; + clocks = <&r_ccu CLK_APB0_IR>, <&r_ccu CLK_IR>; + clock-names = "apb", "ir"; + resets = <&r_ccu RST_APB0_IR>; + interrupts = <GIC_SPI 37 IRQ_TYPE_LEVEL_HIGH>; + pinctrl-names = "default"; + pinctrl-0 = <&r_ir_rx_pin>; + status = "disabled"; + }; + r_pwm: pwm@1f03800 { compatible = "allwinner,sun50i-a64-pwm", "allwinner,sun5i-a13-pwm";
@@ -1099,6 +1112,11 @@ function = "s_i2c"; }; + r_ir_rx_pin: r-ir-rx-pin { + pins = "PL11"; + function = "s_cir_rx"; + }; + r_pwm_pin: r-pwm-pin { pins = "PL10"; function = "s_pwm";
Signature · 1 line
2.20.1
PATCH 6/10 arm64: dts: allwinner: a64: Enable IR on Orange Pi Win
In reply to Clément PéronFrom: Jernej Skrabec <[email protected]>
OrangePi Win board contains IR receiver. Enable it.
--- arch/arm64/boot/dts/allwinner/sun50i-a64-orangepi-win.dts | 4 ++++ 1 file changed, 4 insertions(+)
arch/arm64/boot/dts/allwinner/sun50i-a64-orangepi-win.dts +4 -0
@@ -180,6 +180,10 @@ status = "okay"; }; +&r_ir { + status = "okay"; +}; + &r_rsb { status = "okay";
Signature · 1 line
2.20.1
PATCH 7/10 dt-bindings: media: sunxi-ir: Add H6 compatible
In reply to Clément PéronThere is some minor differences between A31 or A64 and H6 driver.
But A31 IR driver is compatible with H6.
--- Documentation/devicetree/bindings/media/sunxi-ir.txt | 1 + 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/media/sunxi-ir.txt +1 -0
@@ -6,6 +6,7 @@ Required properties: "allwinner,sun5i-a13-ir" "allwinner,sun6i-a31-ir" "allwinner,sun50i-a64-ir", "allwinner,sun6i-a31-ir" + "allwinner,sun50i-h6-ir", "allwinner,sun6i-a31-ir" - clocks : list of clock specifiers, corresponding to entries in clock-names property; - clock-names : should contain "apb" and "ir" entries;
Signature · 1 line
2.20.1
PATCH 8/10 arm64: dts: allwiner: h6: Add IR receiver node
In reply to Clément PéronAllwiner H6 IR is similar to A31 and can use same driver.
Add support for it.
--- arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+)
arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi +19 -0
@@ -647,6 +647,25 @@ pins = "PL0", "PL1"; function = "s_i2c"; }; + + r_ir_rx_pin: r-ir-rx-pin { + pins = "PL9"; + function = "s_cir_rx"; + }; + }; + + r_ir: ir@7040000 { + compatible = "allwinner,sun50i-h6-ir", + "allwinner,sun6i-a31-ir"; + reg = <0x07040000 0x400>; + interrupts = <GIC_SPI 109 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&r_ccu CLK_R_APB1_IR>, + <&r_ccu CLK_IR>; + clock-names = "apb", "ir"; + resets = <&r_ccu RST_R_APB1_IR>; + pinctrl-names = "default"; + pinctrl-0 = <&r_ir_rx_pin>; + status = "disabled"; }; r_i2c: i2c@7081400 {
Signature · 1 line
2.20.1
PATCH 9/10 arm64: dts: allwinner: h6: Enable IR on H6 boards
In reply to Clément PéronBeelink GS1, OrangePi H6 boards and Pine H64 have an IR receiver.
Enable it in their device-tree.
--- arch/arm64/boot/dts/allwinner/sun50i-h6-beelink-gs1.dts | 4 ++++ arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi.dtsi | 4 ++++ arch/arm64/boot/dts/allwinner/sun50i-h6-pine-h64.dts | 4 ++++ 3 files changed, 12 insertions(+)
arch/arm64/boot/dts/allwinner/sun50i-h6-beelink-gs1.dts +4 -0
@@ -232,6 +232,10 @@ }; }; +&r_ir { + status = "okay"; +}; + &r_pio { /* * PL0 and PL1 are used for PMIC I2C
arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi.dtsi +4 -0
@@ -189,6 +189,10 @@ }; }; +&r_ir { + status = "okay"; +}; + &uart0 { pinctrl-names = "default"; pinctrl-0 = <&uart0_ph_pins>;
arch/arm64/boot/dts/allwinner/sun50i-h6-pine-h64.dts +4 -0
@@ -247,6 +247,10 @@ }; }; +&r_ir { + status = "okay"; +}; + &uart0 { pinctrl-names = "default"; pinctrl-0 = <&uart0_ph_pins>;
Signature · 1 line
2.20.1
PATCH 10/10 arm64: defconfig: enable IR SUNXI option
In reply to Clément PéronEnable CONFIG_IR_SUNXI option for ARM64, so that the Allwinner A64/H6 SoCs can use their IR receiver controller.
--- arch/arm64/configs/defconfig | 1 + 1 file changed, 1 insertion(+)
arch/arm64/configs/defconfig +1 -0
@@ -460,6 +460,7 @@ CONFIG_RC_CORE=m CONFIG_RC_DECODERS=y CONFIG_RC_DEVICES=y CONFIG_IR_MESON=m +CONFIG_IR_SUNXI=m CONFIG_MEDIA_SUPPORT=m CONFIG_MEDIA_CAMERA_SUPPORT=y CONFIG_MEDIA_ANALOG_TV_SUPPORT=y
Signature · 1 line
2.20.1
Re: [PATCH 01/10] dt-bindings: media: A31 compatible
In reply to Clément PéronQuoted 5 lines · Clément Péron
Since Allwiner A31 all the SoC have a differente memory mapping.
Introduce this bindings to make a difference since this generation.
Signed-off-by Clément Péron <[email protected]>
Mentionning what those differences are would be great
Maxime
--
Maxime Ripard, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
Re: [PATCH 04/10] dt-bindings: media: sunxi-ir: Add A64 compatible
In reply to Clément PéronQuoted 14 lines · Clément Péron
There is some minor differences between A31 and A64 driver.
But A31 IR driver is compatible with A64.
Signed-off-by Clément Péron <[email protected]>--- Documentation/devicetree/bindings/media/sunxi-ir.txt | 1 + 1 file changed, 1 insertion(+)Documentation/devicetree/bindings/media/sunxi-ir.txt +0
-0
Documentation/devicetree/bindings/media/sunxi-ir.txt Required properties: · line 8
Quoted 4 lines
Documentation/devicetree/bindings/media/sunxi-ir.txt +1
-0@@ -5,6 +5,7 @@ Required properties: "allwinner,sun4i-a10-ir" "allwinner,sun5i-a13-ir" "allwinner,sun6i-a31-ir" + "allwinner,sun50i-a64-ir", "allwinner,sun6i-a31-ir"
I guess resets is mandatory for the A31 onwards too, right?
Maxime
--
Maxime Ripard, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
Re: [PATCH 01/10] dt-bindings: media: A31 compatible
In reply to Maxime RipardHi Maxime,
Quoted 9 lines · Maxime Ripard
Quoted 5 lines · Clément Péron
Since Allwiner A31 all the SoC have a differente memory mapping.
Introduce this bindings to make a difference since this generation.
Signed-off-by Clément Péron <[email protected]>Mentionning what those differences are would be great
Will do,
Thanks for the review,
Clément
Quoted 10 lines
Maxime
--
Maxime Ripard, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com, "Missing dma-requests, using %u.\n",Quoted 3 lines
(quoted diff) +1
-2- DMA_CHAN_MAX_DRQ_A31); - sdc->max_request = DMA_CHAN_MAX_DRQ_A31; + DMA_CHAN_MA
Re: [PATCH 04/10] dt-bindings: media: sunxi-ir: Add A64 compatible
In reply to Maxime RipardHi Maxime,
Quoted 11 lines · Maxime Ripard
Quoted 9 lines · Clément Péron
There is some minor differences between A31 and A64 driver.
But A31 IR driver is compatible with A64.
Signed-off-by Clément Péron <[email protected]>--- Documentation/devicetree/bindings/media/sunxi-ir.txt | 1 + 1 file changed, 1 insertion(+)
Quoted 11 lines
Documentation/devicetree/bindings/media/sunxi-ir.txt Required properties: · line 8
Quoted 9 lines
Documentation/devicetree/bindings/media/sunxi-ir.txt +1
-0@@ -5,6 +5,7 @@ Required properties: "allwinner,sun4i-a10-ir" "allwinner,sun5i-a13-ir" "allwinner,sun6i-a31-ir" + "allwinner,sun50i-a64-ir", "allwinner,sun6i-a31-ir"I guess resets is mandatory for the A31 onwards too, right?
Indeed, I will add this information in the device-tree bindings. Ideally, we should also introduce a quirks with a "has_reset" property.
Thanks for your review,
Clément
Quoted 7 lines
Maxime
--
Maxime Ripard, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com