aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/platform_data
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-11-18 18:50:07 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2013-11-18 18:50:07 -0500
commit13509c3a9d20a9df93dc9b944e8bd20fe1b454a7 (patch)
treed7a97d1d10e88bcb93852cb0143a000710e9e246 /include/linux/platform_data
parent1ea406c0e08c717241275064046d29b5bac1b1db (diff)
parentcfff1f4a9367bfe0d88413e8807f8369e9564729 (diff)
Merge branch 'i2c/for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux
Pull i2c changes from Wolfram Sang: - new drivers for exynos5, bcm kona, and st micro - bigger overhauls for drivers mxs and rcar - typical driver bugfixes, cleanups, improvements - got rid of the superfluous 'driver' member in i2c_client struct This touches a few drivers in other subsystems. All acked. * 'i2c/for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: (38 commits) i2c: bcm-kona: fix error return code in bcm_kona_i2c_probe() i2c: i2c-eg20t: do not print error message in syslog if no ACK received i2c: bcm-kona: Introduce Broadcom I2C Driver i2c: cbus-gpio: Fix device tree binding i2c: wmt: add missing clk_disable_unprepare() on error i2c: designware: add new ACPI IDs i2c: i801: Add Device IDs for Intel Wildcat Point-LP PCH i2c: exynos5: Remove incorrect clk_disable_unprepare i2c: i2c-st: Add ST I2C controller i2c: exynos5: add High Speed I2C controller driver i2c: rcar: fixup rcar type naming i2c: scmi: remove some bogus NULL checks i2c: sh_mobile & rcar: Enable the driver on all ARM platforms i2c: sh_mobile: Convert to clk_prepare/unprepare i2c: mux: gpio: use reg value for i2c_add_mux_adapter i2c: mux: gpio: use gpio_set_value_cansleep() i2c: Include linux/of.h header i2c: mxs: Fix PIO mode on i.MX23 i2c: mxs: Rework the PIO mode operation i2c: mxs: distinguish i.MX23 and i.MX28 based I2C controller ...
Diffstat (limited to 'include/linux/platform_data')
-rw-r--r--include/linux/platform_data/at24.h55
1 files changed, 55 insertions, 0 deletions
diff --git a/include/linux/platform_data/at24.h b/include/linux/platform_data/at24.h
new file mode 100644
index 000000000000..c42aa89d34ee
--- /dev/null
+++ b/include/linux/platform_data/at24.h
@@ -0,0 +1,55 @@
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/memory.h>
13
14/**
15 * struct at24_platform_data - data to set up at24 (generic eeprom) driver
16 * @byte_len: size of eeprom in byte
17 * @page_size: number of byte which can be written in one go
18 * @flags: tunable options, check AT24_FLAG_* defines
19 * @setup: an optional callback invoked after eeprom is probed; enables kernel
20 code to access eeprom via memory_accessor, see example
21 * @context: optional parameter passed to setup()
22 *
23 * If you set up a custom eeprom type, please double-check the parameters.
24 * Especially page_size needs extra care, as you risk data loss if your value
25 * is bigger than what the chip actually supports!
26 *
27 * An example in pseudo code for a setup() callback:
28 *
29 * void get_mac_addr(struct memory_accessor *mem_acc, void *context)
30 * {
31 * u8 *mac_addr = ethernet_pdata->mac_addr;
32 * off_t offset = context;
33 *
34 * // Read MAC addr from EEPROM
35 * if (mem_acc->read(mem_acc, mac_addr, offset, ETH_ALEN) == ETH_ALEN)
36 * pr_info("Read MAC addr from EEPROM: %pM\n", mac_addr);
37 * }
38 *
39 * This function pointer and context can now be set up in at24_platform_data.
40 */
41
42struct at24_platform_data {
43 u32 byte_len; /* size (sum of all addr) */
44 u16 page_size; /* for writes */
45 u8 flags;
46#define AT24_FLAG_ADDR16 0x80 /* address pointer is 16 bit */
47#define AT24_FLAG_READONLY 0x40 /* sysfs-entry will be read-only */
48#define AT24_FLAG_IRUGO 0x20 /* sysfs-entry will be world-readable */
49#define AT24_FLAG_TAKE8ADDR 0x10 /* take always 8 addresses (24c00) */
50
51 void (*setup)(struct memory_accessor *, void *context);
52 void *context;
53};
54
55#endif /* _LINUX_AT24_H */