linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RESEND PATCH 0/2] iio: dac: ad5770r: dt bindings fixes
@ 2020-03-24  9:45 alexandru.tachici
  2020-03-24  9:45 ` [RESEND PATCH 1/2] iio: dac: ad5770r: read channel nr from reg alexandru.tachici
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: alexandru.tachici @ 2020-03-24  9:45 UTC (permalink / raw)
  To: linux-iio, linux-kernel, devicetree; +Cc: jic23, robh+dt

From: Alexandru Tachici <alexandru.tachici@analog.com>

This aims to replace use of num property from dt nodes with
reg property both in dt bindings and driver and fix
dt bindings errors.

1. read from fwnode reg property instead of num property

2. replace num property with reg property and fix dt
bindings errors

Alexandru Tachici (2):
  iio: dac: ad5770r: read channel nr from reg
  dt-bindings: iio: dac: AD5570R fix bindings errors

 .../bindings/iio/dac/adi,ad5770r.yaml         | 77 ++++++++++---------
 drivers/iio/dac/ad5770r.c                     |  2 +-
 2 files changed, 41 insertions(+), 38 deletions(-)

-- 
2.20.1


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

* [RESEND PATCH 1/2] iio: dac: ad5770r: read channel nr from reg
  2020-03-24  9:45 [RESEND PATCH 0/2] iio: dac: ad5770r: dt bindings fixes alexandru.tachici
@ 2020-03-24  9:45 ` alexandru.tachici
  2020-03-24  9:45 ` [RESEND PATCH 2/2] dt-bindings: iio: dac: AD5570R fix bindings errors alexandru.tachici
  2020-04-15 14:31 ` [RESEND PATCH 0/2] iio: dac: ad5770r: dt bindings fixes Rob Herring
  2 siblings, 0 replies; 5+ messages in thread
From: alexandru.tachici @ 2020-03-24  9:45 UTC (permalink / raw)
  To: linux-iio, linux-kernel, devicetree; +Cc: jic23, robh+dt

From: Alexandru Tachici <alexandru.tachici@analog.com>

Read channel number from the reg property of each child
node.

Fixes: cbbb819837f6 ("iio: dac: ad5770r: Add AD5770R support")
Signed-off-by: Alexandru Tachici <alexandru.tachici@analog.com>
---
 drivers/iio/dac/ad5770r.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iio/dac/ad5770r.c b/drivers/iio/dac/ad5770r.c
