2017-04-13 18:30:57

by Javier Martinez Canillas

[permalink] [raw]
Subject: [PATCH v2 05/22] ARM: dts: at91: Add generic compatible string for I2C EEPROM

The at24 driver allows to register I2C EEPROM chips using different vendor
and devices, but the I2C subsystem does not take the vendor into account
when matching using the I2C table since it only has device entries.

But when matching using an OF table, both the vendor and device has to be
taken into account so the driver defines only a set of compatible strings
using the "atmel" vendor as a generic fallback for compatible I2C devices.

So add this generic fallback to the device node compatible string to make
the device to match the driver using the OF device ID table.

Signed-off-by: Javier Martinez Canillas <[email protected]>
---

Changes in v2: None

arch/arm/boot/dts/at91-linea.dtsi | 2 +-
arch/arm/boot/dts/at91-tse850-3.dts | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/boot/dts/at91-linea.dtsi b/arch/arm/boot/dts/at91-linea.dtsi
index 0721c8472509..9a19080fd3bf 100644
--- a/arch/arm/boot/dts/at91-linea.dtsi
+++ b/arch/arm/boot/dts/at91-linea.dtsi
@@ -31,7 +31,7 @@
status = "okay";

eeprom@51 {
- compatible = "st,24c64";
+ compatible = "st,24c64","atmel,24c64";
reg = <0x51>;
pagesize = <32>;
};
diff --git a/arch/arm/boot/dts/at91-tse850-3.dts b/arch/arm/boot/dts/at91-tse850-3.dts
index 7a68805a4eb5..6f005c14a6b0 100644
--- a/arch/arm/boot/dts/at91-tse850-3.dts
+++ b/arch/arm/boot/dts/at91-tse850-3.dts
@@ -239,7 +239,7 @@
};

eeprom@50 {
- compatible = "nxp,24c02";
+ compatible = "nxp,24c02","atmel,24c02";
reg = <0x50>;
pagesize = <16>;
};
--
2.9.3


2017-04-13 20:43:36

by Peter Rosin

[permalink] [raw]
Subject: Re: [PATCH v2 05/22] ARM: dts: at91: Add generic compatible string for I2C EEPROM

On 2017-04-13 20:28, Javier Martinez Canillas wrote:
> The at24 driver allows to register I2C EEPROM chips using different vendor
> and devices, but the I2C subsystem does not take the vendor into account
> when matching using the I2C table since it only has device entries.
>
> But when matching using an OF table, both the vendor and device has to be
> taken into account so the driver defines only a set of compatible strings
> using the "atmel" vendor as a generic fallback for compatible I2C devices.
>
> So add this generic fallback to the device node compatible string to make
> the device to match the driver using the OF device ID table.
>
> Signed-off-by: Javier Martinez Canillas <[email protected]>
> ---
>
> Changes in v2: None
>
> arch/arm/boot/dts/at91-linea.dtsi | 2 +-
> arch/arm/boot/dts/at91-tse850-3.dts | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm/boot/dts/at91-linea.dtsi b/arch/arm/boot/dts/at91-linea.dtsi
> index 0721c8472509..9a19080fd3bf 100644
> --- a/arch/arm/boot/dts/at91-linea.dtsi
> +++ b/arch/arm/boot/dts/at91-linea.dtsi
> @@ -31,7 +31,7 @@
> status = "okay";
>
> eeprom@51 {
> - compatible = "st,24c64";
> + compatible = "st,24c64","atmel,24c64";
> reg = <0x51>;
> pagesize = <32>;
> };
> diff --git a/arch/arm/boot/dts/at91-tse850-3.dts b/arch/arm/boot/dts/at91-tse850-3.dts
> index 7a68805a4eb5..6f005c14a6b0 100644
> --- a/arch/arm/boot/dts/at91-tse850-3.dts
> +++ b/arch/arm/boot/dts/at91-tse850-3.dts
> @@ -239,7 +239,7 @@
> };
>
> eeprom@50 {
> - compatible = "nxp,24c02";
> + compatible = "nxp,24c02","atmel,24c02";
> reg = <0x50>;
> pagesize = <16>;
> };
>

Sure, in principle. But not having a space after the commas is a real OCD
trigger for me. My spine is rotating... :-)

Anyway, with those whitespace fixes (and without them too, but please):
Acked-by: Peter Rosin <[email protected]>

Cheers,
peda


2017-04-13 21:10:22

by Javier Martinez Canillas

[permalink] [raw]
Subject: Re: [PATCH v2 05/22] ARM: dts: at91: Add generic compatible string for I2C EEPROM

Hello Peter,

On 04/13/2017 05:43 PM, Peter Rosin wrote:
> On 2017-04-13 20:28, Javier Martinez Canillas wrote:

[snip]

>>
>> eeprom@50 {
>> - compatible = "nxp,24c02";
>> + compatible = "nxp,24c02","atmel,24c02";
>> reg = <0x50>;
>> pagesize = <16>;
>> };
>>
>
> Sure, in principle. But not having a space after the commas is a real OCD
> trigger for me. My spine is rotating... :-)
>

