aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-03-23 17:12:04 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-03-23 17:12:04 -0400
commitfc2bb8d1cde1296d210a0f1ff9ee979a447d0a34 (patch)
tree725696adebdc70e1b4e0ce8537da25eb5f2bf564 /include/linux
parent475c77edf826333aa61625f49d6a2bec26ecb5a6 (diff)
parentbbceeee82ef55c11db0161f4078edd79290e3bcf (diff)
Merge branch 'i2c-embedded/for-3.4' of git://git.pengutronix.de/git/wsa/linux
Pull i2c embedded updates from Wolfram Sang: "Nothing special from i2c-embedded for this merge window. Two new drivers, minor feature additions, bugfixes, cleanups. All patches have been in linux-next for some time, too." * 'i2c-embedded/for-3.4' of git://git.pengutronix.de/git/wsa/linux: i2c-eg20t: Remove write-only variables i2c-eg20t: Rework pch_i2c_wait_for_bus_idle to reduce wait time i2c-s3c2410: Add stub runtime power management i2c-s3c2410: Convert to devm_kzalloc() i2c: add CSR SiRFprimaII on-chip I2C controllers driver i2c: tegra: Remove unnecessary write to INT_STATUS i2c: imx: fix imx driver to work though signal is pending i2c: designware: dw_i2c_init_driver as subsys initcall misc: at24: describe platform_data with kernel_doc i2c: Move I2C_EG20T option to the right place. i2c: Support for Netlogic XLR/XLS I2C controller. i2c: mpc: Add support for SMBUS_READ_BLOCK_DATA i2c: versatile: Add Device Tree support
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/i2c/at24.h35
1 files changed, 29 insertions, 6 deletions
diff --git a/include/linux/i2c/at24.h b/include/linux/i2c/at24.h
index 8ace93024d60..285025a9cdc9 100644
--- a/include/linux/i2c/at24.h
+++ b/include/linux/i2c/at24.h
@@ -1,19 +1,42 @@
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
1#ifndef _LINUX_AT24_H 8#ifndef _LINUX_AT24_H
2#define _LINUX_AT24_H 9#define _LINUX_AT24_H
3 10
4#include <linux/types.h> 11#include <linux/types.h>
5#include <linux/memory.h> 12#include <linux/memory.h>
6 13
7/* 14/**
8 * As seen through Linux I2C, differences between the most common types of I2C 15 * struct at24_platform_data - data to set up at24 (generic eeprom) driver
9 * memory include: 16 * @byte_len: size of eeprom in byte
10 * - How much memory is available (usually specified in bit)? 17 * @page_size: number of byte which can be written in one go
11 * - What write page size does it support? 18 * @flags: tunable options, check AT24_FLAG_* defines
12 * - Special flags (16 bit addresses, read_only, world readable...)? 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()
13 * 22 *
14 * If you set up a custom eeprom type, please double-check the parameters. 23 * If you set up a custom eeprom type, please double-check the parameters.
15 * Especially page_size needs extra care, as you risk data loss if your value 24 * Especially page_size needs extra care, as you risk data loss if your value
16 * is bigger than what the chip actually supports! 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.
17 */ 40 */
18 41
19struct at24_platform_data { 42struct at24_platform_data {