Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1336176 > unrolled thread

[PATCH v2 0/3] Syscon support for iProc touchscreen driver

Started byRaveendra Padasalagi <raveendra.padasalagi@broadcom.com>
First post2016-02-17 10:50 +0100
Last post2016-02-17 10:50 +0100
Articles 8 — 5 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH v2 0/3] Syscon support for iProc touchscreen driver Raveendra Padasalagi <raveendra.padasalagi@broadcom.com> - 2016-02-17 10:50 +0100
    [PATCH v2 1/3] input: cygnus-update touchscreen dt node document Raveendra Padasalagi <raveendra.padasalagi@broadcom.com> - 2016-02-17 10:50 +0100
      Re: [PATCH v2 1/3] input: cygnus-update touchscreen dt node document Rob Herring <robh@kernel.org> - 2016-02-18 15:40 +0100
        Re: [PATCH v2 1/3] input: cygnus-update touchscreen dt node document Raveendra Padasalagi <raveendra.padasalagi@broadcom.com> - 2016-02-19 07:20 +0100
          Re: [PATCH v2 1/3] input: cygnus-update touchscreen dt node document Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2016-02-22 20:40 +0100
            Re: [PATCH v2 1/3] input: cygnus-update touchscreen dt node document Ray Jui <ray.jui@broadcom.com> - 2016-02-22 20:50 +0100
            Re: [PATCH v2 1/3] input: cygnus-update touchscreen dt node document Scott Branden <scott.branden@broadcom.com> - 2016-02-22 20:50 +0100
    [PATCH v2 3/3] ARM: dts: use syscon in cygnus touchscreen dt node Raveendra Padasalagi <raveendra.padasalagi@broadcom.com> - 2016-02-17 10:50 +0100

#1336176 — [PATCH v2 0/3] Syscon support for iProc touchscreen driver

FromRaveendra Padasalagi <raveendra.padasalagi@broadcom.com>
Date2016-02-17 10:50 +0100
Subject[PATCH v2 0/3] Syscon support for iProc touchscreen driver
Message-ID<r36U9-4uj-3@gated-at.bofh.it>
This patchset is based on v4.5-rc3 tag and its tested on
Broadcom Cygnus SoC.

The patches can be fetched from iproc-tsc-v2 branch of
https://github.com/Broadcom/arm64-linux.git

Changes since v1:
 - Enhanced touchscreen driver to handle syscon based register access if
   "brcm,iproc-touchscreen-syscon" compatible string is provided in dt
 - Normal register access is handled through readl and writel API's if
   "brcm,iproc-touchscreen" compatible string is provided.
 - Updated touchscreen dt node document to reflect the new changes.
 - Updated change logs in each patchset to reflect the new changes.

Raveendra Padasalagi (3):
  input: cygnus-update touchscreen dt node document
  input: syscon support in bcm_iproc_tsc driver
  ARM: dts: use syscon in cygnus touchscreen dt node

 .../input/touchscreen/brcm,iproc-touchscreen.txt   |  57 +++++++-
 arch/arm/boot/dts/bcm-cygnus.dtsi                  |  11 +-
 drivers/input/touchscreen/bcm_iproc_tsc.c          | 152 +++++++++++++++------
 3 files changed, 172 insertions(+), 48 deletions(-)

-- 
1.9.1

[toc] | [next] | [standalone]


#1336180 — [PATCH v2 1/3] input: cygnus-update touchscreen dt node document

FromRaveendra Padasalagi <raveendra.padasalagi@broadcom.com>
Date2016-02-17 10:50 +0100
Subject[PATCH v2 1/3] input: cygnus-update touchscreen dt node document
Message-ID<r36U9-4uj-9@gated-at.bofh.it>
In reply to#1336176
In Cygnus SOC touch screen controller registers are shared
with ADC and flex timer. Using readl/writel could lead to
race condition. So touch screen driver is enhanced to support

1. If touchscreen register's are not shared. Register access
is handled through readl/writel if "brcm,iproc-touchscreen"
compatible is provided in touchscreen dt node. This will help
for future SOC's if comes with dedicated touchscreen IP register's.

2. If touchscreen register's are shared with other IP's, register
access is handled through syscon framework API's to take care of
mutually exclusive access. This feature can be enabled by selecting
"brcm,iproc-touchscreen-syscon" compatible string in the touchscreen
dt node.

Hence touchscreen dt node bindings document is updated to take care
of above changes in the touchscreen driver.

Signed-off-by: Raveendra Padasalagi <raveendra.padasalagi@broadcom.com>
Reviewed-by: Ray Jui <ray.jui@broadcom.com>
Reviewed-by: Scott Branden <scott.branden@broadcom.com>
---
 .../input/touchscreen/brcm,iproc-touchscreen.txt   | 57 +++++++++++++++++++---
 1 file changed, 51 insertions(+), 6 deletions(-)

