aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/w1
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2014-11-18 22:04:20 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-11-26 22:09:02 -0500
commit4b7e4f8289c1ca60accb6c1baf31984f69bc2771 (patch)
treecb5debd8a6f879a77a6481eba8b211d396276da5 /drivers/w1
parent4b97b27939dd9b9ddbd4058efc96d45bc7163601 (diff)
w1: support auto-load of w1_bq27000 module.
1/ change request_module call to zero-pad single digit family numbers. This appears to be the intention of the code, but not what it actually does. This means that the alias created for W1_FAMILY_SMEM_01 might actually be useful. 2/ Define a family name for the BQ27000 battery charge monitor. Unfortunately this is the same number as W1_FAMILY_SMEM_01 so if both a compiled on a system, one module might need to be blacklisted. 3/ Add a MODULE_ALIAS for the bq27000. Acked-by: Evgeniy Polyakov <zbr@ioremap.net> Signed-off-by: NeilBrown <neilb@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/w1')
-rw-r--r--drivers/w1/slaves/w1_bq27000.c4
-rw-r--r--drivers/w1/w1.c2
-rw-r--r--drivers/w1/w1_family.h1
3 files changed, 4 insertions, 3 deletions
diff --git a/drivers/w1/slaves/w1_bq27000.c b/drivers/w1/slaves/w1_bq27000.c
index afbefed5f2c9..caafb1722783 100644
--- a/drivers/w1/slaves/w1_bq27000.c
+++ b/drivers/w1/slaves/w1_bq27000.c
@@ -88,7 +88,7 @@ static struct w1_family_ops w1_bq27000_fops = {
88}; 88};
89 89
90static struct w1_family w1_bq27000_family = { 90static struct w1_family w1_bq27000_family = {
91 .fid = 1, 91 .fid = W1_FAMILY_BQ27000,
92 .fops = &w1_bq27000_fops, 92 .fops = &w1_bq27000_fops,
93}; 93};
94 94
@@ -111,7 +111,7 @@ module_exit(w1_bq27000_exit);
111 111
112module_param(F_ID, int, S_IRUSR); 112module_param(F_ID, int, S_IRUSR);
113MODULE_PARM_DESC(F_ID, "1-wire slave FID for BQ device"); 113MODULE_PARM_DESC(F_ID, "1-wire slave FID for BQ device");
114 114MODULE_ALIAS("w1-family-" __stringify(W1_FAMILY_BQ27000));
115MODULE_LICENSE("GPL"); 115MODULE_LICENSE("GPL");
116MODULE_AUTHOR("Texas Instruments Ltd"); 116MODULE_AUTHOR("Texas Instruments Ltd");
117MODULE_DESCRIPTION("HDQ/1-wire slave driver bq27000 battery monitor chip"); 117MODULE_DESCRIPTION("HDQ/1-wire slave driver bq27000 battery monitor chip");
diff --git a/drivers/w1/w1.c b/drivers/w1/w1.c
index 592f7edc671e..181f41cb960b 100644
--- a/drivers/w1/w1.c
+++ b/drivers/w1/w1.c
@@ -727,7 +727,7 @@ int w1_attach_slave_device(struct w1_master *dev, struct w1_reg_num *rn)
727 727
728 /* slave modules need to be loaded in a context with unlocked mutex */ 728 /* slave modules need to be loaded in a context with unlocked mutex */
729 mutex_unlock(&dev->mutex); 729 mutex_unlock(&dev->mutex);
730 request_module("w1-family-0x%0x", rn->family); 730 request_module("w1-family-0x%02x", rn->family);
731 mutex_lock(&dev->mutex); 731 mutex_lock(&dev->mutex);
732 732
733 spin_lock(&w1_flock); 733 spin_lock(&w1_flock);
diff --git a/drivers/w1/w1_family.h b/drivers/w1/w1_family.h
index 0d18365b61ad..ed5dcb80a1f7 100644
--- a/drivers/w1/w1_family.h
+++ b/drivers/w1/w1_family.h
@@ -27,6 +27,7 @@
27#include <linux/atomic.h> 27#include <linux/atomic.h>
28 28
29#define W1_FAMILY_DEFAULT 0 29#define W1_FAMILY_DEFAULT 0
30#define W1_FAMILY_BQ27000 0x01
30#define W1_FAMILY_SMEM_01 0x01 31#define W1_FAMILY_SMEM_01 0x01
31#define W1_FAMILY_SMEM_81 0x81 32#define W1_FAMILY_SMEM_81 0x81
32#define W1_THERM_DS18S20 0x10 33#define W1_THERM_DS18S20 0x10