index a98ea76732e7..6302f11551d4 100644
--- a/drivers/iio/dac/ad5770r.c
+++ b/drivers/iio/dac/ad5770r.c
@@ -522,7 +522,7 @@ static int ad5770r_channel_config(struct ad5770r_state *st)
 		return -EINVAL;
 
 	device_for_each_child_node(&st->spi->dev, child) {
-		ret = fwnode_property_read_u32(child, "num", &num);
+		ret = fwnode_property_read_u32(child, "reg", &num);
 		if (ret)
 			return ret;
 		if (num > AD5770R_MAX_CHANNELS)
-- 
2.20.1


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

* [RESEND PATCH 2/2] dt-bindings: iio: dac: AD5570R fix bindings errors
  2020-03-24  9:45 [RESEND PATCH 0/2] iio: dac: ad5770r: dt bindings fixes alexandru.tachici
  2020-03-24  9:45 ` [RESEND PATCH 1/2] iio: dac: ad5770r: read channel nr from reg alexandru.tachici
@ 2020-03-24  9:45 ` alexandru.tachici
  2020-03-25 19:05   ` Rob Herring
  2020-04-15 14:31 ` [RESEND PATCH 0/2] iio: dac: ad5770r: dt bindings fixes Rob Herring
  2 siblings, 1 reply; 5+ messages in thread
From: alexandru.tachici @ 2020-03-24  9:45 UTC (permalink / raw)
  To: linux-iio, linux-kernel, devicetree; +Cc: jic23, robh+dt

From: Alexandru Tachici <alexandru.tachici@analog.com>

Replaced num property with reg property, fixed errors
reported by dt-binding-check.

Fixes: ea52c21268e6 ("iio: dac: ad5770r: Add AD5770R support")
Signed-off-by: Alexandru Tachici <alexandru.tachici@analog.com>
---
 .../bindings/iio/dac/adi,ad5770r.yaml         | 77 ++++++++++---------
 1 file changed, 40 insertions(+), 37 deletions(-)

diff --git a/Documentation/devicetree/bindings/iio/dac/adi,ad5770r.yaml b/Documentation/devicetree/bindings/iio/dac/adi,ad5770r.yaml
index d9c25cf4b92f..d1755dbc1a41 100644
--- a/Documentation/devicetree/bindings/iio/dac/adi,ad5770r.yaml
+++ b/Documentation/devicetree/bindings/iio/dac/adi,ad5770r.yaml
@@ -2,7 +2,7 @@
 # Copyright 2020 Analog Devices Inc.
 %YAML 1.2
 ---
-$id: http://devicetree.org/schemas/bindings/iio/dac/adi,ad5770r.yaml#
+$id: http://devicetree.org/schemas/iio/dac/adi,ad5770r.yaml#
 $schema: http://devicetree.org/meta-schemas/core.yaml#
 
 title: Analog Devices AD5770R DAC device driver
@@ -49,83 +49,84 @@ properties:
       asserted during driver probe.
     maxItems: 1
 
-  channel0:
+  channel@0:
     description: Represents an external channel which are
       connected to the DAC. Channel 0 can act both as a current
       source and sink.
     type: object
 
     properties:
-      num:
+      reg:
         description: This represents the channel number.
-        items:
-          const: 0
 
       adi,range-microamp:
           description: Output range of the channel.
           oneOf:
-            - $ref: /schemas/types.yaml#/definitions/int32-array
             - items:
-                - enum: [0 300000]
-                - enum: [-60000 0]
-                - enum: [-60000 300000]
+                - const: 0
+                - const: 300000
+            - items:
+                - const: -60000
+                - const: 0
+            - items:
+                - const: -60000
+                - const: 300000
 
-  channel1:
+  channel@1:
     description: Represents an external channel which are
       connected to the DAC.
     type: object
 
     properties:
-      num:
+      reg:
         description: This represents the channel number.
-        items:
-          const: 1
 
       adi,range-microamp:
           description: Output range of the channel.
           oneOf:
-            - $ref: /schemas/types.yaml#/definitions/uint32-array
             - items:
-                - enum: [0 140000]
-                - enum: [0 250000]
+                - const: 0
+                - const: 140000
+            - items:
+                - const: 0
+                - const: 250000
 
-  channel2:
+  channel@2:
     description: Represents an external channel which are
       connected to the DAC.
     type: object
 
     properties:
-      num:
+      reg:
         description: This represents the channel number.
-        items:
-          const: 2
 
       adi,range-microamp:
           description: Output range of the channel.
           oneOf:
-            - $ref: /schemas/types.yaml#/definitions/uint32-array
             - items:
-                - enum: [0 140000]
-                - enum: [0 250000]
+                - const: 0
+                - const: 55000
+            - items:
+                - const: 0
+                - const: 150000
 
 patternProperties:
   "^channel@([3-5])$":
     type: object
     description: Represents the external channels which are connected to the DAC.
     properties:
-      num:
+      reg:
         description: This represents the channel number.
-        items:
-          minimum: 3
-          maximum: 5
 
       adi,range-microamp:
           description: Output range of the channel.
           oneOf:
-            - $ref: /schemas/types.yaml#/definitions/uint32-array
             - items:
-                - enum: [0 45000]
-                - enum: [0 100000]
+                - const: 0
+                - const: 45000
+            - items:
+                - const: 0
+                - const: 100000
 
 required:
 - reg
@@ -150,34 +151,36 @@ examples:
                         vref-supply = <&vref>;
                         adi,external-resistor;
                         reset-gpios = <&gpio 22 0>;
+                        #address-cells = <1>;
+                        #size-cells = <0>;
 
                         channel@0 {
-                                num = <0>;
-                                adi,range-microamp = <(-60000) 300000>;
+                                reg = <0>;
+                                adi,range-microamp = <0 300000>;
                         };
 
                         channel@1 {
-                                num = <1>;
+                                reg = <1>;
                                 adi,range-microamp = <0 140000>;
                         };
 
                         channel@2 {
-                                num = <2>;
+                                reg = <2>;
                                 adi,range-microamp = <0 55000>;
                         };
 
                         channel@3 {
-                                num = <3>;
+                                reg = <3>;
                                 adi,range-microamp = <0 45000>;
                         };
 
                         channel@4 {
-                                num = <4>;
+                                reg = <4>;
                                 adi,range-microamp = <0 45000>;
                         };
 
                         channel@5 {
-                                num = <5>;
+                                reg = <5>;
                                 adi,range-microamp = <0 45000>;
                         };
                 };