diff --git a/Documentation/devicetree/bindings/input/touchscreen/brcm,iproc-touchscreen.txt b/Documentation/devicetree/bindings/input/touchscreen/brcm,iproc-touchscreen.txt
index 34e3382..f530c25 100644
--- a/Documentation/devicetree/bindings/input/touchscreen/brcm,iproc-touchscreen.txt
+++ b/Documentation/devicetree/bindings/input/touchscreen/brcm,iproc-touchscreen.txt
@@ -1,12 +1,30 @@
 * Broadcom's IPROC Touchscreen Controller
 
 Required properties:
-- compatible: must be "brcm,iproc-touchscreen"
-- reg: physical base address of the controller and length of memory mapped
-  region.
+- compatible: should be one of
+        "brcm,iproc-touchscreen"
+        "brcm,iproc-touchscreen-syscon"
+- ts_syscon: if "brcm,iproc-touchscreen-syscon" compatible string
+  is selected then "ts_syscon" is mandatory or else not required.
+  The "ts_syscon" is handler of syscon node defining physical base
+  address of the controller and length of memory mapped region.
+  If this property is selected please make sure MFD_SYSCON config
+  is enabled in the defconfig file.
+- reg: if "brcm,iproc-touchscreen" compatible string is selected
+  then "reg" property is mandatory or else not required.
+  The "reg" should be physical base address of the controller and
+  length of memory mapped region.
 - clocks:  The clock provided by the SOC to driver the tsc
 - clock-name:  name for the clock
 - interrupts: The touchscreen controller's interrupt
+- address-cells: Specify the number of u32 entries needed in child nodes.
+                 Should set to 1. This property is mandatory when
+                 "brcm,iproc-touchscreen-syscon" compatible string is selected
+                 or else not required.
+- size-cells: Specify number of u32 entries needed to specify child nodes size
+              in reg property. Should set to 1.This property is mandatory when
+              "brcm,iproc-touchscreen-syscon" compatible string is selected or
+              else not required.
 
 Optional properties:
 - scanning_period: Time between scans. Each step is 1024 us.  Valid 1-256.
@@ -53,13 +71,40 @@ Optional properties:
 - touchscreen-inverted-x: X axis is inverted (boolean)
 - touchscreen-inverted-y: Y axis is inverted (boolean)
 
