aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorEvgeniy Polyakov <johnpol@2ka.mipt.ru>2005-12-06 05:38:28 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2006-03-23 20:28:11 -0500
commitbd529cfb40c427d5b5aae0d315afb9f0a1da5e76 (patch)
tree54de1d9860defa3c4938fd96246caffe089b9f3a /drivers
parentccd6994000fb6d08ee1be8a7fa20c8d602a2267d (diff)
[PATCH] W1: Move w1 bus master code into 'w1/masters' and move w1 slave code into 'w1/slaves'
Signed-off-by: Ben Gardner <bgardner@wabtec.com> Signed-off-by: Evgeniy Polyakov <johnpol@2ka.mipt.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/w1/Kconfig60
-rw-r--r--drivers/w1/Makefile10
-rw-r--r--drivers/w1/masters/Kconfig38
-rw-r--r--drivers/w1/masters/Makefile11
-rw-r--r--drivers/w1/masters/ds_w1_bridge.c (renamed from drivers/w1/ds_w1_bridge.c)4
-rw-r--r--drivers/w1/masters/dscore.c (renamed from drivers/w1/dscore.c)4
-rw-r--r--drivers/w1/masters/dscore.h (renamed from drivers/w1/dscore.h)0
-rw-r--r--drivers/w1/masters/matrox_w1.c (renamed from drivers/w1/matrox_w1.c)8
-rw-r--r--drivers/w1/slaves/Kconfig38
-rw-r--r--drivers/w1/slaves/Makefile12
-rw-r--r--drivers/w1/slaves/w1_ds2433.c (renamed from drivers/w1/w1_ds2433.c)8
-rw-r--r--drivers/w1/slaves/w1_smem.c (renamed from drivers/w1/w1_smem.c)10
-rw-r--r--drivers/w1/slaves/w1_therm.c (renamed from drivers/w1/w1_therm.c)14
13 files changed, 126 insertions, 91 deletions
diff --git a/drivers/w1/Kconfig b/drivers/w1/Kconfig
index 4baf61a22327..5e61ed59a41e 100644
--- a/drivers/w1/Kconfig
+++ b/drivers/w1/Kconfig
@@ -11,63 +11,7 @@ config W1
11 This W1 support can also be built as a module. If so, the module 11 This W1 support can also be built as a module. If so, the module
12 will be called wire.ko. 12 will be called wire.ko.
13 13
14config W1_MATROX 14source drivers/w1/masters/Kconfig
15 tristate "Matrox G400 transport layer for 1-wire" 15source drivers/w1/slaves/Kconfig
16 depends on W1 && PCI
17 help
18 Say Y here if you want to communicate with your 1-wire devices
19 using Matrox's G400 GPIO pins.
20
21 This support is also available as a module. If so, the module
22 will be called matrox_w1.ko.
23
24config W1_DS9490
25 tristate "DS9490R transport layer driver"
26 depends on W1 && USB
27 help
28 Say Y here if you want to have a driver for DS9490R UWB <-> W1 bridge.
29
30 This support is also available as a module. If so, the module
31 will be called ds9490r.ko.
32
33config W1_DS9490_BRIDGE
34 tristate "DS9490R USB <-> W1 transport layer for 1-wire"
35 depends on W1_DS9490
36 help
37 Say Y here if you want to communicate with your 1-wire devices
38 using DS9490R USB bridge.
39
40 This support is also available as a module. If so, the module
41 will be called ds_w1_bridge.ko.
42
43config W1_THERM
44 tristate "Thermal family implementation"
45 depends on W1
46 help
47 Say Y here if you want to connect 1-wire thermal sensors to you
48 wire.
49
50config W1_SMEM
51 tristate "Simple 64bit memory family implementation"
52 depends on W1
53 help
54 Say Y here if you want to connect 1-wire
55 simple 64bit memory rom(ds2401/ds2411/ds1990*) to you wire.
56
57config W1_DS2433
58 tristate "4kb EEPROM family support (DS2433)"
59 depends on W1
60 help
61 Say Y here if you want to use a 1-wire
62 4kb EEPROM family device (DS2433).
63
64config W1_DS2433_CRC
65 bool "Protect DS2433 data with a CRC16"
66 depends on W1_DS2433
67 select CRC16
68 help
69 Say Y here to protect DS2433 data with a CRC16.
70 Each block has 30 bytes of data and a two byte CRC16.
71 Full block writes are only allowed if the CRC is valid.
72 16
73endmenu 17endmenu
diff --git a/drivers/w1/Makefile b/drivers/w1/Makefile
index 01fb54391470..0c2aa22d8c04 100644
--- a/drivers/w1/Makefile
+++ b/drivers/w1/Makefile
@@ -13,13 +13,5 @@ endif
13obj-$(CONFIG_W1) += wire.o 13obj-$(CONFIG_W1) += wire.o
14wire-objs := w1.o w1_int.o w1_family.o w1_netlink.o w1_io.o 14wire-objs := w1.o w1_int.o w1_family.o w1_netlink.o w1_io.o
15 15
16obj-$(CONFIG_W1_MATROX) += matrox_w1.o 16obj-y += masters/ slaves/
17obj-$(CONFIG_W1_THERM) += w1_therm.o
18obj-$(CONFIG_W1_SMEM) += w1_smem.o
19 17
20obj-$(CONFIG_W1_DS9490) += ds9490r.o
21ds9490r-objs := dscore.o
22
23obj-$(CONFIG_W1_DS9490_BRIDGE) += ds_w1_bridge.o
24
25obj-$(CONFIG_W1_DS2433) += w1_ds2433.o
diff --git a/drivers/w1/masters/Kconfig b/drivers/w1/masters/Kconfig
new file mode 100644
index 000000000000..51bd64d0e54d
--- /dev/null
+++ b/drivers/w1/masters/Kconfig
@@ -0,0 +1,38 @@
1#
2# 1-wire bus master configuration
3#
4
5menu "1-wire Bus Masters"
6 depends on W1
7
8config W1_MASTER_MATROX
9 tristate "Matrox G400 transport layer for 1-wire"
10 depends on W1 && PCI
11 help
12 Say Y here if you want to communicate with your 1-wire devices
13 using Matrox's G400 GPIO pins.
14
15 This support is also available as a module. If so, the module
16 will be called matrox_w1.ko.
17
18config W1_MASTER_DS9490
19 tristate "DS9490R transport layer driver"
20 depends on W1 && USB
21 help
22 Say Y here if you want to have a driver for DS9490R UWB <-> W1 bridge.
23
24 This support is also available as a module. If so, the module
25 will be called ds9490r.ko.
26
27config W1_MASTER_DS9490_BRIDGE
28 tristate "DS9490R USB <-> W1 transport layer for 1-wire"
29 depends on W1_DS9490
30 help
31 Say Y here if you want to communicate with your 1-wire devices
32 using DS9490R USB bridge.
33
34 This support is also available as a module. If so, the module
35 will be called ds_w1_bridge.ko.
36
37endmenu
38
diff --git a/drivers/w1/masters/Makefile b/drivers/w1/masters/Makefile
new file mode 100644
index 000000000000..d9b84e522d6c
--- /dev/null
+++ b/drivers/w1/masters/Makefile
@@ -0,0 +1,11 @@
1#
2# Makefile for 1-wire bus master drivers.
3#
4
5obj-$(CONFIG_W1_MASTER_MATROX) += matrox_w1.o
6
7obj-$(CONFIG_W1_MASTER_DS9490) += ds9490r.o
8ds9490r-objs := dscore.o
9
10obj-$(CONFIG_W1_MASTER_DS9490_BRIDGE) += ds_w1_bridge.o
11
diff --git a/drivers/w1/ds_w1_bridge.c b/drivers/w1/masters/ds_w1_bridge.c
index 29e01d57c6be..5d30783a3eb6 100644
--- a/drivers/w1/ds_w1_bridge.c
+++ b/drivers/w1/masters/ds_w1_bridge.c
@@ -22,8 +22,8 @@
22#include <linux/module.h> 22#include <linux/module.h>
23#include <linux/types.h> 23#include <linux/types.h>
24 24
25#include "../w1/w1.h" 25#include "../w1.h"
26#include "../w1/w1_int.h" 26#include "../w1_int.h"
27#include "dscore.h" 27#include "dscore.h"
28 28
29static struct ds_device *ds_dev; 29static struct ds_device *ds_dev;
diff --git a/drivers/w1/dscore.c b/drivers/w1/masters/dscore.c
index b9146306df49..2cf7776a7080 100644
--- a/drivers/w1/dscore.c
+++ b/drivers/w1/masters/dscore.c
@@ -340,7 +340,7 @@ int ds_reset(struct ds_device *dev, struct ds_status *st)
340 return -EIO; 340 return -EIO;
341 } 341 }
342#endif 342#endif
343 343
344 return 0; 344 return 0;
345} 345}
346 346
@@ -348,7 +348,7 @@ int ds_reset(struct ds_device *dev, struct ds_status *st)
348int ds_set_speed(struct ds_device *dev, int speed) 348int ds_set_speed(struct ds_device *dev, int speed)
349{ 349{
350 int err; 350 int err;
351 351
352 if (speed != SPEED_NORMAL && speed != SPEED_FLEXIBLE && speed != SPEED_OVERDRIVE) 352 if (speed != SPEED_NORMAL && speed != SPEED_FLEXIBLE && speed != SPEED_OVERDRIVE)
353 return -EINVAL; 353 return -EINVAL;
354 354
diff --git a/drivers/w1/dscore.h b/drivers/w1/masters/dscore.h
index 6cf5671d6ebe..6cf5671d6ebe 100644
--- a/drivers/w1/dscore.h
+++ b/drivers/w1/masters/dscore.h
diff --git a/drivers/w1/matrox_w1.c b/drivers/w1/masters/matrox_w1.c
index 750a1aacf6f5..591809cbbb97 100644
--- a/drivers/w1/matrox_w1.c
+++ b/drivers/w1/masters/matrox_w1.c
@@ -19,8 +19,8 @@
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */ 20 */
21 21
22#include <asm/atomic.h>
23#include <asm/types.h> 22#include <asm/types.h>
23#include <asm/atomic.h>
24#include <asm/io.h> 24#include <asm/io.h>
25 25
26#include <linux/delay.h> 26#include <linux/delay.h>
@@ -35,9 +35,9 @@
35#include <linux/pci.h> 35#include <linux/pci.h>
36#include <linux/timer.h> 36#include <linux/timer.h>
37 37
38#include "w1.h" 38#include "../w1.h"
39#include "w1_int.h" 39#include "../w1_int.h"
40#include "w1_log.h" 40#include "../w1_log.h"
41 41
42MODULE_LICENSE("GPL"); 42MODULE_LICENSE("GPL");
43MODULE_AUTHOR("Evgeniy Polyakov <johnpol@2ka.mipt.ru>"); 43MODULE_AUTHOR("Evgeniy Polyakov <johnpol@2ka.mipt.ru>");
diff --git a/drivers/w1/slaves/Kconfig b/drivers/w1/slaves/Kconfig
new file mode 100644
index 000000000000..f9d4c91fc533
--- /dev/null
+++ b/drivers/w1/slaves/Kconfig
@@ -0,0 +1,38 @@
1#
2# 1-wire slaves configuration
3#
4
5menu "1-wire Slaves"
6 depends on W1
7
8config W1_SLAVE_THERM
9 tristate "Thermal family implementation"
10 depends on W1
11 help
12 Say Y here if you want to connect 1-wire thermal sensors to you
13 wire.
14
15config W1_SLAVE_SMEM
16 tristate "Simple 64bit memory family implementation"
17 depends on W1
18 help
19 Say Y here if you want to connect 1-wire
20 simple 64bit memory rom(ds2401/ds2411/ds1990*) to you wire.
21
22config W1_SLAVE_DS2433
23 tristate "4kb EEPROM family support (DS2433)"
24 depends on W1
25 help
26 Say Y here if you want to use a 1-wire
27 4kb EEPROM family device (DS2433).
28
29config W1_SLAVE_DS2433_CRC
30 bool "Protect DS2433 data with a CRC16"
31 depends on W1_DS2433
32 select CRC16
33 help
34 Say Y here to protect DS2433 data with a CRC16.
35 Each block has 30 bytes of data and a two byte CRC16.
36 Full block writes are only allowed if the CRC is valid.
37
38endmenu
diff --git a/drivers/w1/slaves/Makefile b/drivers/w1/slaves/Makefile
new file mode 100644
index 000000000000..70e21e2d70c3
--- /dev/null
+++ b/drivers/w1/slaves/Makefile
@@ -0,0 +1,12 @@
1#
2# Makefile for the Dallas's 1-wire slaves.
3#
4
5ifeq ($(CONFIG_W1_SLAVE_DS2433_CRC), y)
6EXTRA_CFLAGS += -DCONFIG_W1_F23_CRC
7endif
8
9obj-$(CONFIG_W1_SLAVE_THERM) += w1_therm.o
10obj-$(CONFIG_W1_SLAVE_SMEM) += w1_smem.o
11obj-$(CONFIG_W1_SLAVE_DS2433) += w1_ds2433.o
12
diff --git a/drivers/w1/w1_ds2433.c b/drivers/w1/slaves/w1_ds2433.c
index 1e3d98aac12d..fb118be789ea 100644
--- a/drivers/w1/w1_ds2433.c
+++ b/drivers/w1/slaves/w1_ds2433.c
@@ -21,10 +21,10 @@
21 21
22#endif 22#endif
23 23
24#include "w1.h" 24#include "../w1.h"
25#include "w1_io.h" 25#include "../w1_io.h"
26#include "w1_int.h" 26#include "../w1_int.h"
27#include "w1_family.h" 27#include "../w1_family.h"
28 28
29MODULE_LICENSE("GPL"); 29MODULE_LICENSE("GPL");
30MODULE_AUTHOR("Ben Gardner <bgardner@wabtec.com>"); 30MODULE_AUTHOR("Ben Gardner <bgardner@wabtec.com>");
diff --git a/drivers/w1/w1_smem.c b/drivers/w1/slaves/w1_smem.c
index e3209d0aca9b..c6d3be54f94c 100644
--- a/drivers/w1/w1_smem.c
+++ b/drivers/w1/slaves/w1_smem.c
@@ -27,10 +27,10 @@
27#include <linux/device.h> 27#include <linux/device.h>
28#include <linux/types.h> 28#include <linux/types.h>
29 29
30#include "w1.h" 30#include "../w1.h"
31#include "w1_io.h" 31#include "../w1_io.h"
32#include "w1_int.h" 32#include "../w1_int.h"
33#include "w1_family.h" 33#include "../w1_family.h"
34 34
35MODULE_LICENSE("GPL"); 35MODULE_LICENSE("GPL");
36MODULE_AUTHOR("Evgeniy Polyakov <johnpol@2ka.mipt.ru>"); 36MODULE_AUTHOR("Evgeniy Polyakov <johnpol@2ka.mipt.ru>");
@@ -51,7 +51,7 @@ static int __init w1_smem_init(void)
51 err = w1_register_family(&w1_smem_family_01); 51 err = w1_register_family(&w1_smem_family_01);
52 if (err) 52 if (err)
53 return err; 53 return err;
54 54
55 err = w1_register_family(&w1_smem_family_81); 55 err = w1_register_family(&w1_smem_family_81);
56 if (err) { 56 if (err) {
57 w1_unregister_family(&w1_smem_family_01); 57 w1_unregister_family(&w1_smem_family_01);
diff --git a/drivers/w1/w1_therm.c b/drivers/w1/slaves/w1_therm.c
index 4577df3cfc48..536d16d78de7 100644
--- a/drivers/w1/w1_therm.c
+++ b/drivers/w1/slaves/w1_therm.c
@@ -28,10 +28,10 @@
28#include <linux/types.h> 28#include <linux/types.h>
29#include <linux/delay.h> 29#include <linux/delay.h>
30 30
31#include "w1.h" 31#include "../w1.h"
32#include "w1_io.h" 32#include "../w1_io.h"
33#include "w1_int.h" 33#include "../w1_int.h"
34#include "w1_family.h" 34#include "../w1_family.h"
35 35
36MODULE_LICENSE("GPL"); 36MODULE_LICENSE("GPL");
37MODULE_AUTHOR("Evgeniy Polyakov <johnpol@2ka.mipt.ru>"); 37MODULE_AUTHOR("Evgeniy Polyakov <johnpol@2ka.mipt.ru>");
@@ -123,12 +123,12 @@ static inline int w1_DS18S20_convert_temp(u8 rom[9])
123 123
124 if (!rom[7]) 124 if (!rom[7])
125 return 0; 125 return 0;
126 126
127 if (rom[1] == 0) 127 if (rom[1] == 0)
128 t = ((s32)rom[0] >> 1)*1000; 128 t = ((s32)rom[0] >> 1)*1000;
129 else 129 else
130 t = 1000*(-1*(s32)(0x100-rom[0]) >> 1); 130 t = 1000*(-1*(s32)(0x100-rom[0]) >> 1);
131 131
132 t -= 250; 132 t -= 250;
133 h = 1000*((s32)rom[7] - (s32)rom[6]); 133 h = 1000*((s32)rom[7] - (s32)rom[6]);
134 h /= (s32)rom[7]; 134 h /= (s32)rom[7];
@@ -231,7 +231,7 @@ static ssize_t w1_therm_read_bin(struct kobject *kobj, char *buf, loff_t off, si
231 231
232 for (i = 0; i < 9; ++i) 232 for (i = 0; i < 9; ++i)
233 count += sprintf(buf + count, "%02x ", sl->rom[i]); 233 count += sprintf(buf + count, "%02x ", sl->rom[i]);
234 234
235 count += sprintf(buf + count, "t=%d\n", w1_convert_temp(rom, sl->family->fid)); 235 count += sprintf(buf + count, "t=%d\n", w1_convert_temp(rom, sl->family->fid));
236out: 236out:
237 up(&dev->mutex); 237 up(&dev->mutex);