Re: [linux-sunxi] Re: [PATCH v3 2/3] dt-bindings: input: Add R_LRADC support for A83T

2017-06-29 Thread Ziping Chen
2017-06-29 15:53 GMT+08:00 Maxime Ripard :
> On Thu, Jun 29, 2017 at 12:45:51PM +0800, Ziping Chen wrote:
>> 2017-06-28 1:36 GMT+08:00 Maxime Ripard :
>> > Hi,
>> >
>> > On Tue, Jun 27, 2017 at 11:29:10PM +0800, icen...@aosc.io wrote:
>> >> Maxime, here's another problem: if we have already a GP LRADC driver,
>> >> how can we tell the kernel to use it as IIO ADC rather than keys?
>> >
>> > The GPADC IIO driver is not for the LRADC driver, but the GPADC /
>> > temperature sensor.
>> >
>> > We used to have an LRADC IIO driver in the CHIP BSP written by Alex
>> > (in CC):
>> > https://github.com/NextThingCo/CHIP-linux/commit/8675b761c54be73dc7cc0113209f02e10cc63a27
>> >
>> > But he never mainlined it.
>> >
>> >> Should we introduce a new property for this once ready?
>> >
>> > We need to keep the current binding. We can just check for the
>> > presence or not of child nodes to see if it has some keys, and we'd
>> > need an IIO-to-input driver that is yet to be written.
>> >
>>
>> Yes, then we need an iio-to-input driver...
>> So...whether the driver(a83t lradc keys) can be applied now,
>> or we should wait for the iio-to-input driver.
>
> This is a long term discussion, it shouldn't hold the patches you
> sent.

OK, I get it.

And I will think about how to implement the iio-to-input driver.

Thanks,
Ziping

>
> Maxime
>
> --
> Maxime Ripard, Free Electrons
> Embedded Linux and Kernel engineering
> http://free-electrons.com


Re: [linux-sunxi] Re: [PATCH v3 2/3] dt-bindings: input: Add R_LRADC support for A83T

2017-06-29 Thread Ziping Chen
2017-06-29 15:53 GMT+08:00 Maxime Ripard :
> On Thu, Jun 29, 2017 at 12:45:51PM +0800, Ziping Chen wrote:
>> 2017-06-28 1:36 GMT+08:00 Maxime Ripard :
>> > Hi,
>> >
>> > On Tue, Jun 27, 2017 at 11:29:10PM +0800, icen...@aosc.io wrote:
>> >> Maxime, here's another problem: if we have already a GP LRADC driver,
>> >> how can we tell the kernel to use it as IIO ADC rather than keys?
>> >
>> > The GPADC IIO driver is not for the LRADC driver, but the GPADC /
>> > temperature sensor.
>> >
>> > We used to have an LRADC IIO driver in the CHIP BSP written by Alex
>> > (in CC):
>> > https://github.com/NextThingCo/CHIP-linux/commit/8675b761c54be73dc7cc0113209f02e10cc63a27
>> >
>> > But he never mainlined it.
>> >
>> >> Should we introduce a new property for this once ready?
>> >
>> > We need to keep the current binding. We can just check for the
>> > presence or not of child nodes to see if it has some keys, and we'd
>> > need an IIO-to-input driver that is yet to be written.
>> >
>>
>> Yes, then we need an iio-to-input driver...
>> So...whether the driver(a83t lradc keys) can be applied now,
>> or we should wait for the iio-to-input driver.
>
> This is a long term discussion, it shouldn't hold the patches you
> sent.

OK, I get it.

And I will think about how to implement the iio-to-input driver.

Thanks,
Ziping

>
> Maxime
>
> --
> Maxime Ripard, Free Electrons
> Embedded Linux and Kernel engineering
> http://free-electrons.com


Re: [PATCH v3 2/3] dt-bindings: input: Add R_LRADC support for A83T

2017-06-29 Thread Maxime Ripard
Hi,

On Thu, Jun 29, 2017 at 12:35:30PM +0800, Ziping Chen wrote:
> 2017-06-28 1:31 GMT+08:00 Maxime Ripard :
> > On Tue, Jun 27, 2017 at 11:18:17PM +0800, Ziping Chen wrote:
> >> 2017-06-27 1:15 GMT+08:00 Maxime Ripard :
> >> > Hi,
> >> >
> >> > On Sat, Jun 24, 2017 at 10:45:14AM +0800, Ziping Chen wrote:
> >> >> From: Ziping Chen 
> >> >>
> >> >> Allwinner A83T SoC has a low res adc like the one
> >> >> in Allwinner A10 SoC.
> >> >>
> >> >> Add binding for it.
> >> >>
> >> >> Signed-off-by: Ziping Chen 
> >> >> Acked-by: Rob Herring 
> >> >> ---
> >> >>  Documentation/devicetree/bindings/input/sun4i-lradc-keys.txt | 6 --
> >> >>  1 file changed, 4 insertions(+), 2 deletions(-)
> >> >>
> >> >> diff --git 
> >> >> a/Documentation/devicetree/bindings/input/sun4i-lradc-keys.txt 
> >> >> b/Documentation/devicetree/bindings/input/sun4i-lradc-keys.txt
> >> >> index 4357e498ef04..525d85e3043f 100644
> >> >> --- a/Documentation/devicetree/bindings/input/sun4i-lradc-keys.txt
> >> >> +++ b/Documentation/devicetree/bindings/input/sun4i-lradc-keys.txt
> >> >> @@ -2,12 +2,14 @@ Allwinner sun4i low res adc attached tablet keys
> >> >>  
> >> >>
> >> >>  Required properties:
> >> >> - - compatible: "allwinner,sun4i-a10-lradc-keys"
> >> >> + - compatible: should be one of the following string:
> >> >> + "allwinner,sun4i-a10-lradc-keys"
> >> >> + "allwinner,sun8i-a83t-r-lradc-keys"
> >> >
> >> > This doesn't really have anything related to keys, and can be used
> >> > purely as an ADC.
> >> >
> >> > I know this is the compatible that was used for the A10, but I'd
> >> > rather drop the keys for the the new compatible.
> >> >
> >>
> >> LRADC is named KEYADC in some other SoCs' User Manual(such as R40 User
> >> Manual V1.0), thus LRADC is related to keys.
> >
> > It's still called LRADC on the A83T, so we'll use that name. If we
> > ever need another compatible for the R40, then yes, keyadc would make
> > sense in that case.
> 
> Hi,
> 
> So... whether to use "sun4i-lradc" to replace "sun4i-lradc-keys"?
> 
> I think it should be separated, one is the input subsystem, the other
> is the iio subsystem.

