diff mbox series

[v3,03/12] dt-bindings: i2c: Discard i2c-slave flag from the DW I2C example

Message ID 20200526215528.16417-4-Sergey.Semin@baikalelectronics.ru (mailing list archive)
State Superseded
Headers show
Series i2c: designeware: Add Baikal-T1 System I2C support | expand

Commit Message

Serge Semin May 26, 2020, 9:55 p.m. UTC
dtc currently doesn't support I2C_OWN_SLAVE_ADDRESS flag set in the
i2c "reg" property. If it is the compiler will print a warning:

Warning (i2c_bus_reg): /example-2/i2c@1120000/eeprom@64: I2C bus unit address format error, expected "40000064"
Warning (i2c_bus_reg): /example-2/i2c@1120000/eeprom@64:reg: I2C address must be less than 10-bits, got "0x40000064"

In order to silence dtc up let's discard the flag from the DW I2C DT
binding example for now. Just revert this commit when dtc is fixed.

Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>
Cc: Alexey Malahov <Alexey.Malahov@baikalelectronics.ru>
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Mika Westerberg <mika.westerberg@linux.intel.com>
Cc: linux-mips@vger.kernel.org

---

Changelog v3:
- This is a new patch created as a result of the Rob request to remove
  the EEPROM-slave bit setting in the DT binndings example until the dtc
  is fixed.
---
 Documentation/devicetree/bindings/i2c/snps,designware-i2c.yaml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Andy Shevchenko May 27, 2020, 9:30 a.m. UTC | #1
On Wed, May 27, 2020 at 1:00 AM Serge Semin
<Sergey.Semin@baikalelectronics.ru> wrote:
>
> dtc currently doesn't support I2C_OWN_SLAVE_ADDRESS flag set in the
> i2c "reg" property. If it is the compiler will print a warning:

Shouldn't be dtc whatever tools fixed?

> Warning (i2c_bus_reg): /example-2/i2c@1120000/eeprom@64: I2C bus unit address format error, expected "40000064"
> Warning (i2c_bus_reg): /example-2/i2c@1120000/eeprom@64:reg: I2C address must be less than 10-bits, got "0x40000064"
>
> In order to silence dtc up let's discard the flag from the DW I2C DT
> binding example for now. Just revert this commit when dtc is fixed.

Doesn't sound like a good idea. If user happens in between of these
ping-pong change, how they will know this subtle issue?
Serge Semin May 27, 2020, 12:07 p.m. UTC | #2
On Wed, May 27, 2020 at 12:30:04PM +0300, Andy Shevchenko wrote:
> On Wed, May 27, 2020 at 1:00 AM Serge Semin
> <Sergey.Semin@baikalelectronics.ru> wrote:
> >
> > dtc currently doesn't support I2C_OWN_SLAVE_ADDRESS flag set in the
> > i2c "reg" property. If it is the compiler will print a warning:
> 
> Shouldn't be dtc whatever tools fixed?

See the first patch in the series.

> 
> > Warning (i2c_bus_reg): /example-2/i2c@1120000/eeprom@64: I2C bus unit address format error, expected "40000064"
> > Warning (i2c_bus_reg): /example-2/i2c@1120000/eeprom@64:reg: I2C address must be less than 10-bits, got "0x40000064"
> >
> > In order to silence dtc up let's discard the flag from the DW I2C DT
> > binding example for now. Just revert this commit when dtc is fixed.
> 
> Doesn't sound like a good idea. If user happens in between of these
> ping-pong change, how they will know this subtle issue?

As I see it, there are three ways we can follow.
1) Apply the patch and revert when dtc is fixed.
2) Apply the patch, but add a comment above the property, that we need
   to get the 0x40000064 address back when dtc is dixed.
3) Leave this ugly warning be until dtc is fixed.

In a comment to v2 Rob mentioned a solution like 1). Personally I am ok with
either, though I'd like to see a Rob's final comment about this.

-Sergey 

> 
> -- 
> With Best Regards,
> Andy Shevchenko
Andy Shevchenko May 27, 2020, 1:32 p.m. UTC | #3
On Wed, May 27, 2020 at 03:07:16PM +0300, Serge Semin wrote:
> On Wed, May 27, 2020 at 12:30:04PM +0300, Andy Shevchenko wrote:
> > On Wed, May 27, 2020 at 1:00 AM Serge Semin
> > <Sergey.Semin@baikalelectronics.ru> wrote:
> > >
> > > dtc currently doesn't support I2C_OWN_SLAVE_ADDRESS flag set in the
> > > i2c "reg" property. If it is the compiler will print a warning:
> > 
> > Shouldn't be dtc whatever tools fixed?
> 
> See the first patch in the series.

I can't by the reason that I have no such. I also answered to cover letter
about it.

> > > Warning (i2c_bus_reg): /example-2/i2c@1120000/eeprom@64: I2C bus unit address format error, expected "40000064"
> > > Warning (i2c_bus_reg): /example-2/i2c@1120000/eeprom@64:reg: I2C address must be less than 10-bits, got "0x40000064"
> > >
> > > In order to silence dtc up let's discard the flag from the DW I2C DT
> > > binding example for now. Just revert this commit when dtc is fixed.
> > 
> > Doesn't sound like a good idea. If user happens in between of these
> > ping-pong change, how they will know this subtle issue?
> 
> As I see it, there are three ways we can follow.
> 1) Apply the patch and revert when dtc is fixed.
> 2) Apply the patch, but add a comment above the property, that we need
>    to get the 0x40000064 address back when dtc is dixed.
> 3) Leave this ugly warning be until dtc is fixed.
> 
> In a comment to v2 Rob mentioned a solution like 1). Personally I am ok with
> either, though I'd like to see a Rob's final comment about this.

Yes, let's follow what Rob proposes.
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 4bd430b2b41d..101d78e8f19d 100644
--- a/Documentation/devicetree/bindings/i2c/snps,designware-i2c.yaml
+++ b/Documentation/devicetree/bindings/i2c/snps,designware-i2c.yaml
@@ -137,7 +137,7 @@  examples:
 
       eeprom@64 {
         compatible = "linux,slave-24c02";
-        reg = <0x40000064>;
+        reg = <0x64>;
       };
     };
   - |