diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-01-10 20:09:13 -0500 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-01-10 20:09:13 -0500 |
| commit | 8adbf8d46718a8f110de55ec82c40d04d0c362cc (patch) | |
| tree | dbaf7109edaaa26496e131e6644074fbcb75c75d /include | |
| parent | 0be8c8bd1de21d75ef14eb6af35b664f70a35746 (diff) | |
| parent | 0cc43a1806f078f7fd414850d8f1f1761696e4af (diff) | |
Merge branch 'i2c-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging
* 'i2c-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging:
i2c: Constify i2c_client where possible
i2c-algo-bit: Complain about masters which can't read SCL
i2c-algo-bit: Refactor adapter registration
i2c: Add generic I2C multiplexer using GPIO API
i2c-nforce2: Remove unnecessary cast of pci_get_drvdata
i2c-i801: Include <linux/slab.h>
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/gpio-i2cmux.h | 38 | ||||
| -rw-r--r-- | include/linux/i2c.h | 27 |
2 files changed, 53 insertions, 12 deletions
diff --git a/include/linux/gpio-i2cmux.h b/include/linux/gpio-i2cmux.h new file mode 100644 index 000000000000..4a333bb0bd0d --- /dev/null +++ b/include/linux/gpio-i2cmux.h | |||
| @@ -0,0 +1,38 @@ | |||
| 1 | /* | ||
| 2 | * gpio-i2cmux interface to platform code | ||
| 3 | * | ||
| 4 | * Peter Korsgaard <peter.korsgaard@barco.com> | ||
| 5 | * | ||
| 6 | * This program is free software; you can redistribute it and/or modify | ||
| 7 | * it under the terms of the GNU General Public License version 2 as | ||
| 8 | * published by the Free Software Foundation. | ||
| 9 | */ | ||
| 10 | |||
| 11 | #ifndef _LINUX_GPIO_I2CMUX_H | ||
| 12 | #define _LINUX_GPIO_I2CMUX_H | ||
| 13 | |||
| 14 | /* MUX has no specific idle mode */ | ||
| 15 | #define GPIO_I2CMUX_NO_IDLE ((unsigned)-1) | ||
| 16 | |||
| 17 | /** | ||
| 18 | * struct gpio_i2cmux_platform_data - Platform-dependent data for gpio-i2cmux | ||
| 19 | * @parent: Parent I2C bus adapter number | ||
| 20 | * @base_nr: Base I2C bus number to number adapters from or zero for dynamic | ||
| 21 | * @values: Array of bitmasks of GPIO settings (low/high) for each | ||
| 22 | * position | ||
| 23 | * @n_values: Number of multiplexer positions (busses to instantiate) | ||
| 24 | * @gpios: Array of GPIO numbers used to control MUX | ||
| 25 | * @n_gpios: Number of GPIOs used to control MUX | ||
| 26 | * @idle: Bitmask to write to MUX when idle or GPIO_I2CMUX_NO_IDLE if not used | ||
| 27 | */ | ||
| 28 | struct gpio_i2cmux_platform_data { | ||
| 29 | int parent; | ||
| 30 | int base_nr; | ||
| 31 | const unsigned *values; | ||
| 32 | int n_values; | ||
| 33 | const unsigned *gpios; | ||
| 34 | int n_gpios; | ||
| 35 | unsigned idle; | ||
| 36 | }; | ||
| 37 | |||
| 38 | #endif /* _LINUX_GPIO_I2CMUX_H */ | ||
diff --git a/include/linux/i2c.h b/include/linux/i2c.h index 56cfe23ffb39..903576df88dc 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h | |||
| @@ -57,9 +57,10 @@ struct i2c_board_info; | |||
| 57 | * transmit an arbitrary number of messages without interruption. | 57 | * transmit an arbitrary number of messages without interruption. |
| 58 | * @count must be be less than 64k since msg.len is u16. | 58 | * @count must be be less than 64k since msg.len is u16. |
| 59 | */ | 59 | */ |
| 60 | extern int i2c_master_send(struct i2c_client *client, const char *buf, | 60 | extern int i2c_master_send(const struct i2c_client *client, const char *buf, |
| 61 | int count); | ||
| 62 | extern int i2c_master_recv(const struct i2c_client *client, char *buf, | ||
| 61 | int count); | 63 | int count); |
| 62 | extern int i2c_master_recv(struct i2c_client *client, char *buf, int count); | ||
| 63 | 64 | ||
| 64 | /* Transfer num messages. | 65 | /* Transfer num messages. |
| 65 | */ | 66 | */ |
| @@ -78,23 +79,25 @@ extern s32 i2c_smbus_xfer(struct i2c_adapter *adapter, u16 addr, | |||
| 78 | /* Now follow the 'nice' access routines. These also document the calling | 79 | /* Now follow the 'nice' access routines. These also document the calling |
| 79 | conventions of i2c_smbus_xfer. */ | 80 | conventions of i2c_smbus_xfer. */ |
| 80 | 81 | ||
| 81 | extern s32 i2c_smbus_read_byte(struct i2c_client *client); | 82 | extern s32 i2c_smbus_read_byte(const struct i2c_client *client); |
| 82 | extern s32 i2c_smbus_write_byte(struct i2c_client *client, u8 value); | 83 | extern s32 i2c_smbus_write_byte(const struct i2c_client *client, u8 value); |
| 83 | extern s32 i2c_smbus_read_byte_data(struct i2c_client *client, u8 command); | 84 | extern s32 i2c_smbus_read_byte_data(const struct i2c_client *client, |
| 84 | extern s32 i2c_smbus_write_byte_data(struct i2c_client *client, | 85 | u8 command); |
| 86 | extern s32 i2c_smbus_write_byte_data(const struct i2c_client *client, | ||
| 85 | u8 command, u8 value); | 87 | u8 command, u8 value); |
| 86 | extern s32 i2c_smbus_read_word_data(struct i2c_client *client, u8 command); | 88 | extern s32 i2c_smbus_read_word_data(const struct i2c_client *client, |
| 87 | extern s32 i2c_smbus_write_word_data(struct i2c_client *client, | 89 | u8 command); |
| 90 | extern s32 i2c_smbus_write_word_data(const struct i2c_client *client, | ||
| 88 | u8 command, u16 value); | 91 | u8 command, u16 value); |
| 89 | /* Returns the number of read bytes */ | 92 | /* Returns the number of read bytes */ |
| 90 | extern s32 i2c_smbus_read_block_data(struct i2c_client *client, | 93 | extern s32 i2c_smbus_read_block_data(const struct i2c_client *client, |
| 91 | u8 command, u8 *values); | 94 | u8 command, u8 *values); |
| 92 | extern s32 i2c_smbus_write_block_data(struct i2c_client *client, | 95 | extern s32 i2c_smbus_write_block_data(const struct i2c_client *client, |
| 93 | u8 command, u8 length, const u8 *values); | 96 | u8 command, u8 length, const u8 *values); |
| 94 | /* Returns the number of read bytes */ | 97 | /* Returns the number of read bytes */ |
| 95 | extern s32 i2c_smbus_read_i2c_block_data(struct i2c_client *client, | 98 | extern s32 i2c_smbus_read_i2c_block_data(const struct i2c_client *client, |
| 96 | u8 command, u8 length, u8 *values); | 99 | u8 command, u8 length, u8 *values); |
| 97 | extern s32 i2c_smbus_write_i2c_block_data(struct i2c_client *client, | 100 | extern s32 i2c_smbus_write_i2c_block_data(const struct i2c_client *client, |
| 98 | u8 command, u8 length, | 101 | u8 command, u8 length, |
| 99 | const u8 *values); | 102 | const u8 *values); |
| 100 | #endif /* I2C */ | 103 | #endif /* I2C */ |
