Linux-Media 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; 14+ 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] 14+ 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; 14+ 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] 14+ 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; 14+ 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] 14+ 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; 14+ 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] 14+ 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
  2019-01-21  9:50     ` Maxime Ripard
  0 siblings, 2 replies; 14+ 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] 14+ 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
  2019-01-21  9:50     ` Maxime Ripard
  1 sibling, 0 replies; 14+ 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] 14+ 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
@ 2019-01-21  9:50     ` Maxime Ripard
  2019-01-21  9:57       ` Chen-Yu Tsai
  1 sibling, 1 reply; 14+ messages in thread
From: Maxime Ripard @ 2019-01-21  9:50 UTC (permalink / raw)
  To: Chen-Yu Tsai
  Cc: Jernej Skrabec, Rob Herring, Mark Rutland, Mauro Carvalho Chehab,
	Linux Media Mailing List, devicetree, linux-arm-kernel,
	linux-kernel, linux-sunxi

[-- Attachment #1: Type: text/plain, Size: 1257 bytes --]

Hi,

I'm a bit late to the party, sorry for that.

On Sat, Jan 12, 2019 at 09:56:11AM +0800, Chen-Yu Tsai wrote:
> 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.

Even if we don't spot things, since we have the stable DT now, if we
ever had that compatible in the DT from day 1, it's much easier to
deal with.

I'd really like to have that pattern for all the IPs even if we didn't
spot any issue, since we can't really say that the datasheet are
complete, and one can always make a mistake and overlook something.

I'm fine with this version, and can apply it as is if we all agree.

Maxime

-- 
Maxime Ripard, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

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

* Re: [PATCH 1/3] media: dt: bindings: sunxi-ir: Add A64 compatible
  2019-01-21  9:50     ` Maxime Ripard
@ 2019-01-21  9:57       ` Chen-Yu Tsai
  2019-01-21 17:33         ` Jernej Škrabec
  2019-01-22  0:19         ` Rob Herring
  0 siblings, 2 replies; 14+ messages in thread
From: Chen-Yu Tsai @ 2019-01-21  9:57 UTC (permalink / raw)
  To: Maxime Ripard, Jernej Skrabec
  Cc: Rob Herring, Mark Rutland, Mauro Carvalho Chehab,
	Linux Media Mailing List, devicetree, linux-arm-kernel,
	linux-kernel, linux-sunxi

On Mon, Jan 21, 2019 at 5:50 PM Maxime Ripard <maxime.ripard@bootlin.com> wrote:
>
> Hi,
>
> I'm a bit late to the party, sorry for that.
>
> On Sat, Jan 12, 2019 at 09:56:11AM +0800, Chen-Yu Tsai wrote:
> > 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.
>
> Even if we don't spot things, since we have the stable DT now, if we
> ever had that compatible in the DT from day 1, it's much easier to
> deal with.
>
> I'd really like to have that pattern for all the IPs even if we didn't
> spot any issue, since we can't really say that the datasheet are
> complete, and one can always make a mistake and overlook something.
>
> I'm fine with this version, and can apply it as is if we all agree.

I'm OK with having the fallback compatible. I'm just pointing out
that there are and will be a whole bunch of them, and we don't need
to document all of them unless we are actually doing something to
support them.

On the other hand, the compatible string situation for IR needs a
bit of cleaning up at the moment. Right now we have sun4i-a10 and
sun5i-a13. As Jernej pointed out, the A13's register definition is
different from A64 (or any other SoCs later than sun6i). So we need
someone with an A10s/A13 device that has IR to test it and see if
the driver or the manual is wrong, and we'd likely add a compatible
for the A20.

Also, the earlier SoCs (A10/sun5i/A20) have IR TX capability. This
was lost in A31, and also all of sun8i / sun50i. So we're going to
need to add an A31 compatible that all later platforms would need
to switch to.


Regards
ChenYu

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

* Re: [PATCH 1/3] media: dt: bindings: sunxi-ir: Add A64 compatible
  2019-01-21  9:57       ` Chen-Yu Tsai
@ 2019-01-21 17:33         ` Jernej Škrabec
  2019-01-21 17:39           ` Chen-Yu Tsai
  2019-01-22  0:19         ` Rob Herring
  1 sibling, 1 reply; 14+ messages in thread
From: Jernej Škrabec @ 2019-01-21 17:33 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 ponedeljek, 21. januar 2019 ob 10:57:57 CET je Chen-Yu Tsai napisal(a):
> On Mon, Jan 21, 2019 at 5:50 PM Maxime Ripard <maxime.ripard@bootlin.com> 
wrote:
> > Hi,
> > 
> > I'm a bit late to the party, sorry for that.
> > 
> > On Sat, Jan 12, 2019 at 09:56:11AM +0800, Chen-Yu Tsai wrote:
> > > 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.
> > 
> > Even if we don't spot things, since we have the stable DT now, if we
> > ever had that compatible in the DT from day 1, it's much easier to
> > deal with.
> > 
> > I'd really like to have that pattern for all the IPs even if we didn't
> > spot any issue, since we can't really say that the datasheet are
> > complete, and one can always make a mistake and overlook something.
> > 
> > I'm fine with this version, and can apply it as is if we all agree.
> 
> I'm OK with having the fallback compatible. I'm just pointing out
> that there are and will be a whole bunch of them, and we don't need
> to document all of them unless we are actually doing something to
> support them.

If you don't document them, checkpatch will complain. But if you can live with 
this warning, that's fine by me.

> 
> On the other hand, the compatible string situation for IR needs a
> bit of cleaning up at the moment. Right now we have sun4i-a10 and
> sun5i-a13. As Jernej pointed out, the A13's register definition is
> different from A64 (or any other SoCs later than sun6i). So we need
> someone with an A10s/A13 device that has IR to test it and see if
> the driver or the manual is wrong, and we'd likely add a compatible
> for the A20.
> 
> Also, the earlier SoCs (A10/sun5i/A20) have IR TX capability. This
> was lost in A31, and also all of sun8i / sun50i. So we're going to
> need to add an A31 compatible that all later platforms would need
> to switch to.
> 

H6 has IR TX peripheral too, but it's different IP block...

Do you want me to switch all A31 and newer to different compatible in this 
series? I can do this, but I haven't any A13 device to test if this is really 
needed. Or you can argue that this is needed anyway due to missing TX 
capability.

BR,
Jernej



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

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

On Tue, Jan 22, 2019 at 1:33 AM Jernej Škrabec <jernej.skrabec@siol.net> wrote:
>
> Dne ponedeljek, 21. januar 2019 ob 10:57:57 CET je Chen-Yu Tsai napisal(a):
> > On Mon, Jan 21, 2019 at 5:50 PM Maxime Ripard <maxime.ripard@bootlin.com>
> wrote:
> > > Hi,
> > >
> > > I'm a bit late to the party, sorry for that.
> > >
> > > On Sat, Jan 12, 2019 at 09:56:11AM +0800, Chen-Yu Tsai wrote:
> > > > 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.
> > >
> > > Even if we don't spot things, since we have the stable DT now, if we
> > > ever had that compatible in the DT from day 1, it's much easier to
> > > deal with.
> > >
> > > I'd really like to have that pattern for all the IPs even if we didn't
> > > spot any issue, since we can't really say that the datasheet are
> > > complete, and one can always make a mistake and overlook something.
> > >
> > > I'm fine with this version, and can apply it as is if we all agree.
> >
> > I'm OK with having the fallback compatible. I'm just pointing out
> > that there are and will be a whole bunch of them, and we don't need
> > to document all of them unless we are actually doing something to
> > support them.
>
> If you don't document them, checkpatch will complain. But if you can live with
> this warning, that's fine by me.
>
> >
> > On the other hand, the compatible string situation for IR needs a
> > bit of cleaning up at the moment. Right now we have sun4i-a10 and
> > sun5i-a13. As Jernej pointed out, the A13's register definition is
> > different from A64 (or any other SoCs later than sun6i). So we need
> > someone with an A10s/A13 device that has IR to test it and see if
> > the driver or the manual is wrong, and we'd likely add a compatible
> > for the A20.
> >
> > Also, the earlier SoCs (A10/sun5i/A20) have IR TX capability. This
> > was lost in A31, and also all of sun8i / sun50i. So we're going to
> > need to add an A31 compatible that all later platforms would need
> > to switch to.
> >
>
> H6 has IR TX peripheral too, but it's different IP block...
>
> Do you want me to switch all A31 and newer to different compatible in this
> series? I can do this, but I haven't any A13 device to test if this is really
> needed. Or you can argue that this is needed anyway due to missing TX
> capability.

The lack of TX capability does necessitate switching to an A31 compatible.
So yes, please switch. Lets leave the A10s/A13 alone for now, unless
someone complains. I think this was done from inception, so if it was
broken, someone should've complained a long time ago. I just want to
be sure where the error is, and put in a comment explaining it. However
I don't have the hardware either.

ChenYu

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

* Re: [PATCH 1/3] media: dt: bindings: sunxi-ir: Add A64 compatible
  2019-01-21 17:39           ` Chen-Yu Tsai
@ 2019-01-21 17:59             ` Jernej Škrabec
  0 siblings, 0 replies; 14+ messages in thread
From: Jernej Škrabec @ 2019-01-21 17:59 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 ponedeljek, 21. januar 2019 ob 18:39:26 CET je Chen-Yu Tsai napisal(a):
> On Tue, Jan 22, 2019 at 1:33 AM Jernej Škrabec <jernej.skrabec@siol.net> 
wrote:
> > Dne ponedeljek, 21. januar 2019 ob 10:57:57 CET je Chen-Yu Tsai 
napisal(a):
> > > On Mon, Jan 21, 2019 at 5:50 PM Maxime Ripard
> > > <maxime.ripard@bootlin.com>
> > 
> > wrote:
> > > > Hi,
> > > > 
> > > > I'm a bit late to the party, sorry for that.
> > > > 
> > > > On Sat, Jan 12, 2019 at 09:56:11AM +0800, Chen-Yu Tsai wrote:
> > > > > 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.
> > > > 
> > > > Even if we don't spot things, since we have the stable DT now, if we
> > > > ever had that compatible in the DT from day 1, it's much easier to
> > > > deal with.
> > > > 
> > > > I'd really like to have that pattern for all the IPs even if we didn't
> > > > spot any issue, since we can't really say that the datasheet are
> > > > complete, and one can always make a mistake and overlook something.
> > > > 
> > > > I'm fine with this version, and can apply it as is if we all agree.
> > > 
> > > I'm OK with having the fallback compatible. I'm just pointing out
> > > that there are and will be a whole bunch of them, and we don't need
> > > to document all of them unless we are actually doing something to
> > > support them.
> > 
> > If you don't document them, checkpatch will complain. But if you can live
> > with this warning, that's fine by me.
> > 
> > > On the other hand, the compatible string situation for IR needs a
> > > bit of cleaning up at the moment. Right now we have sun4i-a10 and
> > > sun5i-a13. As Jernej pointed out, the A13's register definition is
> > > different from A64 (or any other SoCs later than sun6i). So we need
> > > someone with an A10s/A13 device that has IR to test it and see if
> > > the driver or the manual is wrong, and we'd likely add a compatible
> > > for the A20.
> > > 
> > > Also, the earlier SoCs (A10/sun5i/A20) have IR TX capability. This
> > > was lost in A31, and also all of sun8i / sun50i. So we're going to
> > > need to add an A31 compatible that all later platforms would need
> > > to switch to.
> > 
> > H6 has IR TX peripheral too, but it's different IP block...
> > 
> > Do you want me to switch all A31 and newer to different compatible in this
> > series? I can do this, but I haven't any A13 device to test if this is
> > really needed. Or you can argue that this is needed anyway due to missing
> > TX capability.
> 
> The lack of TX capability does necessitate switching to an A31 compatible.
> So yes, please switch. Lets leave the A10s/A13 alone for now, unless
> someone complains. I think this was done from inception, so if it was
> broken, someone should've complained a long time ago. I just want to
> be sure where the error is, and put in a comment explaining it. However
> I don't have the hardware either.

How do you want me to split patches? I propose following:
1. one patch to add all compatibles to DT binding documentation
2. one patch to add A31 compatible to driver
3. one patch for all 32 bit SoCs DT changes
4. one patch to add A64 compatible
5. one patch to enable OrangePi Win IR node

I don't think it's sensible to have multiple patches (one per SoC) for step 1 
and 3.

Best regards,
Jernej



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

* Re: [PATCH 1/3] media: dt: bindings: sunxi-ir: Add A64 compatible
  2019-01-21  9:57       ` Chen-Yu Tsai
  2019-01-21 17:33         ` Jernej Škrabec
@ 2019-01-22  0:19         ` Rob Herring
  2019-01-22  2:16           ` Chen-Yu Tsai
  1 sibling, 1 reply; 14+ messages in thread
From: Rob Herring @ 2019-01-22  0:19 UTC (permalink / raw)
  To: Chen-Yu Tsai
  Cc: Maxime Ripard, Jernej Skrabec, Mark Rutland,
	Mauro Carvalho Chehab, Linux Media Mailing List, devicetree,
	linux-arm-kernel, linux-kernel, linux-sunxi

On Mon, Jan 21, 2019 at 05:57:57PM +0800, Chen-Yu Tsai wrote:
> On Mon, Jan 21, 2019 at 5:50 PM Maxime Ripard <maxime.ripard@bootlin.com> wrote:
> >
> > Hi,
> >
> > I'm a bit late to the party, sorry for that.
> >
> > On Sat, Jan 12, 2019 at 09:56:11AM +0800, Chen-Yu Tsai wrote:
> > > 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.
> >
> > Even if we don't spot things, since we have the stable DT now, if we
> > ever had that compatible in the DT from day 1, it's much easier to
> > deal with.
> >
> > I'd really like to have that pattern for all the IPs even if we didn't
> > spot any issue, since we can't really say that the datasheet are
> > complete, and one can always make a mistake and overlook something.
> >
> > I'm fine with this version, and can apply it as is if we all agree.
> 
> I'm OK with having the fallback compatible. I'm just pointing out
> that there are and will be a whole bunch of them, and we don't need
> to document all of them unless we are actually doing something to
> support them.

Yes, you do. Otherwise, how will we validate what is and isn't a valid 
set of compatible strings? It's not required yet, but bindings are 
moving to json-schema.

Rob

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

* Re: [PATCH 1/3] media: dt: bindings: sunxi-ir: Add A64 compatible
  2019-01-22  0:19         ` Rob Herring
@ 2019-01-22  2:16           ` Chen-Yu Tsai
  2019-01-22 13:37             ` Rob Herring
  0 siblings, 1 reply; 14+ messages in thread
From: Chen-Yu Tsai @ 2019-01-22  2:16 UTC (permalink / raw)
  To: Rob Herring
  Cc: Maxime Ripard, Jernej Skrabec, Mark Rutland,
	Mauro Carvalho Chehab, Linux Media Mailing List, devicetree,
	linux-arm-kernel, linux-kernel, linux-sunxi

On Tue, Jan 22, 2019 at 8:19 AM Rob Herring <robh@kernel.org> wrote:
>
> On Mon, Jan 21, 2019 at 05:57:57PM +0800, Chen-Yu Tsai wrote:
> > On Mon, Jan 21, 2019 at 5:50 PM Maxime Ripard <maxime.ripard@bootlin.com> wrote:
> > >
> > > Hi,
> > >
> > > I'm a bit late to the party, sorry for that.
> > >
> > > On Sat, Jan 12, 2019 at 09:56:11AM +0800, Chen-Yu Tsai wrote:
> > > > 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.
> > >
> > > Even if we don't spot things, since we have the stable DT now, if we
> > > ever had that compatible in the DT from day 1, it's much easier to
> > > deal with.
> > >
> > > I'd really like to have that pattern for all the IPs even if we didn't
> > > spot any issue, since we can't really say that the datasheet are
> > > complete, and one can always make a mistake and overlook something.
> > >
> > > I'm fine with this version, and can apply it as is if we all agree.
> >
> > I'm OK with having the fallback compatible. I'm just pointing out
> > that there are and will be a whole bunch of them, and we don't need
> > to document all of them unless we are actually doing something to
> > support them.
>
> Yes, you do. Otherwise, how will we validate what is and isn't a valid
> set of compatible strings? It's not required yet, but bindings are
> moving to json-schema.

Ideally, if we knew which IP blocks in each SoC were compatible with
each other, we wouldn't need "per-SoC" compatible strings for each
block. However in reality this doesn't happen, due to a combination
of lack of time, lack of / uncertainty of documentation, and lack of
hardware for testing by the contributors.

The per-SoC compatible we ask people to add are a contigency plan,
for when things don't actually work, and we need some way to support
that specific piece of hardware on old DTs. At which point we will
add that SoC-specific compatible as a new compatible string to the
bindings. But not before.

ChenYu

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

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

On Mon, Jan 21, 2019 at 8:16 PM Chen-Yu Tsai <wens@csie.org> wrote:
>
> On Tue, Jan 22, 2019 at 8:19 AM Rob Herring <robh@kernel.org> wrote:
> >
> > On Mon, Jan 21, 2019 at 05:57:57PM +0800, Chen-Yu Tsai wrote:
> > > On Mon, Jan 21, 2019 at 5:50 PM Maxime Ripard <maxime.ripard@bootlin.com> wrote:
> > > >
> > > > Hi,
> > > >
> > > > I'm a bit late to the party, sorry for that.
> > > >
> > > > On Sat, Jan 12, 2019 at 09:56:11AM +0800, Chen-Yu Tsai wrote:
> > > > > 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.
> > > >
> > > > Even if we don't spot things, since we have the stable DT now, if we
> > > > ever had that compatible in the DT from day 1, it's much easier to
> > > > deal with.
> > > >
> > > > I'd really like to have that pattern for all the IPs even if we didn't
> > > > spot any issue, since we can't really say that the datasheet are
> > > > complete, and one can always make a mistake and overlook something.
> > > >
> > > > I'm fine with this version, and can apply it as is if we all agree.
> > >
> > > I'm OK with having the fallback compatible. I'm just pointing out
> > > that there are and will be a whole bunch of them, and we don't need
> > > to document all of them unless we are actually doing something to
> > > support them.
> >
> > Yes, you do. Otherwise, how will we validate what is and isn't a valid
> > set of compatible strings? It's not required yet, but bindings are
> > moving to json-schema.
>
> Ideally, if we knew which IP blocks in each SoC were compatible with
> each other, we wouldn't need "per-SoC" compatible strings for each
> block. However in reality this doesn't happen, due to a combination
> of lack of time, lack of / uncertainty of documentation, and lack of
> hardware for testing by the contributors.
>
> The per-SoC compatible we ask people to add are a contigency plan,
> for when things don't actually work, and we need some way to support
> that specific piece of hardware on old DTs.

You are right up to here.

> At which point we will
> add that SoC-specific compatible as a new compatible string to the
> bindings. But not before.

No, the point SoC-specific compatibles is they are already present in
the DT and you only have to update the OS to fix issues. The SoC
specific compatible has to be documented when first used in dts files,
not when the OS uses them. That is the rule.

Rob

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

end of thread, back to index

Thread overview: 14+ 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-21  9:50     ` Maxime Ripard
2019-01-21  9:57       ` Chen-Yu Tsai
2019-01-21 17:33         ` Jernej Škrabec
2019-01-21 17:39           ` Chen-Yu Tsai
2019-01-21 17:59             ` Jernej Škrabec
2019-01-22  0:19         ` Rob Herring
2019-01-22  2:16           ` Chen-Yu Tsai
2019-01-22 13:37             ` Rob Herring
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

Linux-Media Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-media/0 linux-media/git/0.git

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


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


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