i2c: add a protocol parameter to the alert callback

.alert() is meant to be generic, but there is currently no way
for the device driver to know which protocol generated the alert.
Add a parameter in .alert() to help the device driver to understand
what is given in data.

This patch is required to have the support of SMBus Host Notify protocol
through .alert().

Tested-by: Andrew Duggan <aduggan@synaptics.com>
For hwmon:
Acked-by: Guenter Roeck <linux@roeck-us.net>
For IPMI:
Acked-by: Corey Minyard <cminyard@mvista.com>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
This commit is contained in:
Benjamin Tissoires
2016-06-09 16:53:47 +02:00
committed by Wolfram Sang
parent 33c77abcf4
commit b4f210541f
4 changed files with 18 additions and 4 deletions

View File

@@ -56,7 +56,8 @@ static int smbus_do_alert(struct device *dev, void *addrp)
if (client->dev.driver) {
driver = to_i2c_driver(client->dev.driver);
if (driver->alert)
driver->alert(client, data->flag);
driver->alert(client, I2C_PROTOCOL_SMBUS_ALERT,
data->flag);
else
dev_warn(&client->dev, "no driver alert()!\n");
} else