blob: 8c573e6e97263965bac39b11d360d5179ab23169 [file] [log] [blame]
Davide Rizzo06160322009-03-31 15:24:27 -07001/*
Davide Rizzo0f1deb42010-11-18 07:23:00 -08002 * Copyright (C) 2008, 2010 Davide Rizzo <elpa.rizzo@gmail.com>
Davide Rizzo06160322009-03-31 15:24:27 -07003 *
Davide Rizzo0f1deb42010-11-18 07:23:00 -08004 * The LM95241 is a sensor chip made by National Semiconductors.
5 * It reports up to three temperatures (its own plus up to two external ones).
6 * Complete datasheet can be obtained from National's website at:
Davide Rizzo06160322009-03-31 15:24:27 -07007 * http://www.national.com/ds.cgi/LM/LM95241.pdf
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.
Davide Rizzo06160322009-03-31 15:24:27 -070018 */
19
Guenter Roecke8172a92016-07-04 08:01:04 -070020#include <linux/bitops.h>
Guenter Roeck4b2ea082016-07-04 06:48:18 -070021#include <linux/err.h>
Davide Rizzo06160322009-03-31 15:24:27 -070022#include <linux/i2c.h>
Guenter Roeck4b2ea082016-07-04 06:48:18 -070023#include <linux/init.h>
24#include <linux/jiffies.h>
Davide Rizzo06160322009-03-31 15:24:27 -070025#include <linux/hwmon.h>
Guenter Roeck4b2ea082016-07-04 06:48:18 -070026#include <linux/module.h>
Davide Rizzo06160322009-03-31 15:24:27 -070027#include <linux/mutex.h>
Guenter Roeck4b2ea082016-07-04 06:48:18 -070028#include <linux/slab.h>
Davide Rizzo06160322009-03-31 15:24:27 -070029
Davide Rizzo0f1deb42010-11-18 07:23:00 -080030#define DEVNAME "lm95241"
31
Davide Rizzo06160322009-03-31 15:24:27 -070032static const unsigned short normal_i2c[] = {
Davide Rizzo0f1deb42010-11-18 07:23:00 -080033 0x19, 0x2a, 0x2b, I2C_CLIENT_END };
Davide Rizzo06160322009-03-31 15:24:27 -070034
Davide Rizzo06160322009-03-31 15:24:27 -070035/* LM95241 registers */
36#define LM95241_REG_R_MAN_ID 0xFE
37#define LM95241_REG_R_CHIP_ID 0xFF
38#define LM95241_REG_R_STATUS 0x02
39#define LM95241_REG_RW_CONFIG 0x03
40#define LM95241_REG_RW_REM_FILTER 0x06
41#define LM95241_REG_RW_TRUTHERM 0x07
Davide Rizzo0f1deb42010-11-18 07:23:00 -080042#define LM95241_REG_W_ONE_SHOT 0x0F
Davide Rizzo06160322009-03-31 15:24:27 -070043#define LM95241_REG_R_LOCAL_TEMPH 0x10
44#define LM95241_REG_R_REMOTE1_TEMPH 0x11
45#define LM95241_REG_R_REMOTE2_TEMPH 0x12
46#define LM95241_REG_R_LOCAL_TEMPL 0x20
47#define LM95241_REG_R_REMOTE1_TEMPL 0x21
48#define LM95241_REG_R_REMOTE2_TEMPL 0x22
49#define LM95241_REG_RW_REMOTE_MODEL 0x30
50
51/* LM95241 specific bitfields */
Guenter Roecke8172a92016-07-04 08:01:04 -070052#define CFG_STOP BIT(6)
53#define CFG_CR0076 0x00
54#define CFG_CR0182 BIT(4)
55#define CFG_CR1000 BIT(5)
56#define CFG_CR2700 (BIT(4) | BIT(5))
57#define CFG_CRMASK (BIT(4) | BIT(5))
58#define R1MS_MASK BIT(0)
59#define R2MS_MASK BIT(2)
60#define R1DF_MASK BIT(1)
61#define R2DF_MASK BIT(2)
62#define R1FE_MASK BIT(0)
63#define R2FE_MASK BIT(2)
64#define R1DM BIT(0)
65#define R2DM BIT(1)
66#define TT1_SHIFT 0
67#define TT2_SHIFT 4
68#define TT_OFF 0
69#define TT_ON 1
70#define TT_MASK 7
Guenter Roeck8c1d0412011-07-05 13:31:48 -070071#define NATSEMI_MAN_ID 0x01
72#define LM95231_CHIP_ID 0xA1
73#define LM95241_CHIP_ID 0xA4
Davide Rizzo06160322009-03-31 15:24:27 -070074
Davide Rizzo0f1deb42010-11-18 07:23:00 -080075static const u8 lm95241_reg_address[] = {
76 LM95241_REG_R_LOCAL_TEMPH,
77 LM95241_REG_R_LOCAL_TEMPL,
78 LM95241_REG_R_REMOTE1_TEMPH,
79 LM95241_REG_R_REMOTE1_TEMPL,
80 LM95241_REG_R_REMOTE2_TEMPH,
81 LM95241_REG_R_REMOTE2_TEMPL
82};
Davide Rizzo06160322009-03-31 15:24:27 -070083
Davide Rizzo06160322009-03-31 15:24:27 -070084/* Client data (each client gets its own) */
85struct lm95241_data {
Guenter Roeckf8096212014-01-20 09:25:50 -080086 struct i2c_client *client;
Davide Rizzo06160322009-03-31 15:24:27 -070087 struct mutex update_lock;
Guenter Roeckf48ccb22016-07-03 21:46:05 -070088 unsigned long last_updated; /* in jiffies */
89 unsigned long interval; /* in milli-seconds */
Davide Rizzo0f1deb42010-11-18 07:23:00 -080090 char valid; /* zero until following fields are valid */
Davide Rizzo06160322009-03-31 15:24:27 -070091 /* registers values */
Davide Rizzo0f1deb42010-11-18 07:23:00 -080092 u8 temp[ARRAY_SIZE(lm95241_reg_address)];
Guenter Roeck090a7f82016-07-04 06:46:31 -070093 u8 status, config, model, trutherm;
Davide Rizzo06160322009-03-31 15:24:27 -070094};
95
Davide Rizzo0f1deb42010-11-18 07:23:00 -080096/* Conversions */
Guenter Roeck0c2a40e2011-06-30 02:09:37 -070097static int temp_from_reg_signed(u8 val_h, u8 val_l)
Davide Rizzo0f1deb42010-11-18 07:23:00 -080098{
Guenter Roeck0c2a40e2011-06-30 02:09:37 -070099 s16 val_hl = (val_h << 8) | val_l;
100 return val_hl * 1000 / 256;
101}
102
103static int temp_from_reg_unsigned(u8 val_h, u8 val_l)
104{
105 u16 val_hl = (val_h << 8) | val_l;
106 return val_hl * 1000 / 256;
Davide Rizzo06160322009-03-31 15:24:27 -0700107}
Davide Rizzo06160322009-03-31 15:24:27 -0700108
Davide Rizzo0f1deb42010-11-18 07:23:00 -0800109static struct lm95241_data *lm95241_update_device(struct device *dev)
110{
Guenter Roeckf8096212014-01-20 09:25:50 -0800111 struct lm95241_data *data = dev_get_drvdata(dev);
112 struct i2c_client *client = data->client;
Davide Rizzo0f1deb42010-11-18 07:23:00 -0800113
114 mutex_lock(&data->update_lock);
115
Guenter Roeckf48ccb22016-07-03 21:46:05 -0700116 if (time_after(jiffies, data->last_updated
117 + msecs_to_jiffies(data->interval)) ||
Davide Rizzo0f1deb42010-11-18 07:23:00 -0800118 !data->valid) {
119 int i;
120
Guenter Roeckf8096212014-01-20 09:25:50 -0800121 dev_dbg(dev, "Updating lm95241 data.\n");
Davide Rizzo0f1deb42010-11-18 07:23:00 -0800122 for (i = 0; i < ARRAY_SIZE(lm95241_reg_address); i++)
123 data->temp[i]
124 = i2c_smbus_read_byte_data(client,
125 lm95241_reg_address[i]);
Guenter Roeck090a7f82016-07-04 06:46:31 -0700126
127 data->status = i2c_smbus_read_byte_data(client,
128 LM95241_REG_R_STATUS);
Davide Rizzo0f1deb42010-11-18 07:23:00 -0800129 data->last_updated = jiffies;
130 data->valid = 1;
131 }
132
133 mutex_unlock(&data->update_lock);
134
135 return data;
136}
137
Guenter Roeck3e904622016-07-04 19:58:11 -0700138static int lm95241_read_chip(struct device *dev, u32 attr, int channel,
139 long *val)
Davide Rizzo0f1deb42010-11-18 07:23:00 -0800140{
Guenter Roeckf8096212014-01-20 09:25:50 -0800141 struct lm95241_data *data = dev_get_drvdata(dev);
Davide Rizzo0f1deb42010-11-18 07:23:00 -0800142
Guenter Roeck3e904622016-07-04 19:58:11 -0700143 switch (attr) {
144 case hwmon_chip_update_interval:
145 *val = data->interval;
146 return 0;
147 default:
148 return -EOPNOTSUPP;
149 }
Davide Rizzo0f1deb42010-11-18 07:23:00 -0800150}
151
Guenter Roeck3e904622016-07-04 19:58:11 -0700152static int lm95241_read_temp(struct device *dev, u32 attr, int channel,
153 long *val)
154{
155 struct lm95241_data *data = lm95241_update_device(dev);
156
157 switch (attr) {
158 case hwmon_temp_input:
159 if (!channel || (data->config & BIT(channel - 1)))
160 *val = temp_from_reg_signed(data->temp[channel * 2],
161 data->temp[channel * 2 + 1]);
162 else
163 *val = temp_from_reg_unsigned(data->temp[channel * 2],
164 data->temp[channel * 2 + 1]);
165 return 0;
166 case hwmon_temp_min:
167 if (channel == 1)
168 *val = (data->config & R1DF_MASK) ? -128000 : 0;
169 else
170 *val = (data->config & R2DF_MASK) ? -128000 : 0;
171 return 0;
172 case hwmon_temp_max:
173 if (channel == 1)
174 *val = (data->config & R1DF_MASK) ? 127875 : 255875;
175 else
176 *val = (data->config & R2DF_MASK) ? 127875 : 255875;
177 return 0;
178 case hwmon_temp_type:
179 if (channel == 1)
180 *val = (data->model & R1MS_MASK) ? 1 : 2;
181 else
182 *val = (data->model & R2MS_MASK) ? 1 : 2;
183 return 0;
184 case hwmon_temp_fault:
185 if (channel == 1)
186 *val = !!(data->status & R1DM);
187 else
188 *val = !!(data->status & R2DM);
189 return 0;
190 default:
191 return -EOPNOTSUPP;
192 }
193}
194
195static int lm95241_read(struct device *dev, enum hwmon_sensor_types type,
196 u32 attr, int channel, long *val)
197{
198 switch (type) {
199 case hwmon_chip:
200 return lm95241_read_chip(dev, attr, channel, val);
201 case hwmon_temp:
202 return lm95241_read_temp(dev, attr, channel, val);
203 default:
204 return -EOPNOTSUPP;
205 }
206}
207
208static int lm95241_write_chip(struct device *dev, u32 attr, int channel,
209 long val)
210{
211 struct lm95241_data *data = dev_get_drvdata(dev);
212 int convrate;
213 u8 config;
214 int ret;
215
216 mutex_lock(&data->update_lock);
217
218 switch (attr) {
219 case hwmon_chip_update_interval:
220 config = data->config & ~CFG_CRMASK;
221 if (val < 130) {
222 convrate = 76;
223 config |= CFG_CR0076;
224 } else if (val < 590) {
225 convrate = 182;
226 config |= CFG_CR0182;
227 } else if (val < 1850) {
228 convrate = 1000;
229 config |= CFG_CR1000;
230 } else {
231 convrate = 2700;
232 config |= CFG_CR2700;
233 }
234 data->interval = convrate;
235 data->config = config;
236 ret = i2c_smbus_write_byte_data(data->client,
237 LM95241_REG_RW_CONFIG, config);
238 break;
239 default:
240 ret = -EOPNOTSUPP;
241 break;
242 }
243 mutex_unlock(&data->update_lock);
244 return ret;
245}
246
247static int lm95241_write_temp(struct device *dev, u32 attr, int channel,
248 long val)
Davide Rizzo0f1deb42010-11-18 07:23:00 -0800249{
Guenter Roeckf8096212014-01-20 09:25:50 -0800250 struct lm95241_data *data = dev_get_drvdata(dev);
251 struct i2c_client *client = data->client;
Guenter Roeck3e904622016-07-04 19:58:11 -0700252 int ret;
Davide Rizzo0f1deb42010-11-18 07:23:00 -0800253
254 mutex_lock(&data->update_lock);
255
Guenter Roeck3e904622016-07-04 19:58:11 -0700256 switch (attr) {
257 case hwmon_temp_min:
258 if (channel == 1) {
259 if (val < 0)
260 data->config |= R1DF_MASK;
261 else
262 data->config &= ~R1DF_MASK;
263 } else {
264 if (val < 0)
265 data->config |= R2DF_MASK;
266 else
267 data->config &= ~R2DF_MASK;
268 }
269 data->valid = 0;
270 ret = i2c_smbus_write_byte_data(client, LM95241_REG_RW_CONFIG,
271 data->config);
272 break;
273 case hwmon_temp_max:
274 if (channel == 1) {
275 if (val <= 127875)
276 data->config |= R1DF_MASK;
277 else
278 data->config &= ~R1DF_MASK;
279 } else {
280 if (val <= 127875)
281 data->config |= R2DF_MASK;
282 else
283 data->config &= ~R2DF_MASK;
284 }
285 data->valid = 0;
286 ret = i2c_smbus_write_byte_data(client, LM95241_REG_RW_CONFIG,
287 data->config);
288 break;
289 case hwmon_temp_type:
290 if (val != 1 && val != 2) {
291 ret = -EINVAL;
292 break;
293 }
294 if (channel == 1) {
295 data->trutherm &= ~(TT_MASK << TT1_SHIFT);
296 if (val == 1) {
297 data->model |= R1MS_MASK;
298 data->trutherm |= (TT_ON << TT1_SHIFT);
299 } else {
300 data->model &= ~R1MS_MASK;
301 data->trutherm |= (TT_OFF << TT1_SHIFT);
302 }
303 } else {
304 data->trutherm &= ~(TT_MASK << TT2_SHIFT);
305 if (val == 1) {
306 data->model |= R2MS_MASK;
307 data->trutherm |= (TT_ON << TT2_SHIFT);
308 } else {
309 data->model &= ~R2MS_MASK;
310 data->trutherm |= (TT_OFF << TT2_SHIFT);
311 }
312 }
313 ret = i2c_smbus_write_byte_data(client,
314 LM95241_REG_RW_REMOTE_MODEL,
315 data->model);
316 if (ret < 0)
317 break;
318 ret = i2c_smbus_write_byte_data(client, LM95241_REG_RW_TRUTHERM,
319 data->trutherm);
320 break;
321 default:
322 ret = -EOPNOTSUPP;
323 break;
Guenter Roeckf48ccb22016-07-03 21:46:05 -0700324 }
325
Guenter Roeckf48ccb22016-07-03 21:46:05 -0700326 mutex_unlock(&data->update_lock);
Davide Rizzo06160322009-03-31 15:24:27 -0700327
Guenter Roeck3e904622016-07-04 19:58:11 -0700328 return ret;
Davide Rizzo06160322009-03-31 15:24:27 -0700329}
330
Guenter Roeck3e904622016-07-04 19:58:11 -0700331static int lm95241_write(struct device *dev, enum hwmon_sensor_types type,
332 u32 attr, int channel, long val)
333{
334 switch (type) {
335 case hwmon_chip:
336 return lm95241_write_chip(dev, attr, channel, val);
337 case hwmon_temp:
338 return lm95241_write_temp(dev, attr, channel, val);
339 default:
340 return -EOPNOTSUPP;
341 }
342}
Davide Rizzo06160322009-03-31 15:24:27 -0700343
Guenter Roeck3e904622016-07-04 19:58:11 -0700344static umode_t lm95241_is_visible(const void *data,
345 enum hwmon_sensor_types type,
346 u32 attr, int channel)
347{
348 switch (type) {
349 case hwmon_chip:
350 switch (attr) {
351 case hwmon_chip_update_interval:
352 return S_IRUGO | S_IWUSR;
353 }
354 break;
355 case hwmon_temp:
356 switch (attr) {
357 case hwmon_temp_input:
358 return S_IRUGO;
359 case hwmon_temp_fault:
360 return S_IRUGO;
361 case hwmon_temp_min:
362 case hwmon_temp_max:
363 case hwmon_temp_type:
364 return S_IRUGO | S_IWUSR;
365 }
366 break;
367 default:
368 break;
369 }
370 return 0;
371}
Davide Rizzo06160322009-03-31 15:24:27 -0700372
Jean Delvare797eaa42009-04-07 15:32:59 +0200373/* Return 0 if detection is successful, -ENODEV otherwise */
Jean Delvare310ec792009-12-14 21:17:23 +0100374static int lm95241_detect(struct i2c_client *new_client,
Jean Delvare797eaa42009-04-07 15:32:59 +0200375 struct i2c_board_info *info)
Davide Rizzo06160322009-03-31 15:24:27 -0700376{
Jean Delvare797eaa42009-04-07 15:32:59 +0200377 struct i2c_adapter *adapter = new_client->adapter;
Jean Delvare52df6442009-12-09 20:35:57 +0100378 const char *name;
Guenter Roeck8c1d0412011-07-05 13:31:48 -0700379 int mfg_id, chip_id;
Davide Rizzo06160322009-03-31 15:24:27 -0700380
381 if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA))
Jean Delvare797eaa42009-04-07 15:32:59 +0200382 return -ENODEV;
Davide Rizzo06160322009-03-31 15:24:27 -0700383
Guenter Roeck8c1d0412011-07-05 13:31:48 -0700384 mfg_id = i2c_smbus_read_byte_data(new_client, LM95241_REG_R_MAN_ID);
385 if (mfg_id != NATSEMI_MAN_ID)
386 return -ENODEV;
387
388 chip_id = i2c_smbus_read_byte_data(new_client, LM95241_REG_R_CHIP_ID);
389 switch (chip_id) {
390 case LM95231_CHIP_ID:
391 name = "lm95231";
392 break;
393 case LM95241_CHIP_ID:
394 name = "lm95241";
395 break;
396 default:
Jean Delvare52df6442009-12-09 20:35:57 +0100397 return -ENODEV;
Davide Rizzo06160322009-03-31 15:24:27 -0700398 }
399
Jean Delvare797eaa42009-04-07 15:32:59 +0200400 /* Fill the i2c board info */
Jean Delvare797eaa42009-04-07 15:32:59 +0200401 strlcpy(info->type, name, I2C_NAME_SIZE);
402 return 0;
403}
Davide Rizzo06160322009-03-31 15:24:27 -0700404
Guenter Roeckf8096212014-01-20 09:25:50 -0800405static void lm95241_init_client(struct i2c_client *client,
406 struct lm95241_data *data)
Davide Rizzo0f1deb42010-11-18 07:23:00 -0800407{
Guenter Roeckf48ccb22016-07-03 21:46:05 -0700408 data->interval = 1000;
409 data->config = CFG_CR1000;
Davide Rizzo0f1deb42010-11-18 07:23:00 -0800410 data->trutherm = (TT_OFF << TT1_SHIFT) | (TT_OFF << TT2_SHIFT);
411
412 i2c_smbus_write_byte_data(client, LM95241_REG_RW_CONFIG, data->config);
413 i2c_smbus_write_byte_data(client, LM95241_REG_RW_REM_FILTER,
414 R1FE_MASK | R2FE_MASK);
415 i2c_smbus_write_byte_data(client, LM95241_REG_RW_TRUTHERM,
416 data->trutherm);
417 i2c_smbus_write_byte_data(client, LM95241_REG_RW_REMOTE_MODEL,
418 data->model);
419}
420
Guenter Roeck3e904622016-07-04 19:58:11 -0700421static const u32 lm95241_chip_config[] = {
422 HWMON_C_UPDATE_INTERVAL,
423 0
424};
425
426static const struct hwmon_channel_info lm95241_chip = {
427 .type = hwmon_chip,
428 .config = lm95241_chip_config,
429};
430
431static const u32 lm95241_temp_config[] = {
432 HWMON_T_INPUT,
433 HWMON_T_INPUT | HWMON_T_MAX | HWMON_T_MIN | HWMON_T_TYPE |
434 HWMON_T_FAULT,
435 HWMON_T_INPUT | HWMON_T_MAX | HWMON_T_MIN | HWMON_T_TYPE |
436 HWMON_T_FAULT,
437 0
438};
439
440static const struct hwmon_channel_info lm95241_temp = {
441 .type = hwmon_temp,
442 .config = lm95241_temp_config,
443};
444
445static const struct hwmon_channel_info *lm95241_info[] = {
446 &lm95241_chip,
447 &lm95241_temp,
448 NULL
449};
450
451static const struct hwmon_ops lm95241_hwmon_ops = {
452 .is_visible = lm95241_is_visible,
453 .read = lm95241_read,
454 .write = lm95241_write,
455};
456
457static const struct hwmon_chip_info lm95241_chip_info = {
458 .ops = &lm95241_hwmon_ops,
459 .info = lm95241_info,
460};
461
Guenter Roeckf8096212014-01-20 09:25:50 -0800462static int lm95241_probe(struct i2c_client *client,
Jean Delvare797eaa42009-04-07 15:32:59 +0200463 const struct i2c_device_id *id)
464{
Guenter Roeckf8096212014-01-20 09:25:50 -0800465 struct device *dev = &client->dev;
Jean Delvare797eaa42009-04-07 15:32:59 +0200466 struct lm95241_data *data;
Guenter Roeckf8096212014-01-20 09:25:50 -0800467 struct device *hwmon_dev;
Jean Delvare797eaa42009-04-07 15:32:59 +0200468
Guenter Roeckf8096212014-01-20 09:25:50 -0800469 data = devm_kzalloc(dev, sizeof(struct lm95241_data), GFP_KERNEL);
Guenter Roeck1487bf72012-06-02 09:58:11 -0700470 if (!data)
471 return -ENOMEM;
Jean Delvare797eaa42009-04-07 15:32:59 +0200472
Guenter Roeckf8096212014-01-20 09:25:50 -0800473 data->client = client;
Davide Rizzo06160322009-03-31 15:24:27 -0700474 mutex_init(&data->update_lock);
475
Davide Rizzo06160322009-03-31 15:24:27 -0700476 /* Initialize the LM95241 chip */
Guenter Roeckf8096212014-01-20 09:25:50 -0800477 lm95241_init_client(client, data);
Davide Rizzo06160322009-03-31 15:24:27 -0700478
Guenter Roeck3e904622016-07-04 19:58:11 -0700479 hwmon_dev = devm_hwmon_device_register_with_info(dev, client->name,
Guenter Roeckf8096212014-01-20 09:25:50 -0800480 data,
Guenter Roeck3e904622016-07-04 19:58:11 -0700481 &lm95241_chip_info,
482 NULL);
Guenter Roeckf8096212014-01-20 09:25:50 -0800483 return PTR_ERR_OR_ZERO(hwmon_dev);
Davide Rizzo06160322009-03-31 15:24:27 -0700484}
485
Jean Delvare797eaa42009-04-07 15:32:59 +0200486/* Driver data (common to all clients) */
487static const struct i2c_device_id lm95241_id[] = {
Guenter Roeck8c1d0412011-07-05 13:31:48 -0700488 { "lm95231", 0 },
489 { "lm95241", 0 },
Jean Delvare797eaa42009-04-07 15:32:59 +0200490 { }
491};
492MODULE_DEVICE_TABLE(i2c, lm95241_id);
493
494static struct i2c_driver lm95241_driver = {
495 .class = I2C_CLASS_HWMON,
496 .driver = {
Davide Rizzo0f1deb42010-11-18 07:23:00 -0800497 .name = DEVNAME,
Jean Delvare797eaa42009-04-07 15:32:59 +0200498 },
499 .probe = lm95241_probe,
Jean Delvare797eaa42009-04-07 15:32:59 +0200500 .id_table = lm95241_id,
501 .detect = lm95241_detect,
Jean Delvarec3813d62009-12-14 21:17:25 +0100502 .address_list = normal_i2c,
Jean Delvare797eaa42009-04-07 15:32:59 +0200503};
504
Axel Linf0967ee2012-01-20 15:38:18 +0800505module_i2c_driver(lm95241_driver);
Davide Rizzo06160322009-03-31 15:24:27 -0700506
Davide Rizzo0f1deb42010-11-18 07:23:00 -0800507MODULE_AUTHOR("Davide Rizzo <elpa.rizzo@gmail.com>");
Axel Lin0a8784e2016-09-13 15:27:48 +0800508MODULE_DESCRIPTION("LM95231/LM95241 sensor driver");
Davide Rizzo06160322009-03-31 15:24:27 -0700509MODULE_LICENSE("GPL");