diff options
author | Alexander Stein <alexander.stein@informatik.tu-chemnitz.de> | 2013-05-26 14:06:50 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-06-03 17:09:14 -0400 |
commit | 8d7bda51888d14c07cbebacc5a10be776477bb63 (patch) | |
tree | d127eacb0e8961bbafb5bb2b02e0c2c4b008a78e /drivers/w1 | |
parent | a4b05d1262c1f79ff07e9baceccbf3398846b8c0 (diff) |
w1: add family based automatic module loading
This patch allows the 1-wire bus to autoload the corresponding module
for each slave being attached.
This works similar to bluetooth protocols.
Signed-off-by: Alexander Stein <alexander.stein@informatik.tu-chemnitz.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/w1')
-rw-r--r-- | drivers/w1/slaves/w1_ds2408.c | 1 | ||||
-rw-r--r-- | drivers/w1/slaves/w1_ds2413.c | 1 | ||||
-rw-r--r-- | drivers/w1/slaves/w1_ds2423.c | 1 | ||||
-rw-r--r-- | drivers/w1/slaves/w1_ds2431.c | 1 | ||||
-rw-r--r-- | drivers/w1/slaves/w1_ds2433.c | 1 | ||||
-rw-r--r-- | drivers/w1/slaves/w1_ds2760.c | 1 | ||||
-rw-r--r-- | drivers/w1/slaves/w1_ds2780.c | 1 | ||||
-rw-r--r-- | drivers/w1/slaves/w1_ds2781.c | 1 | ||||
-rw-r--r-- | drivers/w1/slaves/w1_ds28e04.c | 1 | ||||
-rw-r--r-- | drivers/w1/slaves/w1_smem.c | 2 | ||||
-rw-r--r-- | drivers/w1/slaves/w1_therm.c | 5 | ||||
-rw-r--r-- | drivers/w1/w1.c | 2 |
12 files changed, 18 insertions, 0 deletions
diff --git a/drivers/w1/slaves/w1_ds2408.c b/drivers/w1/slaves/w1_ds2408.c index e45eca1044bd..91cc2cdf02c0 100644 --- a/drivers/w1/slaves/w1_ds2408.c +++ b/drivers/w1/slaves/w1_ds2408.c | |||
@@ -22,6 +22,7 @@ | |||
22 | MODULE_LICENSE("GPL"); | 22 | MODULE_LICENSE("GPL"); |
23 | MODULE_AUTHOR("Jean-Francois Dagenais <dagenaisj@sonatest.com>"); | 23 | MODULE_AUTHOR("Jean-Francois Dagenais <dagenaisj@sonatest.com>"); |
24 | MODULE_DESCRIPTION("w1 family 29 driver for DS2408 8 Pin IO"); | 24 | MODULE_DESCRIPTION("w1 family 29 driver for DS2408 8 Pin IO"); |
25 | MODULE_ALIAS("w1-family-" __stringify(W1_FAMILY_DS2408)); | ||
25 | 26 | ||
26 | 27 | ||
27 | #define W1_F29_RETRIES 3 | 28 | #define W1_F29_RETRIES 3 |
diff --git a/drivers/w1/slaves/w1_ds2413.c b/drivers/w1/slaves/w1_ds2413.c index 829786252c6b..85937773a96a 100644 --- a/drivers/w1/slaves/w1_ds2413.c +++ b/drivers/w1/slaves/w1_ds2413.c | |||
@@ -23,6 +23,7 @@ | |||
23 | MODULE_LICENSE("GPL"); | 23 | MODULE_LICENSE("GPL"); |
24 | MODULE_AUTHOR("Mariusz Bialonczyk <manio@skyboo.net>"); | 24 | MODULE_AUTHOR("Mariusz Bialonczyk <manio@skyboo.net>"); |
25 | MODULE_DESCRIPTION("w1 family 3a driver for DS2413 2 Pin IO"); | 25 | MODULE_DESCRIPTION("w1 family 3a driver for DS2413 2 Pin IO"); |
26 | MODULE_ALIAS("w1-family-" __stringify(W1_FAMILY_DS2413)); | ||
26 | 27 | ||
27 | #define W1_F3A_RETRIES 3 | 28 | #define W1_F3A_RETRIES 3 |
28 | #define W1_F3A_FUNC_PIO_ACCESS_READ 0xF5 | 29 | #define W1_F3A_FUNC_PIO_ACCESS_READ 0xF5 |
diff --git a/drivers/w1/slaves/w1_ds2423.c b/drivers/w1/slaves/w1_ds2423.c index 40a10b5ed120..7f86aec74088 100644 --- a/drivers/w1/slaves/w1_ds2423.c +++ b/drivers/w1/slaves/w1_ds2423.c | |||
@@ -164,3 +164,4 @@ module_exit(w1_f1d_exit); | |||
164 | MODULE_LICENSE("GPL"); | 164 | MODULE_LICENSE("GPL"); |
165 | MODULE_AUTHOR("Mika Laitio <lamikr@pilppa.org>"); | 165 | MODULE_AUTHOR("Mika Laitio <lamikr@pilppa.org>"); |
166 | MODULE_DESCRIPTION("w1 family 1d driver for DS2423, 4 counters and 4kb ram"); | 166 | MODULE_DESCRIPTION("w1 family 1d driver for DS2423, 4 counters and 4kb ram"); |
167 | MODULE_ALIAS("w1-family-" __stringify(W1_COUNTER_DS2423)); | ||
diff --git a/drivers/w1/slaves/w1_ds2431.c b/drivers/w1/slaves/w1_ds2431.c index 984b30331a45..cef8605e43ec 100644 --- a/drivers/w1/slaves/w1_ds2431.c +++ b/drivers/w1/slaves/w1_ds2431.c | |||
@@ -310,3 +310,4 @@ module_exit(w1_f2d_fini); | |||
310 | MODULE_LICENSE("GPL"); | 310 | MODULE_LICENSE("GPL"); |
311 | MODULE_AUTHOR("Bernhard Weirich <bernhard.weirich@riedel.net>"); | 311 | MODULE_AUTHOR("Bernhard Weirich <bernhard.weirich@riedel.net>"); |
312 | MODULE_DESCRIPTION("w1 family 2d driver for DS2431, 1kb EEPROM"); | 312 | MODULE_DESCRIPTION("w1 family 2d driver for DS2431, 1kb EEPROM"); |
313 | MODULE_ALIAS("w1-family-" __stringify(W1_EEPROM_DS2431)); | ||
diff --git a/drivers/w1/slaves/w1_ds2433.c b/drivers/w1/slaves/w1_ds2433.c index 85f2cdb27fa2..10cc1b6176e6 100644 --- a/drivers/w1/slaves/w1_ds2433.c +++ b/drivers/w1/slaves/w1_ds2433.c | |||
@@ -29,6 +29,7 @@ | |||
29 | MODULE_LICENSE("GPL"); | 29 | MODULE_LICENSE("GPL"); |
30 | MODULE_AUTHOR("Ben Gardner <bgardner@wabtec.com>"); | 30 | MODULE_AUTHOR("Ben Gardner <bgardner@wabtec.com>"); |
31 | MODULE_DESCRIPTION("w1 family 23 driver for DS2433, 4kb EEPROM"); | 31 | MODULE_DESCRIPTION("w1 family 23 driver for DS2433, 4kb EEPROM"); |
32 | MODULE_ALIAS("w1-family-" __stringify(W1_EEPROM_DS2433)); | ||
32 | 33 | ||
33 | #define W1_EEPROM_SIZE 512 | 34 | #define W1_EEPROM_SIZE 512 |
34 | #define W1_PAGE_COUNT 16 | 35 | #define W1_PAGE_COUNT 16 |
diff --git a/drivers/w1/slaves/w1_ds2760.c b/drivers/w1/slaves/w1_ds2760.c index e86a69dc411e..93719d25d849 100644 --- a/drivers/w1/slaves/w1_ds2760.c +++ b/drivers/w1/slaves/w1_ds2760.c | |||
@@ -203,3 +203,4 @@ module_exit(w1_ds2760_exit); | |||
203 | MODULE_LICENSE("GPL"); | 203 | MODULE_LICENSE("GPL"); |
204 | MODULE_AUTHOR("Szabolcs Gyurko <szabolcs.gyurko@tlt.hu>"); | 204 | MODULE_AUTHOR("Szabolcs Gyurko <szabolcs.gyurko@tlt.hu>"); |
205 | MODULE_DESCRIPTION("1-wire Driver Dallas 2760 battery monitor chip"); | 205 | MODULE_DESCRIPTION("1-wire Driver Dallas 2760 battery monitor chip"); |
206 | MODULE_ALIAS("w1-family-" __stringify(W1_FAMILY_DS2760)); | ||
diff --git a/drivers/w1/slaves/w1_ds2780.c b/drivers/w1/slaves/w1_ds2780.c index 98ed9c49cf50..0cd7a27b5d6b 100644 --- a/drivers/w1/slaves/w1_ds2780.c +++ b/drivers/w1/slaves/w1_ds2780.c | |||
@@ -188,3 +188,4 @@ module_exit(w1_ds2780_exit); | |||
188 | MODULE_LICENSE("GPL"); | 188 | MODULE_LICENSE("GPL"); |
189 | MODULE_AUTHOR("Clifton Barnes <cabarnes@indesign-llc.com>"); | 189 | MODULE_AUTHOR("Clifton Barnes <cabarnes@indesign-llc.com>"); |
190 | MODULE_DESCRIPTION("1-wire Driver for Maxim/Dallas DS2780 Stand-Alone Fuel Gauge IC"); | 190 | MODULE_DESCRIPTION("1-wire Driver for Maxim/Dallas DS2780 Stand-Alone Fuel Gauge IC"); |
191 | MODULE_ALIAS("w1-family-" __stringify(W1_FAMILY_DS2780)); | ||
diff --git a/drivers/w1/slaves/w1_ds2781.c b/drivers/w1/slaves/w1_ds2781.c index 5140d7be67ab..1aba8e41ad46 100644 --- a/drivers/w1/slaves/w1_ds2781.c +++ b/drivers/w1/slaves/w1_ds2781.c | |||
@@ -186,3 +186,4 @@ module_exit(w1_ds2781_exit); | |||
186 | MODULE_LICENSE("GPL"); | 186 | MODULE_LICENSE("GPL"); |
187 | MODULE_AUTHOR("Renata Sayakhova <renata@oktetlabs.ru>"); | 187 | MODULE_AUTHOR("Renata Sayakhova <renata@oktetlabs.ru>"); |
188 | MODULE_DESCRIPTION("1-wire Driver for Maxim/Dallas DS2781 Stand-Alone Fuel Gauge IC"); | 188 | MODULE_DESCRIPTION("1-wire Driver for Maxim/Dallas DS2781 Stand-Alone Fuel Gauge IC"); |
189 | MODULE_ALIAS("w1-family-" __stringify(W1_FAMILY_DS2781)); | ||
diff --git a/drivers/w1/slaves/w1_ds28e04.c b/drivers/w1/slaves/w1_ds28e04.c index 98117db595bb..cd30a6d95ea5 100644 --- a/drivers/w1/slaves/w1_ds28e04.c +++ b/drivers/w1/slaves/w1_ds28e04.c | |||
@@ -27,6 +27,7 @@ | |||
27 | MODULE_LICENSE("GPL"); | 27 | MODULE_LICENSE("GPL"); |
28 | MODULE_AUTHOR("Markus Franke <franke.m@sebakmt.com>, <franm@hrz.tu-chemnitz.de>"); | 28 | MODULE_AUTHOR("Markus Franke <franke.m@sebakmt.com>, <franm@hrz.tu-chemnitz.de>"); |
29 | MODULE_DESCRIPTION("w1 family 1C driver for DS28E04, 4kb EEPROM and PIO"); | 29 | MODULE_DESCRIPTION("w1 family 1C driver for DS28E04, 4kb EEPROM and PIO"); |
30 | MODULE_ALIAS("w1-family-" __stringify(W1_FAMILY_DS28E04)); | ||
30 | 31 | ||
31 | /* Allow the strong pullup to be disabled, but default to enabled. | 32 | /* Allow the strong pullup to be disabled, but default to enabled. |
32 | * If it was disabled a parasite powered device might not get the required | 33 | * If it was disabled a parasite powered device might not get the required |
diff --git a/drivers/w1/slaves/w1_smem.c b/drivers/w1/slaves/w1_smem.c index 84655625c870..ed4c87506def 100644 --- a/drivers/w1/slaves/w1_smem.c +++ b/drivers/w1/slaves/w1_smem.c | |||
@@ -34,6 +34,8 @@ | |||
34 | MODULE_LICENSE("GPL"); | 34 | MODULE_LICENSE("GPL"); |
35 | MODULE_AUTHOR("Evgeniy Polyakov <zbr@ioremap.net>"); | 35 | MODULE_AUTHOR("Evgeniy Polyakov <zbr@ioremap.net>"); |
36 | MODULE_DESCRIPTION("Driver for 1-wire Dallas network protocol, 64bit memory family."); | 36 | MODULE_DESCRIPTION("Driver for 1-wire Dallas network protocol, 64bit memory family."); |
37 | MODULE_ALIAS("w1-family-" __stringify(W1_FAMILY_SMEM_01)); | ||
38 | MODULE_ALIAS("w1-family-" __stringify(W1_FAMILY_SMEM_81)); | ||
37 | 39 | ||
38 | static struct w1_family w1_smem_family_01 = { | 40 | static struct w1_family w1_smem_family_01 = { |
39 | .fid = W1_FAMILY_SMEM_01, | 41 | .fid = W1_FAMILY_SMEM_01, |
diff --git a/drivers/w1/slaves/w1_therm.c b/drivers/w1/slaves/w1_therm.c index c1a702f8c803..8978360bd387 100644 --- a/drivers/w1/slaves/w1_therm.c +++ b/drivers/w1/slaves/w1_therm.c | |||
@@ -36,6 +36,11 @@ | |||
36 | MODULE_LICENSE("GPL"); | 36 | MODULE_LICENSE("GPL"); |
37 | MODULE_AUTHOR("Evgeniy Polyakov <zbr@ioremap.net>"); | 37 | MODULE_AUTHOR("Evgeniy Polyakov <zbr@ioremap.net>"); |
38 | MODULE_DESCRIPTION("Driver for 1-wire Dallas network protocol, temperature family."); | 38 | MODULE_DESCRIPTION("Driver for 1-wire Dallas network protocol, temperature family."); |
39 | MODULE_ALIAS("w1-family-" __stringify(W1_THERM_DS18S20)); | ||
40 | MODULE_ALIAS("w1-family-" __stringify(W1_THERM_DS1822)); | ||
41 | MODULE_ALIAS("w1-family-" __stringify(W1_THERM_DS18B20)); | ||
42 | MODULE_ALIAS("w1-family-" __stringify(W1_THERM_DS1825)); | ||
43 | MODULE_ALIAS("w1-family-" __stringify(W1_THERM_DS28EA00)); | ||
39 | 44 | ||
40 | /* Allow the strong pullup to be disabled, but default to enabled. | 45 | /* Allow the strong pullup to be disabled, but default to enabled. |
41 | * If it was disabled a parasite powered device might not get the require | 46 | * If it was disabled a parasite powered device might not get the require |
diff --git a/drivers/w1/w1.c b/drivers/w1/w1.c index 7ce277d2bb67..0459df843c58 100644 --- a/drivers/w1/w1.c +++ b/drivers/w1/w1.c | |||
@@ -680,6 +680,8 @@ static int w1_attach_slave_device(struct w1_master *dev, struct w1_reg_num *rn) | |||
680 | atomic_set(&sl->refcnt, 0); | 680 | atomic_set(&sl->refcnt, 0); |
681 | init_completion(&sl->released); | 681 | init_completion(&sl->released); |
682 | 682 | ||
683 | request_module("w1-family-0x%0x", rn->family); | ||
684 | |||
683 | spin_lock(&w1_flock); | 685 | spin_lock(&w1_flock); |
684 | f = w1_family_registered(rn->family); | 686 | f = w1_family_registered(rn->family); |
685 | if (!f) { | 687 | if (!f) { |