diff options
author | Jean Delvare <khali@linux-fr.org> | 2010-03-02 06:23:42 -0500 |
---|---|---|
committer | Jean Delvare <khali@linux-fr.org> | 2010-03-02 06:23:42 -0500 |
commit | b5527a7766f0505dc72efe3cefe5e9dea826f611 (patch) | |
tree | 0282f6f16a1377a8070d317cc385541e9c651b2c /include/linux/i2c.h | |
parent | 6d376fcc28d98f7f8f652755ae4dca1ff7240563 (diff) |
i2c: Add SMBus alert support
SMBus alert support. The SMBus alert protocol allows several SMBus
slave devices to share a single interrupt pin on the SMBus master,
while still allowing the master to know which slave triggered the
interrupt.
This is based on preliminary work by David Brownell. The key
difference between David's implementation and mine is that his was
part of i2c-core, while mine is split into a separate, standalone
module named i2c-smbus. The i2c-smbus module is meant to include
support for all SMBus extensions to the I2C protocol in the future.
The benefit of this approach is a zero cost for I2C bus segments which
do not need SMBus alert support. Where David's implementation
increased the size of struct i2c_adapter by 7% (40 bytes on i386),
mine doesn't touch it. Where David's implementation added over 150
lines of code to i2c-core (+10%), mine doesn't touch it. The only
change that touches all the users of the i2c subsystem is a new
callback in struct i2c_driver (common to both implementations.) I seem
to remember Trent was worried about the footprint of David'd
implementation, hopefully mine addresses the issue.
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Jonathan Cameron <jic23@cam.ac.uk>
Cc: David Brownell <dbrownell@users.sourceforge.net>
Cc: Trent Piepho <tpiepho@freescale.com>
Diffstat (limited to 'include/linux/i2c.h')
-rw-r--r-- | include/linux/i2c.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/i2c.h b/include/linux/i2c.h index 02fc617782ef..476abd09c921 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h | |||
@@ -152,6 +152,13 @@ struct i2c_driver { | |||
152 | int (*suspend)(struct i2c_client *, pm_message_t mesg); | 152 | int (*suspend)(struct i2c_client *, pm_message_t mesg); |
153 | int (*resume)(struct i2c_client *); | 153 | int (*resume)(struct i2c_client *); |
154 | 154 | ||
155 | /* Alert callback, for example for the SMBus alert protocol. | ||
156 | * The format and meaning of the data value depends on the protocol. | ||
157 | * For the SMBus alert protocol, there is a single bit of data passed | ||
158 | * as the alert response's low bit ("event flag"). | ||
159 | */ | ||
160 | void (*alert)(struct i2c_client *, unsigned int data); | ||
161 | |||
155 | /* a ioctl like command that can be used to perform specific functions | 162 | /* a ioctl like command that can be used to perform specific functions |
156 | * with the device. | 163 | * with the device. |
157 | */ | 164 | */ |