LKML Archive on lore.kernel.org
 help / Atom feed
* [PATCH 0/3] Add support for IR on Allwinner A64
@ 2019-01-11 17:30 Jernej Skrabec
  2019-01-11 17:30 ` [PATCH 1/3] media: dt: bindings: sunxi-ir: Add A64 compatible Jernej Skrabec
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Jernej Skrabec @ 2019-01-11 17:30 UTC (permalink / raw)
  To: maxime.ripard, wens
  Cc: robh+dt, mark.rutland, mchehab, linux-media, devicetree,
	linux-arm-kernel, linux-kernel, linux-sunxi

IR on A64 is nothing special and very similar to IR on A13 to the point
that same driver can be used.

Following patches just add necessary DT changes.

Best regards,
Jernej

Igors Makejevs (1):
  arm64: dts: allwinner: a64: Add IR node

Jernej Skrabec (2):
  media: dt: bindings: sunxi-ir: Add A64 compatible
  arm64: dts: allwinner: a64: Orange Pi Win: Enable IR

 .../devicetree/bindings/media/sunxi-ir.txt     |  5 ++++-
 .../dts/allwinner/sun50i-a64-orangepi-win.dts  |  4 ++++
 arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi  | 18 ++++++++++++++++++
 3 files changed, 26 insertions(+), 1 deletion(-)

-- 
2.20.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 1/3] media: dt: bindings: sunxi-ir: Add A64 compatible
  2019-01-11 17:30 [PATCH 0/3] Add support for IR on Allwinner A64 Jernej Skrabec
@ 2019-01-11 17:30 ` Jernej Skrabec
  2019-01-12  1:56   ` Chen-Yu Tsai
  2019-01-11 17:30 ` [PATCH 2/3] arm64: dts: allwinner: a64: Add IR node Jernej Skrabec
  2019-01-11 17:30 ` [PATCH 3/3] arm64: dts: allwinner: a64: Orange Pi Win: Enable IR Jernej Skrabec
  2 siblings, 1 reply; 6+ messages in thread
From: Jernej Skrabec @ 2019-01-11 17:30 UTC (permalink / raw)
  To: maxime.ripard, wens
  Cc: robh+dt, mark.rutland, mchehab, linux-media, devicetree,
	linux-arm-kernel, linux-kernel, linux-sunxi

A64 IR is compatible with A13, so add A64 compatible with A13 as a
fallback.

Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
---
 Documentation/devicetree/bindings/media/sunxi-ir.txt | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/media/sunxi-ir.txt b/Documentation/devicetree/bindings/media/sunxi-ir.txt
index 278098987edb..ecac6964b69b 100644
--- a/Documentation/devicetree/bindings/media/sunxi-ir.txt
+++ b/Documentation/devicetree/bindings/media/sunxi-ir.txt
@@ -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	    : value must be one of:
+  * "allwinner,sun4i-a10-ir"
+  * "allwinner,sun5i-a13-ir"
+  * "allwinner,sun50i-a64-ir", "allwinner,sun5i-a13-ir"
 - clocks	    : list of clock specifiers, corresponding to
 		      entries in clock-names property;
 - clock-names	    : should contain "apb" and "ir" entries;
-- 
2.20.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 2/3] arm64: dts: allwinner: a64: Add IR node
  2019-01-11 17:30 [PATCH 0/3] Add support for IR on Allwinner A64 Jernej Skrabec
  2019-01-11 17:30 ` [PATCH 1/3] media: dt: bindings: sunxi-ir: Add A64 compatible Jernej Skrabec
@ 2019-01-11 17:30 ` Jernej Skrabec
  2019-01-11 17:30 ` [PATCH 3/3] arm64: dts: allwinner: a64: Orange Pi Win: Enable IR Jernej Skrabec
  2 siblings, 0 replies; 6+ messages in thread
From: Jernej Skrabec @ 2019-01-11 17:30 UTC (permalink / raw)
  To: maxime.ripard, wens
  Cc: robh+dt, mark.rutland, mchehab, linux-media, devicetree,
	linux-arm-kernel, linux-kernel, linux-sunxi, Igors Makejevs

From: Igors Makejevs <git_bb@bwzone.com>

IR is similar to that in A13 and can use same driver.

Signed-off-by: Igors Makejevs <git_bb@bwzone.com>
Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
---
 arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
index 839b2ae88583..00827072376a 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
@@ -1004,6 +1004,19 @@
 			status = "disabled";
 		};
 