I was just talking about your compatible here, and was basically
suggesting to do sed 's/sun8i-a83t-r-lradc-keys/sun8i-a83t-r-lradc/',
that's all.

Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com


signature.asc
Description: PGP signature


Re: [linux-sunxi] Re: [PATCH v3 2/3] dt-bindings: input: Add R_LRADC support for A83T

2017-06-29 Thread Maxime Ripard
On Thu, Jun 29, 2017 at 12:45:51PM +0800, Ziping Chen wrote:
> 2017-06-28 1:36 GMT+08:00 Maxime Ripard :
> > Hi,
> >
> > On Tue, Jun 27, 2017 at 11:29:10PM +0800, icen...@aosc.io wrote:
> >> Maxime, here's another problem: if we have already a GP LRADC driver,
> >> how can we tell the kernel to use it as IIO ADC rather than keys?
> >
> > The GPADC IIO driver is not for the LRADC driver, but the GPADC /
> > temperature sensor.
> >
> > We used to have an LRADC IIO driver in the CHIP BSP written by Alex
> > (in CC):
> > https://github.com/NextThingCo/CHIP-linux/commit/8675b761c54be73dc7cc0113209f02e10cc63a27
> >
> > But he never mainlined it.
> >
> >> Should we introduce a new property for this once ready?
> >
> > We need to keep the current binding. We can just check for the
> > presence or not of child nodes to see if it has some keys, and we'd
> > need an IIO-to-input driver that is yet to be written.
> >
> 
> Yes, then we need an iio-to-input driver...
> So...whether the driver(a83t lradc keys) can be applied now,
> or we should wait for the iio-to-input driver.

This is a long term discussion, it shouldn't hold the patches you
sent.

Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com


signature.asc
Description: PGP signature


Re: [PATCH v3 2/3] dt-bindings: input: Add R_LRADC support for A83T

2017-06-29 Thread Maxime Ripard
Hi,

On Thu, Jun 29, 2017 at 12:35:30PM +0800, Ziping Chen wrote:
> 2017-06-28 1:31 GMT+08:00 Maxime Ripard :
> > On Tue, Jun 27, 2017 at 11:18:17PM +0800, Ziping Chen wrote:
> >> 2017-06-27 1:15 GMT+08:00 Maxime Ripard :
> >> > Hi,
> >> >
> >> > On Sat, Jun 24, 2017 at 10:45:14AM +0800, Ziping Chen wrote:
> >> >> From: Ziping Chen 
> >> >>
> >> >> Allwinner A83T SoC has a low res adc like the one
> >> >> in Allwinner A10 SoC.
> >> >>
> >> >> Add binding for it.
> >> >>
> >> >> Signed-off-by: Ziping Chen 
> >> >> Acked-by: Rob Herring 
> >> >> ---
> >> >>  Documentation/devicetree/bindings/input/sun4i-lradc-keys.txt | 6 --
> >> >>  1 file changed, 4 insertions(+), 2 deletions(-)
> >> >>
> >> >> diff --git 
> >> >> a/Documentation/devicetree/bindings/input/sun4i-lradc-keys.txt 
> >> >> b/Documentation/devicetree/bindings/input/sun4i-lradc-keys.txt
> >> >> index 4357e498ef04..525d85e3043f 100644
> >> >> --- a/Documentation/devicetree/bindings/input/sun4i-lradc-keys.txt
> >> >> +++ b/Documentation/devicetree/bindings/input/sun4i-lradc-keys.txt
> >> >> @@ -2,12 +2,14 @@ Allwinner sun4i low res adc attached tablet keys
> >> >>  
> >> >>
> >> >>  Required properties:
> >> >> - - compatible: "allwinner,sun4i-a10-lradc-keys"
> >> >> + - compatible: should be one of the following string:
> >> >> + "allwinner,sun4i-a10-lradc-keys"
> >> >> + "allwinner,sun8i-a83t-r-lradc-keys"
> >> >
> >> > This doesn't really have anything related to keys, and can be used
> >> > purely as an ADC.
> >> >
> >> > I know this is the compatible that was used for the A10, but I'd
> >> > rather drop the keys for the the new compatible.
> >> >
> >>
> >> LRADC is named KEYADC in some other SoCs' User Manual(such as R40 User
> >> Manual V1.0), thus LRADC is related to keys.
> >
> > It's still called LRADC on the A83T, so we'll use that name. If we
> > ever need another compatible for the R40, then yes, keyadc would make
> > sense in that case.
> 
> Hi,
> 
> So... whether to use "sun4i-lradc" to replace "sun4i-lradc-keys"?
> 
> I think it should be separated, one is the input subsystem, the other
> is the iio subsystem.

I was just talking about your compatible here, and was basically
suggesting to do sed 's/sun8i-a83t-r-lradc-keys/sun8i-a83t-r-lradc/',
that's all.

Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com


signature.asc
Description: PGP signature


Re: [linux-sunxi] Re: [PATCH v3 2/3] dt-bindings: input: Add R_LRADC support for A83T

