blob: df52cb355f7dd10b093bff43796c283c62c9bb26 [file] [log] [blame]
Evgeniy Polyakovbaf12ae2005-12-06 13:38:28 +03001/**
2 * ds2482.c - provides i2c to w1-master bridge(s)
3 * Copyright (C) 2005 Ben Gardner <bgardner@wabtec.com>
4 *
5 * The DS2482 is a sensor chip made by Dallas Semiconductor (Maxim).
6 * It is a I2C to 1-wire bridge.
7 * There are two variations: -100 and -800, which have 1 or 8 1-wire ports.
8 * The complete datasheet can be obtained from MAXIM's website at:
9 * http://www.maxim-ic.com/quick_view2.cfm/qv_pk/4382
10 *
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; version 2 of the License.
14 */
15
16#include <linux/module.h>
17#include <linux/init.h>
18#include <linux/slab.h>
19#include <linux/i2c.h>
20#include <linux/delay.h>
21#include <asm/delay.h>
22
23#include "../w1.h"
24#include "../w1_int.h"
25
26/**
27 * Address is selected using 2 pins, resulting in 4 possible addresses.
28 * 0x18, 0x19, 0x1a, 0x1b
29 * However, the chip cannot be detected without doing an i2c write,
30 * so use the force module parameter.
31 */
Jean Delvare2cdddeb2008-01-27 18:14:47 +010032static const unsigned short normal_i2c[] = { I2C_CLIENT_END };
Evgeniy Polyakovbaf12ae2005-12-06 13:38:28 +030033
34/**
35 * Insmod parameters
36 */
37I2C_CLIENT_INSMOD_1(ds2482);
38
39/**
40 * The DS2482 registers - there are 3 registers that are addressed by a read
41 * pointer. The read pointer is set by the last command executed.
42 *
43 * To read the data, issue a register read for any address
44 */
45#define DS2482_CMD_RESET 0xF0 /* No param */
46#define DS2482_CMD_SET_READ_PTR 0xE1 /* Param: DS2482_PTR_CODE_xxx */
47#define DS2482_CMD_CHANNEL_SELECT 0xC3 /* Param: Channel byte - DS2482-800 only */
48#define DS2482_CMD_WRITE_CONFIG 0xD2 /* Param: Config byte */
49#define DS2482_CMD_1WIRE_RESET 0xB4 /* Param: None */
50#define DS2482_CMD_1WIRE_SINGLE_BIT 0x87 /* Param: Bit byte (bit7) */
51#define DS2482_CMD_1WIRE_WRITE_BYTE 0xA5 /* Param: Data byte */
52#define DS2482_CMD_1WIRE_READ_BYTE 0x96 /* Param: None */
53/* Note to read the byte, Set the ReadPtr to Data then read (any addr) */
54#define DS2482_CMD_1WIRE_TRIPLET 0x78 /* Param: Dir byte (bit7) */
55
56/* Values for DS2482_CMD_SET_READ_PTR */
57#define DS2482_PTR_CODE_STATUS 0xF0
58#define DS2482_PTR_CODE_DATA 0xE1
59#define DS2482_PTR_CODE_CHANNEL 0xD2 /* DS2482-800 only */
60#define DS2482_PTR_CODE_CONFIG 0xC3
61
62/**
63 * Configure Register bit definitions
64 * The top 4 bits always read 0.
65 * To write, the top nibble must be the 1's compl. of the low nibble.
66 */
67#define DS2482_REG_CFG_1WS 0x08
68#define DS2482_REG_CFG_SPU 0x04
69#define DS2482_REG_CFG_PPM 0x02
70#define DS2482_REG_CFG_APU 0x01
71
72
73/**
74 * Write and verify codes for the CHANNEL_SELECT command (DS2482-800 only).
75 * To set the channel, write the value at the index of the channel.
76 * Read and compare against the corresponding value to verify the change.
77 */
78static const u8 ds2482_chan_wr[8] =
79 { 0xF0, 0xE1, 0xD2, 0xC3, 0xB4, 0xA5, 0x96, 0x87 };
80static const u8 ds2482_chan_rd[8] =
81 { 0xB8, 0xB1, 0xAA, 0xA3, 0x9C, 0x95, 0x8E, 0x87 };
82
83
84/**
85 * Status Register bit definitions (read only)
86 */
87#define DS2482_REG_STS_DIR 0x80
88#define DS2482_REG_STS_TSB 0x40
89#define DS2482_REG_STS_SBR 0x20
90#define DS2482_REG_STS_RST 0x10
91#define DS2482_REG_STS_LL 0x08
92#define DS2482_REG_STS_SD 0x04
93#define DS2482_REG_STS_PPD 0x02
94#define DS2482_REG_STS_1WB 0x01
95
96
Jean Delvare61c91f72008-07-16 19:30:07 +020097static int ds2482_probe(struct i2c_client *client,
98 const struct i2c_device_id *id);
99static int ds2482_detect(struct i2c_client *client, int kind,
100 struct i2c_board_info *info);
101static int ds2482_remove(struct i2c_client *client);
Evgeniy Polyakovbaf12ae2005-12-06 13:38:28 +0300102
103
104/**
105 * Driver data (common to all clients)
106 */
Jean Delvare61c91f72008-07-16 19:30:07 +0200107static const struct i2c_device_id ds2482_id[] = {
108 { "ds2482", 0 },
109 { }
110};
111
Evgeniy Polyakovbaf12ae2005-12-06 13:38:28 +0300112static struct i2c_driver ds2482_driver = {
113 .driver = {
114 .owner = THIS_MODULE,
115 .name = "ds2482",
116 },
Jean Delvare61c91f72008-07-16 19:30:07 +0200117 .probe = ds2482_probe,
118 .remove = ds2482_remove,
119 .id_table = ds2482_id,
120 .detect = ds2482_detect,
121 .address_data = &addr_data,
Evgeniy Polyakovbaf12ae2005-12-06 13:38:28 +0300122};
123
124/*
125 * Client data (each client gets its own)
126 */
127
128struct ds2482_data;
129
130struct ds2482_w1_chan {
131 struct ds2482_data *pdev;
132 u8 channel;
133 struct w1_bus_master w1_bm;
134};
135
136struct ds2482_data {
Jean Delvare61c91f72008-07-16 19:30:07 +0200137 struct i2c_client *client;
Evgeniy Polyakovabd52a12006-04-03 12:04:27 +0400138 struct mutex access_lock;
Evgeniy Polyakovbaf12ae2005-12-06 13:38:28 +0300139
140 /* 1-wire interface(s) */
141 int w1_count; /* 1 or 8 */
142 struct ds2482_w1_chan w1_ch[8];
143
144 /* per-device values */
145 u8 channel;
146 u8 read_prt; /* see DS2482_PTR_CODE_xxx */
147 u8 reg_config;
148};
149
150
151/**
152 * Sets the read pointer.
153 * @param pdev The ds2482 client pointer
154 * @param read_ptr see DS2482_PTR_CODE_xxx above
155 * @return -1 on failure, 0 on success
156 */
157static inline int ds2482_select_register(struct ds2482_data *pdev, u8 read_ptr)
158{
159 if (pdev->read_prt != read_ptr) {
Jean Delvare61c91f72008-07-16 19:30:07 +0200160 if (i2c_smbus_write_byte_data(pdev->client,
Evgeniy Polyakovbaf12ae2005-12-06 13:38:28 +0300161 DS2482_CMD_SET_READ_PTR,
162 read_ptr) < 0)
163 return -1;
164
165 pdev->read_prt = read_ptr;
166 }
167 return 0;
168}
169
170/**
171 * Sends a command without a parameter
172 * @param pdev The ds2482 client pointer
173 * @param cmd DS2482_CMD_RESET,
174 * DS2482_CMD_1WIRE_RESET,
175 * DS2482_CMD_1WIRE_READ_BYTE
176 * @return -1 on failure, 0 on success
177 */
178static inline int ds2482_send_cmd(struct ds2482_data *pdev, u8 cmd)
179{
Jean Delvare61c91f72008-07-16 19:30:07 +0200180 if (i2c_smbus_write_byte(pdev->client, cmd) < 0)
Evgeniy Polyakovbaf12ae2005-12-06 13:38:28 +0300181 return -1;
182
183 pdev->read_prt = DS2482_PTR_CODE_STATUS;
184 return 0;
185}
186
187/**
188 * Sends a command with a parameter
189 * @param pdev The ds2482 client pointer
190 * @param cmd DS2482_CMD_WRITE_CONFIG,
191 * DS2482_CMD_1WIRE_SINGLE_BIT,
192 * DS2482_CMD_1WIRE_WRITE_BYTE,
193 * DS2482_CMD_1WIRE_TRIPLET
194 * @param byte The data to send
195 * @return -1 on failure, 0 on success
196 */
197static inline int ds2482_send_cmd_data(struct ds2482_data *pdev,
198 u8 cmd, u8 byte)
199{
Jean Delvare61c91f72008-07-16 19:30:07 +0200200 if (i2c_smbus_write_byte_data(pdev->client, cmd, byte) < 0)
Evgeniy Polyakovbaf12ae2005-12-06 13:38:28 +0300201 return -1;
202
203 /* all cmds leave in STATUS, except CONFIG */
204 pdev->read_prt = (cmd != DS2482_CMD_WRITE_CONFIG) ?
205 DS2482_PTR_CODE_STATUS : DS2482_PTR_CODE_CONFIG;
206 return 0;
207}
208
209
210/*
211 * 1-Wire interface code
212 */
213
214#define DS2482_WAIT_IDLE_TIMEOUT 100
215
216/**
217 * Waits until the 1-wire interface is idle (not busy)
218 *
219 * @param pdev Pointer to the device structure
220 * @return the last value read from status or -1 (failure)
221 */
222static int ds2482_wait_1wire_idle(struct ds2482_data *pdev)
223{
224 int temp = -1;
225 int retries = 0;
226
227 if (!ds2482_select_register(pdev, DS2482_PTR_CODE_STATUS)) {
228 do {
Jean Delvare61c91f72008-07-16 19:30:07 +0200229 temp = i2c_smbus_read_byte(pdev->client);
Evgeniy Polyakovbaf12ae2005-12-06 13:38:28 +0300230 } while ((temp >= 0) && (temp & DS2482_REG_STS_1WB) &&
Ben Gardnerb4786f12006-06-29 22:33:22 +0400231 (++retries < DS2482_WAIT_IDLE_TIMEOUT));
Evgeniy Polyakovbaf12ae2005-12-06 13:38:28 +0300232 }
233
234 if (retries > DS2482_WAIT_IDLE_TIMEOUT)
235 printk(KERN_ERR "%s: timeout on channel %d\n",
236 __func__, pdev->channel);
237
238 return temp;
239}
240
241/**
242 * Selects a w1 channel.
243 * The 1-wire interface must be idle before calling this function.
244 *
245 * @param pdev The ds2482 client pointer
246 * @param channel 0-7
247 * @return -1 (failure) or 0 (success)
248 */
249static int ds2482_set_channel(struct ds2482_data *pdev, u8 channel)
250{
Jean Delvare61c91f72008-07-16 19:30:07 +0200251 if (i2c_smbus_write_byte_data(pdev->client, DS2482_CMD_CHANNEL_SELECT,
Evgeniy Polyakovbaf12ae2005-12-06 13:38:28 +0300252 ds2482_chan_wr[channel]) < 0)
253 return -1;
254
255 pdev->read_prt = DS2482_PTR_CODE_CHANNEL;
256 pdev->channel = -1;
Jean Delvare61c91f72008-07-16 19:30:07 +0200257 if (i2c_smbus_read_byte(pdev->client) == ds2482_chan_rd[channel]) {
Evgeniy Polyakovbaf12ae2005-12-06 13:38:28 +0300258 pdev->channel = channel;
259 return 0;
260 }
261 return -1;
262}
263
264
265/**
266 * Performs the touch-bit function, which writes a 0 or 1 and reads the level.
267 *
268 * @param data The ds2482 channel pointer
269 * @param bit The level to write: 0 or non-zero
270 * @return The level read: 0 or 1
271 */
272static u8 ds2482_w1_touch_bit(void *data, u8 bit)
273{
274 struct ds2482_w1_chan *pchan = data;
275 struct ds2482_data *pdev = pchan->pdev;
276 int status = -1;
277
Evgeniy Polyakovabd52a12006-04-03 12:04:27 +0400278 mutex_lock(&pdev->access_lock);
Evgeniy Polyakovbaf12ae2005-12-06 13:38:28 +0300279
280 /* Select the channel */
281 ds2482_wait_1wire_idle(pdev);
282 if (pdev->w1_count > 1)
283 ds2482_set_channel(pdev, pchan->channel);
284
285 /* Send the touch command, wait until 1WB == 0, return the status */
286 if (!ds2482_send_cmd_data(pdev, DS2482_CMD_1WIRE_SINGLE_BIT,
287 bit ? 0xFF : 0))
288 status = ds2482_wait_1wire_idle(pdev);
289
Evgeniy Polyakovabd52a12006-04-03 12:04:27 +0400290 mutex_unlock(&pdev->access_lock);
Evgeniy Polyakovbaf12ae2005-12-06 13:38:28 +0300291
292 return (status & DS2482_REG_STS_SBR) ? 1 : 0;
293}
294
295/**
296 * Performs the triplet function, which reads two bits and writes a bit.
297 * The bit written is determined by the two reads:
298 * 00 => dbit, 01 => 0, 10 => 1
299 *
300 * @param data The ds2482 channel pointer
301 * @param dbit The direction to choose if both branches are valid
302 * @return b0=read1 b1=read2 b3=bit written
303 */
304static u8 ds2482_w1_triplet(void *data, u8 dbit)
305{
306 struct ds2482_w1_chan *pchan = data;
307 struct ds2482_data *pdev = pchan->pdev;
308 int status = (3 << 5);
309
Evgeniy Polyakovabd52a12006-04-03 12:04:27 +0400310 mutex_lock(&pdev->access_lock);
Evgeniy Polyakovbaf12ae2005-12-06 13:38:28 +0300311
312 /* Select the channel */
313 ds2482_wait_1wire_idle(pdev);
314 if (pdev->w1_count > 1)
315 ds2482_set_channel(pdev, pchan->channel);
316
317 /* Send the triplet command, wait until 1WB == 0, return the status */
318 if (!ds2482_send_cmd_data(pdev, DS2482_CMD_1WIRE_TRIPLET,
319 dbit ? 0xFF : 0))
320 status = ds2482_wait_1wire_idle(pdev);
321
Evgeniy Polyakovabd52a12006-04-03 12:04:27 +0400322 mutex_unlock(&pdev->access_lock);
Evgeniy Polyakovbaf12ae2005-12-06 13:38:28 +0300323
324 /* Decode the status */
325 return (status >> 5);
326}
327
328/**
329 * Performs the write byte function.
330 *
331 * @param data The ds2482 channel pointer
332 * @param byte The value to write
333 */
334static void ds2482_w1_write_byte(void *data, u8 byte)
335{
336 struct ds2482_w1_chan *pchan = data;
337 struct ds2482_data *pdev = pchan->pdev;
338
Evgeniy Polyakovabd52a12006-04-03 12:04:27 +0400339 mutex_lock(&pdev->access_lock);
Evgeniy Polyakovbaf12ae2005-12-06 13:38:28 +0300340
341 /* Select the channel */
342 ds2482_wait_1wire_idle(pdev);
343 if (pdev->w1_count > 1)
344 ds2482_set_channel(pdev, pchan->channel);
345
346 /* Send the write byte command */
347 ds2482_send_cmd_data(pdev, DS2482_CMD_1WIRE_WRITE_BYTE, byte);
348
Evgeniy Polyakovabd52a12006-04-03 12:04:27 +0400349 mutex_unlock(&pdev->access_lock);
Evgeniy Polyakovbaf12ae2005-12-06 13:38:28 +0300350}
351
352/**
353 * Performs the read byte function.
354 *
355 * @param data The ds2482 channel pointer
356 * @return The value read
357 */
358static u8 ds2482_w1_read_byte(void *data)
359{
360 struct ds2482_w1_chan *pchan = data;
361 struct ds2482_data *pdev = pchan->pdev;
362 int result;
363
Evgeniy Polyakovabd52a12006-04-03 12:04:27 +0400364 mutex_lock(&pdev->access_lock);
Evgeniy Polyakovbaf12ae2005-12-06 13:38:28 +0300365
366 /* Select the channel */
367 ds2482_wait_1wire_idle(pdev);
368 if (pdev->w1_count > 1)
369 ds2482_set_channel(pdev, pchan->channel);
370
371 /* Send the read byte command */
372 ds2482_send_cmd(pdev, DS2482_CMD_1WIRE_READ_BYTE);
373
374 /* Wait until 1WB == 0 */
375 ds2482_wait_1wire_idle(pdev);
376
377 /* Select the data register */
378 ds2482_select_register(pdev, DS2482_PTR_CODE_DATA);
379
380 /* Read the data byte */
Jean Delvare61c91f72008-07-16 19:30:07 +0200381 result = i2c_smbus_read_byte(pdev->client);
Evgeniy Polyakovbaf12ae2005-12-06 13:38:28 +0300382
Evgeniy Polyakovabd52a12006-04-03 12:04:27 +0400383 mutex_unlock(&pdev->access_lock);
Evgeniy Polyakovbaf12ae2005-12-06 13:38:28 +0300384
385 return result;
386}
387
388
389/**
390 * Sends a reset on the 1-wire interface
391 *
392 * @param data The ds2482 channel pointer
393 * @return 0=Device present, 1=No device present or error
394 */
395static u8 ds2482_w1_reset_bus(void *data)
396{
397 struct ds2482_w1_chan *pchan = data;
398 struct ds2482_data *pdev = pchan->pdev;
399 int err;
400 u8 retval = 1;
401
Evgeniy Polyakovabd52a12006-04-03 12:04:27 +0400402 mutex_lock(&pdev->access_lock);
Evgeniy Polyakovbaf12ae2005-12-06 13:38:28 +0300403
404 /* Select the channel */
405 ds2482_wait_1wire_idle(pdev);
406 if (pdev->w1_count > 1)
407 ds2482_set_channel(pdev, pchan->channel);
408
409 /* Send the reset command */
410 err = ds2482_send_cmd(pdev, DS2482_CMD_1WIRE_RESET);
411 if (err >= 0) {
412 /* Wait until the reset is complete */
413 err = ds2482_wait_1wire_idle(pdev);
414 retval = !(err & DS2482_REG_STS_PPD);
415
416 /* If the chip did reset since detect, re-config it */
417 if (err & DS2482_REG_STS_RST)
418 ds2482_send_cmd_data(pdev, DS2482_CMD_WRITE_CONFIG,
419 0xF0);
420 }
421
Evgeniy Polyakovabd52a12006-04-03 12:04:27 +0400422 mutex_unlock(&pdev->access_lock);
Evgeniy Polyakovbaf12ae2005-12-06 13:38:28 +0300423
424 return retval;
425}
426
427
Jean Delvare61c91f72008-07-16 19:30:07 +0200428static int ds2482_detect(struct i2c_client *client, int kind,
429 struct i2c_board_info *info)
Evgeniy Polyakovbaf12ae2005-12-06 13:38:28 +0300430{
Jean Delvare61c91f72008-07-16 19:30:07 +0200431 if (!i2c_check_functionality(client->adapter,
Evgeniy Polyakovbaf12ae2005-12-06 13:38:28 +0300432 I2C_FUNC_SMBUS_WRITE_BYTE_DATA |
433 I2C_FUNC_SMBUS_BYTE))
Jean Delvare61c91f72008-07-16 19:30:07 +0200434 return -ENODEV;
435
436 strlcpy(info->type, "ds2482", I2C_NAME_SIZE);
437
438 return 0;
439}
440
441static int ds2482_probe(struct i2c_client *client,
442 const struct i2c_device_id *id)
443{
444 struct ds2482_data *data;
445 int err = -ENODEV;
446 int temp1;
447 int idx;
Evgeniy Polyakovbaf12ae2005-12-06 13:38:28 +0300448
449 if (!(data = kzalloc(sizeof(struct ds2482_data), GFP_KERNEL))) {
450 err = -ENOMEM;
451 goto exit;
452 }
453
Jean Delvare61c91f72008-07-16 19:30:07 +0200454 data->client = client;
455 i2c_set_clientdata(client, data);
Evgeniy Polyakovbaf12ae2005-12-06 13:38:28 +0300456
457 /* Reset the device (sets the read_ptr to status) */
458 if (ds2482_send_cmd(data, DS2482_CMD_RESET) < 0) {
Jean Delvare61c91f72008-07-16 19:30:07 +0200459 dev_warn(&client->dev, "DS2482 reset failed.\n");
Evgeniy Polyakovbaf12ae2005-12-06 13:38:28 +0300460 goto exit_free;
461 }
462
463 /* Sleep at least 525ns to allow the reset to complete */
464 ndelay(525);
465
466 /* Read the status byte - only reset bit and line should be set */
Jean Delvare61c91f72008-07-16 19:30:07 +0200467 temp1 = i2c_smbus_read_byte(client);
Evgeniy Polyakovbaf12ae2005-12-06 13:38:28 +0300468 if (temp1 != (DS2482_REG_STS_LL | DS2482_REG_STS_RST)) {
Jean Delvare61c91f72008-07-16 19:30:07 +0200469 dev_warn(&client->dev, "DS2482 reset status "
470 "0x%02X - not a DS2482\n", temp1);
Evgeniy Polyakovbaf12ae2005-12-06 13:38:28 +0300471 goto exit_free;
472 }
473
474 /* Detect the 8-port version */
475 data->w1_count = 1;
476 if (ds2482_set_channel(data, 7) == 0)
477 data->w1_count = 8;
478
479 /* Set all config items to 0 (off) */
480 ds2482_send_cmd_data(data, DS2482_CMD_WRITE_CONFIG, 0xF0);
481
Evgeniy Polyakovabd52a12006-04-03 12:04:27 +0400482 mutex_init(&data->access_lock);
Evgeniy Polyakovbaf12ae2005-12-06 13:38:28 +0300483
Evgeniy Polyakovbaf12ae2005-12-06 13:38:28 +0300484 /* Register 1-wire interface(s) */
485 for (idx = 0; idx < data->w1_count; idx++) {
486 data->w1_ch[idx].pdev = data;
487 data->w1_ch[idx].channel = idx;
488
489 /* Populate all the w1 bus master stuff */
490 data->w1_ch[idx].w1_bm.data = &data->w1_ch[idx];
491 data->w1_ch[idx].w1_bm.read_byte = ds2482_w1_read_byte;
492 data->w1_ch[idx].w1_bm.write_byte = ds2482_w1_write_byte;
493 data->w1_ch[idx].w1_bm.touch_bit = ds2482_w1_touch_bit;
494 data->w1_ch[idx].w1_bm.triplet = ds2482_w1_triplet;
495 data->w1_ch[idx].w1_bm.reset_bus = ds2482_w1_reset_bus;
496
497 err = w1_add_master_device(&data->w1_ch[idx].w1_bm);
498 if (err) {
499 data->w1_ch[idx].pdev = NULL;
500 goto exit_w1_remove;
501 }
502 }
503
504 return 0;
505
506exit_w1_remove:
Evgeniy Polyakovbaf12ae2005-12-06 13:38:28 +0300507 for (idx = 0; idx < data->w1_count; idx++) {
508 if (data->w1_ch[idx].pdev != NULL)
509 w1_remove_master_device(&data->w1_ch[idx].w1_bm);
510 }
511exit_free:
512 kfree(data);
513exit:
514 return err;
515}
516
Jean Delvare61c91f72008-07-16 19:30:07 +0200517static int ds2482_remove(struct i2c_client *client)
Evgeniy Polyakovbaf12ae2005-12-06 13:38:28 +0300518{
519 struct ds2482_data *data = i2c_get_clientdata(client);
Jean Delvare61c91f72008-07-16 19:30:07 +0200520 int idx;
Evgeniy Polyakovbaf12ae2005-12-06 13:38:28 +0300521
522 /* Unregister the 1-wire bridge(s) */
523 for (idx = 0; idx < data->w1_count; idx++) {
524 if (data->w1_ch[idx].pdev != NULL)
525 w1_remove_master_device(&data->w1_ch[idx].w1_bm);
526 }
527
Evgeniy Polyakovbaf12ae2005-12-06 13:38:28 +0300528 /* Free the memory */
529 kfree(data);
530 return 0;
531}
532
533static int __init sensors_ds2482_init(void)
534{
535 return i2c_add_driver(&ds2482_driver);
536}
537
538static void __exit sensors_ds2482_exit(void)
539{
540 i2c_del_driver(&ds2482_driver);
541}
542
543MODULE_AUTHOR("Ben Gardner <bgardner@wabtec.com>");
544MODULE_DESCRIPTION("DS2482 driver");
545MODULE_LICENSE("GPL");
546
547module_init(sensors_ds2482_init);
548module_exit(sensors_ds2482_exit);