2017-12-27 13:51:11

by Bartosz Golaszewski

[permalink] [raw]
Subject: [PATCH v3 0/5] eeprom: at24: device tree support fixes

The first three patches fix certain issues with the DT binding
document.

The last two extend the device tree support in the driver with more
at24 EEPROM variants.

v1 -> v2:
- remove any implementation details from patch 1/5

v2 -> v3:
- reword patch 1/5: allow any "<manufacturer>,<vendor>" pair as long
as a supported fallback is used

Bartosz Golaszewski (5):
dt-bindings: at24: consistently document the compatible property
dt-bindings: at24: add a missing compatible
dt-bindings: at24: fix formatting and style
dt-bindings: at24: extend the list of supported chips
eeprom: at24: extend the list of chips supported in DT

Documentation/devicetree/bindings/eeprom/at24.txt | 71 ++++++++++++-----------
drivers/misc/eeprom/at24.c | 9 +++
2 files changed, 46 insertions(+), 34 deletions(-)

--
2.15.1


2017-12-27 13:51:16

by Bartosz Golaszewski

[permalink] [raw]
Subject: [PATCH v3 3/5] dt-bindings: at24: fix formatting and style

Make formatting and style consistent for the entire document.

This patch doesn't change the content of the binding.

Signed-off-by: Bartosz Golaszewski <[email protected]>
Reviewed-by: Javier Martinez Canillas <[email protected]>
---
Documentation/devicetree/bindings/eeprom/at24.txt | 24 +++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/Documentation/devicetree/bindings/eeprom/at24.txt b/Documentation/devicetree/bindings/eeprom/at24.txt
index 487e1005036c..7d4dc264b3cc 100644
--- a/Documentation/devicetree/bindings/eeprom/at24.txt
+++ b/Documentation/devicetree/bindings/eeprom/at24.txt
@@ -2,7 +2,7 @@ EEPROMs (I2C)

Required properties:

- - compatible: must be a "<manufacturer>,<model>" pair with one of the
+ - compatible: Must be a "<manufacturer>,<model>" pair with one of the
following values as fallback:

"atmel,24c00",
@@ -19,23 +19,23 @@ Required properties:
"atmel,24c512",
"atmel,24c1024"

- - reg : the I2C address of the EEPROM
+ - reg: The I2C address of the EEPROM.

Optional properties:

- - pagesize : the length of the pagesize for writing. Please consult the
- manual of your device, that value varies a lot. A wrong value
- may result in data loss! If not specified, a safety value of
- '1' is used which will be very slow.
+ - pagesize: The length of the pagesize for writing. Please consult the
+ manual of your device, that value varies a lot. A wrong value
+ may result in data loss! If not specified, a safety value of
+ '1' is used which will be very slow.

- - read-only: this parameterless property disables writes to the eeprom
+ - read-only: This parameterless property disables writes to the eeprom.

- - size: total eeprom size in bytes
+ - size: Total eeprom size in bytes.

- - no-read-rollover:
- This parameterless property indicates that the multi-address
- eeprom does not automatically roll over reads to the next
- slave address. Please consult the manual of your device.
+ - no-read-rollover: This parameterless property indicates that the
+ multi-address eeprom does not automatically roll over
+ reads to the next slave address. Please consult the
+ manual of your device.

- wp-gpios: GPIO to which the write-protect pin of the chip is connected.

--
2.15.1

2017-12-27 13:51:29

by Bartosz Golaszewski

[permalink] [raw]
Subject: [PATCH v3 5/5] eeprom: at24: extend the list of chips supported in DT

Add all supported at24 variants to the of_match table.

Signed-off-by: Bartosz Golaszewski <[email protected]>
Reviewed-by: Javier Martinez Canillas <[email protected]>
---
drivers/misc/eeprom/at24.c | 9 +++++++++
1 file changed, 9 insertions(+)

