]> err.no Git - linux-2.6/commitdiff
[PATCH] w1_smem: support for new simple rom family [0x81 id].
authorEvgeniy Polyakov <johnpol@2ka.mipt.ru>
Mon, 2 May 2005 10:26:42 +0000 (14:26 +0400)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 22 Jun 2005 04:43:09 +0000 (21:43 -0700)
Support for new simple rom family [0x81 id].
It is the same as existing 0x01 family,
which is used in ds9490* w1 adapters.
Patch is on top of new-thermal-sensor-families patch.

Signed-off-by: Evgeniy Polyakov <johnpol@2ka.mipt.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/w1/w1_family.h
drivers/w1/w1_smem.c

index 2995c6cb869f09f88d0cf5618d72ca343a88a1b6..d01f0424cee913960bd21825b4c4d7bcd30c4134 100644 (file)
@@ -27,7 +27,8 @@
 #include <asm/atomic.h>
 
 #define W1_FAMILY_DEFAULT      0
-#define W1_FAMILY_SMEM         0x01
+#define W1_FAMILY_SMEM_01      0x01
+#define W1_FAMILY_SMEM_81      0x81
 #define W1_THERM_DS18S20       0x10
 #define W1_THERM_DS1822        0x22
 #define W1_THERM_DS18B20       0x28
index 674eb75a9bad1d21a70b6d7cee56cf469df989e2..4a335f1a2ae2225ca2ce1b1f60601cc9291b7821 100644 (file)
@@ -99,19 +99,37 @@ out_dec:
        return count;
 }
 
-static struct w1_family w1_smem_family = {
-       .fid = W1_FAMILY_SMEM,
+static struct w1_family w1_smem_family_01 = {
+       .fid = W1_FAMILY_SMEM_01,
+       .fops = &w1_smem_fops,
+};
+
+static struct w1_family w1_smem_family_81 = {
+       .fid = W1_FAMILY_SMEM_81,
        .fops = &w1_smem_fops,
 };
 
 static int __init w1_smem_init(void)
 {
-       return w1_register_family(&w1_smem_family);
+       int err;
+
+       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);
+               return err;
+       }
+
+       return 0;
 }
 
 static void __exit w1_smem_fini(void)
 {
-       w1_unregister_family(&w1_smem_family);
+       w1_unregister_family(&w1_smem_family_01);
+       w1_unregister_family(&w1_smem_family_81);
 }
 
 module_init(w1_smem_init);