Commit | Line | Data |
---|---|---|
add77c64 | 1 | /* |
4d387df7 GR |
2 | * thmc50.c - Part of lm_sensors, Linux kernel modules for hardware |
3 | * monitoring | |
4 | * Copyright (C) 2007 Krzysztof Helt <krzysztof.h1@wp.pl> | |
5 | * Based on 2.4 driver by Frodo Looijaard <frodol@dds.nl> and | |
6 | * Philip Edelbrock <phil@netroedge.com> | |
7 | * | |
8 | * This program is free software; you can redistribute it and/or modify | |
9 | * it under the terms of the GNU General Public License as published by | |
10 | * the Free Software Foundation; either version 2 of the License, or | |
11 | * (at your option) any later version. | |
12 | * | |
13 | * This program is distributed in the hope that it will be useful, | |
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
16 | * GNU General Public License for more details. | |
17 | * | |
18 | * You should have received a copy of the GNU General Public License | |
19 | * along with this program; if not, write to the Free Software | |
20 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | |
21 | */ | |
add77c64 KH |
22 | |
23 | #include <linux/module.h> | |
24 | #include <linux/init.h> | |
25 | #include <linux/slab.h> | |
26 | #include <linux/i2c.h> | |
27 | #include <linux/hwmon.h> | |
28 | #include <linux/hwmon-sysfs.h> | |
29 | #include <linux/err.h> | |
30 | #include <linux/mutex.h> | |
dcd8f392 | 31 | #include <linux/jiffies.h> |
add77c64 KH |
32 | |
33 | MODULE_LICENSE("GPL"); | |
34 | ||
35 | /* Addresses to scan */ | |
25e9c86d | 36 | static const unsigned short normal_i2c[] = { 0x2c, 0x2d, 0x2e, I2C_CLIENT_END }; |
add77c64 KH |
37 | |
38 | /* Insmod parameters */ | |
e5e9f44c | 39 | enum chips { thmc50, adm1022 }; |
f95f0b4c JD |
40 | |
41 | static unsigned short adm1022_temp3[16]; | |
42 | static unsigned int adm1022_temp3_num; | |
43 | module_param_array(adm1022_temp3, ushort, &adm1022_temp3_num, 0); | |
b55f3757 GR |
44 | MODULE_PARM_DESC(adm1022_temp3, |
45 | "List of adapter,address pairs to enable 3rd temperature (ADM1022 only)"); | |
add77c64 KH |
46 | |
47 | /* Many THMC50 constants specified below */ | |
48 | ||
49 | /* The THMC50 registers */ | |
50 | #define THMC50_REG_CONF 0x40 | |
51 | #define THMC50_REG_COMPANY_ID 0x3E | |
52 | #define THMC50_REG_DIE_CODE 0x3F | |
53 | #define THMC50_REG_ANALOG_OUT 0x19 | |
dcf3b5fb | 54 | /* |
bba891c2 KH |
55 | * The mirror status register cannot be used as |
56 | * reading it does not clear alarms. | |
dcf3b5fb | 57 | */ |
bba891c2 | 58 | #define THMC50_REG_INTR 0x41 |
add77c64 | 59 | |
5910a9b2 TK |
60 | static const u8 THMC50_REG_TEMP[] = { 0x27, 0x26, 0x20 }; |
61 | static const u8 THMC50_REG_TEMP_MIN[] = { 0x3A, 0x38, 0x2C }; | |
62 | static const u8 THMC50_REG_TEMP_MAX[] = { 0x39, 0x37, 0x2B }; | |
84f768c1 KH |
63 | static const u8 THMC50_REG_TEMP_CRITICAL[] = { 0x13, 0x14, 0x14 }; |
64 | static const u8 THMC50_REG_TEMP_DEFAULT[] = { 0x17, 0x18, 0x18 }; | |
add77c64 KH |
65 | |
66 | #define THMC50_REG_CONF_nFANOFF 0x20 | |
84f768c1 | 67 | #define THMC50_REG_CONF_PROGRAMMED 0x08 |
add77c64 KH |
68 | |
69 | /* Each client has this additional data */ | |
70 | struct thmc50_data { | |
1beeffe4 | 71 | struct device *hwmon_dev; |
add77c64 KH |
72 | |
73 | struct mutex update_lock; | |
74 | enum chips type; | |
75 | unsigned long last_updated; /* In jiffies */ | |
76 | char has_temp3; /* !=0 if it is ADM1022 in temp3 mode */ | |
77 | char valid; /* !=0 if following fields are valid */ | |
78 | ||
79 | /* Register values */ | |
80 | s8 temp_input[3]; | |
81 | s8 temp_max[3]; | |
82 | s8 temp_min[3]; | |
84f768c1 | 83 | s8 temp_critical[3]; |
add77c64 | 84 | u8 analog_out; |
dcf3b5fb | 85 | u8 alarms; |
add77c64 KH |
86 | }; |
87 | ||
9b38a66e AL |
88 | static struct thmc50_data *thmc50_update_device(struct device *dev) |
89 | { | |
90 | struct i2c_client *client = to_i2c_client(dev); | |
91 | struct thmc50_data *data = i2c_get_clientdata(client); | |
92 | int timeout = HZ / 5 + (data->type == thmc50 ? HZ : 0); | |
add77c64 | 93 | |
9b38a66e | 94 | mutex_lock(&data->update_lock); |
ccf37488 | 95 | |
9b38a66e AL |
96 | if (time_after(jiffies, data->last_updated + timeout) |
97 | || !data->valid) { | |
98 | ||
99 | int temps = data->has_temp3 ? 3 : 2; | |
100 | int i; | |
101 | int prog = i2c_smbus_read_byte_data(client, THMC50_REG_CONF); | |
102 | ||
103 | prog &= THMC50_REG_CONF_PROGRAMMED; | |
104 | ||
105 | for (i = 0; i < temps; i++) { | |
106 | data->temp_input[i] = i2c_smbus_read_byte_data(client, | |
107 | THMC50_REG_TEMP[i]); | |
108 | data->temp_max[i] = i2c_smbus_read_byte_data(client, | |
109 | THMC50_REG_TEMP_MAX[i]); | |
110 | data->temp_min[i] = i2c_smbus_read_byte_data(client, | |
111 | THMC50_REG_TEMP_MIN[i]); | |
112 | data->temp_critical[i] = | |
113 | i2c_smbus_read_byte_data(client, | |
114 | prog ? THMC50_REG_TEMP_CRITICAL[i] | |
115 | : THMC50_REG_TEMP_DEFAULT[i]); | |
116 | } | |
117 | data->analog_out = | |
118 | i2c_smbus_read_byte_data(client, THMC50_REG_ANALOG_OUT); | |
119 | data->alarms = | |
120 | i2c_smbus_read_byte_data(client, THMC50_REG_INTR); | |
121 | data->last_updated = jiffies; | |
122 | data->valid = 1; | |
123 | } | |
124 | ||
125 | mutex_unlock(&data->update_lock); | |
126 | ||
127 | return data; | |
128 | } | |
add77c64 KH |
129 | |
130 | static ssize_t show_analog_out(struct device *dev, | |
131 | struct device_attribute *attr, char *buf) | |
132 | { | |
133 | struct thmc50_data *data = thmc50_update_device(dev); | |
134 | return sprintf(buf, "%d\n", data->analog_out); | |
135 | } | |
136 | ||
137 | static ssize_t set_analog_out(struct device *dev, | |
138 | struct device_attribute *attr, | |
139 | const char *buf, size_t count) | |
140 | { | |
141 | struct i2c_client *client = to_i2c_client(dev); | |
142 | struct thmc50_data *data = i2c_get_clientdata(client); | |
add77c64 | 143 | int config; |
4d387df7 GR |
144 | unsigned long tmp; |
145 | int err; | |
146 | ||
147 | err = kstrtoul(buf, 10, &tmp); | |
148 | if (err) | |
149 | return err; | |
add77c64 KH |
150 | |
151 | mutex_lock(&data->update_lock); | |
2a844c14 | 152 | data->analog_out = clamp_val(tmp, 0, 255); |
add77c64 KH |
153 | i2c_smbus_write_byte_data(client, THMC50_REG_ANALOG_OUT, |
154 | data->analog_out); | |
155 | ||
156 | config = i2c_smbus_read_byte_data(client, THMC50_REG_CONF); | |
157 | if (data->analog_out == 0) | |
158 | config &= ~THMC50_REG_CONF_nFANOFF; | |
159 | else | |
160 | config |= THMC50_REG_CONF_nFANOFF; | |
161 | i2c_smbus_write_byte_data(client, THMC50_REG_CONF, config); | |
162 | ||
163 | mutex_unlock(&data->update_lock); | |
164 | return count; | |
165 | } | |
166 | ||
167 | /* There is only one PWM mode = DC */ | |
168 | static ssize_t show_pwm_mode(struct device *dev, struct device_attribute *attr, | |
169 | char *buf) | |
170 | { | |
171 | return sprintf(buf, "0\n"); | |
172 | } | |
173 | ||
174 | /* Temperatures */ | |
175 | static ssize_t show_temp(struct device *dev, struct device_attribute *attr, | |
176 | char *buf) | |
177 | { | |
178 | int nr = to_sensor_dev_attr(attr)->index; | |
179 | struct thmc50_data *data = thmc50_update_device(dev); | |
180 | return sprintf(buf, "%d\n", data->temp_input[nr] * 1000); | |
181 | } | |
182 | ||
183 | static ssize_t show_temp_min(struct device *dev, struct device_attribute *attr, | |
184 | char *buf) | |
185 | { | |
186 | int nr = to_sensor_dev_attr(attr)->index; | |
187 | struct thmc50_data *data = thmc50_update_device(dev); | |
188 | return sprintf(buf, "%d\n", data->temp_min[nr] * 1000); | |
189 | } | |
190 | ||
191 | static ssize_t set_temp_min(struct device *dev, struct device_attribute *attr, | |
192 | const char *buf, size_t count) | |
193 | { | |
194 | int nr = to_sensor_dev_attr(attr)->index; | |
195 | struct i2c_client *client = to_i2c_client(dev); | |
196 | struct thmc50_data *data = i2c_get_clientdata(client); | |
4d387df7 GR |
197 | long val; |
198 | int err; | |
199 | ||
200 | err = kstrtol(buf, 10, &val); | |
201 | if (err) | |
202 | return err; | |
add77c64 KH |
203 | |
204 | mutex_lock(&data->update_lock); | |
2a844c14 | 205 | data->temp_min[nr] = clamp_val(val / 1000, -128, 127); |
add77c64 KH |
206 | i2c_smbus_write_byte_data(client, THMC50_REG_TEMP_MIN[nr], |
207 | data->temp_min[nr]); | |
208 | mutex_unlock(&data->update_lock); | |
209 | return count; | |
210 | } | |
211 | ||
212 | static ssize_t show_temp_max(struct device *dev, struct device_attribute *attr, | |
213 | char *buf) | |
214 | { | |
215 | int nr = to_sensor_dev_attr(attr)->index; | |
216 | struct thmc50_data *data = thmc50_update_device(dev); | |
217 | return sprintf(buf, "%d\n", data->temp_max[nr] * 1000); | |
218 | } | |
219 | ||
220 | static ssize_t set_temp_max(struct device *dev, struct device_attribute *attr, | |
221 | const char *buf, size_t count) | |
222 | { | |
223 | int nr = to_sensor_dev_attr(attr)->index; | |
224 | struct i2c_client *client = to_i2c_client(dev); | |
225 | struct thmc50_data *data = i2c_get_clientdata(client); | |
4d387df7 GR |
226 | long val; |
227 | int err; | |
228 | ||
229 | err = kstrtol(buf, 10, &val); | |
230 | if (err) | |
231 | return err; | |
add77c64 KH |
232 | |
233 | mutex_lock(&data->update_lock); | |
2a844c14 | 234 | data->temp_max[nr] = clamp_val(val / 1000, -128, 127); |
add77c64 KH |
235 | i2c_smbus_write_byte_data(client, THMC50_REG_TEMP_MAX[nr], |
236 | data->temp_max[nr]); | |
237 | mutex_unlock(&data->update_lock); | |
238 | return count; | |
239 | } | |
240 | ||
84f768c1 KH |
241 | static ssize_t show_temp_critical(struct device *dev, |
242 | struct device_attribute *attr, | |
243 | char *buf) | |
244 | { | |
245 | int nr = to_sensor_dev_attr(attr)->index; | |
246 | struct thmc50_data *data = thmc50_update_device(dev); | |
247 | return sprintf(buf, "%d\n", data->temp_critical[nr] * 1000); | |
248 | } | |
249 | ||
dcf3b5fb KH |
250 | static ssize_t show_alarm(struct device *dev, struct device_attribute *attr, |
251 | char *buf) | |
252 | { | |
253 | int index = to_sensor_dev_attr(attr)->index; | |
254 | struct thmc50_data *data = thmc50_update_device(dev); | |
255 | ||
256 | return sprintf(buf, "%u\n", (data->alarms >> index) & 1); | |
257 | } | |
258 | ||
add77c64 KH |
259 | #define temp_reg(offset) \ |
260 | static SENSOR_DEVICE_ATTR(temp##offset##_input, S_IRUGO, show_temp, \ | |
261 | NULL, offset - 1); \ | |
262 | static SENSOR_DEVICE_ATTR(temp##offset##_min, S_IRUGO | S_IWUSR, \ | |
263 | show_temp_min, set_temp_min, offset - 1); \ | |
264 | static SENSOR_DEVICE_ATTR(temp##offset##_max, S_IRUGO | S_IWUSR, \ | |
84f768c1 KH |
265 | show_temp_max, set_temp_max, offset - 1); \ |
266 | static SENSOR_DEVICE_ATTR(temp##offset##_crit, S_IRUGO, \ | |
267 | show_temp_critical, NULL, offset - 1); | |
add77c64 KH |
268 | |
269 | temp_reg(1); | |
270 | temp_reg(2); | |
271 | temp_reg(3); | |
272 | ||
dcf3b5fb KH |
273 | static SENSOR_DEVICE_ATTR(temp1_alarm, S_IRUGO, show_alarm, NULL, 0); |
274 | static SENSOR_DEVICE_ATTR(temp2_alarm, S_IRUGO, show_alarm, NULL, 5); | |
275 | static SENSOR_DEVICE_ATTR(temp3_alarm, S_IRUGO, show_alarm, NULL, 1); | |
276 | static SENSOR_DEVICE_ATTR(temp2_fault, S_IRUGO, show_alarm, NULL, 7); | |
277 | static SENSOR_DEVICE_ATTR(temp3_fault, S_IRUGO, show_alarm, NULL, 2); | |
278 | ||
add77c64 KH |
279 | static SENSOR_DEVICE_ATTR(pwm1, S_IRUGO | S_IWUSR, show_analog_out, |
280 | set_analog_out, 0); | |
281 | static SENSOR_DEVICE_ATTR(pwm1_mode, S_IRUGO, show_pwm_mode, NULL, 0); | |
282 | ||
283 | static struct attribute *thmc50_attributes[] = { | |
284 | &sensor_dev_attr_temp1_max.dev_attr.attr, | |
285 | &sensor_dev_attr_temp1_min.dev_attr.attr, | |
286 | &sensor_dev_attr_temp1_input.dev_attr.attr, | |
84f768c1 | 287 | &sensor_dev_attr_temp1_crit.dev_attr.attr, |
dcf3b5fb | 288 | &sensor_dev_attr_temp1_alarm.dev_attr.attr, |
add77c64 KH |
289 | &sensor_dev_attr_temp2_max.dev_attr.attr, |
290 | &sensor_dev_attr_temp2_min.dev_attr.attr, | |
291 | &sensor_dev_attr_temp2_input.dev_attr.attr, | |
84f768c1 | 292 | &sensor_dev_attr_temp2_crit.dev_attr.attr, |
dcf3b5fb KH |
293 | &sensor_dev_attr_temp2_alarm.dev_attr.attr, |
294 | &sensor_dev_attr_temp2_fault.dev_attr.attr, | |
add77c64 KH |
295 | &sensor_dev_attr_pwm1.dev_attr.attr, |
296 | &sensor_dev_attr_pwm1_mode.dev_attr.attr, | |
297 | NULL | |
298 | }; | |
299 | ||
300 | static const struct attribute_group thmc50_group = { | |
301 | .attrs = thmc50_attributes, | |
302 | }; | |
303 | ||
304 | /* for ADM1022 3rd temperature mode */ | |
894c00cf | 305 | static struct attribute *temp3_attributes[] = { |
add77c64 KH |
306 | &sensor_dev_attr_temp3_max.dev_attr.attr, |
307 | &sensor_dev_attr_temp3_min.dev_attr.attr, | |
308 | &sensor_dev_attr_temp3_input.dev_attr.attr, | |
84f768c1 | 309 | &sensor_dev_attr_temp3_crit.dev_attr.attr, |
dcf3b5fb KH |
310 | &sensor_dev_attr_temp3_alarm.dev_attr.attr, |
311 | &sensor_dev_attr_temp3_fault.dev_attr.attr, | |
add77c64 KH |
312 | NULL |
313 | }; | |
314 | ||
894c00cf JD |
315 | static const struct attribute_group temp3_group = { |
316 | .attrs = temp3_attributes, | |
add77c64 KH |
317 | }; |
318 | ||
ccf37488 | 319 | /* Return 0 if detection is successful, -ENODEV otherwise */ |
310ec792 | 320 | static int thmc50_detect(struct i2c_client *client, |
ccf37488 | 321 | struct i2c_board_info *info) |
add77c64 KH |
322 | { |
323 | unsigned company; | |
324 | unsigned revision; | |
325 | unsigned config; | |
ccf37488 | 326 | struct i2c_adapter *adapter = client->adapter; |
cc28a610 | 327 | const char *type_name; |
add77c64 KH |
328 | |
329 | if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA)) { | |
b55f3757 | 330 | pr_debug("thmc50: detect failed, smbus byte data not supported!\n"); |
ccf37488 | 331 | return -ENODEV; |
add77c64 KH |
332 | } |
333 | ||
add77c64 KH |
334 | pr_debug("thmc50: Probing for THMC50 at 0x%2X on bus %d\n", |
335 | client->addr, i2c_adapter_id(client->adapter)); | |
336 | ||
add77c64 KH |
337 | company = i2c_smbus_read_byte_data(client, THMC50_REG_COMPANY_ID); |
338 | revision = i2c_smbus_read_byte_data(client, THMC50_REG_DIE_CODE); | |
339 | config = i2c_smbus_read_byte_data(client, THMC50_REG_CONF); | |
52df6440 JD |
340 | if (revision < 0xc0 || (config & 0x10)) |
341 | return -ENODEV; | |
add77c64 | 342 | |
52df6440 | 343 | if (company == 0x41) { |
add77c64 KH |
344 | int id = i2c_adapter_id(client->adapter); |
345 | int i; | |
346 | ||
347 | type_name = "adm1022"; | |
add77c64 KH |
348 | for (i = 0; i + 1 < adm1022_temp3_num; i += 2) |
349 | if (adm1022_temp3[i] == id && | |
ccf37488 | 350 | adm1022_temp3[i + 1] == client->addr) { |
add77c64 | 351 | /* enable 2nd remote temp */ |
ccf37488 JD |
352 | config |= (1 << 7); |
353 | i2c_smbus_write_byte_data(client, | |
354 | THMC50_REG_CONF, | |
355 | config); | |
add77c64 KH |
356 | break; |
357 | } | |
52df6440 | 358 | } else if (company == 0x49) { |
cc28a610 | 359 | type_name = "thmc50"; |
52df6440 JD |
360 | } else { |
361 | pr_debug("thmc50: Detection of THMC50/ADM1022 failed\n"); | |
362 | return -ENODEV; | |
add77c64 | 363 | } |
52df6440 | 364 | |
cc28a610 JD |
365 | pr_debug("thmc50: Detected %s (version %x, revision %x)\n", |
366 | type_name, (revision >> 4) - 0xc, revision & 0xf); | |
add77c64 | 367 | |
ccf37488 | 368 | strlcpy(info->type, type_name, I2C_NAME_SIZE); |
add77c64 | 369 | |
ccf37488 JD |
370 | return 0; |
371 | } | |
372 | ||
9b38a66e AL |
373 | static void thmc50_init_client(struct i2c_client *client) |
374 | { | |
375 | struct thmc50_data *data = i2c_get_clientdata(client); | |
376 | int config; | |
377 | ||
378 | data->analog_out = i2c_smbus_read_byte_data(client, | |
379 | THMC50_REG_ANALOG_OUT); | |
380 | /* set up to at least 1 */ | |
381 | if (data->analog_out == 0) { | |
382 | data->analog_out = 1; | |
383 | i2c_smbus_write_byte_data(client, THMC50_REG_ANALOG_OUT, | |
384 | data->analog_out); | |
385 | } | |
386 | config = i2c_smbus_read_byte_data(client, THMC50_REG_CONF); | |
387 | config |= 0x1; /* start the chip if it is in standby mode */ | |
388 | if (data->type == adm1022 && (config & (1 << 7))) | |
389 | data->has_temp3 = 1; | |
390 | i2c_smbus_write_byte_data(client, THMC50_REG_CONF, config); | |
391 | } | |
392 | ||
ccf37488 JD |
393 | static int thmc50_probe(struct i2c_client *client, |
394 | const struct i2c_device_id *id) | |
395 | { | |
396 | struct thmc50_data *data; | |
397 | int err; | |
398 | ||
bd91d3ba GR |
399 | data = devm_kzalloc(&client->dev, sizeof(struct thmc50_data), |
400 | GFP_KERNEL); | |
401 | if (!data) | |
402 | return -ENOMEM; | |
ccf37488 JD |
403 | |
404 | i2c_set_clientdata(client, data); | |
405 | data->type = id->driver_data; | |
406 | mutex_init(&data->update_lock); | |
add77c64 KH |
407 | |
408 | thmc50_init_client(client); | |
409 | ||
410 | /* Register sysfs hooks */ | |
4d387df7 GR |
411 | err = sysfs_create_group(&client->dev.kobj, &thmc50_group); |
412 | if (err) | |
bd91d3ba | 413 | return err; |
add77c64 KH |
414 | |
415 | /* Register ADM1022 sysfs hooks */ | |
4d387df7 GR |
416 | if (data->has_temp3) { |
417 | err = sysfs_create_group(&client->dev.kobj, &temp3_group); | |
418 | if (err) | |
add77c64 | 419 | goto exit_remove_sysfs_thmc50; |
4d387df7 | 420 | } |
add77c64 KH |
421 | |
422 | /* Register a new directory entry with module sensors */ | |
1beeffe4 TJ |
423 | data->hwmon_dev = hwmon_device_register(&client->dev); |
424 | if (IS_ERR(data->hwmon_dev)) { | |
425 | err = PTR_ERR(data->hwmon_dev); | |
add77c64 KH |
426 | goto exit_remove_sysfs; |
427 | } | |
428 | ||
429 | return 0; | |
430 | ||
431 | exit_remove_sysfs: | |
894c00cf JD |
432 | if (data->has_temp3) |
433 | sysfs_remove_group(&client->dev.kobj, &temp3_group); | |
add77c64 KH |
434 | exit_remove_sysfs_thmc50: |
435 | sysfs_remove_group(&client->dev.kobj, &thmc50_group); | |
add77c64 KH |
436 | return err; |
437 | } | |
438 | ||
ccf37488 | 439 | static int thmc50_remove(struct i2c_client *client) |
add77c64 KH |
440 | { |
441 | struct thmc50_data *data = i2c_get_clientdata(client); | |
add77c64 | 442 | |
1beeffe4 | 443 | hwmon_device_unregister(data->hwmon_dev); |
add77c64 | 444 | sysfs_remove_group(&client->dev.kobj, &thmc50_group); |
894c00cf JD |
445 | if (data->has_temp3) |
446 | sysfs_remove_group(&client->dev.kobj, &temp3_group); | |
add77c64 | 447 | |
add77c64 KH |
448 | return 0; |
449 | } | |
450 | ||
9b38a66e AL |
451 | static const struct i2c_device_id thmc50_id[] = { |
452 | { "adm1022", adm1022 }, | |
453 | { "thmc50", thmc50 }, | |
454 | { } | |
455 | }; | |
456 | MODULE_DEVICE_TABLE(i2c, thmc50_id); | |
add77c64 | 457 | |
9b38a66e AL |
458 | static struct i2c_driver thmc50_driver = { |
459 | .class = I2C_CLASS_HWMON, | |
460 | .driver = { | |
461 | .name = "thmc50", | |
462 | }, | |
463 | .probe = thmc50_probe, | |
464 | .remove = thmc50_remove, | |
465 | .id_table = thmc50_id, | |
466 | .detect = thmc50_detect, | |
467 | .address_list = normal_i2c, | |
468 | }; | |
add77c64 | 469 | |
f0967eea | 470 | module_i2c_driver(thmc50_driver); |
add77c64 KH |
471 | |
472 | MODULE_AUTHOR("Krzysztof Helt <krzysztof.h1@wp.pl>"); | |
473 | MODULE_DESCRIPTION("THMC50 driver"); |