+		r_ir: ir@1f02000 {
+			compatible = "allwinner,sun50i-a64-ir",
+				     "allwinner,sun5i-a13-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_pin>;
+			status = "disabled";
+		};
+
 		r_i2c: i2c@1f02400 {
 			compatible = "allwinner,sun50i-a64-i2c",
 				     "allwinner,sun6i-a31-i2c";
@@ -1043,6 +1056,11 @@
 				function = "s_i2c";
 			};
 
+			r_ir_pin: ir {
+				pins = "PL11";
+				function = "s_cir_rx";
+			};
+
 			r_pwm_pin: pwm {
 				pins = "PL10";
 				function = "s_pwm";
-- 
2.20.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 3/3] arm64: dts: allwinner: a64: Orange Pi Win: Enable IR
  2019-01-11 17:30 [PATCH 0/3] Add support for IR on Allwinner A64 Jernej Skrabec
  2019-01-11 17:30 ` [PATCH 1/3] media: dt: bindings: sunxi-ir: Add A64 compatible Jernej Skrabec
  2019-01-11 17:30 ` [PATCH 2/3] arm64: dts: allwinner: a64: Add IR node Jernej Skrabec
@ 2019-01-11 17:30 ` Jernej Skrabec
  2 siblings, 0 replies; 6+ messages in thread
From: Jernej Skrabec @ 2019-01-11 17:30 UTC (permalink / raw)
  To: maxime.ripard, wens
  Cc: robh+dt, mark.rutland, mchehab, linux-media, devicetree,
	linux-arm-kernel, linux-kernel, linux-sunxi

OrangePi Win board contains IR receiver. Enable it.

Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
---
 arch/arm64/boot/dts/allwinner/sun50i-a64-orangepi-win.dts | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-orangepi-win.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-orangepi-win.dts
index b0c64f75792c..4f9bedce6c70 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-orangepi-win.dts
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-orangepi-win.dts
@@ -180,6 +180,10 @@
 	status = "okay";
 };
 
+&r_ir {
+	status = "okay";
+};
+
 &r_rsb {
 	status = "okay";
 
-- 
2.20.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/3] media: dt: bindings: sunxi-ir: Add A64 compatible
  2019-01-11 17:30 ` [PATCH 1/3] media: dt: bindings: sunxi-ir: Add A64 compatible Jernej Skrabec
@ 2019-01-12  1:56   ` Chen-Yu Tsai
  2019-01-12  8:08     ` Jernej Škrabec
  0 siblings, 1 reply; 6+ messages in thread
From: Chen-Yu Tsai @ 2019-01-12  1:56 UTC (permalink / raw)
  To: Jernej Skrabec
  Cc: Maxime Ripard, Rob Herring, Mark Rutland, Mauro Carvalho Chehab,
	Linux Media Mailing List, devicetree, linux-arm-kernel,
	linux-kernel, linux-sunxi

On Sat, Jan 12, 2019 at 1:30 AM Jernej Skrabec <jernej.skrabec@siol.net> wrote:
>
> A64 IR is compatible with A13, so add A64 compatible with A13 as a
> fallback.

We ask people to add the SoC-specific compatible as a contigency,
in case things turn out to be not so "compatible".

To be consistent with all the other SoCs and other peripherals,
unless you already spotted a "compatible" difference in the
hardware, i.e. the hardware isn't completely the same, this
patch isn't needed. On the other hand, if you did, please mention
the differences in the commit log.

ChenYu

> Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
> ---
>  Documentation/devicetree/bindings/media/sunxi-ir.txt | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/Documentation/devicetree/bindings/media/sunxi-ir.txt b/Documentation/devicetree/bindings/media/sunxi-ir.txt
> index 278098987edb..ecac6964b69b 100644
> --- a/Documentation/devicetree/bindings/media/sunxi-ir.txt
> +++ b/Documentation/devicetree/bindings/media/sunxi-ir.txt
> @@ -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       : value must be one of:
> +  * "allwinner,sun4i-a10-ir"
> +  * "allwinner,sun5i-a13-ir"
> +  * "allwinner,sun50i-a64-ir", "allwinner,sun5i-a13-ir"
>  - clocks           : list of clock specifiers, corresponding to
>                       entries in clock-names property;
>  - clock-names      : should contain "apb" and "ir" entries;
> --
> 2.20.1
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/3] media: dt: bindings: sunxi-ir: Add A64 compatible
  2019-01-12  1:56   ` Chen-Yu Tsai
@ 2019-01-12  8:08     ` Jernej Škrabec
  0 siblings, 0 replies; 6+ messages in thread