2017-06-29 Thread Maxime Ripard
On Thu, Jun 29, 2017 at 12:45:51PM +0800, Ziping Chen wrote:
> 2017-06-28 1:36 GMT+08:00 Maxime Ripard :
> > Hi,
> >
> > On Tue, Jun 27, 2017 at 11:29:10PM +0800, icen...@aosc.io wrote:
> >> Maxime, here's another problem: if we have already a GP LRADC driver,
> >> how can we tell the kernel to use it as IIO ADC rather than keys?
> >
> > The GPADC IIO driver is not for the LRADC driver, but the GPADC /
> > temperature sensor.
> >
> > We used to have an LRADC IIO driver in the CHIP BSP written by Alex
> > (in CC):
> > https://github.com/NextThingCo/CHIP-linux/commit/8675b761c54be73dc7cc0113209f02e10cc63a27
> >
> > But he never mainlined it.
> >
> >> Should we introduce a new property for this once ready?
> >
> > We need to keep the current binding. We can just check for the
> > presence or not of child nodes to see if it has some keys, and we'd
> > need an IIO-to-input driver that is yet to be written.
> >
> 
> Yes, then we need an iio-to-input driver...
> So...whether the driver(a83t lradc keys) can be applied now,
> or we should wait for the iio-to-input driver.

This is a long term discussion, it shouldn't hold the patches you
sent.

Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com


signature.asc
Description: PGP signature


Re: [linux-sunxi] Re: [PATCH v3 2/3] dt-bindings: input: Add R_LRADC support for A83T

2017-06-28 Thread Ziping Chen
2017-06-28 1:36 GMT+08:00 Maxime Ripard :
> Hi,
>
> On Tue, Jun 27, 2017 at 11:29:10PM +0800, icen...@aosc.io wrote:
>> Maxime, here's another problem: if we have already a GP LRADC driver,
>> how can we tell the kernel to use it as IIO ADC rather than keys?
>
> The GPADC IIO driver is not for the LRADC driver, but the GPADC /
> temperature sensor.
>
> We used to have an LRADC IIO driver in the CHIP BSP written by Alex
> (in CC):
> https://github.com/NextThingCo/CHIP-linux/commit/8675b761c54be73dc7cc0113209f02e10cc63a27
>
> But he never mainlined it.
>
>> Should we introduce a new property for this once ready?
>
> We need to keep the current binding. We can just check for the
> presence or not of child nodes to see if it has some keys, and we'd
> need an IIO-to-input driver that is yet to be written.
>

Yes, then we need an iio-to-input driver...
So...whether the driver(a83t lradc keys) can be applied now,
or we should wait for the iio-to-input driver.

Thanks
Ziping

> Maxime
>
> --
> Maxime Ripard, Free Electrons
> Embedded Linux and Kernel engineering
> http://free-electrons.com


Re: [linux-sunxi] Re: [PATCH v3 2/3] dt-bindings: input: Add R_LRADC support for A83T

2017-06-28 Thread Ziping Chen
2017-06-28 1:36 GMT+08:00 Maxime Ripard :
> Hi,
>
> On Tue, Jun 27, 2017 at 11:29:10PM +0800, icen...@aosc.io wrote:
>> Maxime, here's another problem: if we have already a GP LRADC driver,
>> how can we tell the kernel to use it as IIO ADC rather than keys?
>
> The GPADC IIO driver is not for the LRADC driver, but the GPADC /
> temperature sensor.
>
> We used to have an LRADC IIO driver in the CHIP BSP written by Alex
> (in CC):
> https://github.com/NextThingCo/CHIP-linux/commit/8675b761c54be73dc7cc0113209f02e10cc63a27
>
> But he never mainlined it.
>
>> Should we introduce a new property for this once ready?
>
> We need to keep the current binding. We can just check for the
> presence or not of child nodes to see if it has some keys, and we'd
> need an IIO-to-input driver that is yet to be written.
>

Yes, then we need an iio-to-input driver...
So...whether the driver(a83t lradc keys) can be applied now,
or we should wait for the iio-to-input driver.

Thanks
Ziping

> Maxime
>
> --
> Maxime Ripard, Free Electrons
> Embedded Linux and Kernel engineering
> http://free-electrons.com


Re: [PATCH v3 2/3] dt-bindings: input: Add R_LRADC support for A83T

2017-06-28 Thread Ziping Chen
2017-06-28 1:31 GMT+08:00 Maxime Ripard :
> On Tue, Jun 27, 2017 at 11:18:17PM +0800, Ziping Chen wrote:
>> 2017-06-27 1:15 GMT+08:00 Maxime Ripard :
>> > Hi,
>> >
>> > On Sat, Jun 24, 2017 at 10:45:14AM +0800, Ziping Chen wrote:
>> >> From: Ziping Chen 
>> >>
>> >> Allwinner A83T SoC has a low res adc like the one
>> >> in Allwinner A10 SoC.
>> >>
>> >> Add binding for it.
>> >>
>> >> Signed-off-by: Ziping Chen 
>> >> Acked-by: Rob Herring 
>> >> ---
>> >>  Documentation/devicetree/bindings/input/sun4i-lradc-keys.txt | 6 --
>> >>  1 file changed, 4 insertions(+), 2 deletions(-)
>> >>
>> >> diff --git a/Documentation/devicetree/bindings/input/sun4i-lradc-keys.txt 
>> >> b/Documentation/devicetree/bindings/input/sun4i-lradc-keys.txt
>> >> index 4357e498ef04..525d85e3043f 100644
>> >> --- a/Documentation/devicetree/bindings/input/sun4i-lradc-keys.txt
>> >> +++ b/Documentation/devicetree/bindings/input/sun4i-lradc-keys.txt
>> >> @@ -2,12 +2,14 @@ Allwinner sun4i low res adc attached tablet keys
>> >>  
>> >>
>> >>  Required properties:
>> >> - - compatible: "allwinner,sun4i-a10-lradc-keys"
>> >> + - compatible: should be one of the following string:
>> >> + "allwinner,sun4i-a10-lradc-keys"
>> >> + "allwinner,sun8i-a83t-r-lradc-keys"
>> >
>> > This doesn't really have anything related to keys, and can be used
>> > purely as an ADC.
>> >
>> > I know this is the compatible that was used for the A10, but I'd
>> > rather drop the keys for the the new compatible.
>> >
>>
>> LRADC is named KEYADC in some other SoCs' User Manual(such as R40 User
>> Manual V1.0), thus LRADC is related to keys.
>
> It's still called LRADC on the A83T, so we'll use that name. If we
> ever need another compatible for the R40, then yes, keyadc would make
> sense in that case.

