diff mbox series

[v2,03/12] dt-bindings: i2c: dw: Add Baikal-T1 SoC I2C controller

Message ID 20200510095019.20981-4-Sergey.Semin@baikalelectronics.ru
State Changes Requested, archived
Headers show
Series i2c: designeware: Add Baikal-T1 System I2C support | expand

Checks

Context Check Description
robh/checkpatch success

Commit Message

Serge Semin May 10, 2020, 9:50 a.m. UTC
Add the "baikal,bt1-sys-i2c" compatible string to the DW I2C binding and
make sure the reg property isn't required in this case because the
controller is embedded into the Baikal-T1 System Controller. The rest of
the DW APB I2C properties are compatible and can be freely used to describe
the Baikal-T1 I2C controller dts-node.

Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>
Cc: Alexey Malahov <Alexey.Malahov@baikalelectronics.ru>
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc: Paul Burton <paulburton@kernel.org>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Mika Westerberg <mika.westerberg@linux.intel.com>
Cc: Wolfram Sang <wsa@the-dreams.de>
Cc: Frank Rowand <frowand.list@gmail.com>
Cc: linux-mips@vger.kernel.org

---

Rob, I had to remove your acked-by tag because of the changes introduced
in v2 of the patch.

Changelog v2:
- Make the reg property being optional if it's Baikal-T1 System I2C DT
  node.
---
 .../devicetree/bindings/i2c/snps,designware-i2c.yaml | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

Comments

Rob Herring May 18, 2020, 8:33 p.m. UTC | #1
On Sun, May 10, 2020 at 12:50:09PM +0300, Serge Semin wrote:
> Add the "baikal,bt1-sys-i2c" compatible string to the DW I2C binding and
> make sure the reg property isn't required in this case because the
> controller is embedded into the Baikal-T1 System Controller. The rest of
> the DW APB I2C properties are compatible and can be freely used to describe
> the Baikal-T1 I2C controller dts-node.

Is there not a sub-range of the system controller with the I2C 
registers? I'd assume there is, so you can still have 'reg' even if 
Linux doesn't use it (currently).

> 
> Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>
> Cc: Alexey Malahov <Alexey.Malahov@baikalelectronics.ru>
> Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
> Cc: Paul Burton <paulburton@kernel.org>
> Cc: Ralf Baechle <ralf@linux-mips.org>
> Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Cc: Mika Westerberg <mika.westerberg@linux.intel.com>
> Cc: Wolfram Sang <wsa@the-dreams.de>
> Cc: Frank Rowand <frowand.list@gmail.com>
> Cc: linux-mips@vger.kernel.org
> 
> ---
> 
> Rob, I had to remove your acked-by tag because of the changes introduced
> in v2 of the patch.
> 
> Changelog v2:
> - Make the reg property being optional if it's Baikal-T1 System I2C DT
>   node.
> ---
>  .../devicetree/bindings/i2c/snps,designware-i2c.yaml | 12 +++++++++++-
>  1 file changed, 11 insertions(+), 1 deletion(-)
> 
> diff --git a/Documentation/devicetree/bindings/i2c/snps,designware-i2c.yaml b/Documentation/devicetree/bindings/i2c/snps,designware-i2c.yaml
> index 8d4e5fccbd1c..579964098eb9 100644
> --- a/Documentation/devicetree/bindings/i2c/snps,designware-i2c.yaml
> +++ b/Documentation/devicetree/bindings/i2c/snps,designware-i2c.yaml
> @@ -21,6 +21,15 @@ allOf:
>        properties:
>          reg:
>            maxItems: 1
> +  - if:
> +      properties:
> +        compatible:
> +          not:
> +            contains:
> +              const: baikal,bt1-sys-i2c
> +    then:
> +      required:
> +        - reg
>  
>  properties:
>    compatible:
> @@ -31,6 +40,8 @@ properties:
>          items:
>            - const: mscc,ocelot-i2c
>            - const: snps,designware-i2c
> +      - description: Baikal-T1 SoC System I2C controller
> +        const: baikal,bt1-sys-i2c
>  
>    reg:
>      minItems: 1
> @@ -98,7 +109,6 @@ unevaluatedProperties: false
>  
>  required:
>    - compatible
> -  - reg
>    - "#address-cells"
>    - "#size-cells"
>    - interrupts
> -- 
> 2.25.1
>
Serge Semin May 18, 2020, 9:39 p.m. UTC | #2
On Mon, May 18, 2020 at 02:33:19PM -0600, Rob Herring wrote:
> On Sun, May 10, 2020 at 12:50:09PM +0300, Serge Semin wrote:
> > Add the "baikal,bt1-sys-i2c" compatible string to the DW I2C binding and
> > make sure the reg property isn't required in this case because the
> > controller is embedded into the Baikal-T1 System Controller. The rest of
> > the DW APB I2C properties are compatible and can be freely used to describe
> > the Baikal-T1 I2C controller dts-node.
> 
> Is there not a sub-range of the system controller with the I2C 
> registers? I'd assume there is, so you can still have 'reg' even if 
> Linux doesn't use it (currently).