diff --git a/drivers/misc/eeprom/at24.c b/drivers/misc/eeprom/at24.c
index e79833d62284..01f9c4921c50 100644
--- a/drivers/misc/eeprom/at24.c
+++ b/drivers/misc/eeprom/at24.c
@@ -209,13 +209,22 @@ MODULE_DEVICE_TABLE(i2c, at24_ids);
static const struct of_device_id at24_of_match[] = {
{ .compatible = "atmel,24c00", .data = &at24_data_24c00 },
{ .compatible = "atmel,24c01", .data = &at24_data_24c01 },
+ { .compatible = "atmel,24cs01", .data = &at24_data_24cs01 },
{ .compatible = "atmel,24c02", .data = &at24_data_24c02 },
+ { .compatible = "atmel,24cs02", .data = &at24_data_24cs02 },
+ { .compatible = "atmel,24mac402", .data = &at24_data_24mac402 },
+ { .compatible = "atmel,24mac602", .data = &at24_data_24mac602 },
{ .compatible = "atmel,spd", .data = &at24_data_spd },
{ .compatible = "atmel,24c04", .data = &at24_data_24c04 },
+ { .compatible = "atmel,24cs04", .data = &at24_data_24cs04 },
{ .compatible = "atmel,24c08", .data = &at24_data_24c08 },
+ { .compatible = "atmel,24cs08", .data = &at24_data_24cs08 },
{ .compatible = "atmel,24c16", .data = &at24_data_24c16 },
+ { .compatible = "atmel,24cs16", .data = &at24_data_24cs16 },
{ .compatible = "atmel,24c32", .data = &at24_data_24c32 },
+ { .compatible = "atmel,24cs32", .data = &at24_data_24cs32 },
{ .compatible = "atmel,24c64", .data = &at24_data_24c64 },
+ { .compatible = "atmel,24cs64", .data = &at24_data_24cs64 },
{ .compatible = "atmel,24c128", .data = &at24_data_24c128 },
{ .compatible = "atmel,24c256", .data = &at24_data_24c256 },
{ .compatible = "atmel,24c512", .data = &at24_data_24c512 },
--
2.15.1

2017-12-27 13:51:45

by Bartosz Golaszewski

[permalink] [raw]
Subject: [PATCH v3 4/5] dt-bindings: at24: extend the list of supported chips

Add other variants of at24 EEPROMs we support in the driver to the
list of allowed compatible fallbacks.

Signed-off-by: Bartosz Golaszewski <[email protected]>
Reviewed-by: Javier Martinez Canillas <[email protected]>
---
Documentation/devicetree/bindings/eeprom/at24.txt | 9 +++++++++
1 file changed, 9 insertions(+)

diff --git a/Documentation/devicetree/bindings/eeprom/at24.txt b/Documentation/devicetree/bindings/eeprom/at24.txt
index 7d4dc264b3cc..7b01fa020ae4 100644
--- a/Documentation/devicetree/bindings/eeprom/at24.txt
+++ b/Documentation/devicetree/bindings/eeprom/at24.txt
@@ -7,13 +7,22 @@ Required properties:

"atmel,24c00",
"atmel,24c01",
+ "atmel,24cs01",
"atmel,24c02",
+ "atmel,24cs02",
+ "atmel,24mac402",
+ "atmel,24mac602",
"atmel,spd",
"atmel,24c04",
+ "atmel,24cs04",
"atmel,24c08",
+ "atmel,24cs08",
"atmel,24c16",
+ "atmel,24cs16",
"atmel,24c32",
+ "atmel,24cs32",
"atmel,24c64",
+ "atmel,24cs64",
"atmel,24c128",
"atmel,24c256",
"atmel,24c512",
--
2.15.1

2017-12-27 13:52:12

by Bartosz Golaszewski

[permalink] [raw]
Subject: [PATCH v3 1/5] dt-bindings: at24: consistently document the compatible property

Current description of the compatible property for at24 is quite vague.

State explicitly that any "<manufacturer>,<model>" pair is accepted as
long as one of the listed strings is used as fallback.

Signed-off-by: Bartosz Golaszewski <[email protected]>
---
Documentation/devicetree/bindings/eeprom/at24.txt | 37 +++++++++--------------
1 file changed, 15 insertions(+), 22 deletions(-)

diff --git a/Documentation/devicetree/bindings/eeprom/at24.txt b/Documentation/devicetree/bindings/eeprom/at24.txt
index cbc80e194ac6..b5ce5a247554 100644
--- a/Documentation/devicetree/bindings/eeprom/at24.txt
+++ b/Documentation/devicetree/bindings/eeprom/at24.txt
@@ -2,28 +2,21 @@ EEPROMs (I2C)

Required properties:

- - compatible : should be "<manufacturer>,<type>", like these:
-
- "atmel,24c00", "atmel,24c01", "atmel,24c02", "atmel,24c04",
- "atmel,24c08", "atmel,24c16", "atmel,24c32", "atmel,24c64",
- "atmel,24c128", "atmel,24c256", "atmel,24c512", "atmel,24c1024"
-
- "catalyst,24c32"
-
- "microchip,24c128"
-
- "ramtron,24c64"
-
- "renesas,r1ex24002"
-
- The following manufacturers values have been deprecated:
- "at", "at24"
-
- If there is no specific driver for <manufacturer>, a generic
- device with <type> and manufacturer "atmel" should be used.
- Possible types are:
- "24c00", "24c01", "24c02", "24c04", "24c08", "24c16", "24c32", "24c64",
- "24c128", "24c256", "24c512", "24c1024", "spd"
+ - compatible: must be a "<manufacturer>,<model>" pair with one of the
+ following values as fallback:
+
+ "atmel,24c00",
+ "atmel,24c01",
+ "atmel,24c02",
+ "atmel,24c04",
+ "atmel,24c08",
+ "atmel,24c16",
+ "atmel,24c32",
+ "atmel,24c64",
+ "atmel,24c128",
+ "atmel,24c256",
+ "atmel,24c512",
+ "atmel,24c1024"

- reg : the I2C address of the EEPROM

--
2.15.1

2017-12-27 13:52:10

by Bartosz Golaszewski

[permalink] [raw]
Subject: [PATCH v3 2/5] dt-bindings: at24: add a missing compatible

"atmel,spd" is reported by checkpatch as undocumented in the device
tree bindings. Add it to the list of supported compatible fallbacks.

Signed-off-by: Bartosz Golaszewski <[email protected]>
Reviewed-by: Javier Martinez Canillas <[email protected]>
---
Documentation/devicetree/bindings/eeprom/at24.txt | 1 +
1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/eeprom/at24.txt b/Documentation/devicetree/bindings/eeprom/at24.txt
index b5ce5a247554..487e1005036c 100644
--- a/Documentation/devicetree/bindings/eeprom/at24.txt
+++ b/Documentation/devicetree/bindings/eeprom/at24.txt
@@ -8,6 +8,7 @@ Required properties:
"atmel,24c00",
"atmel,24c01",
"atmel,24c02",
+ "atmel,spd",
"atmel,24c04",
"atmel,24c08",
"atmel,24c16",
--
2.15.1

2017-12-27 17:21:46

by Rob Herring

[permalink] [raw]
Subject: Re: [PATCH v3 1/5] dt-bindings: at24: consistently document the compatible property

On Wed, Dec 27, 2017 at 7:50 AM, Bartosz Golaszewski <[email protected]> wrote:
> Current description of the compatible property for at24 is quite vague.
>
> State explicitly that any "<manufacturer>,<model>" pair is accepted as
> long as one of the listed strings is used as fallback.
>
> Signed-off-by: Bartosz Golaszewski <[email protected]>
> ---
> Documentation/devicetree/bindings/eeprom/at24.txt | 37 +++++++++--------------
> 1 file changed, 15 insertions(+), 22 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/eeprom/at24.txt b/Documentation/devicetree/bindings/eeprom/at24.txt
> index cbc80e194ac6..b5ce5a247554 100644
> --- a/Documentation/devicetree/bindings/eeprom/at24.txt
> +++ b/Documentation/devicetree/bindings/eeprom/at24.txt
> @@ -2,28 +2,21 @@ EEPROMs (I2C)
>
> Required properties:
>
> - - compatible : should be "<manufacturer>,<type>", like these:
> -
> - "atmel,24c00", "atmel,24c01", "atmel,24c02", "atmel,24c04",
> - "atmel,24c08", "atmel,24c16", "atmel,24c32", "atmel,24c64",
> - "atmel,24c128", "atmel,24c256", "atmel,24c512", "atmel,24c1024"
> -
> - "catalyst,24c32"
> -
> - "microchip,24c128"
> -
> - "ramtron,24c64"
> -
> - "renesas,r1ex24002"

Keep this and any others that don't have an atmel model. This should
probably also state what the fallback should be (atmel,24c02 ?).

> -
> - The following manufacturers values have been deprecated:
> - "at", "at24"
> -
> - If there is no specific driver for <manufacturer>, a generic
> - device with <type> and manufacturer "atmel" should be used.
> - Possible types are:
> - "24c00", "24c01", "24c02", "24c04", "24c08", "24c16", "24c32", "24c64",
> - "24c128", "24c256", "24c512", "24c1024", "spd"

You remove "spd" here and add it back later. Just fold that in below.
I'll leave it to others to bikeshed where in the list.

> + - compatible: must be a "<manufacturer>,<model>" pair with one of the

We should enumerate known vendors/manufacturers because something like
"linaro,24c00" is not valid.

> + following values as fallback:
> +
> + "atmel,24c00",
> + "atmel,24c01",
> + "atmel,24c02",
> + "atmel,24c04",
> + "atmel,24c08",
> + "atmel,24c16",
> + "atmel,24c32",
> + "atmel,24c64",
> + "atmel,24c128",
> + "atmel,24c256",
> + "atmel,24c512",
> + "atmel,24c1024"
>
> - reg : the I2C address of the EEPROM
>
> --
> 2.15.1
>

2017-12-27 17:24:25

by Rob Herring

[permalink] [raw]
Subject: Re: [PATCH v3 1/5] dt-bindings: at24: consistently document the compatible property

On Wed, Dec 27, 2017 at 7:50 AM, Bartosz Golaszewski <[email protected]> wrote:
> Current description of the compatible property for at24 is quite vague.
>
> State explicitly that any "<manufacturer>,<model>" pair is accepted as
> long as one of the listed strings is used as fallback.
>
> Signed-off-by: Bartosz Golaszewski <[email protected]>
> ---
> Documentation/devicetree/bindings/eeprom/at24.txt | 37 +++++++++--------------
> 1 file changed, 15 insertions(+), 22 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/eeprom/at24.txt b/Documentation/devicetree/bindings/eeprom/at24.txt
> index cbc80e194ac6..b5ce5a247554 100644
> --- a/Documentation/devicetree/bindings/eeprom/at24.txt
> +++ b/Documentation/devicetree/bindings/eeprom/at24.txt
> @@ -2,28 +2,21 @@ EEPROMs (I2C)
>
> Required properties:
>
> - - compatible : should be "<manufacturer>,<type>", like these:
> -
> - "atmel,24c00", "atmel,24c01", "atmel,24c02", "atmel,24c04",
> - "atmel,24c08", "atmel,24c16", "atmel,24c32", "atmel,24c64",
> - "atmel,24c128", "atmel,24c256", "atmel,24c512", "atmel,24c1024"
> -
> - "catalyst,24c32"
> -
> - "microchip,24c128"
> -
> - "ramtron,24c64"
> -
> - "renesas,r1ex24002"
> -
> - The following manufacturers values have been deprecated:
> - "at", "at24"
> -
> - If there is no specific driver for <manufacturer>, a generic
> - device with <type> and manufacturer "atmel" should be used.
> - Possible types are:
> - "24c00", "24c01", "24c02", "24c04", "24c08", "24c16", "24c32", "24c64",
> - "24c128", "24c256", "24c512", "24c1024", "spd"
> + - compatible: must be a "<manufacturer>,<model>" pair with one of the

Also, why do you add "must" here and then fix it with "Must" in patch
3? Just get it right here.

Rob

2017-12-27 22:03:10

by Peter Rosin

[permalink] [raw]
Subject: Re: [PATCH v3 1/5] dt-bindings: at24: consistently document the compatible property

On 2017-12-27 14:50, Bartosz Golaszewski wrote:
> Current description of the compatible property for at24 is quite vague.
>
> State explicitly that any "<manufacturer>,<model>" pair is accepted as
> long as one of the listed strings is used as fallback.
>
> Signed-off-by: Bartosz Golaszewski <[email protected]>
> ---
> Documentation/devicetree/bindings/eeprom/at24.txt | 37 +++++++++--------------
> 1 file changed, 15 insertions(+), 22 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/eeprom/at24.txt b/Documentation/devicetree/bindings/eeprom/at24.txt
> index cbc80e194ac6..b5ce5a247554 100644
> --- a/Documentation/devicetree/bindings/eeprom/at24.txt
> +++ b/Documentation/devicetree/bindings/eeprom/at24.txt
> @@ -2,28 +2,21 @@ EEPROMs (I2C)
>
> Required properties:
>
> - - compatible : should be "<manufacturer>,<type>", like these:
> -
> - "atmel,24c00", "atmel,24c01", "atmel,24c02", "atmel,24c04",
> - "atmel,24c08", "atmel,24c16", "atmel,24c32", "atmel,24c64",
> - "atmel,24c128", "atmel,24c256", "atmel,24c512", "atmel,24c1024"
> -
> - "catalyst,24c32"
> -
> - "microchip,24c128"
> -
> - "ramtron,24c64"
> -
> - "renesas,r1ex24002"
> -
> - The following manufacturers values have been deprecated:
> - "at", "at24"
> -
> - If there is no specific driver for <manufacturer>, a generic
> - device with <type> and manufacturer "atmel" should be used.
> - Possible types are:
> - "24c00", "24c01", "24c02", "24c04", "24c08", "24c16", "24c32", "24c64",
> - "24c128", "24c256", "24c512", "24c1024", "spd"
> + - compatible: must be a "<manufacturer>,<model>" pair with one of the
> + following values as fallback:
> +
> + "atmel,24c00",
> + "atmel,24c01",

I read the above as if it is no longer allowed to have a plain old atmel
chip, since the atmel compatibles are now valid as fallbacks /only/. I don't
think that's what you intended?

Cheers,
Peter

> + "atmel,24c02",
> + "atmel,24c04",
> + "atmel,24c08",
> + "atmel,24c16",
> + "atmel,24c32",
> + "atmel,24c64",
> + "atmel,24c128",
> + "atmel,24c256",
> + "atmel,24c512",
> + "atmel,24c1024"
>
> - reg : the I2C address of the EEPROM
>
>