Hi,

So... whether to use "sun4i-lradc" to replace "sun4i-lradc-keys"?

I think it should be separated, one is the input subsystem, the other
is the iio subsystem.

>
> Maxime
>
> --
> Maxime Ripard, Free Electrons
> Embedded Linux and Kernel engineering
> http://free-electrons.com


Re: [PATCH v3 2/3] dt-bindings: input: Add R_LRADC support for A83T

2017-06-28 Thread Ziping Chen
2017-06-28 1:31 GMT+08:00 Maxime Ripard :
> On Tue, Jun 27, 2017 at 11:18:17PM +0800, Ziping Chen wrote:
>> 2017-06-27 1:15 GMT+08:00 Maxime Ripard :
>> > Hi,
>> >
>> > On Sat, Jun 24, 2017 at 10:45:14AM +0800, Ziping Chen wrote:
>> >> From: Ziping Chen 
>> >>
>> >> Allwinner A83T SoC has a low res adc like the one
>> >> in Allwinner A10 SoC.
>> >>
>> >> Add binding for it.
>> >>
>> >> Signed-off-by: Ziping Chen 
>> >> Acked-by: Rob Herring 
>> >> ---
>> >>  Documentation/devicetree/bindings/input/sun4i-lradc-keys.txt | 6 --
>> >>  1 file changed, 4 insertions(+), 2 deletions(-)
>> >>
>> >> diff --git a/Documentation/devicetree/bindings/input/sun4i-lradc-keys.txt 
>> >> b/Documentation/devicetree/bindings/input/sun4i-lradc-keys.txt
>> >> index 4357e498ef04..525d85e3043f 100644
>> >> --- a/Documentation/devicetree/bindings/input/sun4i-lradc-keys.txt
>> >> +++ b/Documentation/devicetree/bindings/input/sun4i-lradc-keys.txt
>> >> @@ -2,12 +2,14 @@ Allwinner sun4i low res adc attached tablet keys
>> >>  
>> >>
>> >>  Required properties:
>> >> - - compatible: "allwinner,sun4i-a10-lradc-keys"
>> >> + - compatible: should be one of the following string:
>> >> + "allwinner,sun4i-a10-lradc-keys"
>> >> + "allwinner,sun8i-a83t-r-lradc-keys"
>> >
>> > This doesn't really have anything related to keys, and can be used
>> > purely as an ADC.
>> >
>> > I know this is the compatible that was used for the A10, but I'd
>> > rather drop the keys for the the new compatible.
>> >
>>
>> LRADC is named KEYADC in some other SoCs' User Manual(such as R40 User
>> Manual V1.0), thus LRADC is related to keys.
>
> It's still called LRADC on the A83T, so we'll use that name. If we
> ever need another compatible for the R40, then yes, keyadc would make
> sense in that case.

Hi,

So... whether to use "sun4i-lradc" to replace "sun4i-lradc-keys"?

I think it should be separated, one is the input subsystem, the other
is the iio subsystem.

>
> Maxime
>
> --
> Maxime Ripard, Free Electrons
> Embedded Linux and Kernel engineering
> http://free-electrons.com


Re: [linux-sunxi] Re: [PATCH v3 2/3] dt-bindings: input: Add R_LRADC support for A83T

2017-06-27 Thread Alexandre Belloni
On 27/06/2017 at 19:36:31 +0200, Maxime Ripard wrote:
> Hi,
> 
> On Tue, Jun 27, 2017 at 11:29:10PM +0800, icen...@aosc.io wrote:
> > Maxime, here's another problem: if we have already a GP LRADC driver,
> > how can we tell the kernel to use it as IIO ADC rather than keys?
> 
> The GPADC IIO driver is not for the LRADC driver, but the GPADC /
> temperature sensor.
> 
> We used to have an LRADC IIO driver in the CHIP BSP written by Alex
> (in CC):
> https://github.com/NextThingCo/CHIP-linux/commit/8675b761c54be73dc7cc0113209f02e10cc63a27
> 
> But he never mainlined it.
> 
> > Should we introduce a new property for this once ready?
> 
> We need to keep the current binding. We can just check for the
> presence or not of child nodes to see if it has some keys, and we'd
> need an IIO-to-input driver that is yet to be written.
> 

The whole submission is here and can already replace the existing driver
but it will be polling instead of using interrupts:

http://lists.infradead.org/pipermail/linux-arm-kernel/2016-July/440734.html

It is not upstream because it seems the full replacement was required at
once instead of doing it incrementally and there was (is) no API for
in-kernel events consumers.

Also, the DT ABI stuff would have to be solved.

-- 
Alexandre Belloni, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com


Re: [linux-sunxi] Re: [PATCH v3 2/3] dt-bindings: input: Add R_LRADC support for A83T

2017-06-27 Thread Alexandre Belloni
On 27/06/2017 at 19:36:31 +0200, Maxime Ripard wrote:
> Hi,
> 
> On Tue, Jun 27, 2017 at 11:29:10PM +0800, icen...@aosc.io wrote:
> > Maxime, here's another problem: if we have already a GP LRADC driver,
> > how can we tell the kernel to use it as IIO ADC rather than keys?
> 
> The GPADC IIO driver is not for the LRADC driver, but the GPADC /
> temperature sensor.
> 
> We used to have an LRADC IIO driver in the CHIP BSP written by Alex
> (in CC):
> https://github.com/NextThingCo/CHIP-linux/commit/8675b761c54be73dc7cc0113209f02e10cc63a27
> 
> But he never mainlined it.
> 
> > Should we introduce a new property for this once ready?
> 
> We need to keep the current binding. We can just check for the
> presence or not of child nodes to see if it has some keys, and we'd
> need an IIO-to-input driver that is yet to be written.
> 