Right, Geert already pointed out. It's something I missed in my sed script
so I got it wrong in all the DTS :(

I'll fix my script and send a v2.

> Anyway, with those whitespace fixes (and without them too, but please):
> Acked-by: Peter Rosin <[email protected]>
>

Thanks for the review!

> Cheers,
> peda
>
>

Best regards,
--
Javier Martinez Canillas
Open Source Group
Samsung Research America

2017-04-13 21:21:28

by Alexandre Belloni

[permalink] [raw]
Subject: Re: [PATCH v2 05/22] ARM: dts: at91: Add generic compatible string for I2C EEPROM

On 13/04/2017 at 18:09:56 -0300, Javier Martinez Canillas wrote:
> Hello Peter,
>
> On 04/13/2017 05:43 PM, Peter Rosin wrote:
> > On 2017-04-13 20:28, Javier Martinez Canillas wrote:
>
> [snip]
>
> >>
> >> eeprom@50 {
> >> - compatible = "nxp,24c02";
> >> + compatible = "nxp,24c02","atmel,24c02";
> >> reg = <0x50>;
> >> pagesize = <16>;
> >> };
> >>
> >
> > Sure, in principle. But not having a space after the commas is a real OCD
> > trigger for me. My spine is rotating... :-)
> >
>
> Right, Geert already pointed out. It's something I missed in my sed script
> so I got it wrong in all the DTS :(
>
> I'll fix my script and send a v2.
>

That would be v3, right? ;)

> > Anyway, with those whitespace fixes (and without them too, but please):
> > Acked-by: Peter Rosin <[email protected]>
> >
>
> Thanks for the review!
>

I'd like to be copied on the first patches to ensure they are applied
before applying that one. (Also, it is probably too late for 4.12 anyway
because we are past rc6).

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

2017-04-13 23:47:23

by Javier Martinez Canillas

[permalink] [raw]
Subject: Re: [PATCH v2 05/22] ARM: dts: at91: Add generic compatible string for I2C EEPROM

Hello Alexandre,

On 04/13/2017 06:20 PM, Alexandre Belloni wrote:
> On 13/04/2017 at 18:09:56 -0300, Javier Martinez Canillas wrote:
>> Hello Peter,
>>
>> On 04/13/2017 05:43 PM, Peter Rosin wrote:
>>> On 2017-04-13 20:28, Javier Martinez Canillas wrote:
>>
>> [snip]
>>
>>>>
>>>> eeprom@50 {
>>>> - compatible = "nxp,24c02";
>>>> + compatible = "nxp,24c02","atmel,24c02";
>>>> reg = <0x50>;
>>>> pagesize = <16>;
>>>> };
>>>>
>>>
>>> Sure, in principle. But not having a space after the commas is a real OCD
>>> trigger for me. My spine is rotating... :-)
>>>
>>
>> Right, Geert already pointed out. It's something I missed in my sed script
>> so I got it wrong in all the DTS :(
>>
>> I'll fix my script and send a v2.
>>
>
> That would be v3, right? ;)
>

err, right :)

>>> Anyway, with those whitespace fixes (and without them too, but please):
>>> Acked-by: Peter Rosin <[email protected]>
>>>
>>
>> Thanks for the review!
>>
>
> I'd like to be copied on the first patches to ensure they are applied
> before applying that one. (Also, it is probably too late for 4.12 anyway

Ok, I'll copy you on the whole patch-set. But keep in mind that there is
no strict order since $SUBJECT without the at24 OF table is a no-op (the
match happens between first device in compatible string and I2C table).

> because we are past rc6).
>

Yes, there's no rush on applying these. I'm just posting all the patches
needed to finally have a proper OF modalias reporting in the I2C core.

Best regards,
--
Javier Martinez Canillas
Open Source Group
Samsung Research America

2017-04-13 23:58:56

by Simon Horman

[permalink] [raw]
Subject: Re: [PATCH v2 05/22] ARM: dts: at91: Add generic compatible string for I2C EEPROM

On Thu, Apr 13, 2017 at 11:20:59PM +0200, Alexandre Belloni wrote:
> On 13/04/2017 at 18:09:56 -0300, Javier Martinez Canillas wrote:
> > Hello Peter,
> >
> > On 04/13/2017 05:43 PM, Peter Rosin wrote:
> > > On 2017-04-13 20:28, Javier Martinez Canillas wrote:
> >
> > [snip]
> >
> > >>
> > >> eeprom@50 {
> > >> - compatible = "nxp,24c02";
> > >> + compatible = "nxp,24c02","atmel,24c02";
> > >> reg = <0x50>;
> > >> pagesize = <16>;
> > >> };
> > >>
> > >
> > > Sure, in principle. But not having a space after the commas is a real OCD
> > > trigger for me. My spine is rotating... :-)
> > >
> >
> > Right, Geert already pointed out. It's something I missed in my sed script
> > so I got it wrong in all the DTS :(
> >
> > I'll fix my script and send a v2.
> >
>
> That would be v3, right? ;)
>
> > > Anyway, with those whitespace fixes (and without them too, but please):
> > > Acked-by: Peter Rosin <[email protected]>
> > >
> >
> > Thanks for the review!
> >
>
> I'd like to be copied on the first patches to ensure they are applied
> before applying that one. (Also, it is probably too late for 4.12 anyway
> because we are past rc6).

Ditto