10 #include <linux/types.h>
11 #include <linux/errno.h>
12 #include <linux/kernel.h>
14 #include <linux/slab.h>
16 #include <linux/wait.h>
17 #include <linux/i2c.h>
19 #include <asm/machdep.h>
21 #include <asm/sections.h>
31 #define DBG(args...) printk(args)
33 #define DBG(args...) do { } while(0)
42 #define wf_to_lm75(c) container_of(c, struct wf_lm75_sensor, sens)
56 DBG(
"wf_lm75: Initializing %s, cfg was: %02x\n",
62 cfg_new = cfg & ~0x01;
86 .get_value = wf_lm75_get,
87 .release = wf_lm75_release,
98 DBG(
"wf_lm75: creating %s device at address 0x%02x\n",
99 ds1775 ?
"ds1775" :
"lm75", client->
addr);
103 dev_warn(&client->
dev,
"Missing hwsensor-location property!\n");
111 if (!
strcmp(loc,
"Hard drive") || !
strcmp(loc,
"DRIVE BAY"))
113 else if (!
strcmp(loc,
"Incoming Air Temp"))
114 name =
"incoming-air-temp";
115 else if (!
strcmp(loc,
"ODD Temp"))
116 name =
"optical-drive-temp";
117 else if (!
strcmp(loc,
"HD Temp"))
118 name =
"hard-drive-temp";
119 else if (!
strcmp(loc,
"PCI SLOTS"))
121 else if (!
strcmp(loc,
"CPU A INLET"))
122 name =
"cpu-inlet-temp-0";
123 else if (!
strcmp(loc,
"CPU B INLET"))
124 name =
"cpu-inlet-temp-1";
136 lm->
sens.name = (
char *)name;
137 lm->
sens.ops = &wf_lm75_ops;
138 i2c_set_clientdata(client, lm);
146 static int wf_lm75_remove(
struct i2c_client *client)
150 DBG(
"wf_lm75: i2c detatch called for %s\n", lm->
sens.name);
172 .probe = wf_lm75_probe,
173 .remove = wf_lm75_remove,
174 .id_table = wf_lm75_id,
177 static int __init wf_lm75_sensor_init(
void)
179 return i2c_add_driver(&wf_lm75_driver);
182 static void __exit wf_lm75_sensor_exit(
void)