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)
40 #define wf_to_lm87(c) container_of(c, struct wf_lm87_sensor, sens)
59 DBG(
"wf_lm87: Error reading LM87, retrying...\n");
76 #define LM87_INT_TEMP 0x27
79 temp = wf_lm87_read_reg(lm->
i2c, LM87_INT_TEMP);
87 static void wf_lm87_release(
struct wf_sensor *sr)
95 .get_value = wf_lm87_get,
96 .release = wf_lm87_release,
121 else if (
strstr(loc,
"Processors"))
122 name =
"between-cpus-temp";
129 pr_warning(
"wf_lm87: Unsupported sensor %s\n",
130 client->
dev.of_node->full_name);
140 lm->
sens.ops = &wf_lm87_ops;
142 i2c_set_clientdata(client, lm);
150 static int wf_lm87_remove(
struct i2c_client *client)
154 DBG(
"wf_lm87: i2c detatch called for %s\n", lm->
sens.name);
166 {
"MAC,lm87cimt", 0 },
175 .probe = wf_lm87_probe,
176 .remove = wf_lm87_remove,
177 .id_table = wf_lm87_id,
180 static int __init wf_lm87_sensor_init(
void)
186 return i2c_add_driver(&wf_lm87_driver);
189 static void __exit wf_lm87_sensor_exit(
void)