From: Jernej Škrabec @ 2019-01-12  8:08 UTC (permalink / raw)
  To: Chen-Yu Tsai
  Cc: Maxime Ripard, Rob Herring, Mark Rutland, Mauro Carvalho Chehab,
	Linux Media Mailing List, devicetree, linux-arm-kernel,
	linux-kernel, linux-sunxi

Dne sobota, 12. januar 2019 ob 02:56:11 CET je Chen-Yu Tsai napisal(a):
> On Sat, Jan 12, 2019 at 1:30 AM Jernej Skrabec <jernej.skrabec@siol.net> 
wrote:
> > A64 IR is compatible with A13, so add A64 compatible with A13 as a
> > fallback.
> 
> We ask people to add the SoC-specific compatible as a contigency,
> in case things turn out to be not so "compatible".
> 
> To be consistent with all the other SoCs and other peripherals,
> unless you already spotted a "compatible" difference in the
> hardware, i.e. the hardware isn't completely the same, this
> patch isn't needed. On the other hand, if you did, please mention
> the differences in the commit log.

When comparing registers descriptions between A13 and A64, I noticed few minor 
differences:

A13: RXINT: 11:6 RAL
A64: RXINT: 13:8 RAL

A13: IR_RXSTA: 12:6 RAC
A64: IR_RXSTA: 14:8 RAC, 7 STAT (missing on A13)

What is strange that  RAL and RAC field have offset defined as 8 in driver. I'm 
not sure if that is a typo in A13 manual or driver issue. I assume the former, 
otherwise it wouldn't work. I couldn't found original BSP driver source to 
confirm, though.

STAT bit is really not that important. It just tells if IR unit is busy or 
not.

The biggest difference is in 0x34 register. A64 has one more clock option 
(without postdivider), although register values are backward compatible. A64 
also has Active threshold setting (duration of CIR going from idle to active 
state).

If we dismiss RAC and RAL differences as manual error and don't care for new 
clock option and active threshold, then having new compatible maybe really 
doesn't make sense.

Best regards,
Jernej

> 
> ChenYu
> 
> > Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
> > ---
> > 
> >  Documentation/devicetree/bindings/media/sunxi-ir.txt | 5 ++++-
> >  1 file changed, 4 insertions(+), 1 deletion(-)
> > 
> > diff --git a/Documentation/devicetree/bindings/media/sunxi-ir.txt
> > b/Documentation/devicetree/bindings/media/sunxi-ir.txt index
> > 278098987edb..ecac6964b69b 100644
> > --- a/Documentation/devicetree/bindings/media/sunxi-ir.txt
> > +++ b/Documentation/devicetree/bindings/media/sunxi-ir.txt
> > @@ -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       : value must be one of:
> > +  * "allwinner,sun4i-a10-ir"
> > +  * "allwinner,sun5i-a13-ir"
> > +  * "allwinner,sun50i-a64-ir", "allwinner,sun5i-a13-ir"
> > 
> >  - clocks           : list of clock specifiers, corresponding to
> >  
> >                       entries in clock-names property;
> >  
> >  - clock-names      : should contain "apb" and "ir" entries;
> > 
> > --
> > 2.20.1





^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, back to index

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-11 17:30 [PATCH 0/3] Add support for IR on Allwinner A64 Jernej Skrabec
2019-01-11 17:30 ` [PATCH 1/3] media: dt: bindings: sunxi-ir: Add A64 compatible Jernej Skrabec
2019-01-12  1:56   ` Chen-Yu Tsai
2019-01-12  8:08     ` Jernej Škrabec
2019-01-11 17:30 ` [PATCH 2/3] arm64: dts: allwinner: a64: Add IR node Jernej Skrabec
2019-01-11 17:30 ` [PATCH 3/3] arm64: dts: allwinner: a64: Orange Pi Win: Enable IR Jernej Skrabec

LKML Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/lkml/0 lkml/git/0.git
	git clone --mirror https://lore.kernel.org/lkml/1 lkml/git/1.git
	git clone --mirror https://lore.kernel.org/lkml/2 lkml/git/2.git
	git clone --mirror https://lore.kernel.org/lkml/3 lkml/git/3.git
	git clone --mirror https://lore.kernel.org/lkml/4 lkml/git/4.git
	git clone --mirror https://lore.kernel.org/lkml/5 lkml/git/5.git
	git clone --mirror https://lore.kernel.org/lkml/6 lkml/git/6.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 lkml lkml/ https://lore.kernel.org/lkml \
		linux-kernel@vger.kernel.org linux-kernel@archiver.kernel.org
	public-inbox-index lkml


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-kernel


AGPL code for this site: git clone https://public-inbox.org/ public-inbox