Re: [PATCH V2] eeprom: at24: support second page of M24M01

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2018-01-30 17:50 GMT+01:00 Johannes Poehlmann <johannes.poehlmann@xxxxxxxxxxx>:
> The M24M01-D* eeproms are in effect 2 eeproms under 2 I2C addresses:
>
> 1. a standard 1Mbit eeprom (driver model 24c1024 is working)
>
> 2. a 256 Byte "ID page" that is a write lockable page.
>    As the ID page demands 2 byte addresses, the 24c02 driver model
>    can not be used.
>
> I was thinking about not to pollute the name space of chip names
> with a made up name that is not the name of a real chip.
>
> I would propose to name it "24cb02", thus making clear
> that we have a kind of 24c02 but with 2 byte address.
> (The "b" ist meant to say this)

If anything, this is just super confusing.

>
> Signed-off-by: Johannes Poehlmann <Johannes.Poehlmann@xxxxxxxxxxx>
> ---
>  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 4d63ac8..debc8e3 100644
> --- a/drivers/misc/eeprom/at24.c
> +++ b/drivers/misc/eeprom/at24.c
> @@ -139,6 +139,7 @@ static const struct i2c_device_id at24_ids[] = {
>         { "24cs01",     AT24_DEVICE_MAGIC(16,
>                                 AT24_FLAG_SERIAL | AT24_FLAG_READONLY) },
>         { "24c02",      AT24_DEVICE_MAGIC(2048 / 8,     0) },
> +       { "24cb02",     AT24_DEVICE_MAGIC(2048 / 8,     AT24_FLAG_ADDR16) },

Please add the device tree support as well.

>         { "24cs02",     AT24_DEVICE_MAGIC(16,
>                                 AT24_FLAG_SERIAL | AT24_FLAG_READONLY) },
>         { "24mac402",   AT24_DEVICE_MAGIC(48 / 8,
> --
> 2.1.4
>

Take a look at what we do with at24cs* and at24mac* models: at24cs32
stands for the serial number block, while for the regular memory area
we use at24c32.

Analogously in your case: the 'regular' memory block of this EEPROM is
compatible with 'atmel,24c1024', so this is the compatible you'll use
to access it. For the write-lockable page, it's OK to use
'atmel,24cm01'.

Best regards,
Bartosz Golaszewski



[Index of Archives]     [Linux GPIO]     [Linux SPI]     [Linux Hardward Monitoring]     [LM Sensors]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux