Skip to contentSkip to conversation

dt-bindings: at24: add ST M24C32-D Additional Write lockable page

PATCH Applied Marek Vasut 4 participants 9 messages Oct 10, 2023 – Oct 12, 2023

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

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

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.

---
Cc: Arnd Bergmann <[email protected]>
Cc: Bartosz Golaszewski <[email protected]>
Cc: Conor Dooley <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: Krzysztof Kozlowski <[email protected]>
Cc: Rob Herring <[email protected]>
Cc: [email protected]
Cc: [email protected]

---
 Documentation/devicetree/bindings/eeprom/at24.yaml | 2 ++
 1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/eeprom/at24.yaml +2 -0
index 98139489d4b5c..7be127e9b2507 100644
@@ -67,6 +67,8 @@ properties:
                   pattern: cs16$
               - items:
                   pattern: c32$
+              - items:
+                  pattern: c32d-wl$
               - items:
                   pattern: cs32$
               - items:
Signature · 1 line
2.40.1
#1 lore raw

PATCH 2/2 eeprom: at24: add ST M24C32-D Additional Write lockable page support

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. Add entry 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.

---
Cc: Arnd Bergmann <[email protected]>
Cc: Bartosz Golaszewski <[email protected]>
Cc: Conor Dooley <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: Krzysztof Kozlowski <[email protected]>
Cc: Rob Herring <[email protected]>
Cc: [email protected]
Cc: [email protected]

---
 drivers/misc/eeprom/at24.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/misc/eeprom/at24.c +4 -0
index 7dfd7fdb423e6..616e63efc9864 100644
@@ -191,6 +191,8 @@ AT24_CHIP_DATA(at24_data_24c16, 16384 / 8, 0);
 AT24_CHIP_DATA(at24_data_24cs16, 16,
 	AT24_FLAG_SERIAL | AT24_FLAG_READONLY);
 AT24_CHIP_DATA(at24_data_24c32, 32768 / 8, AT24_FLAG_ADDR16);
+/* M24C32-D Additional Write lockable page (M24C32-D order codes) */
+AT24_CHIP_DATA(at24_data_24c32d_wlp, 32, AT24_FLAG_ADDR16);
 AT24_CHIP_DATA(at24_data_24cs32, 16,
 	AT24_FLAG_ADDR16 | AT24_FLAG_SERIAL | AT24_FLAG_READONLY);
 AT24_CHIP_DATA(at24_data_24c64, 65536 / 8, AT24_FLAG_ADDR16);
