diff options
author | David Brownell <david-b@pacbell.net> | 2007-10-13 17:56:29 -0400 |
---|---|---|
committer | Jean Delvare <khali@hyperion.delvare> | 2007-10-13 17:56:29 -0400 |
commit | 3bbb835d4c53faf0bca62f0e39835926bef40b1f (patch) | |
tree | 116a84eeb50d0406e18f4d733a1ba05d67f8fe86 | |
parent | cee37ae4071740cb190d1ac4ddb7aa77484aa7b3 (diff) |
i2c: New-style devices can support driver model wakeup flags
We need to be able to flag I2C devices, such as RTCs, which can issue wake
events (usually through IRQ lines). This adds an i2c_board_info.flags bit,
and uses it to initialize the i2c device node. (And shrinks a few lines
that were overly long.)
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
-rw-r--r-- | drivers/i2c/i2c-core.c | 4 | ||||
-rw-r--r-- | include/linux/i2c.h | 7 |
2 files changed, 7 insertions, 4 deletions
diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c index 910a62de190d..06b4b9e1a23e 100644 --- a/drivers/i2c/i2c-core.c +++ b/drivers/i2c/i2c-core.c | |||
@@ -226,7 +226,9 @@ i2c_new_device(struct i2c_adapter *adap, struct i2c_board_info const *info) | |||
226 | client->adapter = adap; | 226 | client->adapter = adap; |
227 | 227 | ||
228 | client->dev.platform_data = info->platform_data; | 228 | client->dev.platform_data = info->platform_data; |
229 | client->flags = info->flags; | 229 | device_init_wakeup(&client->dev, info->flags & I2C_CLIENT_WAKE); |
230 | |||
231 | client->flags = info->flags & ~I2C_CLIENT_WAKE; | ||
230 | client->addr = info->addr; | 232 | client->addr = info->addr; |
231 | client->irq = info->irq; | 233 | client->irq = info->irq; |
232 | 234 | ||
diff --git a/include/linux/i2c.h b/include/linux/i2c.h index 2a32f2fd940d..e4793feac2bb 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h | |||
@@ -342,9 +342,10 @@ static inline void i2c_set_adapdata (struct i2c_adapter *dev, void *data) | |||
342 | } | 342 | } |
343 | 343 | ||
344 | /*flags for the client struct: */ | 344 | /*flags for the client struct: */ |
345 | #define I2C_CLIENT_PEC 0x04 /* Use Packet Error Checking */ | 345 | #define I2C_CLIENT_PEC 0x04 /* Use Packet Error Checking */ |
346 | #define I2C_CLIENT_TEN 0x10 /* we have a ten bit chip address */ | 346 | #define I2C_CLIENT_TEN 0x10 /* we have a ten bit chip address */ |
347 | /* Must equal I2C_M_TEN below */ | 347 | /* Must equal I2C_M_TEN below */ |
348 | #define I2C_CLIENT_WAKE 0x80 /* for board_info; true iff can wake */ | ||
348 | 349 | ||
349 | /* i2c adapter classes (bitmask) */ | 350 | /* i2c adapter classes (bitmask) */ |
350 | #define I2C_CLASS_HWMON (1<<0) /* lm_sensors, ... */ | 351 | #define I2C_CLASS_HWMON (1<<0) /* lm_sensors, ... */ |