From 818d0220d857cc92cb37600758c5b47c3df3782b Mon Sep 17 00:00:00 2001 From: Bartosz Golaszewski Date: Mon, 6 Jun 2016 10:48:51 +0200 Subject: eeprom: at24: support reading the serial number for 24csxx The chips from the at24cs family have two memory areas - a regular read-write block and a read-only area containing the serial number. The latter is visible on a different slave address (the address of the rw memory block + 0x08). In order to access both blocks the user needs to instantiate a regular at24c device for the rw block address and a corresponding at24cs device on the serial number block address. Add a function that allows to access the serial number and assign it to at24->read_func if the chip allows serial number read operations and the driver was passed the relevant flag for this device. Signed-off-by: Bartosz Golaszewski Signed-off-by: Wolfram Sang --- include/linux/platform_data/at24.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/linux/platform_data') diff --git a/include/linux/platform_data/at24.h b/include/linux/platform_data/at24.h index fcfdfe3c0e9c..d59587473aed 100644 --- a/include/linux/platform_data/at24.h +++ b/include/linux/platform_data/at24.h @@ -48,6 +48,7 @@ struct at24_platform_data { #define AT24_FLAG_READONLY BIT(6) /* sysfs-entry will be read-only */ #define AT24_FLAG_IRUGO BIT(5) /* sysfs-entry will be world-readable */ #define AT24_FLAG_TAKE8ADDR BIT(4) /* take always 8 addresses (24c00) */ +#define AT24_FLAG_SERIAL BIT(3) /* factory-programmed serial number */ void (*setup)(struct nvmem_device *nvmem, void *context); void *context; -- cgit v1.2.3