-- 
2.20.1


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

* Re: [RESEND PATCH 2/2] dt-bindings: iio: dac: AD5570R fix bindings errors
  2020-03-24  9:45 ` [RESEND PATCH 2/2] dt-bindings: iio: dac: AD5570R fix bindings errors alexandru.tachici
@ 2020-03-25 19:05   ` Rob Herring
  0 siblings, 0 replies; 5+ messages in thread
From: Rob Herring @ 2020-03-25 19:05 UTC (permalink / raw)
  To: Alexandru Tachici
  Cc: open list:IIO SUBSYSTEM AND DRIVERS, linux-kernel, devicetree,
	Jonathan Cameron

On Tue, Mar 24, 2020 at 3:45 AM <alexandru.tachici@analog.com> wrote:
>
> From: Alexandru Tachici <alexandru.tachici@analog.com>
>
> Replaced num property with reg property, fixed errors
> reported by dt-binding-check.
>
> Fixes: ea52c21268e6 ("iio: dac: ad5770r: Add AD5770R support")
> Signed-off-by: Alexandru Tachici <alexandru.tachici@analog.com>
> ---
>  .../bindings/iio/dac/adi,ad5770r.yaml         | 77 ++++++++++---------
>  1 file changed, 40 insertions(+), 37 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/iio/dac/adi,ad5770r.yaml b/Documentation/devicetree/bindings/iio/dac/adi,ad5770r.yaml
> index d9c25cf4b92f..d1755dbc1a41 100644
> --- a/Documentation/devicetree/bindings/iio/dac/adi,ad5770r.yaml
> +++ b/Documentation/devicetree/bindings/iio/dac/adi,ad5770r.yaml
> @@ -2,7 +2,7 @@
>  # Copyright 2020 Analog Devices Inc.
>  %YAML 1.2
>  ---
> -$id: http://devicetree.org/schemas/bindings/iio/dac/adi,ad5770r.yaml#
> +$id: http://devicetree.org/schemas/iio/dac/adi,ad5770r.yaml#
>  $schema: http://devicetree.org/meta-schemas/core.yaml#
>
>  title: Analog Devices AD5770R DAC device driver
> @@ -49,83 +49,84 @@ properties:
>        asserted during driver probe.
>      maxItems: 1
>
> -  channel0:
> +  channel@0:
>      description: Represents an external channel which are
>        connected to the DAC. Channel 0 can act both as a current
>        source and sink.
>      type: object
>
>      properties:
> -      num:
> +      reg:
>          description: This represents the channel number.
> -        items:
> -          const: 0
>
>        adi,range-microamp:
>            description: Output range of the channel.
>            oneOf:
> -            - $ref: /schemas/types.yaml#/definitions/int32-array
>              - items:
> -                - enum: [0 300000]
> -                - enum: [-60000 0]
> -                - enum: [-60000 300000]
> +                - const: 0
> +                - const: 300000
> +            - items:
> +                - const: -60000
> +                - const: 0
> +            - items:
> +                - const: -60000
> +                - const: 300000
>
> -  channel1:
> +  channel@1:
>      description: Represents an external channel which are
>        connected to the DAC.
>      type: object
>
>      properties:
> -      num:
> +      reg:
>          description: This represents the channel number.
> -        items:
> -          const: 1

This should be:

reg:
  const: 1

>
>        adi,range-microamp:
>            description: Output range of the channel.
>            oneOf:
> -            - $ref: /schemas/types.yaml#/definitions/uint32-array
>              - items:
> -                - enum: [0 140000]
> -                - enum: [0 250000]
> +                - const: 0
> +                - const: 140000
> +            - items:
> +                - const: 0
> +                - const: 250000
>
> -  channel2:
> +  channel@2:
>      description: Represents an external channel which are
>        connected to the DAC.
>      type: object
>
>      properties:
> -      num:
> +      reg:
>          description: This represents the channel number.
> -        items:
> -          const: 2
>
>        adi,range-microamp:
>            description: Output range of the channel.
>            oneOf:
> -            - $ref: /schemas/types.yaml#/definitions/uint32-array
>              - items:
> -                - enum: [0 140000]
> -                - enum: [0 250000]
> +                - const: 0
> +                - const: 55000
> +            - items:
> +                - const: 0
> +                - const: 150000
>
>  patternProperties:
>    "^channel@([3-5])$":
>      type: object
>      description: Represents the external channels which are connected to the DAC.
>      properties:
> -      num:
> +      reg:
>          description: This represents the channel number.
> -        items:
> -          minimum: 3
> -          maximum: 5

