diff options
author | Kevin Hilman <khilman@deeprootsystems.com> | 2009-04-02 19:56:57 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-04-02 22:04:50 -0400 |
commit | 7274ec8bd71e99018642f474528ea7de4bb3ae25 (patch) | |
tree | 3c2e719f696292afa0717f7111d174bdfc073f27 /include/linux/i2c/at24.h | |
parent | 06c421ee0d5af95c8c6749ca0ba620cd5010707f (diff) |
memory_accessor: implement the new memory_accessor interface for I2C EEPROM
In the case of at24, the platform code registers a 'setup' callback with
the at24_platform_data. When the at24 driver detects an EEPROM, it fills
out the read and write functions of the memory_accessor and calls the
setup callback passing the memory_accessor struct. The platform code can
then use the read/write functions in the memory_accessor struct for
reading and writing the EEPROM.
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Cc: David Brownell <dbrownell@users.sourceforge.net>
Cc: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/i2c/at24.h')
-rw-r--r-- | include/linux/i2c/at24.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/i2c/at24.h b/include/linux/i2c/at24.h index f6edd522a929..8ace93024d60 100644 --- a/include/linux/i2c/at24.h +++ b/include/linux/i2c/at24.h | |||
@@ -2,6 +2,7 @@ | |||
2 | #define _LINUX_AT24_H | 2 | #define _LINUX_AT24_H |
3 | 3 | ||
4 | #include <linux/types.h> | 4 | #include <linux/types.h> |
5 | #include <linux/memory.h> | ||
5 | 6 | ||
6 | /* | 7 | /* |
7 | * As seen through Linux I2C, differences between the most common types of I2C | 8 | * As seen through Linux I2C, differences between the most common types of I2C |
@@ -23,6 +24,9 @@ struct at24_platform_data { | |||
23 | #define AT24_FLAG_READONLY 0x40 /* sysfs-entry will be read-only */ | 24 | #define AT24_FLAG_READONLY 0x40 /* sysfs-entry will be read-only */ |
24 | #define AT24_FLAG_IRUGO 0x20 /* sysfs-entry will be world-readable */ | 25 | #define AT24_FLAG_IRUGO 0x20 /* sysfs-entry will be world-readable */ |
25 | #define AT24_FLAG_TAKE8ADDR 0x10 /* take always 8 addresses (24c00) */ | 26 | #define AT24_FLAG_TAKE8ADDR 0x10 /* take always 8 addresses (24c00) */ |
27 | |||
28 | void (*setup)(struct memory_accessor *, void *context); | ||
29 | void *context; | ||
26 | }; | 30 | }; |
27 | 31 | ||
28 | #endif /* _LINUX_AT24_H */ | 32 | #endif /* _LINUX_AT24_H */ |