The whole submission is here and can already replace the existing driver
but it will be polling instead of using interrupts:

http://lists.infradead.org/pipermail/linux-arm-kernel/2016-July/440734.html

It is not upstream because it seems the full replacement was required at
once instead of doing it incrementally and there was (is) no API for
in-kernel events consumers.

Also, the DT ABI stuff would have to be solved.

-- 
Alexandre Belloni, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com


Re: [linux-sunxi] Re: [PATCH v3 2/3] dt-bindings: input: Add R_LRADC support for A83T

2017-06-27 Thread Maxime Ripard
Hi,

On Tue, Jun 27, 2017 at 11:29:10PM +0800, icen...@aosc.io wrote:
> Maxime, here's another problem: if we have already a GP LRADC driver,
> how can we tell the kernel to use it as IIO ADC rather than keys?

The GPADC IIO driver is not for the LRADC driver, but the GPADC /
temperature sensor.

We used to have an LRADC IIO driver in the CHIP BSP written by Alex
(in CC):
https://github.com/NextThingCo/CHIP-linux/commit/8675b761c54be73dc7cc0113209f02e10cc63a27

But he never mainlined it.

> Should we introduce a new property for this once ready?

We need to keep the current binding. We can just check for the
presence or not of child nodes to see if it has some keys, and we'd
need an IIO-to-input driver that is yet to be written.

Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com


signature.asc
Description: PGP signature


Re: [linux-sunxi] Re: [PATCH v3 2/3] dt-bindings: input: Add R_LRADC support for A83T

2017-06-27 Thread Maxime Ripard
Hi,

On Tue, Jun 27, 2017 at 11:29:10PM +0800, icen...@aosc.io wrote:
> Maxime, here's another problem: if we have already a GP LRADC driver,
> how can we tell the kernel to use it as IIO ADC rather than keys?

The GPADC IIO driver is not for the LRADC driver, but the GPADC /
temperature sensor.

We used to have an LRADC IIO driver in the CHIP BSP written by Alex
(in CC):
https://github.com/NextThingCo/CHIP-linux/commit/8675b761c54be73dc7cc0113209f02e10cc63a27

But he never mainlined it.

> Should we introduce a new property for this once ready?

We need to keep the current binding. We can just check for the
presence or not of child nodes to see if it has some keys, and we'd
need an IIO-to-input driver that is yet to be written.

Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com


signature.asc
Description: PGP signature


Re: [PATCH v3 2/3] dt-bindings: input: Add R_LRADC support for A83T

2017-06-27 Thread Maxime Ripard
On Tue, Jun 27, 2017 at 11:18:17PM +0800, Ziping Chen wrote:
> 2017-06-27 1:15 GMT+08:00 Maxime Ripard :
> > Hi,
> >
> > On Sat, Jun 24, 2017 at 10:45:14AM +0800, Ziping Chen wrote:
> >> From: Ziping Chen 
> >>
> >> Allwinner A83T SoC has a low res adc like the one
> >> in Allwinner A10 SoC.
> >>
> >> Add binding for it.
> >>
> >> Signed-off-by: Ziping Chen 
> >> Acked-by: Rob Herring 
> >> ---
> >>  Documentation/devicetree/bindings/input/sun4i-lradc-keys.txt | 6 --
> >>  1 file changed, 4 insertions(+), 2 deletions(-)
> >>
> >> diff --git a/Documentation/devicetree/bindings/input/sun4i-lradc-keys.txt 
> >> b/Documentation/devicetree/bindings/input/sun4i-lradc-keys.txt
> >> index 4357e498ef04..525d85e3043f 100644
> >> --- a/Documentation/devicetree/bindings/input/sun4i-lradc-keys.txt
> >> +++ b/Documentation/devicetree/bindings/input/sun4i-lradc-keys.txt
> >> @@ -2,12 +2,14 @@ Allwinner sun4i low res adc attached tablet keys
> >>  
> >>
> >>  Required properties:
> >> - - compatible: "allwinner,sun4i-a10-lradc-keys"
> >> + - compatible: should be one of the following string:
> >> + "allwinner,sun4i-a10-lradc-keys"
> >> + "allwinner,sun8i-a83t-r-lradc-keys"
> >
> > This doesn't really have anything related to keys, and can be used
> > purely as an ADC.
> >
> > I know this is the compatible that was used for the A10, but I'd
> > rather drop the keys for the the new compatible.
> >
> 
> LRADC is named KEYADC in some other SoCs' User Manual(such as R40 User
> Manual V1.0), thus LRADC is related to keys.

It's still called LRADC on the A83T, so we'll use that name. If we
ever need another compatible for the R40, then yes, keyadc would make
sense in that case.

Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com


signature.asc
Description: PGP signature


Re: [PATCH v3 2/3] dt-bindings: input: Add R_LRADC support for A83T

