2020-09-16 20:36:51

by Vadym Kochan

[permalink] [raw]
Subject: [PATCH 0/3] misc: eeprom: set type id as EEPROM for nvmem devices

Set type as NVMEM_TYPE_EEPROM to expose this info via
sysfs:

$ cat /sys/bus/nvmem/devices/0-00560/type
EEPROM

Tested only with at24 device.

Vadym Kochan (3):
eeprom: at24: set type id as EEPROM
eeprom: at25: set type id as EEPROM
eeprom: 93xx46: set type id as EEPROM

drivers/misc/eeprom/at24.c | 1 +
drivers/misc/eeprom/at25.c | 1 +
drivers/misc/eeprom/eeprom_93xx46.c | 1 +
3 files changed, 3 insertions(+)

--
2.17.1


2020-09-16 20:40:18

by Vadym Kochan

[permalink] [raw]
Subject: [PATCH 1/3] eeprom: at24: set type id as EEPROM

Set type as NVMEM_TYPE_EEPROM to expose this info via
sysfs:

$ cat /sys/bus/nvmem/devices/{DEVICE}/type
EEPROM

Signed-off-by: Vadym Kochan <[email protected]>
---
drivers/misc/eeprom/at24.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/misc/eeprom/at24.c b/drivers/misc/eeprom/at24.c
index 2591c21b2b5d..800300296c74 100644
--- a/drivers/misc/eeprom/at24.c
+++ b/drivers/misc/eeprom/at24.c
@@ -678,6 +678,7 @@ static int at24_probe(struct i2c_client *client)
return err;
}

+ nvmem_config.type = NVMEM_TYPE_EEPROM;
nvmem_config.name = dev_name(dev);
nvmem_config.dev = dev;
nvmem_config.read_only = !writable;
--
2.17.1

2020-09-17 08:11:01

by Bartosz Golaszewski

[permalink] [raw]
Subject: Re: [PATCH 1/3] eeprom: at24: set type id as EEPROM

On Wed, Sep 16, 2020 at 7:10 PM Vadym Kochan <[email protected]> wrote:
>
> Set type as NVMEM_TYPE_EEPROM to expose this info via
> sysfs:
>
> $ cat /sys/bus/nvmem/devices/{DEVICE}/type
> EEPROM
>
> Signed-off-by: Vadym Kochan <[email protected]>
> ---
> drivers/misc/eeprom/at24.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/misc/eeprom/at24.c b/drivers/misc/eeprom/at24.c
> index 2591c21b2b5d..800300296c74 100644
> --- a/drivers/misc/eeprom/at24.c
> +++ b/drivers/misc/eeprom/at24.c
> @@ -678,6 +678,7 @@ static int at24_probe(struct i2c_client *client)
> return err;
> }
>
> + nvmem_config.type = NVMEM_TYPE_EEPROM;
> nvmem_config.name = dev_name(dev);
> nvmem_config.dev = dev;
> nvmem_config.read_only = !writable;
> --
> 2.17.1
>

Queued for v5.10, thanks!

Bartosz