Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
| 2 | * lm80.c - From lm_sensors, Linux kernel modules for hardware |
| 3 | * monitoring |
| 4 | * Copyright (C) 1998, 1999 Frodo Looijaard <frodol@dds.nl> |
| 5 | * and Philip Edelbrock <phil@netroedge.com> |
| 6 | * |
| 7 | * Ported to Linux 2.6 by Tiago Sousa <mirage@kaotik.org> |
| 8 | * |
| 9 | * This program is free software; you can redistribute it and/or modify |
| 10 | * it under the terms of the GNU General Public License as published by |
| 11 | * the Free Software Foundation; either version 2 of the License, or |
| 12 | * (at your option) any later version. |
| 13 | * |
| 14 | * This program is distributed in the hope that it will be useful, |
| 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 17 | * GNU General Public License for more details. |
| 18 | * |
| 19 | * You should have received a copy of the GNU General Public License |
| 20 | * along with this program; if not, write to the Free Software |
| 21 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
| 22 | */ |
| 23 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 24 | #include <linux/module.h> |
| 25 | #include <linux/init.h> |
| 26 | #include <linux/slab.h> |
| 27 | #include <linux/jiffies.h> |
| 28 | #include <linux/i2c.h> |
Mark M. Hoffman | 943b083 | 2005-07-15 21:39:18 -0400 | [diff] [blame] | 29 | #include <linux/hwmon.h> |
Jean Delvare | f818176 | 2008-01-05 15:37:05 +0100 | [diff] [blame] | 30 | #include <linux/hwmon-sysfs.h> |
Mark M. Hoffman | 943b083 | 2005-07-15 21:39:18 -0400 | [diff] [blame] | 31 | #include <linux/err.h> |
Ingo Molnar | 9a61bf6 | 2006-01-18 23:19:26 +0100 | [diff] [blame] | 32 | #include <linux/mutex.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 33 | |
| 34 | /* Addresses to scan */ |
Mark M. Hoffman | 25e9c86 | 2008-02-17 22:28:03 -0500 | [diff] [blame^] | 35 | static const unsigned short normal_i2c[] = { 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, |
| 36 | 0x2e, 0x2f, I2C_CLIENT_END }; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 37 | |
| 38 | /* Insmod parameters */ |
Jean Delvare | f4b5026 | 2005-07-31 21:49:03 +0200 | [diff] [blame] | 39 | I2C_CLIENT_INSMOD_1(lm80); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 40 | |
| 41 | /* Many LM80 constants specified below */ |
| 42 | |
| 43 | /* The LM80 registers */ |
| 44 | #define LM80_REG_IN_MAX(nr) (0x2a + (nr) * 2) |
| 45 | #define LM80_REG_IN_MIN(nr) (0x2b + (nr) * 2) |
| 46 | #define LM80_REG_IN(nr) (0x20 + (nr)) |
| 47 | |
| 48 | #define LM80_REG_FAN1 0x28 |
| 49 | #define LM80_REG_FAN2 0x29 |
| 50 | #define LM80_REG_FAN_MIN(nr) (0x3b + (nr)) |
| 51 | |
| 52 | #define LM80_REG_TEMP 0x27 |
| 53 | #define LM80_REG_TEMP_HOT_MAX 0x38 |
| 54 | #define LM80_REG_TEMP_HOT_HYST 0x39 |
| 55 | #define LM80_REG_TEMP_OS_MAX 0x3a |
| 56 | #define LM80_REG_TEMP_OS_HYST 0x3b |
| 57 | |
| 58 | #define LM80_REG_CONFIG 0x00 |
| 59 | #define LM80_REG_ALARM1 0x01 |
| 60 | #define LM80_REG_ALARM2 0x02 |
| 61 | #define LM80_REG_MASK1 0x03 |
| 62 | #define LM80_REG_MASK2 0x04 |
| 63 | #define LM80_REG_FANDIV 0x05 |
| 64 | #define LM80_REG_RES 0x06 |
| 65 | |
| 66 | |
| 67 | /* Conversions. Rounding and limit checking is only done on the TO_REG |
| 68 | variants. Note that you should be a bit careful with which arguments |
| 69 | these macros are called: arguments may be evaluated more than once. |
| 70 | Fixing this is just not worth it. */ |
| 71 | |
| 72 | #define IN_TO_REG(val) (SENSORS_LIMIT(((val)+5)/10,0,255)) |
| 73 | #define IN_FROM_REG(val) ((val)*10) |
| 74 | |
| 75 | static inline unsigned char FAN_TO_REG(unsigned rpm, unsigned div) |
| 76 | { |
| 77 | if (rpm == 0) |
| 78 | return 255; |
| 79 | rpm = SENSORS_LIMIT(rpm, 1, 1000000); |
| 80 | return SENSORS_LIMIT((1350000 + rpm*div / 2) / (rpm*div), 1, 254); |
| 81 | } |
| 82 | |
| 83 | #define FAN_FROM_REG(val,div) ((val)==0?-1:\ |
| 84 | (val)==255?0:1350000/((div)*(val))) |
| 85 | |
| 86 | static inline long TEMP_FROM_REG(u16 temp) |
| 87 | { |
| 88 | long res; |
| 89 | |
| 90 | temp >>= 4; |
| 91 | if (temp < 0x0800) |
| 92 | res = 625 * (long) temp; |
| 93 | else |
| 94 | res = ((long) temp - 0x01000) * 625; |
| 95 | |
| 96 | return res / 10; |
| 97 | } |
| 98 | |
| 99 | #define TEMP_LIMIT_FROM_REG(val) (((val)>0x80?(val)-0x100:(val))*1000) |
| 100 | |
| 101 | #define TEMP_LIMIT_TO_REG(val) SENSORS_LIMIT((val)<0?\ |
| 102 | ((val)-500)/1000:((val)+500)/1000,0,255) |
| 103 | |
| 104 | #define DIV_FROM_REG(val) (1 << (val)) |
| 105 | |
| 106 | /* |
| 107 | * Client data (each client gets its own) |
| 108 | */ |
| 109 | |
| 110 | struct lm80_data { |
| 111 | struct i2c_client client; |
Tony Jones | 1beeffe | 2007-08-20 13:46:20 -0700 | [diff] [blame] | 112 | struct device *hwmon_dev; |
Ingo Molnar | 9a61bf6 | 2006-01-18 23:19:26 +0100 | [diff] [blame] | 113 | struct mutex update_lock; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 114 | char valid; /* !=0 if following fields are valid */ |
| 115 | unsigned long last_updated; /* In jiffies */ |
| 116 | |
| 117 | u8 in[7]; /* Register value */ |
| 118 | u8 in_max[7]; /* Register value */ |
| 119 | u8 in_min[7]; /* Register value */ |
| 120 | u8 fan[2]; /* Register value */ |
| 121 | u8 fan_min[2]; /* Register value */ |
| 122 | u8 fan_div[2]; /* Register encoding, shifted right */ |
| 123 | u16 temp; /* Register values, shifted right */ |
| 124 | u8 temp_hot_max; /* Register value */ |
| 125 | u8 temp_hot_hyst; /* Register value */ |
| 126 | u8 temp_os_max; /* Register value */ |
| 127 | u8 temp_os_hyst; /* Register value */ |
| 128 | u16 alarms; /* Register encoding, combined */ |
| 129 | }; |
| 130 | |
Jean Delvare | 6cc37ee | 2008-01-05 15:35:09 +0100 | [diff] [blame] | 131 | /* |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 132 | * Functions declaration |
| 133 | */ |
| 134 | |
| 135 | static int lm80_attach_adapter(struct i2c_adapter *adapter); |
| 136 | static int lm80_detect(struct i2c_adapter *adapter, int address, int kind); |
| 137 | static void lm80_init_client(struct i2c_client *client); |
| 138 | static int lm80_detach_client(struct i2c_client *client); |
| 139 | static struct lm80_data *lm80_update_device(struct device *dev); |
| 140 | static int lm80_read_value(struct i2c_client *client, u8 reg); |
| 141 | static int lm80_write_value(struct i2c_client *client, u8 reg, u8 value); |
| 142 | |
| 143 | /* |
| 144 | * Driver data (common to all clients) |
| 145 | */ |
| 146 | |
| 147 | static struct i2c_driver lm80_driver = { |
Laurent Riffard | cdaf793 | 2005-11-26 20:37:41 +0100 | [diff] [blame] | 148 | .driver = { |
Laurent Riffard | cdaf793 | 2005-11-26 20:37:41 +0100 | [diff] [blame] | 149 | .name = "lm80", |
| 150 | }, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 151 | .attach_adapter = lm80_attach_adapter, |
| 152 | .detach_client = lm80_detach_client, |
| 153 | }; |
| 154 | |
| 155 | /* |
| 156 | * Sysfs stuff |
| 157 | */ |
| 158 | |
| 159 | #define show_in(suffix, value) \ |
Yani Ioannou | 8627f9b | 2005-05-17 06:42:03 -0400 | [diff] [blame] | 160 | static ssize_t show_in_##suffix(struct device *dev, struct device_attribute *attr, char *buf) \ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 161 | { \ |
Jean Delvare | f818176 | 2008-01-05 15:37:05 +0100 | [diff] [blame] | 162 | int nr = to_sensor_dev_attr(attr)->index; \ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 163 | struct lm80_data *data = lm80_update_device(dev); \ |
Jean Delvare | f818176 | 2008-01-05 15:37:05 +0100 | [diff] [blame] | 164 | return sprintf(buf, "%d\n", IN_FROM_REG(data->value[nr])); \ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 165 | } |
Jean Delvare | f818176 | 2008-01-05 15:37:05 +0100 | [diff] [blame] | 166 | show_in(min, in_min) |
| 167 | show_in(max, in_max) |
| 168 | show_in(input, in) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 169 | |
| 170 | #define set_in(suffix, value, reg) \ |
Yani Ioannou | 8627f9b | 2005-05-17 06:42:03 -0400 | [diff] [blame] | 171 | static ssize_t set_in_##suffix(struct device *dev, struct device_attribute *attr, const char *buf, \ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 172 | size_t count) \ |
| 173 | { \ |
Jean Delvare | f818176 | 2008-01-05 15:37:05 +0100 | [diff] [blame] | 174 | int nr = to_sensor_dev_attr(attr)->index; \ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 175 | struct i2c_client *client = to_i2c_client(dev); \ |
| 176 | struct lm80_data *data = i2c_get_clientdata(client); \ |
| 177 | long val = simple_strtol(buf, NULL, 10); \ |
| 178 | \ |
Ingo Molnar | 9a61bf6 | 2006-01-18 23:19:26 +0100 | [diff] [blame] | 179 | mutex_lock(&data->update_lock);\ |
Jean Delvare | f818176 | 2008-01-05 15:37:05 +0100 | [diff] [blame] | 180 | data->value[nr] = IN_TO_REG(val); \ |
| 181 | lm80_write_value(client, reg(nr), data->value[nr]); \ |
Ingo Molnar | 9a61bf6 | 2006-01-18 23:19:26 +0100 | [diff] [blame] | 182 | mutex_unlock(&data->update_lock);\ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 183 | return count; \ |
| 184 | } |
Jean Delvare | f818176 | 2008-01-05 15:37:05 +0100 | [diff] [blame] | 185 | set_in(min, in_min, LM80_REG_IN_MIN) |
| 186 | set_in(max, in_max, LM80_REG_IN_MAX) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 187 | |
Jean Delvare | f818176 | 2008-01-05 15:37:05 +0100 | [diff] [blame] | 188 | #define show_fan(suffix, value) \ |
Yani Ioannou | 8627f9b | 2005-05-17 06:42:03 -0400 | [diff] [blame] | 189 | static ssize_t show_fan_##suffix(struct device *dev, struct device_attribute *attr, char *buf) \ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 190 | { \ |
Jean Delvare | f818176 | 2008-01-05 15:37:05 +0100 | [diff] [blame] | 191 | int nr = to_sensor_dev_attr(attr)->index; \ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 192 | struct lm80_data *data = lm80_update_device(dev); \ |
Jean Delvare | f818176 | 2008-01-05 15:37:05 +0100 | [diff] [blame] | 193 | return sprintf(buf, "%d\n", FAN_FROM_REG(data->value[nr], \ |
| 194 | DIV_FROM_REG(data->fan_div[nr]))); \ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 195 | } |
Jean Delvare | f818176 | 2008-01-05 15:37:05 +0100 | [diff] [blame] | 196 | show_fan(min, fan_min) |
| 197 | show_fan(input, fan) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 198 | |
Jean Delvare | f818176 | 2008-01-05 15:37:05 +0100 | [diff] [blame] | 199 | static ssize_t show_fan_div(struct device *dev, struct device_attribute *attr, |
| 200 | char *buf) |
| 201 | { |
| 202 | int nr = to_sensor_dev_attr(attr)->index; |
| 203 | struct lm80_data *data = lm80_update_device(dev); |
| 204 | return sprintf(buf, "%d\n", DIV_FROM_REG(data->fan_div[nr])); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 205 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 206 | |
Jean Delvare | f818176 | 2008-01-05 15:37:05 +0100 | [diff] [blame] | 207 | static ssize_t set_fan_min(struct device *dev, struct device_attribute *attr, |
| 208 | const char *buf, size_t count) |
| 209 | { |
| 210 | int nr = to_sensor_dev_attr(attr)->index; |
| 211 | struct i2c_client *client = to_i2c_client(dev); |
| 212 | struct lm80_data *data = i2c_get_clientdata(client); |
| 213 | long val = simple_strtoul(buf, NULL, 10); |
| 214 | |
| 215 | mutex_lock(&data->update_lock); |
| 216 | data->fan_min[nr] = FAN_TO_REG(val, DIV_FROM_REG(data->fan_div[nr])); |
| 217 | lm80_write_value(client, LM80_REG_FAN_MIN(nr + 1), data->fan_min[nr]); |
| 218 | mutex_unlock(&data->update_lock); |
| 219 | return count; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 220 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 221 | |
| 222 | /* Note: we save and restore the fan minimum here, because its value is |
| 223 | determined in part by the fan divisor. This follows the principle of |
Andreas Mohr | d6e05ed | 2006-06-26 18:35:02 +0200 | [diff] [blame] | 224 | least surprise; the user doesn't expect the fan minimum to change just |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 225 | because the divisor changed. */ |
Jean Delvare | f818176 | 2008-01-05 15:37:05 +0100 | [diff] [blame] | 226 | static ssize_t set_fan_div(struct device *dev, struct device_attribute *attr, |
| 227 | const char *buf, size_t count) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 228 | { |
Jean Delvare | f818176 | 2008-01-05 15:37:05 +0100 | [diff] [blame] | 229 | int nr = to_sensor_dev_attr(attr)->index; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 230 | struct i2c_client *client = to_i2c_client(dev); |
| 231 | struct lm80_data *data = i2c_get_clientdata(client); |
| 232 | unsigned long min, val = simple_strtoul(buf, NULL, 10); |
| 233 | u8 reg; |
| 234 | |
| 235 | /* Save fan_min */ |
Ingo Molnar | 9a61bf6 | 2006-01-18 23:19:26 +0100 | [diff] [blame] | 236 | mutex_lock(&data->update_lock); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 237 | min = FAN_FROM_REG(data->fan_min[nr], |
| 238 | DIV_FROM_REG(data->fan_div[nr])); |
| 239 | |
| 240 | switch (val) { |
| 241 | case 1: data->fan_div[nr] = 0; break; |
| 242 | case 2: data->fan_div[nr] = 1; break; |
| 243 | case 4: data->fan_div[nr] = 2; break; |
| 244 | case 8: data->fan_div[nr] = 3; break; |
| 245 | default: |
| 246 | dev_err(&client->dev, "fan_div value %ld not " |
| 247 | "supported. Choose one of 1, 2, 4 or 8!\n", val); |
Ingo Molnar | 9a61bf6 | 2006-01-18 23:19:26 +0100 | [diff] [blame] | 248 | mutex_unlock(&data->update_lock); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 249 | return -EINVAL; |
| 250 | } |
| 251 | |
| 252 | reg = (lm80_read_value(client, LM80_REG_FANDIV) & ~(3 << (2 * (nr + 1)))) |
| 253 | | (data->fan_div[nr] << (2 * (nr + 1))); |
| 254 | lm80_write_value(client, LM80_REG_FANDIV, reg); |
| 255 | |
| 256 | /* Restore fan_min */ |
| 257 | data->fan_min[nr] = FAN_TO_REG(min, DIV_FROM_REG(data->fan_div[nr])); |
| 258 | lm80_write_value(client, LM80_REG_FAN_MIN(nr + 1), data->fan_min[nr]); |
Ingo Molnar | 9a61bf6 | 2006-01-18 23:19:26 +0100 | [diff] [blame] | 259 | mutex_unlock(&data->update_lock); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 260 | |
| 261 | return count; |
| 262 | } |
| 263 | |
Yani Ioannou | 8627f9b | 2005-05-17 06:42:03 -0400 | [diff] [blame] | 264 | static ssize_t show_temp_input1(struct device *dev, struct device_attribute *attr, char *buf) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 265 | { |
| 266 | struct lm80_data *data = lm80_update_device(dev); |
| 267 | return sprintf(buf, "%ld\n", TEMP_FROM_REG(data->temp)); |
| 268 | } |
| 269 | |
| 270 | #define show_temp(suffix, value) \ |
Yani Ioannou | 8627f9b | 2005-05-17 06:42:03 -0400 | [diff] [blame] | 271 | static ssize_t show_temp_##suffix(struct device *dev, struct device_attribute *attr, char *buf) \ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 272 | { \ |
| 273 | struct lm80_data *data = lm80_update_device(dev); \ |
| 274 | return sprintf(buf, "%d\n", TEMP_LIMIT_FROM_REG(data->value)); \ |
| 275 | } |
| 276 | show_temp(hot_max, temp_hot_max); |
| 277 | show_temp(hot_hyst, temp_hot_hyst); |
| 278 | show_temp(os_max, temp_os_max); |
| 279 | show_temp(os_hyst, temp_os_hyst); |
| 280 | |
| 281 | #define set_temp(suffix, value, reg) \ |
Yani Ioannou | 8627f9b | 2005-05-17 06:42:03 -0400 | [diff] [blame] | 282 | static ssize_t set_temp_##suffix(struct device *dev, struct device_attribute *attr, const char *buf, \ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 283 | size_t count) \ |
| 284 | { \ |
| 285 | struct i2c_client *client = to_i2c_client(dev); \ |
| 286 | struct lm80_data *data = i2c_get_clientdata(client); \ |
| 287 | long val = simple_strtoul(buf, NULL, 10); \ |
| 288 | \ |
Ingo Molnar | 9a61bf6 | 2006-01-18 23:19:26 +0100 | [diff] [blame] | 289 | mutex_lock(&data->update_lock); \ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 290 | data->value = TEMP_LIMIT_TO_REG(val); \ |
| 291 | lm80_write_value(client, reg, data->value); \ |
Ingo Molnar | 9a61bf6 | 2006-01-18 23:19:26 +0100 | [diff] [blame] | 292 | mutex_unlock(&data->update_lock); \ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 293 | return count; \ |
| 294 | } |
| 295 | set_temp(hot_max, temp_hot_max, LM80_REG_TEMP_HOT_MAX); |
| 296 | set_temp(hot_hyst, temp_hot_hyst, LM80_REG_TEMP_HOT_HYST); |
| 297 | set_temp(os_max, temp_os_max, LM80_REG_TEMP_OS_MAX); |
| 298 | set_temp(os_hyst, temp_os_hyst, LM80_REG_TEMP_OS_HYST); |
| 299 | |
Jean Delvare | 6cc37ee | 2008-01-05 15:35:09 +0100 | [diff] [blame] | 300 | static ssize_t show_alarms(struct device *dev, struct device_attribute *attr, |
| 301 | char *buf) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 302 | { |
| 303 | struct lm80_data *data = lm80_update_device(dev); |
| 304 | return sprintf(buf, "%u\n", data->alarms); |
| 305 | } |
| 306 | |
Jean Delvare | e84542f | 2008-01-05 15:40:38 +0100 | [diff] [blame] | 307 | static ssize_t show_alarm(struct device *dev, struct device_attribute *attr, |
| 308 | char *buf) |
| 309 | { |
| 310 | int bitnr = to_sensor_dev_attr(attr)->index; |
| 311 | struct lm80_data *data = lm80_update_device(dev); |
| 312 | return sprintf(buf, "%u\n", (data->alarms >> bitnr) & 1); |
| 313 | } |
| 314 | |
Jean Delvare | f818176 | 2008-01-05 15:37:05 +0100 | [diff] [blame] | 315 | static SENSOR_DEVICE_ATTR(in0_min, S_IWUSR | S_IRUGO, |
| 316 | show_in_min, set_in_min, 0); |
| 317 | static SENSOR_DEVICE_ATTR(in1_min, S_IWUSR | S_IRUGO, |
| 318 | show_in_min, set_in_min, 1); |
| 319 | static SENSOR_DEVICE_ATTR(in2_min, S_IWUSR | S_IRUGO, |
| 320 | show_in_min, set_in_min, 2); |
| 321 | static SENSOR_DEVICE_ATTR(in3_min, S_IWUSR | S_IRUGO, |
| 322 | show_in_min, set_in_min, 3); |
| 323 | static SENSOR_DEVICE_ATTR(in4_min, S_IWUSR | S_IRUGO, |
| 324 | show_in_min, set_in_min, 4); |
| 325 | static SENSOR_DEVICE_ATTR(in5_min, S_IWUSR | S_IRUGO, |
| 326 | show_in_min, set_in_min, 5); |
| 327 | static SENSOR_DEVICE_ATTR(in6_min, S_IWUSR | S_IRUGO, |
| 328 | show_in_min, set_in_min, 6); |
| 329 | static SENSOR_DEVICE_ATTR(in0_max, S_IWUSR | S_IRUGO, |
| 330 | show_in_max, set_in_max, 0); |
| 331 | static SENSOR_DEVICE_ATTR(in1_max, S_IWUSR | S_IRUGO, |
| 332 | show_in_max, set_in_max, 1); |
| 333 | static SENSOR_DEVICE_ATTR(in2_max, S_IWUSR | S_IRUGO, |
| 334 | show_in_max, set_in_max, 2); |
| 335 | static SENSOR_DEVICE_ATTR(in3_max, S_IWUSR | S_IRUGO, |
| 336 | show_in_max, set_in_max, 3); |
| 337 | static SENSOR_DEVICE_ATTR(in4_max, S_IWUSR | S_IRUGO, |
| 338 | show_in_max, set_in_max, 4); |
| 339 | static SENSOR_DEVICE_ATTR(in5_max, S_IWUSR | S_IRUGO, |
| 340 | show_in_max, set_in_max, 5); |
| 341 | static SENSOR_DEVICE_ATTR(in6_max, S_IWUSR | S_IRUGO, |
| 342 | show_in_max, set_in_max, 6); |
| 343 | static SENSOR_DEVICE_ATTR(in0_input, S_IRUGO, show_in_input, NULL, 0); |
| 344 | static SENSOR_DEVICE_ATTR(in1_input, S_IRUGO, show_in_input, NULL, 1); |
| 345 | static SENSOR_DEVICE_ATTR(in2_input, S_IRUGO, show_in_input, NULL, 2); |
| 346 | static SENSOR_DEVICE_ATTR(in3_input, S_IRUGO, show_in_input, NULL, 3); |
| 347 | static SENSOR_DEVICE_ATTR(in4_input, S_IRUGO, show_in_input, NULL, 4); |
| 348 | static SENSOR_DEVICE_ATTR(in5_input, S_IRUGO, show_in_input, NULL, 5); |
| 349 | static SENSOR_DEVICE_ATTR(in6_input, S_IRUGO, show_in_input, NULL, 6); |
| 350 | static SENSOR_DEVICE_ATTR(fan1_min, S_IWUSR | S_IRUGO, |
| 351 | show_fan_min, set_fan_min, 0); |
| 352 | static SENSOR_DEVICE_ATTR(fan2_min, S_IWUSR | S_IRUGO, |
| 353 | show_fan_min, set_fan_min, 1); |
| 354 | static SENSOR_DEVICE_ATTR(fan1_input, S_IRUGO, show_fan_input, NULL, 0); |
| 355 | static SENSOR_DEVICE_ATTR(fan2_input, S_IRUGO, show_fan_input, NULL, 1); |
| 356 | static SENSOR_DEVICE_ATTR(fan1_div, S_IWUSR | S_IRUGO, |
| 357 | show_fan_div, set_fan_div, 0); |
| 358 | static SENSOR_DEVICE_ATTR(fan2_div, S_IWUSR | S_IRUGO, |
| 359 | show_fan_div, set_fan_div, 1); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 360 | static DEVICE_ATTR(temp1_input, S_IRUGO, show_temp_input1, NULL); |
| 361 | static DEVICE_ATTR(temp1_max, S_IWUSR | S_IRUGO, show_temp_hot_max, |
| 362 | set_temp_hot_max); |
| 363 | static DEVICE_ATTR(temp1_max_hyst, S_IWUSR | S_IRUGO, show_temp_hot_hyst, |
| 364 | set_temp_hot_hyst); |
| 365 | static DEVICE_ATTR(temp1_crit, S_IWUSR | S_IRUGO, show_temp_os_max, |
| 366 | set_temp_os_max); |
| 367 | static DEVICE_ATTR(temp1_crit_hyst, S_IWUSR | S_IRUGO, show_temp_os_hyst, |
| 368 | set_temp_os_hyst); |
| 369 | static DEVICE_ATTR(alarms, S_IRUGO, show_alarms, NULL); |
Jean Delvare | e84542f | 2008-01-05 15:40:38 +0100 | [diff] [blame] | 370 | static SENSOR_DEVICE_ATTR(in0_alarm, S_IRUGO, show_alarm, NULL, 0); |
| 371 | static SENSOR_DEVICE_ATTR(in1_alarm, S_IRUGO, show_alarm, NULL, 1); |
| 372 | static SENSOR_DEVICE_ATTR(in2_alarm, S_IRUGO, show_alarm, NULL, 2); |
| 373 | static SENSOR_DEVICE_ATTR(in3_alarm, S_IRUGO, show_alarm, NULL, 3); |
| 374 | static SENSOR_DEVICE_ATTR(in4_alarm, S_IRUGO, show_alarm, NULL, 4); |
| 375 | static SENSOR_DEVICE_ATTR(in5_alarm, S_IRUGO, show_alarm, NULL, 5); |
| 376 | static SENSOR_DEVICE_ATTR(in6_alarm, S_IRUGO, show_alarm, NULL, 6); |
| 377 | static SENSOR_DEVICE_ATTR(fan1_alarm, S_IRUGO, show_alarm, NULL, 10); |
| 378 | static SENSOR_DEVICE_ATTR(fan2_alarm, S_IRUGO, show_alarm, NULL, 11); |
| 379 | static SENSOR_DEVICE_ATTR(temp1_max_alarm, S_IRUGO, show_alarm, NULL, 8); |
| 380 | static SENSOR_DEVICE_ATTR(temp1_crit_alarm, S_IRUGO, show_alarm, NULL, 13); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 381 | |
| 382 | /* |
| 383 | * Real code |
| 384 | */ |
| 385 | |
| 386 | static int lm80_attach_adapter(struct i2c_adapter *adapter) |
| 387 | { |
| 388 | if (!(adapter->class & I2C_CLASS_HWMON)) |
| 389 | return 0; |
Jean Delvare | 2ed2dc3 | 2005-07-31 21:42:02 +0200 | [diff] [blame] | 390 | return i2c_probe(adapter, &addr_data, lm80_detect); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 391 | } |
| 392 | |
Mark M. Hoffman | 0501a38 | 2006-09-24 21:14:35 +0200 | [diff] [blame] | 393 | static struct attribute *lm80_attributes[] = { |
Jean Delvare | f818176 | 2008-01-05 15:37:05 +0100 | [diff] [blame] | 394 | &sensor_dev_attr_in0_min.dev_attr.attr, |
| 395 | &sensor_dev_attr_in1_min.dev_attr.attr, |
| 396 | &sensor_dev_attr_in2_min.dev_attr.attr, |
| 397 | &sensor_dev_attr_in3_min.dev_attr.attr, |
| 398 | &sensor_dev_attr_in4_min.dev_attr.attr, |
| 399 | &sensor_dev_attr_in5_min.dev_attr.attr, |
| 400 | &sensor_dev_attr_in6_min.dev_attr.attr, |
| 401 | &sensor_dev_attr_in0_max.dev_attr.attr, |
| 402 | &sensor_dev_attr_in1_max.dev_attr.attr, |
| 403 | &sensor_dev_attr_in2_max.dev_attr.attr, |
| 404 | &sensor_dev_attr_in3_max.dev_attr.attr, |
| 405 | &sensor_dev_attr_in4_max.dev_attr.attr, |
| 406 | &sensor_dev_attr_in5_max.dev_attr.attr, |
| 407 | &sensor_dev_attr_in6_max.dev_attr.attr, |
| 408 | &sensor_dev_attr_in0_input.dev_attr.attr, |
| 409 | &sensor_dev_attr_in1_input.dev_attr.attr, |
| 410 | &sensor_dev_attr_in2_input.dev_attr.attr, |
| 411 | &sensor_dev_attr_in3_input.dev_attr.attr, |
| 412 | &sensor_dev_attr_in4_input.dev_attr.attr, |
| 413 | &sensor_dev_attr_in5_input.dev_attr.attr, |
| 414 | &sensor_dev_attr_in6_input.dev_attr.attr, |
| 415 | &sensor_dev_attr_fan1_min.dev_attr.attr, |
| 416 | &sensor_dev_attr_fan2_min.dev_attr.attr, |
| 417 | &sensor_dev_attr_fan1_input.dev_attr.attr, |
| 418 | &sensor_dev_attr_fan2_input.dev_attr.attr, |
| 419 | &sensor_dev_attr_fan1_div.dev_attr.attr, |
| 420 | &sensor_dev_attr_fan2_div.dev_attr.attr, |
Mark M. Hoffman | 0501a38 | 2006-09-24 21:14:35 +0200 | [diff] [blame] | 421 | &dev_attr_temp1_input.attr, |
| 422 | &dev_attr_temp1_max.attr, |
| 423 | &dev_attr_temp1_max_hyst.attr, |
| 424 | &dev_attr_temp1_crit.attr, |
| 425 | &dev_attr_temp1_crit_hyst.attr, |
| 426 | &dev_attr_alarms.attr, |
Jean Delvare | e84542f | 2008-01-05 15:40:38 +0100 | [diff] [blame] | 427 | &sensor_dev_attr_in0_alarm.dev_attr.attr, |
| 428 | &sensor_dev_attr_in1_alarm.dev_attr.attr, |
| 429 | &sensor_dev_attr_in2_alarm.dev_attr.attr, |
| 430 | &sensor_dev_attr_in3_alarm.dev_attr.attr, |
| 431 | &sensor_dev_attr_in4_alarm.dev_attr.attr, |
| 432 | &sensor_dev_attr_in5_alarm.dev_attr.attr, |
| 433 | &sensor_dev_attr_in6_alarm.dev_attr.attr, |
| 434 | &sensor_dev_attr_fan1_alarm.dev_attr.attr, |
| 435 | &sensor_dev_attr_fan2_alarm.dev_attr.attr, |
| 436 | &sensor_dev_attr_temp1_max_alarm.dev_attr.attr, |
| 437 | &sensor_dev_attr_temp1_crit_alarm.dev_attr.attr, |
Mark M. Hoffman | 0501a38 | 2006-09-24 21:14:35 +0200 | [diff] [blame] | 438 | NULL |
| 439 | }; |
| 440 | |
| 441 | static const struct attribute_group lm80_group = { |
| 442 | .attrs = lm80_attributes, |
| 443 | }; |
| 444 | |
Ben Dooks | c49efce | 2005-10-26 21:07:25 +0200 | [diff] [blame] | 445 | static int lm80_detect(struct i2c_adapter *adapter, int address, int kind) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 446 | { |
| 447 | int i, cur; |
Jean Delvare | 6cc37ee | 2008-01-05 15:35:09 +0100 | [diff] [blame] | 448 | struct i2c_client *client; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 449 | struct lm80_data *data; |
| 450 | int err = 0; |
| 451 | const char *name; |
| 452 | |
| 453 | if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA)) |
| 454 | goto exit; |
| 455 | |
| 456 | /* OK. For now, we presume we have a valid client. We now create the |
| 457 | client structure, even though we cannot fill it completely yet. |
| 458 | But it allows us to access lm80_{read,write}_value. */ |
Deepak Saxena | ba9c2e8 | 2005-10-17 23:08:32 +0200 | [diff] [blame] | 459 | if (!(data = kzalloc(sizeof(struct lm80_data), GFP_KERNEL))) { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 460 | err = -ENOMEM; |
| 461 | goto exit; |
| 462 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 463 | |
Jean Delvare | 6cc37ee | 2008-01-05 15:35:09 +0100 | [diff] [blame] | 464 | client = &data->client; |
| 465 | i2c_set_clientdata(client, data); |
| 466 | client->addr = address; |
| 467 | client->adapter = adapter; |
| 468 | client->driver = &lm80_driver; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 469 | |
| 470 | /* Now, we do the remaining detection. It is lousy. */ |
Jean Delvare | 6cc37ee | 2008-01-05 15:35:09 +0100 | [diff] [blame] | 471 | if (lm80_read_value(client, LM80_REG_ALARM2) & 0xc0) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 472 | goto error_free; |
| 473 | for (i = 0x2a; i <= 0x3d; i++) { |
Jean Delvare | 6cc37ee | 2008-01-05 15:35:09 +0100 | [diff] [blame] | 474 | cur = i2c_smbus_read_byte_data(client, i); |
| 475 | if ((i2c_smbus_read_byte_data(client, i + 0x40) != cur) |
| 476 | || (i2c_smbus_read_byte_data(client, i + 0x80) != cur) |
| 477 | || (i2c_smbus_read_byte_data(client, i + 0xc0) != cur)) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 478 | goto error_free; |
| 479 | } |
| 480 | |
| 481 | /* Determine the chip type - only one kind supported! */ |
| 482 | kind = lm80; |
| 483 | name = "lm80"; |
| 484 | |
Jean Delvare | 6cc37ee | 2008-01-05 15:35:09 +0100 | [diff] [blame] | 485 | /* Fill in the remaining client fields */ |
| 486 | strlcpy(client->name, name, I2C_NAME_SIZE); |
Ingo Molnar | 9a61bf6 | 2006-01-18 23:19:26 +0100 | [diff] [blame] | 487 | mutex_init(&data->update_lock); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 488 | |
| 489 | /* Tell the I2C layer a new client has arrived */ |
Jean Delvare | 6cc37ee | 2008-01-05 15:35:09 +0100 | [diff] [blame] | 490 | if ((err = i2c_attach_client(client))) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 491 | goto error_free; |
| 492 | |
| 493 | /* Initialize the LM80 chip */ |
Jean Delvare | 6cc37ee | 2008-01-05 15:35:09 +0100 | [diff] [blame] | 494 | lm80_init_client(client); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 495 | |
| 496 | /* A few vars need to be filled upon startup */ |
Jean Delvare | 6cc37ee | 2008-01-05 15:35:09 +0100 | [diff] [blame] | 497 | data->fan_min[0] = lm80_read_value(client, LM80_REG_FAN_MIN(1)); |
| 498 | data->fan_min[1] = lm80_read_value(client, LM80_REG_FAN_MIN(2)); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 499 | |
| 500 | /* Register sysfs hooks */ |
Jean Delvare | 6cc37ee | 2008-01-05 15:35:09 +0100 | [diff] [blame] | 501 | if ((err = sysfs_create_group(&client->dev.kobj, &lm80_group))) |
Mark M. Hoffman | 0501a38 | 2006-09-24 21:14:35 +0200 | [diff] [blame] | 502 | goto error_detach; |
| 503 | |
Jean Delvare | 6cc37ee | 2008-01-05 15:35:09 +0100 | [diff] [blame] | 504 | data->hwmon_dev = hwmon_device_register(&client->dev); |
Tony Jones | 1beeffe | 2007-08-20 13:46:20 -0700 | [diff] [blame] | 505 | if (IS_ERR(data->hwmon_dev)) { |
| 506 | err = PTR_ERR(data->hwmon_dev); |
Mark M. Hoffman | 0501a38 | 2006-09-24 21:14:35 +0200 | [diff] [blame] | 507 | goto error_remove; |
Mark M. Hoffman | 943b083 | 2005-07-15 21:39:18 -0400 | [diff] [blame] | 508 | } |
| 509 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 510 | return 0; |
| 511 | |
Mark M. Hoffman | 0501a38 | 2006-09-24 21:14:35 +0200 | [diff] [blame] | 512 | error_remove: |
Jean Delvare | 6cc37ee | 2008-01-05 15:35:09 +0100 | [diff] [blame] | 513 | sysfs_remove_group(&client->dev.kobj, &lm80_group); |
Mark M. Hoffman | 943b083 | 2005-07-15 21:39:18 -0400 | [diff] [blame] | 514 | error_detach: |
Jean Delvare | 6cc37ee | 2008-01-05 15:35:09 +0100 | [diff] [blame] | 515 | i2c_detach_client(client); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 516 | error_free: |
| 517 | kfree(data); |
| 518 | exit: |
| 519 | return err; |
| 520 | } |
| 521 | |
| 522 | static int lm80_detach_client(struct i2c_client *client) |
| 523 | { |
Mark M. Hoffman | 943b083 | 2005-07-15 21:39:18 -0400 | [diff] [blame] | 524 | struct lm80_data *data = i2c_get_clientdata(client); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 525 | int err; |
| 526 | |
Tony Jones | 1beeffe | 2007-08-20 13:46:20 -0700 | [diff] [blame] | 527 | hwmon_device_unregister(data->hwmon_dev); |
Mark M. Hoffman | 0501a38 | 2006-09-24 21:14:35 +0200 | [diff] [blame] | 528 | sysfs_remove_group(&client->dev.kobj, &lm80_group); |
Jean Delvare | 7bef559 | 2005-07-27 22:14:49 +0200 | [diff] [blame] | 529 | if ((err = i2c_detach_client(client))) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 530 | return err; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 531 | |
Mark M. Hoffman | 943b083 | 2005-07-15 21:39:18 -0400 | [diff] [blame] | 532 | kfree(data); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 533 | return 0; |
| 534 | } |
| 535 | |
| 536 | static int lm80_read_value(struct i2c_client *client, u8 reg) |
| 537 | { |
| 538 | return i2c_smbus_read_byte_data(client, reg); |
| 539 | } |
| 540 | |
| 541 | static int lm80_write_value(struct i2c_client *client, u8 reg, u8 value) |
| 542 | { |
| 543 | return i2c_smbus_write_byte_data(client, reg, value); |
| 544 | } |
| 545 | |
| 546 | /* Called when we have found a new LM80. */ |
| 547 | static void lm80_init_client(struct i2c_client *client) |
| 548 | { |
| 549 | /* Reset all except Watchdog values and last conversion values |
| 550 | This sets fan-divs to 2, among others. This makes most other |
| 551 | initializations unnecessary */ |
| 552 | lm80_write_value(client, LM80_REG_CONFIG, 0x80); |
| 553 | /* Set 11-bit temperature resolution */ |
| 554 | lm80_write_value(client, LM80_REG_RES, 0x08); |
| 555 | |
| 556 | /* Start monitoring */ |
| 557 | lm80_write_value(client, LM80_REG_CONFIG, 0x01); |
| 558 | } |
| 559 | |
| 560 | static struct lm80_data *lm80_update_device(struct device *dev) |
| 561 | { |
| 562 | struct i2c_client *client = to_i2c_client(dev); |
| 563 | struct lm80_data *data = i2c_get_clientdata(client); |
| 564 | int i; |
| 565 | |
Ingo Molnar | 9a61bf6 | 2006-01-18 23:19:26 +0100 | [diff] [blame] | 566 | mutex_lock(&data->update_lock); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 567 | |
| 568 | if (time_after(jiffies, data->last_updated + 2 * HZ) || !data->valid) { |
| 569 | dev_dbg(&client->dev, "Starting lm80 update\n"); |
| 570 | for (i = 0; i <= 6; i++) { |
| 571 | data->in[i] = |
| 572 | lm80_read_value(client, LM80_REG_IN(i)); |
| 573 | data->in_min[i] = |
| 574 | lm80_read_value(client, LM80_REG_IN_MIN(i)); |
| 575 | data->in_max[i] = |
| 576 | lm80_read_value(client, LM80_REG_IN_MAX(i)); |
| 577 | } |
| 578 | data->fan[0] = lm80_read_value(client, LM80_REG_FAN1); |
| 579 | data->fan_min[0] = |
| 580 | lm80_read_value(client, LM80_REG_FAN_MIN(1)); |
| 581 | data->fan[1] = lm80_read_value(client, LM80_REG_FAN2); |
| 582 | data->fan_min[1] = |
| 583 | lm80_read_value(client, LM80_REG_FAN_MIN(2)); |
| 584 | |
| 585 | data->temp = |
| 586 | (lm80_read_value(client, LM80_REG_TEMP) << 8) | |
| 587 | (lm80_read_value(client, LM80_REG_RES) & 0xf0); |
| 588 | data->temp_os_max = |
| 589 | lm80_read_value(client, LM80_REG_TEMP_OS_MAX); |
| 590 | data->temp_os_hyst = |
| 591 | lm80_read_value(client, LM80_REG_TEMP_OS_HYST); |
| 592 | data->temp_hot_max = |
| 593 | lm80_read_value(client, LM80_REG_TEMP_HOT_MAX); |
| 594 | data->temp_hot_hyst = |
| 595 | lm80_read_value(client, LM80_REG_TEMP_HOT_HYST); |
| 596 | |
| 597 | i = lm80_read_value(client, LM80_REG_FANDIV); |
| 598 | data->fan_div[0] = (i >> 2) & 0x03; |
| 599 | data->fan_div[1] = (i >> 4) & 0x03; |
| 600 | data->alarms = lm80_read_value(client, LM80_REG_ALARM1) + |
| 601 | (lm80_read_value(client, LM80_REG_ALARM2) << 8); |
| 602 | data->last_updated = jiffies; |
| 603 | data->valid = 1; |
| 604 | } |
| 605 | |
Ingo Molnar | 9a61bf6 | 2006-01-18 23:19:26 +0100 | [diff] [blame] | 606 | mutex_unlock(&data->update_lock); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 607 | |
| 608 | return data; |
| 609 | } |
| 610 | |
| 611 | static int __init sensors_lm80_init(void) |
| 612 | { |
| 613 | return i2c_add_driver(&lm80_driver); |
| 614 | } |
| 615 | |
| 616 | static void __exit sensors_lm80_exit(void) |
| 617 | { |
| 618 | i2c_del_driver(&lm80_driver); |
| 619 | } |
| 620 | |
| 621 | MODULE_AUTHOR("Frodo Looijaard <frodol@dds.nl> and " |
| 622 | "Philip Edelbrock <phil@netroedge.com>"); |
| 623 | MODULE_DESCRIPTION("LM80 driver"); |
| 624 | MODULE_LICENSE("GPL"); |
| 625 | |
| 626 | module_init(sensors_lm80_init); |
| 627 | module_exit(sensors_lm80_exit); |