Yes, there is a range. It's just three access registers. Is it wrong to make the
reg property being optional in this case since it can be accessed over syscon
regmap? Do you suggest to get back the reg property being required for our
device?

-Sergey

> 
> > 
> > Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>
> > Cc: Alexey Malahov <Alexey.Malahov@baikalelectronics.ru>
> > Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
> > Cc: Paul Burton <paulburton@kernel.org>
> > Cc: Ralf Baechle <ralf@linux-mips.org>
> > Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > Cc: Mika Westerberg <mika.westerberg@linux.intel.com>
> > Cc: Wolfram Sang <wsa@the-dreams.de>
> > Cc: Frank Rowand <frowand.list@gmail.com>
> > Cc: linux-mips@vger.kernel.org
> > 
> > ---
> > 
> > Rob, I had to remove your acked-by tag because of the changes introduced
> > in v2 of the patch.
> > 
> > Changelog v2:
> > - Make the reg property being optional if it's Baikal-T1 System I2C DT
> >   node.
> > ---
> >  .../devicetree/bindings/i2c/snps,designware-i2c.yaml | 12 +++++++++++-
> >  1 file changed, 11 insertions(+), 1 deletion(-)
> > 
> > diff --git a/Documentation/devicetree/bindings/i2c/snps,designware-i2c.yaml b/Documentation/devicetree/bindings/i2c/snps,designware-i2c.yaml
> > index 8d4e5fccbd1c..579964098eb9 100644
> > --- a/Documentation/devicetree/bindings/i2c/snps,designware-i2c.yaml
> > +++ b/Documentation/devicetree/bindings/i2c/snps,designware-i2c.yaml
> > @@ -21,6 +21,15 @@ allOf:
> >        properties:
> >          reg:
> >            maxItems: 1
> > +  - if:
> > +      properties:
> > +        compatible:
> > +          not:
> > +            contains:
> > +              const: baikal,bt1-sys-i2c
> > +    then:
> > +      required:
> > +        - reg
> >  
> >  properties:
> >    compatible:
> > @@ -31,6 +40,8 @@ properties:
> >          items:
> >            - const: mscc,ocelot-i2c
> >            - const: snps,designware-i2c
> > +      - description: Baikal-T1 SoC System I2C controller
> > +        const: baikal,bt1-sys-i2c
> >  
> >    reg:
> >      minItems: 1
> > @@ -98,7 +109,6 @@ unevaluatedProperties: false
> >  
> >  required:
> >    - compatible
> > -  - reg
> >    - "#address-cells"
> >    - "#size-cells"
> >    - interrupts
> > -- 
> > 2.25.1
> >
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/i2c/snps,designware-i2c.yaml b/Documentation/devicetree/bindings/i2c/snps,designware-i2c.yaml
index 8d4e5fccbd1c..579964098eb9 100644
--- a/Documentation/devicetree/bindings/i2c/snps,designware-i2c.yaml
+++ b/Documentation/devicetree/bindings/i2c/snps,designware-i2c.yaml
@@ -21,6 +21,15 @@  allOf:
       properties:
         reg:
           maxItems: 1
+  - if:
+      properties:
+        compatible:
+          not:
+            contains:
+              const: baikal,bt1-sys-i2c
+    then:
+      required:
+        - reg
 
 properties:
   compatible:
@@ -31,6 +40,8 @@  properties:
         items:
           - const: mscc,ocelot-i2c
           - const: snps,designware-i2c
+      - description: Baikal-T1 SoC System I2C controller
+        const: baikal,bt1-sys-i2c
 
   reg:
     minItems: 1
@@ -98,7 +109,6 @@  unevaluatedProperties: false
 
 required:
   - compatible
-  - reg
   - "#address-cells"
   - "#size-cells"
   - interrupts