diff mbox series

[1/2] dt-bindings: at24: add ST M24C32-D Additional Write lockable page

Message ID 20231010190926.57674-1-marex@denx.de
State New
Headers show
Series [1/2] dt-bindings: at24: add ST M24C32-D Additional Write lockable page | expand

Commit Message

Marek Vasut Oct. 10, 2023, 7:09 p.m. UTC
The ST M24C32-D behaves as a regular M24C32, except for the -D variant
which uses up another I2C address for Additional Write lockable page.
This page is 32 Bytes long and can contain additional data. Document
compatible string for it, so users can describe that page in DT. Note
that users still have to describe the main M24C32 area separately as
that is on separate I2C address from this page.

Signed-off-by: Marek Vasut <marex@denx.de>
---
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Bartosz Golaszewski <brgl@bgdev.pl>
Cc: Conor Dooley <conor+dt@kernel.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>
Cc: Rob Herring <robh+dt@kernel.org>
Cc: devicetree@vger.kernel.org
Cc: linux-i2c@vger.kernel.org
---
 Documentation/devicetree/bindings/eeprom/at24.yaml | 2 ++
 1 file changed, 2 insertions(+)

Comments

Conor Dooley Oct. 11, 2023, 2:32 p.m. UTC | #1
On Tue, Oct 10, 2023 at 09:09:25PM +0200, Marek Vasut wrote:
> The ST M24C32-D behaves as a regular M24C32, except for the -D variant
> which uses up another I2C address for Additional Write lockable page.
> This page is 32 Bytes long and can contain additional data. Document
> compatible string for it, so users can describe that page in DT. Note
> that users still have to describe the main M24C32 area separately as
> that is on separate I2C address from this page.
> 
> Signed-off-by: Marek Vasut <marex@denx.de>

Acked-by: Conor Dooley <conor.dooley@microchip.com>

Oh and Bartosz, this binding seems to have a baylibre email address for
you in it. I'm sure it's mailmap'ed to the right place, but just FYI.

Thanks,
Conor.

> ---
> Cc: Arnd Bergmann <arnd@arndb.de>
> Cc: Bartosz Golaszewski <brgl@bgdev.pl>
> Cc: Conor Dooley <conor+dt@kernel.org>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Cc: Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>
> Cc: Rob Herring <robh+dt@kernel.org>
> Cc: devicetree@vger.kernel.org
> Cc: linux-i2c@vger.kernel.org
> ---
>  Documentation/devicetree/bindings/eeprom/at24.yaml | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/eeprom/at24.yaml b/Documentation/devicetree/bindings/eeprom/at24.yaml
> index 98139489d4b5c..7be127e9b2507 100644
> --- a/Documentation/devicetree/bindings/eeprom/at24.yaml
> +++ b/Documentation/devicetree/bindings/eeprom/at24.yaml
> @@ -67,6 +67,8 @@ properties:
>                    pattern: cs16$
>                - items:
>                    pattern: c32$
> +              - items:
> +                  pattern: c32d-wl$
>                - items:
>                    pattern: cs32$
>                - items:
> -- 
> 2.40.1
>
Bartosz Golaszewski Oct. 12, 2023, 9:28 a.m. UTC | #2
On Tue, Oct 10, 2023 at 9:09 PM Marek Vasut <marex@denx.de> wrote:
>
> The ST M24C32-D behaves as a regular M24C32, except for the -D variant
> which uses up another I2C address for Additional Write lockable page.
> This page is 32 Bytes long and can contain additional data. Document
> compatible string for it, so users can describe that page in DT. Note
> that users still have to describe the main M24C32 area separately as
> that is on separate I2C address from this page.
>
> Signed-off-by: Marek Vasut <marex@denx.de>
> ---
> Cc: Arnd Bergmann <arnd@arndb.de>
> Cc: Bartosz Golaszewski <brgl@bgdev.pl>
> Cc: Conor Dooley <conor+dt@kernel.org>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Cc: Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>
> Cc: Rob Herring <robh+dt@kernel.org>
> Cc: devicetree@vger.kernel.org
> Cc: linux-i2c@vger.kernel.org
> ---
>  Documentation/devicetree/bindings/eeprom/at24.yaml | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/eeprom/at24.yaml b/Documentation/devicetree/bindings/eeprom/at24.yaml
> index 98139489d4b5c..7be127e9b2507 100644
> --- a/Documentation/devicetree/bindings/eeprom/at24.yaml
> +++ b/Documentation/devicetree/bindings/eeprom/at24.yaml
> @@ -67,6 +67,8 @@ properties:
>                    pattern: cs16$
>                - items:
>                    pattern: c32$
> +              - items:
> +                  pattern: c32d-wl$
>                - items:
>                    pattern: cs32$
>                - items:
> --
> 2.40.1
>

Applied, thanks!

Bart
Rob Herring (Arm) Oct. 12, 2023, 11:57 a.m. UTC | #3
On Tue, Oct 10, 2023 at 09:09:25PM +0200, Marek Vasut wrote:
> The ST M24C32-D behaves as a regular M24C32, except for the -D variant
> which uses up another I2C address for Additional Write lockable page.
> This page is 32 Bytes long and can contain additional data. Document
> compatible string for it, so users can describe that page in DT. Note
> that users still have to describe the main M24C32 area separately as
> that is on separate I2C address from this page.

