aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/w1
diff options
context:
space:
mode:
authorDave Jones <davej@redhat.com>2006-12-12 18:13:32 -0500
committerDave Jones <davej@redhat.com>2006-12-12 18:13:32 -0500
commitf0eef25339f92f7cd4aeea23d9ae97987a5a1e82 (patch)
tree2472e94d39f43a9580a6d2d5d92de0b749023263 /drivers/w1
parent0cfea5dd98205f2fa318836da664a7d7df1afbc1 (diff)
parente1036502e5263851259d147771226161e5ccc85a (diff)
Merge ../linus
Diffstat (limited to 'drivers/w1')
-rw-r--r--drivers/w1/Kconfig3
-rw-r--r--drivers/w1/Makefile4
-rw-r--r--drivers/w1/masters/matrox_w1.c2
-rw-r--r--drivers/w1/slaves/Makefile4
-rw-r--r--drivers/w1/slaves/w1_ds2433.c30
-rw-r--r--drivers/w1/slaves/w1_therm.c1
-rw-r--r--drivers/w1/w1.c1
7 files changed, 20 insertions, 25 deletions
diff --git a/drivers/w1/Kconfig b/drivers/w1/Kconfig
index 8b3d0f0c7bd5..c287a9ae4fdd 100644
--- a/drivers/w1/Kconfig
+++ b/drivers/w1/Kconfig
@@ -2,7 +2,6 @@ menu "Dallas's 1-wire bus"
2 2
3config W1 3config W1
4 tristate "Dallas's 1-wire support" 4 tristate "Dallas's 1-wire support"
5 depends on CONNECTOR
6 ---help--- 5 ---help---
7 Dallas' 1-wire bus is useful to connect slow 1-pin devices 6 Dallas' 1-wire bus is useful to connect slow 1-pin devices
8 such as iButtons and thermal sensors. 7 such as iButtons and thermal sensors.
@@ -21,7 +20,7 @@ config W1_CON
21 There are three types of messages between w1 core and userspace: 20 There are three types of messages between w1 core and userspace:
22 1. Events. They are generated each time new master or slave device found 21 1. Events. They are generated each time new master or slave device found
23 either due to automatic or requested search. 22 either due to automatic or requested search.
24 2. Userspace commands. Includes read/write and search/alarm search comamnds. 23 2. Userspace commands. Includes read/write and search/alarm search commands.
25 3. Replies to userspace commands. 24 3. Replies to userspace commands.
26 25
27source drivers/w1/masters/Kconfig 26source drivers/w1/masters/Kconfig
diff --git a/drivers/w1/Makefile b/drivers/w1/Makefile
index 93845a2c7c21..6bb0b54965f2 100644
--- a/drivers/w1/Makefile
+++ b/drivers/w1/Makefile
@@ -2,10 +2,6 @@
2# Makefile for the Dallas's 1-wire bus. 2# Makefile for the Dallas's 1-wire bus.
3# 3#
4 4
5ifeq ($(CONFIG_W1_DS2433_CRC), y)
6EXTRA_CFLAGS += -DCONFIG_W1_F23_CRC
7endif
8
9obj-$(CONFIG_W1) += wire.o 5obj-$(CONFIG_W1) += wire.o
10wire-objs := w1.o w1_int.o w1_family.o w1_netlink.o w1_io.o 6wire-objs := w1.o w1_int.o w1_family.o w1_netlink.o w1_io.o
11 7
diff --git a/drivers/w1/masters/matrox_w1.c b/drivers/w1/masters/matrox_w1.c
index 2788b8ca9bb1..6f9d880ab2e9 100644
--- a/drivers/w1/masters/matrox_w1.c
+++ b/drivers/w1/masters/matrox_w1.c
@@ -215,6 +215,8 @@ static int __devinit matrox_w1_probe(struct pci_dev *pdev, const struct pci_devi
215 return 0; 215 return 0;
216 216
217err_out_free_device: 217err_out_free_device:
218 if (dev->virt_addr)
219 iounmap(dev->virt_addr);
218 kfree(dev); 220 kfree(dev);
219 221
220 return err; 222 return err;
diff --git a/drivers/w1/slaves/Makefile b/drivers/w1/slaves/Makefile
index 70e21e2d70c3..725dcfdfddb4 100644
--- a/drivers/w1/slaves/Makefile
+++ b/drivers/w1/slaves/Makefile
@@ -2,10 +2,6 @@
2# Makefile for the Dallas's 1-wire slaves. 2# Makefile for the Dallas's 1-wire slaves.
3# 3#
4 4
5ifeq ($(CONFIG_W1_SLAVE_DS2433_CRC), y)
6EXTRA_CFLAGS += -DCONFIG_W1_F23_CRC
7endif
8
9obj-$(CONFIG_W1_SLAVE_THERM) += w1_therm.o 5obj-$(CONFIG_W1_SLAVE_THERM) += w1_therm.o
10obj-$(CONFIG_W1_SLAVE_SMEM) += w1_smem.o 6obj-$(CONFIG_W1_SLAVE_SMEM) += w1_smem.o
11obj-$(CONFIG_W1_SLAVE_DS2433) += w1_ds2433.o 7obj-$(CONFIG_W1_SLAVE_DS2433) += w1_ds2433.o
diff --git a/drivers/w1/slaves/w1_ds2433.c b/drivers/w1/slaves/w1_ds2433.c
index 2ac238f1480e..8ea17a53eed8 100644
--- a/drivers/w1/slaves/w1_ds2433.c
+++ b/drivers/w1/slaves/w1_ds2433.c
@@ -13,7 +13,7 @@
13#include <linux/device.h> 13#include <linux/device.h>
14#include <linux/types.h> 14#include <linux/types.h>
15#include <linux/delay.h> 15#include <linux/delay.h>
16#ifdef CONFIG_W1_F23_CRC 16#ifdef CONFIG_W1_SLAVE_DS2433_CRC
17#include <linux/crc16.h> 17#include <linux/crc16.h>
18 18
19#define CRC16_INIT 0 19#define CRC16_INIT 0
@@ -62,7 +62,7 @@ static inline size_t w1_f23_fix_count(loff_t off, size_t count, size_t size)
62 return count; 62 return count;
63} 63}
64 64
65#ifdef CONFIG_W1_F23_CRC 65#ifdef CONFIG_W1_SLAVE_DS2433_CRC
66static int w1_f23_refresh_block(struct w1_slave *sl, struct w1_f23_data *data, 66static int w1_f23_refresh_block(struct w1_slave *sl, struct w1_f23_data *data,
67 int block) 67 int block)
68{ 68{
@@ -89,13 +89,13 @@ static int w1_f23_refresh_block(struct w1_slave *sl, struct w1_f23_data *data,
89 89
90 return 0; 90 return 0;
91} 91}
92#endif /* CONFIG_W1_F23_CRC */ 92#endif /* CONFIG_W1_SLAVE_DS2433_CRC */
93 93
94static ssize_t w1_f23_read_bin(struct kobject *kobj, char *buf, loff_t off, 94static ssize_t w1_f23_read_bin(struct kobject *kobj, char *buf, loff_t off,
95 size_t count) 95 size_t count)
96{ 96{
97 struct w1_slave *sl = kobj_to_w1_slave(kobj); 97 struct w1_slave *sl = kobj_to_w1_slave(kobj);
98#ifdef CONFIG_W1_F23_CRC 98#ifdef CONFIG_W1_SLAVE_DS2433_CRC
99 struct w1_f23_data *data = sl->family_data; 99 struct w1_f23_data *data = sl->family_data;
100 int i, min_page, max_page; 100 int i, min_page, max_page;
101#else 101#else
@@ -107,7 +107,7 @@ static ssize_t w1_f23_read_bin(struct kobject *kobj, char *buf, loff_t off,
107 107
108 mutex_lock(&sl->master->mutex); 108 mutex_lock(&sl->master->mutex);
109 109
110#ifdef CONFIG_W1_F23_CRC 110#ifdef CONFIG_W1_SLAVE_DS2433_CRC
111 111
112 min_page = (off >> W1_PAGE_BITS); 112 min_page = (off >> W1_PAGE_BITS);
113 max_page = (off + count - 1) >> W1_PAGE_BITS; 113 max_page = (off + count - 1) >> W1_PAGE_BITS;
@@ -119,7 +119,7 @@ static ssize_t w1_f23_read_bin(struct kobject *kobj, char *buf, loff_t off,
119 } 119 }
120 memcpy(buf, &data->memory[off], count); 120 memcpy(buf, &data->memory[off], count);
121 121
122#else /* CONFIG_W1_F23_CRC */ 122#else /* CONFIG_W1_SLAVE_DS2433_CRC */
123 123
124 /* read directly from the EEPROM */ 124 /* read directly from the EEPROM */
125 if (w1_reset_select_slave(sl)) { 125 if (w1_reset_select_slave(sl)) {
@@ -133,7 +133,7 @@ static ssize_t w1_f23_read_bin(struct kobject *kobj, char *buf, loff_t off,
133 w1_write_block(sl->master, wrbuf, 3); 133 w1_write_block(sl->master, wrbuf, 3);
134 w1_read_block(sl->master, buf, count); 134 w1_read_block(sl->master, buf, count);
135 135
136#endif /* CONFIG_W1_F23_CRC */ 136#endif /* CONFIG_W1_SLAVE_DS2433_CRC */
137 137
138out_up: 138out_up:
139 mutex_unlock(&sl->master->mutex); 139 mutex_unlock(&sl->master->mutex);
@@ -208,7 +208,7 @@ static ssize_t w1_f23_write_bin(struct kobject *kobj, char *buf, loff_t off,
208 if ((count = w1_f23_fix_count(off, count, W1_EEPROM_SIZE)) == 0) 208 if ((count = w1_f23_fix_count(off, count, W1_EEPROM_SIZE)) == 0)
209 return 0; 209 return 0;
210 210
211#ifdef CONFIG_W1_F23_CRC 211#ifdef CONFIG_W1_SLAVE_DS2433_CRC
212 /* can only write full blocks in cached mode */ 212 /* can only write full blocks in cached mode */
213 if ((off & W1_PAGE_MASK) || (count & W1_PAGE_MASK)) { 213 if ((off & W1_PAGE_MASK) || (count & W1_PAGE_MASK)) {
214 dev_err(&sl->dev, "invalid offset/count off=%d cnt=%zd\n", 214 dev_err(&sl->dev, "invalid offset/count off=%d cnt=%zd\n",
@@ -223,7 +223,7 @@ static ssize_t w1_f23_write_bin(struct kobject *kobj, char *buf, loff_t off,
223 return -EINVAL; 223 return -EINVAL;
224 } 224 }
225 } 225 }
226#endif /* CONFIG_W1_F23_CRC */ 226#endif /* CONFIG_W1_SLAVE_DS2433_CRC */
227 227
228 mutex_lock(&sl->master->mutex); 228 mutex_lock(&sl->master->mutex);
229 229
@@ -262,7 +262,7 @@ static struct bin_attribute w1_f23_bin_attr = {
262static int w1_f23_add_slave(struct w1_slave *sl) 262static int w1_f23_add_slave(struct w1_slave *sl)
263{ 263{
264 int err; 264 int err;
265#ifdef CONFIG_W1_F23_CRC 265#ifdef CONFIG_W1_SLAVE_DS2433_CRC
266 struct w1_f23_data *data; 266 struct w1_f23_data *data;
267 267
268 data = kmalloc(sizeof(struct w1_f23_data), GFP_KERNEL); 268 data = kmalloc(sizeof(struct w1_f23_data), GFP_KERNEL);
@@ -271,24 +271,24 @@ static int w1_f23_add_slave(struct w1_slave *sl)
271 memset(data, 0, sizeof(struct w1_f23_data)); 271 memset(data, 0, sizeof(struct w1_f23_data));
272 sl->family_data = data; 272 sl->family_data = data;
273 273
274#endif /* CONFIG_W1_F23_CRC */ 274#endif /* CONFIG_W1_SLAVE_DS2433_CRC */
275 275
276 err = sysfs_create_bin_file(&sl->dev.kobj, &w1_f23_bin_attr); 276 err = sysfs_create_bin_file(&sl->dev.kobj, &w1_f23_bin_attr);
277 277
278#ifdef CONFIG_W1_F23_CRC 278#ifdef CONFIG_W1_SLAVE_DS2433_CRC
279 if (err) 279 if (err)
280 kfree(data); 280 kfree(data);
281#endif /* CONFIG_W1_F23_CRC */ 281#endif /* CONFIG_W1_SLAVE_DS2433_CRC */
282 282
283 return err; 283 return err;
284} 284}
285 285
286static void w1_f23_remove_slave(struct w1_slave *sl) 286static void w1_f23_remove_slave(struct w1_slave *sl)
287{ 287{
288#ifdef CONFIG_W1_F23_CRC 288#ifdef CONFIG_W1_SLAVE_DS2433_CRC
289 kfree(sl->family_data); 289 kfree(sl->family_data);
290 sl->family_data = NULL; 290 sl->family_data = NULL;
291#endif /* CONFIG_W1_F23_CRC */ 291#endif /* CONFIG_W1_SLAVE_DS2433_CRC */
292 sysfs_remove_bin_file(&sl->dev.kobj, &w1_f23_bin_attr); 292 sysfs_remove_bin_file(&sl->dev.kobj, &w1_f23_bin_attr);
293} 293}
294 294
diff --git a/drivers/w1/slaves/w1_therm.c b/drivers/w1/slaves/w1_therm.c
index 5372cfcbd054..b022fffd8c51 100644
--- a/drivers/w1/slaves/w1_therm.c
+++ b/drivers/w1/slaves/w1_therm.c
@@ -24,6 +24,7 @@
24#include <linux/kernel.h> 24#include <linux/kernel.h>
25#include <linux/module.h> 25#include <linux/module.h>
26#include <linux/moduleparam.h> 26#include <linux/moduleparam.h>
27#include <linux/sched.h>
27#include <linux/device.h> 28#include <linux/device.h>
28#include <linux/types.h> 29#include <linux/types.h>
29#include <linux/delay.h> 30#include <linux/delay.h>
diff --git a/drivers/w1/w1.c b/drivers/w1/w1.c
index de3e9791f80d..63c07243993c 100644
--- a/drivers/w1/w1.c
+++ b/drivers/w1/w1.c
@@ -31,6 +31,7 @@
31#include <linux/slab.h> 31#include <linux/slab.h>
32#include <linux/sched.h> 32#include <linux/sched.h>
33#include <linux/kthread.h> 33#include <linux/kthread.h>
34#include <linux/freezer.h>
34 35
35#include <asm/atomic.h> 36#include <asm/atomic.h>
36 37