2017-06-27 Thread Maxime Ripard
On Tue, Jun 27, 2017 at 11:18:17PM +0800, Ziping Chen wrote:
> 2017-06-27 1:15 GMT+08:00 Maxime Ripard :
> > Hi,
> >
> > On Sat, Jun 24, 2017 at 10:45:14AM +0800, Ziping Chen wrote:
> >> From: Ziping Chen 
> >>
> >> Allwinner A83T SoC has a low res adc like the one
> >> in Allwinner A10 SoC.
> >>
> >> Add binding for it.
> >>
> >> Signed-off-by: Ziping Chen 
> >> Acked-by: Rob Herring 
> >> ---
> >>  Documentation/devicetree/bindings/input/sun4i-lradc-keys.txt | 6 --
> >>  1 file changed, 4 insertions(+), 2 deletions(-)
> >>
> >> diff --git a/Documentation/devicetree/bindings/input/sun4i-lradc-keys.txt 
> >> b/Documentation/devicetree/bindings/input/sun4i-lradc-keys.txt
> >> index 4357e498ef04..525d85e3043f 100644
> >> --- a/Documentation/devicetree/bindings/input/sun4i-lradc-keys.txt
> >> +++ b/Documentation/devicetree/bindings/input/sun4i-lradc-keys.txt
> >> @@ -2,12 +2,14 @@ Allwinner sun4i low res adc attached tablet keys
> >>  
> >>
> >>  Required properties:
> >> - - compatible: "allwinner,sun4i-a10-lradc-keys"
> >> + - compatible: should be one of the following string:
> >> + "allwinner,sun4i-a10-lradc-keys"
> >> + "allwinner,sun8i-a83t-r-lradc-keys"
> >
> > This doesn't really have anything related to keys, and can be used
> > purely as an ADC.
> >
> > I know this is the compatible that was used for the A10, but I'd
> > rather drop the keys for the the new compatible.
> >
> 
> LRADC is named KEYADC in some other SoCs' User Manual(such as R40 User
> Manual V1.0), thus LRADC is related to keys.

It's still called LRADC on the A83T, so we'll use that name. If we
ever need another compatible for the R40, then yes, keyadc would make
sense in that case.

Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com


signature.asc
Description: PGP signature


Re: [linux-sunxi] Re: [PATCH v3 2/3] dt-bindings: input: Add R_LRADC support for A83T

2017-06-27 Thread icenowy

在 2017-06-27 23:18,Ziping Chen 写道:
2017-06-27 1:15 GMT+08:00 Maxime Ripard 
:

Hi,

On Sat, Jun 24, 2017 at 10:45:14AM +0800, Ziping Chen wrote:

From: Ziping Chen 

Allwinner A83T SoC has a low res adc like the one
in Allwinner A10 SoC.

Add binding for it.

Signed-off-by: Ziping Chen 
Acked-by: Rob Herring 
---
 Documentation/devicetree/bindings/input/sun4i-lradc-keys.txt | 6 
--

 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git 
a/Documentation/devicetree/bindings/input/sun4i-lradc-keys.txt 
b/Documentation/devicetree/bindings/input/sun4i-lradc-keys.txt

index 4357e498ef04..525d85e3043f 100644
--- a/Documentation/devicetree/bindings/input/sun4i-lradc-keys.txt
+++ b/Documentation/devicetree/bindings/input/sun4i-lradc-keys.txt
@@ -2,12 +2,14 @@ Allwinner sun4i low res adc attached tablet keys
 

 Required properties:
- - compatible: "allwinner,sun4i-a10-lradc-keys"
+ - compatible: should be one of the following string:
+ "allwinner,sun4i-a10-lradc-keys"
+ "allwinner,sun8i-a83t-r-lradc-keys"


This doesn't really have anything related to keys, and can be used
purely as an ADC.

I know this is the compatible that was used for the A10, but I'd
rather drop the keys for the the new compatible.



Hi,
LRADC is named KEYADC in some other SoCs' User Manual(such as R40 User
Manual V1.0), thus LRADC is related to keys.

Without keys there is another driver named sun4i-gpadc-iio which is
located at driver/iio/adc/sun4i-gpadc-iio.c


Nope. The general purpose LRADC driver still doesn't land in mainline,
and this driver is for the GPADC related to thermal and resistive
touch screen.

However, the LRADC is possible to be used in general purpose, and
more and more boards are wiring the LRADC pin as a pin on the pinout
(e.g. Pine64 and Lichee Pi Zero) and it may be useful.

And the hardware is not bound to keys -- it's only the Allwinner
reference design which bind the LRADC to keys. Device vendors can
change it if needed.

So it's suggested to have a binding without "-keys".

Maxime, here's another problem: if we have already a GP LRADC driver,
how can we tell the kernel to use it as IIO ADC rather than keys?
Should we introduce a new property for this once ready?


Re: [linux-sunxi] Re: [PATCH v3 2/3] dt-bindings: input: Add R_LRADC support for A83T

2017-06-27 Thread icenowy

在 2017-06-27 23:18,Ziping Chen 写道:
2017-06-27 1:15 GMT+08:00 Maxime Ripard 
:

Hi,

On Sat, Jun 24, 2017 at 10:45:14AM +0800, Ziping Chen wrote:

From: Ziping Chen 

Allwinner A83T SoC has a low res adc like the one
in Allwinner A10 SoC.

Add binding for it.

Signed-off-by: Ziping Chen 
Acked-by: Rob Herring 
---
 Documentation/devicetree/bindings/input/sun4i-lradc-keys.txt | 6 
--

 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git 
a/Documentation/devicetree/bindings/input/sun4i-lradc-keys.txt 
b/Documentation/devicetree/bindings/input/sun4i-lradc-keys.txt

index 4357e498ef04..525d85e3043f 100644
--- a/Documentation/devicetree/bindings/input/sun4i-lradc-keys.txt
+++ b/Documentation/devicetree/bindings/input/sun4i-lradc-keys.txt
@@ -2,12 +2,14 @@ Allwinner sun4i low res adc attached tablet keys
 

 Required properties:
- - compatible: "allwinner,sun4i-a10-lradc-keys"
+ - compatible: should be one of the following string:
+ "allwinner,sun4i-a10-lradc-keys"
+ "allwinner,sun8i-a83t-r-lradc-keys"


This doesn't really have anything related to keys, and can be used
purely as an ADC.

I know this is the compatible that was used for the A10, but I'd
rather drop the keys for the the new compatible.



