diff options
| author | Wolfram Sang <wsa@the-dreams.de> | 2019-02-14 12:03:21 -0500 |
|---|---|---|
| committer | Wolfram Sang <wsa@the-dreams.de> | 2019-02-14 12:03:21 -0500 |
| commit | bceb26bffebf4c8f167787eb87b6a858d991e48e (patch) | |
| tree | 15c226de65a290bf897e9915b54a6bc920ae979a /include/linux/platform_data | |
| parent | d8434c31378d5f2009741fa171bd1143c77a6e4a (diff) | |
| parent | 950bcbbe31548636d24e49b3abaf3780204f7fe8 (diff) | |
Merge tag 'at24-5.1-updates-for-wolfram' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux into i2c/for-5.1
at24 updates for v5.1
- finally remove legacy platform data as all users have been switched
to using device properties and nvmem notifier chain
- add support for the 'num-addresses' property
Diffstat (limited to 'include/linux/platform_data')
| -rw-r--r-- | include/linux/platform_data/at24.h | 60 |
1 files changed, 0 insertions, 60 deletions
diff --git a/include/linux/platform_data/at24.h b/include/linux/platform_data/at24.h deleted file mode 100644 index 63507ff464ee..000000000000 --- a/include/linux/platform_data/at24.h +++ /dev/null | |||
| @@ -1,60 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * at24.h - platform_data for the at24 (generic eeprom) driver | ||
| 3 | * (C) Copyright 2008 by Pengutronix | ||
| 4 | * (C) Copyright 2012 by Wolfram Sang | ||
| 5 | * same license as the driver | ||
| 6 | */ | ||
| 7 | |||
| 8 | #ifndef _LINUX_AT24_H | ||
| 9 | #define _LINUX_AT24_H | ||
| 10 | |||
| 11 | #include <linux/types.h> | ||
| 12 | #include <linux/nvmem-consumer.h> | ||
| 13 | #include <linux/bitops.h> | ||
| 14 | |||
| 15 | /** | ||
| 16 | * struct at24_platform_data - data to set up at24 (generic eeprom) driver | ||
| 17 | * @byte_len: size of eeprom in byte | ||
| 18 | * @page_size: number of byte which can be written in one go | ||
| 19 | * @flags: tunable options, check AT24_FLAG_* defines | ||
| 20 | * @setup: an optional callback invoked after eeprom is probed; enables kernel | ||
| 21 | code to access eeprom via nvmem, see example | ||
| 22 | * @context: optional parameter passed to setup() | ||
| 23 | * | ||
| 24 | * If you set up a custom eeprom type, please double-check the parameters. | ||
| 25 | * Especially page_size needs extra care, as you risk data loss if your value | ||
| 26 | * is bigger than what the chip actually supports! | ||
| 27 | * | ||
| 28 | * An example in pseudo code for a setup() callback: | ||
| 29 | * | ||
| 30 | * void get_mac_addr(struct nvmem_device *nvmem, void *context) | ||
| 31 | * { | ||
| 32 | * u8 *mac_addr = ethernet_pdata->mac_addr; | ||
| 33 | * off_t offset = context; | ||
| 34 | * | ||
| 35 | * // Read MAC addr from EEPROM | ||
| 36 | * if (nvmem_device_read(nvmem, offset, ETH_ALEN, mac_addr) == ETH_ALEN) | ||
| 37 | * pr_info("Read MAC addr from EEPROM: %pM\n", mac_addr); | ||
| 38 | * } | ||
| 39 | * | ||
| 40 | * This function pointer and context can now be set up in at24_platform_data. | ||
| 41 | */ | ||
| 42 | |||
| 43 | struct at24_platform_data { | ||
| 44 | u32 byte_len; /* size (sum of all addr) */ | ||
| 45 | u16 page_size; /* for writes */ | ||
| 46 | u8 flags; | ||
| 47 | #define AT24_FLAG_ADDR16 BIT(7) /* address pointer is 16 bit */ | ||
| 48 | #define AT24_FLAG_READONLY BIT(6) /* sysfs-entry will be read-only */ | ||
| 49 | #define AT24_FLAG_IRUGO BIT(5) /* sysfs-entry will be world-readable */ | ||
| 50 | #define AT24_FLAG_TAKE8ADDR BIT(4) /* take always 8 addresses (24c00) */ | ||
| 51 | #define AT24_FLAG_SERIAL BIT(3) /* factory-programmed serial number */ | ||
| 52 | #define AT24_FLAG_MAC BIT(2) /* factory-programmed mac address */ | ||
| 53 | #define AT24_FLAG_NO_RDROL BIT(1) /* does not auto-rollover reads to */ | ||
| 54 | /* the next slave address */ | ||
| 55 | |||
| 56 | void (*setup)(struct nvmem_device *nvmem, void *context); | ||
| 57 | void *context; | ||
| 58 | }; | ||
| 59 | |||
| 60 | #endif /* _LINUX_AT24_H */ | ||
