Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3bbb835d authored by David Brownell's avatar David Brownell Committed by Jean Delvare
Browse files

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: default avatarDavid Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: default avatarJean Delvare <khali@linux-fr.org>
parent cee37ae4
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -226,7 +226,9 @@ i2c_new_device(struct i2c_adapter *adap, struct i2c_board_info const *info)
	client->adapter = adap;

	client->dev.platform_data = info->platform_data;
	client->flags = info->flags;
	device_init_wakeup(&client->dev, info->flags & I2C_CLIENT_WAKE);

	client->flags = info->flags & ~I2C_CLIENT_WAKE;
	client->addr = info->addr;
	client->irq = info->irq;

+4 −3
Original line number Diff line number Diff line
@@ -345,6 +345,7 @@ static inline void i2c_set_adapdata (struct i2c_adapter *dev, void *data)
#define I2C_CLIENT_PEC	0x04		/* Use Packet Error Checking */
#define I2C_CLIENT_TEN	0x10		/* we have a ten bit chip address */
					/* Must equal I2C_M_TEN below */
#define I2C_CLIENT_WAKE	0x80		/* for board_info; true iff can wake */

/* i2c adapter classes (bitmask) */
#define I2C_CLASS_HWMON		(1<<0)	/* lm_sensors, ... */