-Example:
+Example 1: An example of touchscreen node with "brcm,iproc-touchscreen-syscon"
+           compatible string.
+
+	ts_adc_syscon: ts_adc_syscon@0x180a6000 {
+		compatible = "syscon";
+		reg = <0x180a6000 0xc30>;
+	};
 
 	touchscreen: tsc@0x180A6000 {
-		compatible = "brcm,iproc-touchscreen";
+		compatible = "brcm,iproc-touchscreen-syscon";
 		#address-cells = <1>;
 		#size-cells = <1>;
-		reg = <0x180A6000 0x40>;
+		ts_syscon = <&ts_adc_syscon>;
+		clocks = <&adc_clk>;
+		clock-names = "tsc_clk";
+		interrupts = <GIC_SPI 164 IRQ_TYPE_LEVEL_HIGH>;
+
+		scanning_period = <5>;
+		debounce_timeout = <40>;
+		settling_timeout = <7>;
+		touch_timeout = <10>;
+		average_data = <5>;
+		fifo_threshold = <1>;
+		/* Touchscreen is rotated 180 degrees. */
+		touchscreen-inverted-x;
+		touchscreen-inverted-y;
+	};
+
+Example 2: An example of touchscreen node with "brcm,iproc-touchscreen"
+          compatible string.
+
+	touchscreen: tsc@0x180A6000 {
+		compatible = "brcm,iproc-touchscreen";
+		reg = <0x180a6000 0x40>;
 		clocks = <&adc_clk>;
 		clock-names = "tsc_clk";
 		interrupts = <GIC_SPI 164 IRQ_TYPE_LEVEL_HIGH>;
-- 
1.9.1

[toc] | [prev] | [next] | [standalone]


#1337408 — Re: [PATCH v2 1/3] input: cygnus-update touchscreen dt node document

FromRob Herring <robh@kernel.org>
Date2016-02-18 15:40 +0100
SubjectRe: [PATCH v2 1/3] input: cygnus-update touchscreen dt node document
Message-ID<r3xUm-716-19@gated-at.bofh.it>
In reply to#1336180
On Wed, Feb 17, 2016 at 03:13:44PM +0530, Raveendra Padasalagi wrote:
> In Cygnus SOC touch screen controller registers are shared
> with ADC and flex timer. Using readl/writel could lead to
> race condition. So touch screen driver is enhanced to support
> 
> 1. If touchscreen register's are not shared. Register access
> is handled through readl/writel if "brcm,iproc-touchscreen"
> compatible is provided in touchscreen dt node. This will help
> for future SOC's if comes with dedicated touchscreen IP register's.
> 
> 2. If touchscreen register's are shared with other IP's, register
> access is handled through syscon framework API's to take care of
> mutually exclusive access. This feature can be enabled by selecting
> "brcm,iproc-touchscreen-syscon" compatible string in the touchscreen
> dt node.
> 
> Hence touchscreen dt node bindings document is updated to take care
> of above changes in the touchscreen driver.
> 
> Signed-off-by: Raveendra Padasalagi <raveendra.padasalagi@broadcom.com>
> Reviewed-by: Ray Jui <ray.jui@broadcom.com>
> Reviewed-by: Scott Branden <scott.branden@broadcom.com>
> ---
>  .../input/touchscreen/brcm,iproc-touchscreen.txt   | 57 +++++++++++++++++++---
>  1 file changed, 51 insertions(+), 6 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/input/touchscreen/brcm,iproc-touchscreen.txt b/Documentation/devicetree/bindings/input/touchscreen/brcm,iproc-touchscreen.txt
> index 34e3382..f530c25 100644
> --- a/Documentation/devicetree/bindings/input/touchscreen/brcm,iproc-touchscreen.txt
> +++ b/Documentation/devicetree/bindings/input/touchscreen/brcm,iproc-touchscreen.txt
> @@ -1,12 +1,30 @@
>  * Broadcom's IPROC Touchscreen Controller
>  
>  Required properties:
> -- compatible: must be "brcm,iproc-touchscreen"
> -- reg: physical base address of the controller and length of memory mapped
> -  region.
> +- compatible: should be one of
> +        "brcm,iproc-touchscreen"
> +        "brcm,iproc-touchscreen-syscon"

More specific and this is not how you do syscon. Either the block is or 
isn't. You can't have it both ways.

> +- ts_syscon: if "brcm,iproc-touchscreen-syscon" compatible string
> +  is selected then "ts_syscon" is mandatory or else not required.
> +  The "ts_syscon" is handler of syscon node defining physical base
> +  address of the controller and length of memory mapped region.
> +  If this property is selected please make sure MFD_SYSCON config
> +  is enabled in the defconfig file.
> +- reg: if "brcm,iproc-touchscreen" compatible string is selected
> +  then "reg" property is mandatory or else not required.
> +  The "reg" should be physical base address of the controller and
> +  length of memory mapped region.

I thought every chip to date is a syscon. Add reg support when you 
actually need it.

>  - clocks:  The clock provided by the SOC to driver the tsc
>  - clock-name:  name for the clock
>  - interrupts: The touchscreen controller's interrupt
> +- address-cells: Specify the number of u32 entries needed in child nodes.
> +                 Should set to 1. This property is mandatory when
> +                 "brcm,iproc-touchscreen-syscon" compatible string is selected
> +                 or else not required.
> +- size-cells: Specify number of u32 entries needed to specify child nodes size
> +              in reg property. Should set to 1.This property is mandatory when
> +              "brcm,iproc-touchscreen-syscon" compatible string is selected or
> +              else not required.
>  
>  Optional properties:
>  - scanning_period: Time between scans. Each step is 1024 us.  Valid 1-256.
> @@ -53,13 +71,40 @@ Optional properties:
>  - touchscreen-inverted-x: X axis is inverted (boolean)
>  - touchscreen-inverted-y: Y axis is inverted (boolean)
>  
> -Example:
> +Example 1: An example of touchscreen node with "brcm,iproc-touchscreen-syscon"
> +           compatible string.
> +
> +	ts_adc_syscon: ts_adc_syscon@0x180a6000 {
> +		compatible = "syscon";
> +		reg = <0x180a6000 0xc30>;
> +	};
>  
>  	touchscreen: tsc@0x180A6000 {

Drop the '0x' and the node name should be touchscreen, not tsc.

> -		compatible = "brcm,iproc-touchscreen";
> +		compatible = "brcm,iproc-touchscreen-syscon";
>  		#address-cells = <1>;
>  		#size-cells = <1>;
> -		reg = <0x180A6000 0x40>;
> +		ts_syscon = <&ts_adc_syscon>;
> +		clocks = <&adc_clk>;
> +		clock-names = "tsc_clk";
> +		interrupts = <GIC_SPI 164 IRQ_TYPE_LEVEL_HIGH>;
> +

> +		scanning_period = <5>;
> +		debounce_timeout = <40>;
> +		settling_timeout = <7>;
> +		touch_timeout = <10>;
> +		average_data = <5>;
> +		fifo_threshold = <1>;

New properties?

> +		/* Touchscreen is rotated 180 degrees. */
> +		touchscreen-inverted-x;
> +		touchscreen-inverted-y;
> +	};
> +
> +Example 2: An example of touchscreen node with "brcm,iproc-touchscreen"
> +          compatible string.
> +
> +	touchscreen: tsc@0x180A6000 {
> +		compatible = "brcm,iproc-touchscreen";
> +		reg = <0x180a6000 0x40>;
>  		clocks = <&adc_clk>;
>  		clock-names = "tsc_clk";
>  		interrupts = <GIC_SPI 164 IRQ_TYPE_LEVEL_HIGH>;
> -- 
> 1.9.1
> 

[toc] | [prev] | [next] | [standalone]


#1337912 — Re: [PATCH v2 1/3] input: cygnus-update touchscreen dt node document

FromRaveendra Padasalagi <raveendra.padasalagi@broadcom.com>
Date2016-02-19 07:20 +0100
SubjectRe: [PATCH v2 1/3] input: cygnus-update touchscreen dt node document
Message-ID<r3MA2-Re-27@gated-at.bofh.it>
In reply to#1337408
On Thu, Feb 18, 2016 at 8:06 PM, Rob Herring <robh@kernel.org> wrote:
> On Wed, Feb 17, 2016 at 03:13:44PM +0530, Raveendra Padasalagi wrote:
>> In Cygnus SOC touch screen controller registers are shared
>> with ADC and flex timer. Using readl/writel could lead to
>> race condition. So touch screen driver is enhanced to support
>>
>> 1. If touchscreen register's are not shared. Register access
>> is handled through readl/writel if "brcm,iproc-touchscreen"
>> compatible is provided in touchscreen dt node. This will help
>> for future SOC's if comes with dedicated touchscreen IP register's.
>>
>> 2. If touchscreen register's are shared with other IP's, register
>> access is handled through syscon framework API's to take care of
>> mutually exclusive access. This feature can be enabled by selecting
>> "brcm,iproc-touchscreen-syscon" compatible string in the touchscreen
>> dt node.
>>
>> Hence touchscreen dt node bindings document is updated to take care
>> of above changes in the touchscreen driver.
>>
>> Signed-off-by: Raveendra Padasalagi <raveendra.padasalagi@broadcom.com>
>> Reviewed-by: Ray Jui <ray.jui@broadcom.com>
>> Reviewed-by: Scott Branden <scott.branden@broadcom.com>
>> ---
>>  .../input/touchscreen/brcm,iproc-touchscreen.txt   | 57 +++++++++++++++++++---
>>  1 file changed, 51 insertions(+), 6 deletions(-)
>>
>> diff --git a/Documentation/devicetree/bindings/input/touchscreen/brcm,iproc-touchscreen.txt b/Documentation/devicetree/bindings/input/touchscreen/brcm,iproc-touchscreen.txt
>> index 34e3382..f530c25 100644
>> --- a/Documentation/devicetree/bindings/input/touchscreen/brcm,iproc-touchscreen.txt
>> +++ b/Documentation/devicetree/bindings/input/touchscreen/brcm,iproc-touchscreen.txt
>> @@ -1,12 +1,30 @@
>>  * Broadcom's IPROC Touchscreen Controller
>>
>>  Required properties:
>> -- compatible: must be "brcm,iproc-touchscreen"
>> -- reg: physical base address of the controller and length of memory mapped
>> -  region.
>> +- compatible: should be one of
>> +        "brcm,iproc-touchscreen"
>> +        "brcm,iproc-touchscreen-syscon"
>
> More specific and this is not how you do syscon. Either the block is or
> isn't. You can't have it both ways.

Existing driver has support for reg, if we modify now to support only syscon
then this driver will not work if some one wishes to use previous
kernel version's
dt and vice versa. Basically this breaks dt compatibility. Is that ok ?

>> +- ts_syscon: if "brcm,iproc-touchscreen-syscon" compatible string
>> +  is selected then "ts_syscon" is mandatory or else not required.
>> +  The "ts_syscon" is handler of syscon node defining physical base
>> +  address of the controller and length of memory mapped region.
>> +  If this property is selected please make sure MFD_SYSCON config
>> +  is enabled in the defconfig file.
>> +- reg: if "brcm,iproc-touchscreen" compatible string is selected
>> +  then "reg" property is mandatory or else not required.
>> +  The "reg" should be physical base address of the controller and
>> +  length of memory mapped region.
>
> I thought every chip to date is a syscon. Add reg support when you
> actually need it.

Since the existing driver has support for reg and now if we modify it to
support syscon only then we break the dt compatibility with previous kernel
versions. So keeping support for both will help to avoid dt
compatibility issues.

I will change the driver if you still think syscon only support is fine.
Let me know your opinion.

>>  - clocks:  The clock provided by the SOC to driver the tsc
>>  - clock-name:  name for the clock
>>  - interrupts: The touchscreen controller's interrupt
>> +- address-cells: Specify the number of u32 entries needed in child nodes.
>> +                 Should set to 1. This property is mandatory when
>> +                 "brcm,iproc-touchscreen-syscon" compatible string is selected
>> +                 or else not required.
>> +- size-cells: Specify number of u32 entries needed to specify child nodes size
>> +              in reg property. Should set to 1.This property is mandatory when
>> +              "brcm,iproc-touchscreen-syscon" compatible string is selected or
>> +              else not required.
>>
>>  Optional properties:
>>  - scanning_period: Time between scans. Each step is 1024 us.  Valid 1-256.
>> @@ -53,13 +71,40 @@ Optional properties:
>>  - touchscreen-inverted-x: X axis is inverted (boolean)
>>  - touchscreen-inverted-y: Y axis is inverted (boolean)
>>
>> -Example:
>> +Example 1: An example of touchscreen node with "brcm,iproc-touchscreen-syscon"
>> +           compatible string.
>> +
>> +     ts_adc_syscon: ts_adc_syscon@0x180a6000 {
>> +             compatible = "syscon";
>> +             reg = <0x180a6000 0xc30>;
>> +     };
>>
>>       touchscreen: tsc@0x180A6000 {
>
> Drop the '0x' and the node name should be touchscreen, not tsc.

I will address this in the next patch.

>> -             compatible = "brcm,iproc-touchscreen";
>> +             compatible = "brcm,iproc-touchscreen-syscon";
>>               #address-cells = <1>;
>>               #size-cells = <1>;
>> -             reg = <0x180A6000 0x40>;
>> +             ts_syscon = <&ts_adc_syscon>;
>> +             clocks = <&adc_clk>;
>> +             clock-names = "tsc_clk";
>> +             interrupts = <GIC_SPI 164 IRQ_TYPE_LEVEL_HIGH>;
>> +
>
>> +             scanning_period = <5>;
>> +             debounce_timeout = <40>;
>> +             settling_timeout = <7>;
>> +             touch_timeout = <10>;
>> +             average_data = <5>;
>> +             fifo_threshold = <1>;
>
> New properties?

No, These are existing properties.

>> +             /* Touchscreen is rotated 180 degrees. */
>> +             touchscreen-inverted-x;
>> +             touchscreen-inverted-y;
>> +     };
>> +
>> +Example 2: An example of touchscreen node with "brcm,iproc-touchscreen"
>> +          compatible string.
>> +
>> +     touchscreen: tsc@0x180A6000 {
>> +             compatible = "brcm,iproc-touchscreen";
>> +             reg = <0x180a6000 0x40>;
>>               clocks = <&adc_clk>;
>>               clock-names = "tsc_clk";
>>               interrupts = <GIC_SPI 164 IRQ_TYPE_LEVEL_HIGH>;
>> --
>> 1.9.1
>>

[toc] | [prev] | [next] | [standalone]


#1339867 — Re: [PATCH v2 1/3] input: cygnus-update touchscreen dt node document

FromDmitry Torokhov <dmitry.torokhov@gmail.com>
Date2016-02-22 20:40 +0100
SubjectRe: [PATCH v2 1/3] input: cygnus-update touchscreen dt node document
Message-ID<r54uS-2cu-27@gated-at.bofh.it>
In reply to#1337912
On Fri, Feb 19, 2016 at 11:43:50AM +0530, Raveendra Padasalagi wrote:
> On Thu, Feb 18, 2016 at 8:06 PM, Rob Herring <robh@kernel.org> wrote:
> > On Wed, Feb 17, 2016 at 03:13:44PM +0530, Raveendra Padasalagi wrote:
> >> In Cygnus SOC touch screen controller registers are shared
> >> with ADC and flex timer. Using readl/writel could lead to
> >> race condition. So touch screen driver is enhanced to support
> >>
> >> 1. If touchscreen register's are not shared. Register access
> >> is handled through readl/writel if "brcm,iproc-touchscreen"
> >> compatible is provided in touchscreen dt node. This will help
> >> for future SOC's if comes with dedicated touchscreen IP register's.
> >>
> >> 2. If touchscreen register's are shared with other IP's, register
> >> access is handled through syscon framework API's to take care of
> >> mutually exclusive access. This feature can be enabled by selecting
> >> "brcm,iproc-touchscreen-syscon" compatible string in the touchscreen
> >> dt node.
> >>
> >> Hence touchscreen dt node bindings document is updated to take care
> >> of above changes in the touchscreen driver.
> >>
> >> Signed-off-by: Raveendra Padasalagi <raveendra.padasalagi@broadcom.com>
> >> Reviewed-by: Ray Jui <ray.jui@broadcom.com>
> >> Reviewed-by: Scott Branden <scott.branden@broadcom.com>
> >> ---
> >>  .../input/touchscreen/brcm,iproc-touchscreen.txt   | 57 +++++++++++++++++++---
> >>  1 file changed, 51 insertions(+), 6 deletions(-)
> >>
> >> diff --git a/Documentation/devicetree/bindings/input/touchscreen/brcm,iproc-touchscreen.txt b/Documentation/devicetree/bindings/input/touchscreen/brcm,iproc-touchscreen.txt
> >> index 34e3382..f530c25 100644
> >> --- a/Documentation/devicetree/bindings/input/touchscreen/brcm,iproc-touchscreen.txt
> >> +++ b/Documentation/devicetree/bindings/input/touchscreen/brcm,iproc-touchscreen.txt
> >> @@ -1,12 +1,30 @@
> >>  * Broadcom's IPROC Touchscreen Controller
> >>
> >>  Required properties:
> >> -- compatible: must be "brcm,iproc-touchscreen"
> >> -- reg: physical base address of the controller and length of memory mapped
> >> -  region.
> >> +- compatible: should be one of
> >> +        "brcm,iproc-touchscreen"
> >> +        "brcm,iproc-touchscreen-syscon"
> >
> > More specific and this is not how you do syscon. Either the block is or
> > isn't. You can't have it both ways.
> 
> Existing driver has support for reg, if we modify now to support only syscon
> then this driver will not work if some one wishes to use previous
> kernel version's
> dt and vice versa. Basically this breaks dt compatibility. Is that ok ?

But the issue is that the driver does not actually work correctly with
direct register access on those systems, since the registers are
actually shared with other components. I am not quite sure if it is OK
to break DT binding in this case...

Thanks.

-- 
Dmitry

[toc] | [prev] | [next] | [standalone]


#1339872 — Re: [PATCH v2 1/3] input: cygnus-update touchscreen dt node document

FromRay Jui <ray.jui@broadcom.com>
Date2016-02-22 20:50 +0100
SubjectRe: [PATCH v2 1/3] input: cygnus-update touchscreen dt node document
Message-ID<r54Ey-2hE-13@gated-at.bofh.it>
In reply to#1339867

On 2/22/2016 11:41 AM, Scott Branden wrote:
> My comments below
>
> On 16-02-22 11:36 AM, Dmitry Torokhov wrote:
>> On Fri, Feb 19, 2016 at 11:43:50AM +0530, Raveendra Padasalagi wrote:
>>> On Thu, Feb 18, 2016 at 8:06 PM, Rob Herring <robh@kernel.org> wrote:
>>>> On Wed, Feb 17, 2016 at 03:13:44PM +0530, Raveendra Padasalagi wrote:
>>>>> In Cygnus SOC touch screen controller registers are shared
>>>>> with ADC and flex timer. Using readl/writel could lead to
>>>>> race condition. So touch screen driver is enhanced to support
>>>>>
>>>>> 1. If touchscreen register's are not shared. Register access
>>>>> is handled through readl/writel if "brcm,iproc-touchscreen"
>>>>> compatible is provided in touchscreen dt node. This will help
>>>>> for future SOC's if comes with dedicated touchscreen IP register's.
>>>>>
>>>>> 2. If touchscreen register's are shared with other IP's, register
>>>>> access is handled through syscon framework API's to take care of
>>>>> mutually exclusive access. This feature can be enabled by selecting
>>>>> "brcm,iproc-touchscreen-syscon" compatible string in the touchscreen
>>>>> dt node.
>>>>>
>>>>> Hence touchscreen dt node bindings document is updated to take care
>>>>> of above changes in the touchscreen driver.
>>>>>
>>>>> Signed-off-by: Raveendra Padasalagi
>>>>> <raveendra.padasalagi@broadcom.com>
>>>>> Reviewed-by: Ray Jui <ray.jui@broadcom.com>
>>>>> Reviewed-by: Scott Branden <scott.branden@broadcom.com>
>>>>> ---
>>>>>   .../input/touchscreen/brcm,iproc-touchscreen.txt   | 57
>>>>> +++++++++++++++++++---
>>>>>   1 file changed, 51 insertions(+), 6 deletions(-)
>>>>>
>>>>> diff --git
>>>>> a/Documentation/devicetree/bindings/input/touchscreen/brcm,iproc-touchscreen.txt
>>>>> b/Documentation/devicetree/bindings/input/touchscreen/brcm,iproc-touchscreen.txt
>>>>>
>>>>> index 34e3382..f530c25 100644
>>>>> ---
>>>>> a/Documentation/devicetree/bindings/input/touchscreen/brcm,iproc-touchscreen.txt
>>>>>
>>>>> +++
>>>>> b/Documentation/devicetree/bindings/input/touchscreen/brcm,iproc-touchscreen.txt
>>>>>
>>>>> @@ -1,12 +1,30 @@
>>>>>   * Broadcom's IPROC Touchscreen Controller
>>>>>
>>>>>   Required properties:
>>>>> -- compatible: must be "brcm,iproc-touchscreen"
>>>>> -- reg: physical base address of the controller and length of
>>>>> memory mapped
>>>>> -  region.
>>>>> +- compatible: should be one of
>>>>> +        "brcm,iproc-touchscreen"
>>>>> +        "brcm,iproc-touchscreen-syscon"
>>>>
>>>> More specific and this is not how you do syscon. Either the block is or
>>>> isn't. You can't have it both ways.
>>>
>>> Existing driver has support for reg, if we modify now to support only
>>> syscon
>>> then this driver will not work if some one wishes to use previous
>>> kernel version's
>>> dt and vice versa. Basically this breaks dt compatibility. Is that ok ?
>>
>> But the issue is that the driver does not actually work correctly with
>> direct register access on those systems, since the registers are
>> actually shared with other components. I am not quite sure if it is OK
>> to break DT binding in this case...
>
> The driver does work correctly with direct register access on those
> systems because the other components using those registers are not
> active in those systems - so syscon is not needed in those cases.
>
> I'm ok with not containing backwards compatibility though and always
> using syscon.  There are no deployed systems using older versions of the
> upstreamed kernel.
>>
>> Thanks.
>>
>
> Regards,
> Scott

The iproc touchscreen is currently activated in the "bcm9hmidc.dtsi" 
that represents the optional daughter card installed on reference boards 
bcm958300k and bcm958305k. While not maintaining backwards compatibility 
*might not* be a serious issue, it would be nice if we can at least make 
sure the driver change and DT are merged into the same kernel version so 
they stay in sync.

Going forward, if we are only going to support syscon based 
implementation, the existing compatible string "brcm,iproc-touchscreen" 
is preferred over "brcm,iproc-touchscreen-syscon".

Thanks,

Ray

[toc] | [prev] | [next] | [standalone]


#1339874 — Re: [PATCH v2 1/3] input: cygnus-update touchscreen dt node document

FromScott Branden <scott.branden@broadcom.com>
Date2016-02-22 20:50 +0100
SubjectRe: [PATCH v2 1/3] input: cygnus-update touchscreen dt node document
Message-ID<r54Ey-2hE-15@gated-at.bofh.it>
In reply to#1339867
My comments below

On 16-02-22 11:36 AM, Dmitry Torokhov wrote:
> On Fri, Feb 19, 2016 at 11:43:50AM +0530, Raveendra Padasalagi wrote:
>> On Thu, Feb 18, 2016 at 8:06 PM, Rob Herring <robh@kernel.org> wrote:
>>> On Wed, Feb 17, 2016 at 03:13:44PM +0530, Raveendra Padasalagi wrote:
>>>> In Cygnus SOC touch screen controller registers are shared
>>>> with ADC and flex timer. Using readl/writel could lead to
>>>> race condition. So touch screen driver is enhanced to support
>>>>
>>>> 1. If touchscreen register's are not shared. Register access
>>>> is handled through readl/writel if "brcm,iproc-touchscreen"
>>>> compatible is provided in touchscreen dt node. This will help
>>>> for future SOC's if comes with dedicated touchscreen IP register's.
>>>>
>>>> 2. If touchscreen register's are shared with other IP's, register
>>>> access is handled through syscon framework API's to take care of
>>>> mutually exclusive access. This feature can be enabled by selecting
>>>> "brcm,iproc-touchscreen-syscon" compatible string in the touchscreen
>>>> dt node.
>>>>
>>>> Hence touchscreen dt node bindings document is updated to take care
>>>> of above changes in the touchscreen driver.
>>>>
>>>> Signed-off-by: Raveendra Padasalagi <raveendra.padasalagi@broadcom.com>
>>>> Reviewed-by: Ray Jui <ray.jui@broadcom.com>
>>>> Reviewed-by: Scott Branden <scott.branden@broadcom.com>
>>>> ---
>>>>   .../input/touchscreen/brcm,iproc-touchscreen.txt   | 57 +++++++++++++++++++---
>>>>   1 file changed, 51 insertions(+), 6 deletions(-)
>>>>
>>>> diff --git a/Documentation/devicetree/bindings/input/touchscreen/brcm,iproc-touchscreen.txt b/Documentation/devicetree/bindings/input/touchscreen/brcm,iproc-touchscreen.txt
>>>> index 34e3382..f530c25 100644
>>>> --- a/Documentation/devicetree/bindings/input/touchscreen/brcm,iproc-touchscreen.txt
>>>> +++ b/Documentation/devicetree/bindings/input/touchscreen/brcm,iproc-touchscreen.txt
>>>> @@ -1,12 +1,30 @@
>>>>   * Broadcom's IPROC Touchscreen Controller
>>>>
>>>>   Required properties:
>>>> -- compatible: must be "brcm,iproc-touchscreen"
>>>> -- reg: physical base address of the controller and length of memory mapped
>>>> -  region.
>>>> +- compatible: should be one of
>>>> +        "brcm,iproc-touchscreen"
>>>> +        "brcm,iproc-touchscreen-syscon"
>>>
>>> More specific and this is not how you do syscon. Either the block is or
>>> isn't. You can't have it both ways.
>>
>> Existing driver has support for reg, if we modify now to support only syscon
>> then this driver will not work if some one wishes to use previous
>> kernel version's
>> dt and vice versa. Basically this breaks dt compatibility. Is that ok ?
>
> But the issue is that the driver does not actually work correctly with
> direct register access on those systems, since the registers are
> actually shared with other components. I am not quite sure if it is OK
> to break DT binding in this case...

The driver does work correctly with direct register access on those 
systems because the other components using those registers are not 
active in those systems - so syscon is not needed in those cases.

I'm ok with not containing backwards compatibility though and always 
using syscon.  There are no deployed systems using older versions of the 
upstreamed kernel.
>
> Thanks.
>

Regards,
Scott

[toc] | [prev] | [next] | [standalone]


#1336183 — [PATCH v2 3/3] ARM: dts: use syscon in cygnus touchscreen dt node

FromRaveendra Padasalagi <raveendra.padasalagi@broadcom.com>
Date2016-02-17 10:50 +0100
Subject[PATCH v2 3/3] ARM: dts: use syscon in cygnus touchscreen dt node
Message-ID<r36Ua-4uj-23@gated-at.bofh.it>
In reply to#1336176
In Cygnus SOC touch screen controller registers are shared
with ADC and flex timer. Using readl/writel could lead to
race condition. So in such case register access is handled
through syscon framework API's in the touch screen driver.
This feature is enabled if "brcm,iproc-touchscreen-syscon"
compatible string is selected in touchscreen dt node.

So this patch enables syscon support in touchscreen driver
by adding necessary properties in touchscreen dt node.

Signed-off-by: Raveendra Padasalagi <raveendra.padasalagi@broadcom.com>
Reviewed-by: Ray Jui <ray.jui@broadcom.com>
Reviewed-by: Scott Branden <scott.branden@broadcom.com>
---
 arch/arm/boot/dts/bcm-cygnus.dtsi | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/arch/arm/boot/dts/bcm-cygnus.dtsi b/arch/arm/boot/dts/bcm-cygnus.dtsi
index 3878793..79678c1 100644
--- a/arch/arm/boot/dts/bcm-cygnus.dtsi
+++ b/arch/arm/boot/dts/bcm-cygnus.dtsi
@@ -351,9 +351,16 @@
 					<&pinctrl 142 10 1>;
 		};
 
+		ts_adc_syscon: ts_adc_syscon@0x180a6000 {
+			compatible = "syscon";
+			reg = <0x180a6000 0xc30>;
+		};
+
 		touchscreen: tsc@180a6000 {
-			compatible = "brcm,iproc-touchscreen";
-			reg = <0x180a6000 0x40>;
+			compatible = "brcm,iproc-touchscreen-syscon";
+			#address-cells = <1>;
+			#size-cells = <1>;
+			ts_syscon = <&ts_adc_syscon>;
 			clocks = <&asiu_clks BCM_CYGNUS_ASIU_ADC_CLK>;
 			clock-names = "tsc_clk";
 			interrupts = <GIC_SPI 164 IRQ_TYPE_LEVEL_HIGH>;
-- 
1.9.1

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web