Hi,
LRADC is named KEYADC in some other SoCs' User Manual(such as R40 User
Manual V1.0), thus LRADC is related to keys.

Without keys there is another driver named sun4i-gpadc-iio which is
located at driver/iio/adc/sun4i-gpadc-iio.c


Nope. The general purpose LRADC driver still doesn't land in mainline,
and this driver is for the GPADC related to thermal and resistive
touch screen.

However, the LRADC is possible to be used in general purpose, and
more and more boards are wiring the LRADC pin as a pin on the pinout
(e.g. Pine64 and Lichee Pi Zero) and it may be useful.

And the hardware is not bound to keys -- it's only the Allwinner
reference design which bind the LRADC to keys. Device vendors can
change it if needed.

So it's suggested to have a binding without "-keys".

Maxime, here's another problem: if we have already a GP LRADC driver,
how can we tell the kernel to use it as IIO ADC rather than keys?
Should we introduce a new property for this once ready?


Re: [PATCH v3 2/3] dt-bindings: input: Add R_LRADC support for A83T

2017-06-27 Thread Ziping Chen
2017-06-27 1:15 GMT+08:00 Maxime Ripard :
> Hi,
>
> On Sat, Jun 24, 2017 at 10:45:14AM +0800, Ziping Chen wrote:
>> From: Ziping Chen 
>>
>> Allwinner A83T SoC has a low res adc like the one
>> in Allwinner A10 SoC.
>>
>> Add binding for it.
>>
>> Signed-off-by: Ziping Chen 
>> Acked-by: Rob Herring 
>> ---
>>  Documentation/devicetree/bindings/input/sun4i-lradc-keys.txt | 6 --
>>  1 file changed, 4 insertions(+), 2 deletions(-)
>>
>> diff --git a/Documentation/devicetree/bindings/input/sun4i-lradc-keys.txt 
>> b/Documentation/devicetree/bindings/input/sun4i-lradc-keys.txt
>> index 4357e498ef04..525d85e3043f 100644
>> --- a/Documentation/devicetree/bindings/input/sun4i-lradc-keys.txt
>> +++ b/Documentation/devicetree/bindings/input/sun4i-lradc-keys.txt
>> @@ -2,12 +2,14 @@ Allwinner sun4i low res adc attached tablet keys
>>  
>>
>>  Required properties:
>> - - compatible: "allwinner,sun4i-a10-lradc-keys"
>> + - compatible: should be one of the following string:
>> + "allwinner,sun4i-a10-lradc-keys"
>> + "allwinner,sun8i-a83t-r-lradc-keys"
>
> This doesn't really have anything related to keys, and can be used
> purely as an ADC.
>
> I know this is the compatible that was used for the A10, but I'd
> rather drop the keys for the the new compatible.
>

Hi,
LRADC is named KEYADC in some other SoCs' User Manual(such as R40 User
Manual V1.0), thus LRADC is related to keys.

Without keys there is another driver named sun4i-gpadc-iio which is
located at driver/iio/adc/sun4i-gpadc-iio.c

Is my understanding right?

> Thanks!
> Maxime
>
> --
> Maxime Ripard, Free Electrons
> Embedded Linux and Kernel engineering
> http://free-electrons.com


Re: [PATCH v3 2/3] dt-bindings: input: Add R_LRADC support for A83T

2017-06-27 Thread Ziping Chen
2017-06-27 1:15 GMT+08:00 Maxime Ripard :
> Hi,
>
> On Sat, Jun 24, 2017 at 10:45:14AM +0800, Ziping Chen wrote:
>> From: Ziping Chen 
>>
>> Allwinner A83T SoC has a low res adc like the one
>> in Allwinner A10 SoC.
>>
>> Add binding for it.
>>
>> Signed-off-by: Ziping Chen 
>> Acked-by: Rob Herring 
>> ---
>>  Documentation/devicetree/bindings/input/sun4i-lradc-keys.txt | 6 --
>>  1 file changed, 4 insertions(+), 2 deletions(-)
>>
>> diff --git a/Documentation/devicetree/bindings/input/sun4i-lradc-keys.txt 
>> b/Documentation/devicetree/bindings/input/sun4i-lradc-keys.txt
>> index 4357e498ef04..525d85e3043f 100644
>> --- a/Documentation/devicetree/bindings/input/sun4i-lradc-keys.txt
>> +++ b/Documentation/devicetree/bindings/input/sun4i-lradc-keys.txt
>> @@ -2,12 +2,14 @@ Allwinner sun4i low res adc attached tablet keys
>>  
>>
>>  Required properties:
>> - - compatible: "allwinner,sun4i-a10-lradc-keys"
>> + - compatible: should be one of the following string:
>> + "allwinner,sun4i-a10-lradc-keys"
>> + "allwinner,sun8i-a83t-r-lradc-keys"
>
> This doesn't really have anything related to keys, and can be used
> purely as an ADC.
>
> I know this is the compatible that was used for the A10, but I'd
> rather drop the keys for the the new compatible.
>

Hi,
LRADC is named KEYADC in some other SoCs' User Manual(such as R40 User
Manual V1.0), thus LRADC is related to keys.

Without keys there is another driver named sun4i-gpadc-iio which is
located at driver/iio/adc/sun4i-gpadc-iio.c

Is my understanding right?

> Thanks!
> Maxime
>
> --
> Maxime Ripard, Free Electrons
> Embedded Linux and Kernel engineering
> http://free-electrons.com


Re: [PATCH v3 2/3] dt-bindings: input: Add R_LRADC support for A83T

2017-06-26 Thread Maxime Ripard
Hi,

