w1: Add support for DS2780 gas gauge
authorGreg Meiste <w30289@motorola.com>
Fri, 30 Jul 2010 15:42:36 +0000 (10:42 -0500)
committerColin Cross <ccross@android.com>
Wed, 6 Oct 2010 23:33:28 +0000 (16:33 -0700)
Stingray will initially ship with the DS2780 instead of the DS2781
gas gauge.  The same DS2781 driver will work, but need to look for
the DS2780 family code.

Change-Id: I6b47f31d6362895839af4922210dba2aee41db42
Signed-off-by: Greg Meiste <w30289@motorola.com>
drivers/w1/slaves/w1_ds2781.c
drivers/w1/w1_family.h

index e50341f072444a15b7b1e99c4de475c724fe6060..cda90d7ddffcabb87804a22e8d363c0287b7bc59 100644 (file)
@@ -184,6 +184,11 @@ static struct w1_family_ops w1_ds2781_fops = {
        .remove_slave = w1_ds2781_remove_slave,
 };
 
+static struct w1_family w1_ds2780_family = {
+       .fid = W1_FAMILY_DS2780,
+       .fops = &w1_ds2781_fops,
+};
+
 static struct w1_family w1_ds2781_family = {
        .fid = W1_FAMILY_DS2781,
        .fops = &w1_ds2781_fops,
@@ -192,11 +197,13 @@ static struct w1_family w1_ds2781_family = {
 static int __init w1_ds2781_init(void)
 {
        idr_init(&bat_idr);
+       w1_register_family(&w1_ds2780_family);
        return w1_register_family(&w1_ds2781_family);
 }
 
 static void __exit w1_ds2781_exit(void)
 {
+       w1_unregister_family(&w1_ds2780_family);
        w1_unregister_family(&w1_ds2781_family);
        idr_destroy(&bat_idr);
 }
index 68310b46afd5644d48d76d9383e8f811293d0288..4dae9ee31fe3a884f45c315c9429ce921cd289c6 100644 (file)
@@ -35,6 +35,7 @@
 #define W1_THERM_DS18B20       0x28
 #define W1_EEPROM_DS2431       0x2D
 #define W1_FAMILY_DS2760       0x30
+#define W1_FAMILY_DS2780       0x32
 #define W1_FAMILY_DS2781       0x3D
 
 #define MAXNAMELEN             32