reg:
  minimum: 3
  maximum: 5

>
>        adi,range-microamp:
>            description: Output range of the channel.
>            oneOf:
> -            - $ref: /schemas/types.yaml#/definitions/uint32-array
>              - items:
> -                - enum: [0 45000]
> -                - enum: [0 100000]
> +                - const: 0
> +                - const: 45000
> +            - items:
> +                - const: 0
> +                - const: 100000

This can be simplified to:

items:
  - const: 0
  - enum: [ 45000, 100000 ]

>
>  required:
>  - reg
> @@ -150,34 +151,36 @@ examples:
>                          vref-supply = <&vref>;
>                          adi,external-resistor;
>                          reset-gpios = <&gpio 22 0>;
> +                        #address-cells = <1>;
> +                        #size-cells = <0>;
>
>                          channel@0 {
> -                                num = <0>;
> -                                adi,range-microamp = <(-60000) 300000>;
> +                                reg = <0>;
> +                                adi,range-microamp = <0 300000>;
>                          };
>
>                          channel@1 {
> -                                num = <1>;
> +                                reg = <1>;
>                                  adi,range-microamp = <0 140000>;
>                          };
>
>                          channel@2 {
> -                                num = <2>;
> +                                reg = <2>;
>                                  adi,range-microamp = <0 55000>;
>                          };
>
>                          channel@3 {
> -                                num = <3>;
> +                                reg = <3>;
>                                  adi,range-microamp = <0 45000>;
>                          };
>
>                          channel@4 {
> -                                num = <4>;
> +                                reg = <4>;
>                                  adi,range-microamp = <0 45000>;
>                          };
>
>                          channel@5 {
> -                                num = <5>;
> +                                reg = <5>;
>                                  adi,range-microamp = <0 45000>;
>                          };
>                  };
> --
> 2.20.1
>

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

* Re: [RESEND PATCH 0/2] iio: dac: ad5770r: dt bindings fixes
  2020-03-24  9:45 [RESEND PATCH 0/2] iio: dac: ad5770r: dt bindings fixes alexandru.tachici
  2020-03-24  9:45 ` [RESEND PATCH 1/2] iio: dac: ad5770r: read channel nr from reg alexandru.tachici
  2020-03-24  9:45 ` [RESEND PATCH 2/2] dt-bindings: iio: dac: AD5570R fix bindings errors alexandru.tachici
@ 2020-04-15 14:31 ` Rob Herring
  2 siblings, 0 replies; 5+ messages in thread
From: Rob Herring @ 2020-04-15 14:31 UTC (permalink / raw)
  To: Alexandru Tachici
  Cc: open list:IIO SUBSYSTEM AND DRIVERS, linux-kernel, devicetree,
	Jonathan Cameron

On Tue, Mar 24, 2020 at 4:45 AM <alexandru.tachici@analog.com> wrote:
>
> From: Alexandru Tachici <alexandru.tachici@analog.com>
>
> This aims to replace use of num property from dt nodes with
> reg property both in dt bindings and driver and fix
> dt bindings errors.
>
> 1. read from fwnode reg property instead of num property
>
> 2. replace num property with reg property and fix dt
> bindings errors
>
> Alexandru Tachici (2):
>   iio: dac: ad5770r: read channel nr from reg
>   dt-bindings: iio: dac: AD5570R fix bindings errors

Can I get a respin of this so it can be fixed for rc2. Or I can just revert.

Rob

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

end of thread, other threads:[~2020-04-15 14:31 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-24  9:45 [RESEND PATCH 0/2] iio: dac: ad5770r: dt bindings fixes alexandru.tachici
2020-03-24  9:45 ` [RESEND PATCH 1/2] iio: dac: ad5770r: read channel nr from reg alexandru.tachici
2020-03-24  9:45 ` [RESEND PATCH 2/2] dt-bindings: iio: dac: AD5570R fix bindings errors alexandru.tachici
2020-03-25 19:05   ` Rob Herring
2020-04-15 14:31 ` [RESEND PATCH 0/2] iio: dac: ad5770r: dt bindings fixes Rob Herring

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).