@@ -222,6 +224,7 @@ static const struct i2c_device_id at24_ids[] = {
 	{ "24c16",	(kernel_ulong_t)&at24_data_24c16 },
 	{ "24cs16",	(kernel_ulong_t)&at24_data_24cs16 },
 	{ "24c32",	(kernel_ulong_t)&at24_data_24c32 },
+	{ "24c32d-wl",	(kernel_ulong_t)&at24_data_24c32d_wlp },
 	{ "24cs32",	(kernel_ulong_t)&at24_data_24cs32 },
 	{ "24c64",	(kernel_ulong_t)&at24_data_24c64 },
 	{ "24cs64",	(kernel_ulong_t)&at24_data_24cs64 },
@@ -252,6 +255,7 @@ static const struct of_device_id at24_of_match[] = {
 	{ .compatible = "atmel,24c16",		.data = &at24_data_24c16 },
 	{ .compatible = "atmel,24cs16",		.data = &at24_data_24cs16 },
 	{ .compatible = "atmel,24c32",		.data = &at24_data_24c32 },
+	{ .compatible = "atmel,24c32d-wl",	.data = &at24_data_24c32d_wlp },
 	{ .compatible = "atmel,24cs32",		.data = &at24_data_24cs32 },
 	{ .compatible = "atmel,24c64",		.data = &at24_data_24c64 },
 	{ .compatible = "atmel,24cs64",		.data = &at24_data_24cs64 },
Signature · 1 line
2.40.1
#2 lore raw

Re: [PATCH 2/2] eeprom: at24: add ST M24C32-D Additional Write lockable page support

Quoted 10 lines · Marek Vasut

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. Add entry 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.

---

Applied, thanks!

Bart

Acked-by on v1 1/2
#3 lore raw
In reply to Marek Vasut
Quoted 8 lines · Marek Vasut

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.

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.

Quoted 29 lines

---
Cc: Arnd Bergmann <[email protected]>
Cc: Bartosz Golaszewski <[email protected]>
Cc: Conor Dooley <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: Krzysztof Kozlowski <[email protected]>
Cc: Rob Herring <[email protected]>
Cc: [email protected]
Cc: [email protected]

---
 Documentation/devicetree/bindings/eeprom/at24.yaml | 2 ++
 1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/eeprom/at24.yaml +2 -0
index 98139489d4b5c..7be127e9b2507 100644
@@ -67,6 +67,8 @@ properties:
                   pattern: cs16$
               - items:
                   pattern: c32$
+              - items:
+                  pattern: c32d-wl$
               - items:
                   pattern: cs32$
               - items:
Signature · 1 line
2.40.1
#4 lore raw
Quoted 9 lines · Conor Dooley
Quoted 7 lines · Marek Vasut

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.

Quoted 7 lines
Quoted 1 line

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.

It isn't actually. :(

Thanks for the heads-up, I'll send a patch for .mailmap.

Bartosz

Quoted 32 lines

Thanks,
Conor.

Quoted 29 lines

---
Cc: Arnd Bergmann <[email protected]>
Cc: Bartosz Golaszewski <[email protected]>
Cc: Conor Dooley <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: Krzysztof Kozlowski <[email protected]>
Cc: Rob Herring <[email protected]>
Cc: [email protected]
Cc: [email protected]

---
 Documentation/devicetree/bindings/eeprom/at24.yaml | 2 ++
 1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/eeprom/at24.yaml +2 -1
index 98139489d4b5c..7be127e9b2507 100644
@@ -67,6 +67,8 @@ properties:
                   pattern: cs16$
               - items:
                   pattern: c32$
+              - items:
+                  pattern: c32d-wl$
               - items:
                   pattern: cs32$
               - items:
--

2.40.1

#5 lore raw
In reply to Marek Vasut
Quoted 36 lines · Marek Vasut

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.

---
Cc: Arnd Bergmann <[email protected]>
Cc: Bartosz Golaszewski <[email protected]>
Cc: Conor Dooley <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: Krzysztof Kozlowski <[email protected]>
Cc: Rob Herring <[email protected]>
Cc: [email protected]
Cc: [email protected]

---
 Documentation/devicetree/bindings/eeprom/at24.yaml | 2 ++
 1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/eeprom/at24.yaml +2 -1
index 98139489d4b5c..7be127e9b2507 100644
@@ -67,6 +67,8 @@ properties:
                   pattern: cs16$
               - items:
                   pattern: c32$
+              - items:
+                  pattern: c32d-wl$
               - items:
                   pattern: cs32$
               - items:
--
Quoted 2 lines

2.40.1

Applied, thanks!

Bart

maintainer
#6 lore raw
In reply to Marek Vasut
Quoted 6 lines · Marek Vasut

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?

Quoted 31 lines

---
Cc: Arnd Bergmann <[email protected]>
Cc: Bartosz Golaszewski <[email protected]>
Cc: Conor Dooley <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: Krzysztof Kozlowski <[email protected]>
Cc: Rob Herring <[email protected]>
Cc: [email protected]
Cc: [email protected]

---
 Documentation/devicetree/bindings/eeprom/at24.yaml | 2 ++
 1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/eeprom/at24.yaml +2 -0
index 98139489d4b5c..7be127e9b2507 100644
@@ -67,6 +67,8 @@ properties:
                   pattern: cs16$
               - items:
                   pattern: c32$
+              - items:
+                  pattern: c32d-wl$
               - items:
                   pattern: cs32$
               - items:
Signature · 1 line
2.40.1
#7 lore raw
Quoted 10 lines · Rob Herring
Quoted 6 lines · Marek Vasut

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.

#8 lore raw
In reply to Rob Herring
Quoted 9 lines · Rob Herring
Quoted 6 lines · Marek Vasut

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.

Quoted 3 lines

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/[email protected]/

Quoted 31 lines
Quoted 31 lines

---
Cc: Arnd Bergmann <[email protected]>
Cc: Bartosz Golaszewski <[email protected]>
Cc: Conor Dooley <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: Krzysztof Kozlowski <[email protected]>
Cc: Rob Herring <[email protected]>
Cc: [email protected]
Cc: [email protected]

---
 Documentation/devicetree/bindings/eeprom/at24.yaml | 2 ++
 1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/eeprom/at24.yaml +2 -1
index 98139489d4b5c..7be127e9b2507 100644
@@ -67,6 +67,8 @@ properties:
                   pattern: cs16$
               - items:
                   pattern: c32$
+              - items:
+                  pattern: c32d-wl$
               - items:
                   pattern: cs32$
               - items:
--

2.40.1