So 2 nodes for 1 device? Wouldn't it make more sense for the 1 node to 
have 2 addresses?

> 
> Signed-off-by: Marek Vasut <marex@denx.de>
> ---
> Cc: Arnd Bergmann <arnd@arndb.de>
> Cc: Bartosz Golaszewski <brgl@bgdev.pl>
> Cc: Conor Dooley <conor+dt@kernel.org>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Cc: Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>
> Cc: Rob Herring <robh+dt@kernel.org>
> Cc: devicetree@vger.kernel.org
> Cc: linux-i2c@vger.kernel.org
> ---
>  Documentation/devicetree/bindings/eeprom/at24.yaml | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/eeprom/at24.yaml b/Documentation/devicetree/bindings/eeprom/at24.yaml
> index 98139489d4b5c..7be127e9b2507 100644
> --- a/Documentation/devicetree/bindings/eeprom/at24.yaml
> +++ b/Documentation/devicetree/bindings/eeprom/at24.yaml
> @@ -67,6 +67,8 @@ properties:
>                    pattern: cs16$
>                - items:
>                    pattern: c32$
> +              - items:
> +                  pattern: c32d-wl$
>                - items:
>                    pattern: cs32$
>                - items:
> -- 
> 2.40.1
>
Marek Vasut Oct. 12, 2023, 12:51 p.m. UTC | #4
On 10/12/23 13:57, Rob Herring wrote:
> On Tue, Oct 10, 2023 at 09:09:25PM +0200, Marek Vasut wrote:
>> The ST M24C32-D behaves as a regular M24C32, except for the -D variant
>> which uses up another I2C address for Additional Write lockable page.
>> This page is 32 Bytes long and can contain additional data. Document
>> compatible string for it, so users can describe that page in DT. Note
>> that users still have to describe the main M24C32 area separately as
>> that is on separate I2C address from this page.
> 
> So 2 nodes for 1 device? Wouldn't it make more sense for the 1 node to
> have 2 addresses?

It would, if the 32 Byte Additional Write lockable page was somehow 
related to the main area, but it doesn't seem to be, except that they 
are both on single chip.
Bartosz Golaszewski Oct. 12, 2023, 12:57 p.m. UTC | #5
On Thu, Oct 12, 2023 at 1:57 PM Rob Herring <robh@kernel.org> wrote:
>
> On Tue, Oct 10, 2023 at 09:09:25PM +0200, Marek Vasut wrote:
> > The ST M24C32-D behaves as a regular M24C32, except for the -D variant
> > which uses up another I2C address for Additional Write lockable page.
> > This page is 32 Bytes long and can contain additional data. Document
> > compatible string for it, so users can describe that page in DT. Note
> > that users still have to describe the main M24C32 area separately as
> > that is on separate I2C address from this page.
>
> So 2 nodes for 1 device? Wouldn't it make more sense for the 1 node to
> have 2 addresses?
>

This is in line with what we have been doing so far for 24cs and 24mac
variants. Here[1] is the series that first added support for those
special areas.

The way nvmem works, we'd need to register two nvmem devices anyway as
children of the i2c device associated with the at24 chip. Not worth
the additional complexity this would entail if you ask me.

Bartosz

[1] https://lore.kernel.org/lkml/1465202936-16832-1-git-send-email-bgolaszewski@baylibre.com/

> >
> > Signed-off-by: Marek Vasut <marex@denx.de>
> > ---
> > Cc: Arnd Bergmann <arnd@arndb.de>
> > Cc: Bartosz Golaszewski <brgl@bgdev.pl>
> > Cc: Conor Dooley <conor+dt@kernel.org>
> > Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> > Cc: Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>
> > Cc: Rob Herring <robh+dt@kernel.org>
> > Cc: devicetree@vger.kernel.org
> > Cc: linux-i2c@vger.kernel.org
> > ---
> >  Documentation/devicetree/bindings/eeprom/at24.yaml | 2 ++
> >  1 file changed, 2 insertions(+)
> >
> > diff --git a/Documentation/devicetree/bindings/eeprom/at24.yaml b/Documentation/devicetree/bindings/eeprom/at24.yaml
> > index 98139489d4b5c..7be127e9b2507 100644
> > --- a/Documentation/devicetree/bindings/eeprom/at24.yaml
> > +++ b/Documentation/devicetree/bindings/eeprom/at24.yaml
> > @@ -67,6 +67,8 @@ properties:
> >                    pattern: cs16$
> >                - items:
> >                    pattern: c32$
> > +              - items:
> > +                  pattern: c32d-wl$
> >                - items:
> >                    pattern: cs32$
> >                - items:
> > --
> > 2.40.1
> >
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/eeprom/at24.yaml b/Documentation/devicetree/bindings/eeprom/at24.yaml
index 98139489d4b5c..7be127e9b2507 100644
--- a/Documentation/devicetree/bindings/eeprom/at24.yaml
+++ b/Documentation/devicetree/bindings/eeprom/at24.yaml
@@ -67,6 +67,8 @@  properties:
                   pattern: cs16$
               - items:
                   pattern: c32$
+              - items:
+                  pattern: c32d-wl$
               - items:
                   pattern: cs32$
               - items: