]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[PATCH] W1: Move w1 bus master code into 'w1/masters' and move w1 slave code into...
authorEvgeniy Polyakov <johnpol@2ka.mipt.ru>
Tue, 6 Dec 2005 10:38:28 +0000 (13:38 +0300)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 24 Mar 2006 01:28:11 +0000 (17:28 -0800)
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>
13 files changed:
drivers/w1/Kconfig
drivers/w1/Makefile
drivers/w1/masters/Kconfig [new file with mode: 0644]
drivers/w1/masters/Makefile [new file with mode: 0644]
drivers/w1/masters/ds_w1_bridge.c [moved from drivers/w1/ds_w1_bridge.c with 98% similarity]
drivers/w1/masters/dscore.c [moved from drivers/w1/dscore.c with 99% similarity]
drivers/w1/masters/dscore.h [moved from drivers/w1/dscore.h with 100% similarity]
drivers/w1/masters/matrox_w1.c [moved from drivers/w1/matrox_w1.c with 98% similarity]
drivers/w1/slaves/Kconfig [new file with mode: 0644]
drivers/w1/slaves/Makefile [new file with mode: 0644]
drivers/w1/slaves/w1_ds2433.c [moved from drivers/w1/w1_ds2433.c with 98% similarity]
drivers/w1/slaves/w1_smem.c [moved from drivers/w1/w1_smem.c with 94% similarity]
drivers/w1/slaves/w1_therm.c [moved from drivers/w1/w1_therm.c with 98% similarity]

index 4baf61a22327dd9400d00d9c27ec57fe1cef3235..5e61ed59a41e48e8169f62baec7cdaa9e4c443db 100644 (file)
@@ -11,63 +11,7 @@ config W1
          This W1 support can also be built as a module.  If so, the module
          will be called wire.ko.
 
-config W1_MATROX
-       tristate "Matrox G400 transport layer for 1-wire"
-       depends on W1 && PCI
-       help
-         Say Y here if you want to communicate with your 1-wire devices
-         using Matrox's G400 GPIO pins.
-
-         This support is also available as a module.  If so, the module
-         will be called matrox_w1.ko.
-
-config W1_DS9490
-       tristate "DS9490R transport layer driver"
-       depends on W1 && USB
-       help
-         Say Y here if you want to have a driver for DS9490R UWB <-> W1 bridge.
-
-         This support is also available as a module.  If so, the module
-         will be called ds9490r.ko.
-
-config W1_DS9490_BRIDGE
-       tristate "DS9490R USB <-> W1 transport layer for 1-wire"
-       depends on W1_DS9490
-       help
-         Say Y here if you want to communicate with your 1-wire devices
-         using DS9490R USB bridge.
-
-         This support is also available as a module.  If so, the module
-         will be called ds_w1_bridge.ko.
-
-config W1_THERM
-       tristate "Thermal family implementation"
-       depends on W1
-       help
-         Say Y here if you want to connect 1-wire thermal sensors to you
-         wire.
-
-config W1_SMEM
-       tristate "Simple 64bit memory family implementation"
-       depends on W1
-       help
-         Say Y here if you want to connect 1-wire
-         simple 64bit memory rom(ds2401/ds2411/ds1990*) to you wire.
-
-config W1_DS2433
-       tristate "4kb EEPROM family support (DS2433)"
-       depends on W1
-       help
-         Say Y here if you want to use a 1-wire
-         4kb EEPROM family device (DS2433).
-
-config W1_DS2433_CRC
-       bool "Protect DS2433 data with a CRC16"
-       depends on W1_DS2433
-       select CRC16
-       help
-         Say Y here to protect DS2433 data with a CRC16.
-         Each block has 30 bytes of data and a two byte CRC16.
-         Full block writes are only allowed if the CRC is valid.
+source drivers/w1/masters/Kconfig
+source drivers/w1/slaves/Kconfig
 
 endmenu
index 01fb54391470e78cc60959028528d3a7ac2b2971..0c2aa22d8c04ca6d0d89406431381bac62e8ac39 100644 (file)
@@ -13,13 +13,5 @@ endif
 obj-$(CONFIG_W1)       += wire.o
 wire-objs              := w1.o w1_int.o w1_family.o w1_netlink.o w1_io.o
 
-obj-$(CONFIG_W1_MATROX)                += matrox_w1.o
-obj-$(CONFIG_W1_THERM)         += w1_therm.o
-obj-$(CONFIG_W1_SMEM)          += w1_smem.o
+obj-y                  += masters/ slaves/
 
-obj-$(CONFIG_W1_DS9490)                += ds9490r.o
-ds9490r-objs    := dscore.o
-
-obj-$(CONFIG_W1_DS9490_BRIDGE) += ds_w1_bridge.o
-
-obj-$(CONFIG_W1_DS2433)                += w1_ds2433.o
diff --git a/drivers/w1/masters/Kconfig b/drivers/w1/masters/Kconfig
new file mode 100644 (file)
index 0000000..51bd64d
--- /dev/null
@@ -0,0 +1,38 @@
+#
+# 1-wire bus master configuration
+#
+
+menu "1-wire Bus Masters"
+       depends on W1
+
+config W1_MASTER_MATROX
+       tristate "Matrox G400 transport layer for 1-wire"
+       depends on W1 && PCI
+       help
+         Say Y here if you want to communicate with your 1-wire devices
+         using Matrox's G400 GPIO pins.
+
+         This support is also available as a module.  If so, the module
+         will be called matrox_w1.ko.
+
+config W1_MASTER_DS9490
+       tristate "DS9490R transport layer driver"
+       depends on W1 && USB
+       help
+         Say Y here if you want to have a driver for DS9490R UWB <-> W1 bridge.
+
+         This support is also available as a module.  If so, the module
+         will be called ds9490r.ko.
+
+config W1_MASTER_DS9490_BRIDGE
+       tristate "DS9490R USB <-> W1 transport layer for 1-wire"
+       depends on W1_DS9490
+       help
+         Say Y here if you want to communicate with your 1-wire devices
+         using DS9490R USB bridge.
+
+         This support is also available as a module.  If so, the module
+         will be called ds_w1_bridge.ko.
+
+endmenu
+
diff --git a/drivers/w1/masters/Makefile b/drivers/w1/masters/Makefile
new file mode 100644 (file)
index 0000000..d9b84e5
--- /dev/null
@@ -0,0 +1,11 @@
+#
+# Makefile for 1-wire bus master drivers.
+#
+
+obj-$(CONFIG_W1_MASTER_MATROX)         += matrox_w1.o
+
+obj-$(CONFIG_W1_MASTER_DS9490)         += ds9490r.o
+ds9490r-objs    := dscore.o
+
+obj-$(CONFIG_W1_MASTER_DS9490_BRIDGE)  += ds_w1_bridge.o
+
similarity index 98%
rename from drivers/w1/ds_w1_bridge.c
rename to drivers/w1/masters/ds_w1_bridge.c
index 29e01d57c6bec6389fa67744665c525d38910f55..5d30783a3eb6dfac0d33544ce31e1a25b68b870d 100644 (file)
@@ -22,8 +22,8 @@
 #include <linux/module.h>
 #include <linux/types.h>
 
-#include "../w1/w1.h"
-#include "../w1/w1_int.h"
+#include "../w1.h"
+#include "../w1_int.h"
 #include "dscore.h"
 
 static struct ds_device *ds_dev;
similarity index 99%
rename from drivers/w1/dscore.c
rename to drivers/w1/masters/dscore.c
index b9146306df49a94df1b6443baa48a9fb17417ce3..2cf7776a7080e1de927f3eeea005e8b897ab14bb 100644 (file)
@@ -340,7 +340,7 @@ int ds_reset(struct ds_device *dev, struct ds_status *st)
                return -EIO;
        }
 #endif
-       
+
        return 0;
 }
 
@@ -348,7 +348,7 @@ int ds_reset(struct ds_device *dev, struct ds_status *st)
 int ds_set_speed(struct ds_device *dev, int speed)
 {
        int err;
-       
+
        if (speed != SPEED_NORMAL && speed != SPEED_FLEXIBLE && speed != SPEED_OVERDRIVE)
                return -EINVAL;
 
similarity index 98%
rename from drivers/w1/matrox_w1.c
rename to drivers/w1/masters/matrox_w1.c
index 750a1aacf6f5a720b149a11e3a301379c6668507..591809cbbb97cee5a765044320095fbf091fd0ec 100644 (file)
@@ -19,8 +19,8 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
-#include <asm/atomic.h>
 #include <asm/types.h>
+#include <asm/atomic.h>
 #include <asm/io.h>
 
 #include <linux/delay.h>
@@ -35,9 +35,9 @@
 #include <linux/pci.h>
 #include <linux/timer.h>
 
-#include "w1.h"
-#include "w1_int.h"
-#include "w1_log.h"
+#include "../w1.h"
+#include "../w1_int.h"
+#include "../w1_log.h"
 
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Evgeniy Polyakov <johnpol@2ka.mipt.ru>");
diff --git a/drivers/w1/slaves/Kconfig b/drivers/w1/slaves/Kconfig
new file mode 100644 (file)
index 0000000..f9d4c91
--- /dev/null
@@ -0,0 +1,38 @@
+#
+# 1-wire slaves configuration
+#
+
+menu "1-wire Slaves"
+       depends on W1
+
+config W1_SLAVE_THERM
+       tristate "Thermal family implementation"
+       depends on W1
+       help
+         Say Y here if you want to connect 1-wire thermal sensors to you
+         wire.
+
+config W1_SLAVE_SMEM
+       tristate "Simple 64bit memory family implementation"
+       depends on W1
+       help
+         Say Y here if you want to connect 1-wire
+         simple 64bit memory rom(ds2401/ds2411/ds1990*) to you wire.
+
+config W1_SLAVE_DS2433
+       tristate "4kb EEPROM family support (DS2433)"
+       depends on W1
+       help
+         Say Y here if you want to use a 1-wire
+         4kb EEPROM family device (DS2433).
+
+config W1_SLAVE_DS2433_CRC
+       bool "Protect DS2433 data with a CRC16"
+       depends on W1_DS2433
+       select CRC16
+       help
+         Say Y here to protect DS2433 data with a CRC16.
+         Each block has 30 bytes of data and a two byte CRC16.
+         Full block writes are only allowed if the CRC is valid.
+
+endmenu
diff --git a/drivers/w1/slaves/Makefile b/drivers/w1/slaves/Makefile
new file mode 100644 (file)
index 0000000..70e21e2
--- /dev/null
@@ -0,0 +1,12 @@
+#
+# Makefile for the Dallas's 1-wire slaves.
+#
+
+ifeq ($(CONFIG_W1_SLAVE_DS2433_CRC), y)
+EXTRA_CFLAGS += -DCONFIG_W1_F23_CRC
+endif
+
+obj-$(CONFIG_W1_SLAVE_THERM)   += w1_therm.o
+obj-$(CONFIG_W1_SLAVE_SMEM)    += w1_smem.o
+obj-$(CONFIG_W1_SLAVE_DS2433)  += w1_ds2433.o
+
similarity index 98%
rename from drivers/w1/w1_ds2433.c
rename to drivers/w1/slaves/w1_ds2433.c
index 1e3d98aac12dbc788b458a6adbb8e2bf70139889..fb118be789ea4e67e26ff8d0fc27d86d47b5694c 100644 (file)
 
 #endif
 
-#include "w1.h"
-#include "w1_io.h"
-#include "w1_int.h"
-#include "w1_family.h"
+#include "../w1.h"
+#include "../w1_io.h"
+#include "../w1_int.h"
+#include "../w1_family.h"
 
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Ben Gardner <bgardner@wabtec.com>");
similarity index 94%
rename from drivers/w1/w1_smem.c
rename to drivers/w1/slaves/w1_smem.c
index e3209d0aca9b6f0832f296a7a0dde6c45175ff0b..c6d3be54f94c57fca71db8d529bd02fd370cdf93 100644 (file)
 #include <linux/device.h>
 #include <linux/types.h>
 
-#include "w1.h"
-#include "w1_io.h"
-#include "w1_int.h"
-#include "w1_family.h"
+#include "../w1.h"
+#include "../w1_io.h"
+#include "../w1_int.h"
+#include "../w1_family.h"
 
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Evgeniy Polyakov <johnpol@2ka.mipt.ru>");
@@ -51,7 +51,7 @@ static int __init w1_smem_init(void)
        err = w1_register_family(&w1_smem_family_01);
        if (err)
                return err;
-       
+
        err = w1_register_family(&w1_smem_family_81);
        if (err) {
                w1_unregister_family(&w1_smem_family_01);
similarity index 98%
rename from drivers/w1/w1_therm.c
rename to drivers/w1/slaves/w1_therm.c
index 4577df3cfc4839e8537ed22618f02381a1b1b079..536d16d78de75ce313fa7f4f2b394e2617f4033e 100644 (file)
 #include <linux/types.h>
 #include <linux/delay.h>
 
-#include "w1.h"
-#include "w1_io.h"
-#include "w1_int.h"
-#include "w1_family.h"
+#include "../w1.h"
+#include "../w1_io.h"
+#include "../w1_int.h"
+#include "../w1_family.h"
 
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Evgeniy Polyakov <johnpol@2ka.mipt.ru>");
@@ -123,12 +123,12 @@ static inline int w1_DS18S20_convert_temp(u8 rom[9])
 
        if (!rom[7])
                return 0;
-       
+
        if (rom[1] == 0)
                t = ((s32)rom[0] >> 1)*1000;
        else
                t = 1000*(-1*(s32)(0x100-rom[0]) >> 1);
-       
+
        t -= 250;
        h = 1000*((s32)rom[7] - (s32)rom[6]);
        h /= (s32)rom[7];
@@ -231,7 +231,7 @@ static ssize_t w1_therm_read_bin(struct kobject *kobj, char *buf, loff_t off, si
 
        for (i = 0; i < 9; ++i)
                count += sprintf(buf + count, "%02x ", sl->rom[i]);
-       
+
        count += sprintf(buf + count, "t=%d\n", w1_convert_temp(rom, sl->family->fid));
 out:
        up(&dev->mutex);