On Sat, Jun 24, 2017 at 10:45:14AM +0800, Ziping Chen wrote:
> From: Ziping Chen 
> 
> Allwinner A83T SoC has a low res adc like the one
> in Allwinner A10 SoC.
> 
> Add binding for it.
> 
> Signed-off-by: Ziping Chen 
> Acked-by: Rob Herring 
> ---
>  Documentation/devicetree/bindings/input/sun4i-lradc-keys.txt | 6 --
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/input/sun4i-lradc-keys.txt 
> b/Documentation/devicetree/bindings/input/sun4i-lradc-keys.txt
> index 4357e498ef04..525d85e3043f 100644
> --- a/Documentation/devicetree/bindings/input/sun4i-lradc-keys.txt
> +++ b/Documentation/devicetree/bindings/input/sun4i-lradc-keys.txt
> @@ -2,12 +2,14 @@ Allwinner sun4i low res adc attached tablet keys
>  
>  
>  Required properties:
> - - compatible: "allwinner,sun4i-a10-lradc-keys"
> + - compatible: should be one of the following string:
> + "allwinner,sun4i-a10-lradc-keys"
> + "allwinner,sun8i-a83t-r-lradc-keys"

This doesn't really have anything related to keys, and can be used
purely as an ADC.

I know this is the compatible that was used for the A10, but I'd
rather drop the keys for the the new compatible.

Thanks!
Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com


signature.asc
Description: PGP signature


Re: [PATCH v3 2/3] dt-bindings: input: Add R_LRADC support for A83T

2017-06-26 Thread Maxime Ripard
Hi,

On Sat, Jun 24, 2017 at 10:45:14AM +0800, Ziping Chen wrote:
> From: Ziping Chen 
> 
> Allwinner A83T SoC has a low res adc like the one
> in Allwinner A10 SoC.
> 
> Add binding for it.
> 
> Signed-off-by: Ziping Chen 
> Acked-by: Rob Herring 
> ---
>  Documentation/devicetree/bindings/input/sun4i-lradc-keys.txt | 6 --
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/input/sun4i-lradc-keys.txt 
> b/Documentation/devicetree/bindings/input/sun4i-lradc-keys.txt
> index 4357e498ef04..525d85e3043f 100644
> --- a/Documentation/devicetree/bindings/input/sun4i-lradc-keys.txt
> +++ b/Documentation/devicetree/bindings/input/sun4i-lradc-keys.txt
> @@ -2,12 +2,14 @@ Allwinner sun4i low res adc attached tablet keys
>  
>  
>  Required properties:
> - - compatible: "allwinner,sun4i-a10-lradc-keys"
> + - compatible: should be one of the following string:
> + "allwinner,sun4i-a10-lradc-keys"
> + "allwinner,sun8i-a83t-r-lradc-keys"

This doesn't really have anything related to keys, and can be used
purely as an ADC.

I know this is the compatible that was used for the A10, but I'd
rather drop the keys for the the new compatible.

Thanks!
Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com


signature.asc
Description: PGP signature


[PATCH v3 2/3] dt-bindings: input: Add R_LRADC support for A83T

2017-06-23 Thread Ziping Chen
From: Ziping Chen 

Allwinner A83T SoC has a low res adc like the one
in Allwinner A10 SoC.

Add binding for it.

Signed-off-by: Ziping Chen 
Acked-by: Rob Herring 
---
 Documentation/devicetree/bindings/input/sun4i-lradc-keys.txt | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/Documentation/devicetree/bindings/input/sun4i-lradc-keys.txt 
b/Documentation/devicetree/bindings/input/sun4i-lradc-keys.txt
index 4357e498ef04..525d85e3043f 100644
--- a/Documentation/devicetree/bindings/input/sun4i-lradc-keys.txt
+++ b/Documentation/devicetree/bindings/input/sun4i-lradc-keys.txt
@@ -2,12 +2,14 @@ Allwinner sun4i low res adc attached tablet keys
 
 
 Required properties:
- - compatible: "allwinner,sun4i-a10-lradc-keys"
+ - compatible: should be one of the following string:
+   "allwinner,sun4i-a10-lradc-keys"
+   "allwinner,sun8i-a83t-r-lradc-keys"
  - reg: mmio address range of the chip
  - interrupts: interrupt to which the chip is connected
  - vref-supply: powersupply for the lradc reference voltage
 
-Each key is represented as a sub-node of "allwinner,sun4i-a10-lradc-keys":
+Each key is represented as a sub-node of the compatible mentioned above:
 
 Required subnode-properties:
- label: Descriptive name of the key.
-- 
2.11.0



[PATCH v3 2/3] dt-bindings: input: Add R_LRADC support for A83T

2017-06-23 Thread Ziping Chen
From: Ziping Chen 

Allwinner A83T SoC has a low res adc like the one
in Allwinner A10 SoC.

Add binding for it.

Signed-off-by: Ziping Chen 
Acked-by: Rob Herring 
---
 Documentation/devicetree/bindings/input/sun4i-lradc-keys.txt | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/Documentation/devicetree/bindings/input/sun4i-lradc-keys.txt 
b/Documentation/devicetree/bindings/input/sun4i-lradc-keys.txt
index 4357e498ef04..525d85e3043f 100644
--- a/Documentation/devicetree/bindings/input/sun4i-lradc-keys.txt
+++ b/Documentation/devicetree/bindings/input/sun4i-lradc-keys.txt
@@ -2,12 +2,14 @@ Allwinner sun4i low res adc attached tablet keys
 
 
 Required properties:
- - compatible: "allwinner,sun4i-a10-lradc-keys"
+ - compatible: should be one of the following string:
+   "allwinner,sun4i-a10-lradc-keys"
+   "allwinner,sun8i-a83t-r-lradc-keys"
  - reg: mmio address range of the chip
  - interrupts: interrupt to which the chip is connected
  - vref-supply: powersupply for the lradc reference voltage
 
-Each key is represented as a sub-node of "allwinner,sun4i-a10-lradc-keys":
+Each key is represented as a sub-node of the compatible mentioned above:
 
 Required subnode-properties:
- label: Descriptive name of the key.
-- 
2.11.0