23 #include <linux/kernel.h>
24 #include <linux/module.h>
25 #include <linux/device.h>
28 #include <linux/i2c.h>
30 #include <linux/slab.h>
45 static int smbus_do_alert(
struct device *
dev,
void *addrp)
50 if (!client || client->
addr != data->
addr)
66 dev_dbg(&client->
dev,
"alert with no driver\n");
81 unsigned short prev_addr = 0;
102 data.flag = status & 1;
103 data.addr = status >> 1;
105 if (
data.addr == prev_addr) {
106 dev_warn(&ara->
dev,
"Duplicate SMBALERT# from dev "
107 "0x%02x, skipping\n",
data.addr);
110 dev_dbg(&ara->
dev,
"SMBALERT# from dev 0x%02x, flag %d\n",
116 prev_addr =
data.addr;
137 static int smbalert_probe(
struct i2c_client *ara,
155 if (setup->
irq > 0) {
156 res = devm_request_irq(&ara->
dev, setup->
irq, smbalert_irq,
157 0,
"smbus_alert", alert);
162 i2c_set_clientdata(ara, alert);
163 dev_info(&adapter->
dev,
"supports SMBALERT#, %s trigger\n",
170 static int smbalert_remove(
struct i2c_client *ara)
179 {
"smbus_alert", 0 },
186 .name =
"smbus_alert",
188 .probe = smbalert_probe,
189 .remove = smbalert_remove,
190 .id_table = smbalert_ids,
218 .platform_data = setup,