diff options
Diffstat (limited to 'drivers/w1')
-rw-r--r-- | drivers/w1/Kconfig | 2 | ||||
-rw-r--r-- | drivers/w1/masters/Kconfig | 6 | ||||
-rw-r--r-- | drivers/w1/masters/w1-gpio.c | 35 |
3 files changed, 39 insertions, 4 deletions
diff --git a/drivers/w1/Kconfig b/drivers/w1/Kconfig index 9adbb4f90479..fd2c7bd9dfbe 100644 --- a/drivers/w1/Kconfig +++ b/drivers/w1/Kconfig | |||
@@ -8,7 +8,7 @@ menuconfig W1 | |||
8 | If you want W1 support, you should say Y here. | 8 | If you want W1 support, you should say Y here. |
9 | 9 | ||
10 | This W1 support can also be built as a module. If so, the module | 10 | This W1 support can also be built as a module. If so, the module |
11 | will be called wire.ko. | 11 | will be called wire. |
12 | 12 | ||
13 | if W1 | 13 | if W1 |
14 | 14 | ||
diff --git a/drivers/w1/masters/Kconfig b/drivers/w1/masters/Kconfig index 96d2f8e4c275..3195fb8b7d9a 100644 --- a/drivers/w1/masters/Kconfig +++ b/drivers/w1/masters/Kconfig | |||
@@ -12,7 +12,7 @@ config W1_MASTER_MATROX | |||
12 | using Matrox's G400 GPIO pins. | 12 | using Matrox's G400 GPIO pins. |
13 | 13 | ||
14 | This support is also available as a module. If so, the module | 14 | This support is also available as a module. If so, the module |
15 | will be called matrox_w1.ko. | 15 | will be called matrox_w1. |
16 | 16 | ||
17 | config W1_MASTER_DS2490 | 17 | config W1_MASTER_DS2490 |
18 | tristate "DS2490 USB <-> W1 transport layer for 1-wire" | 18 | tristate "DS2490 USB <-> W1 transport layer for 1-wire" |
@@ -22,7 +22,7 @@ config W1_MASTER_DS2490 | |||
22 | for example DS9490*. | 22 | for example DS9490*. |
23 | 23 | ||
24 | This support is also available as a module. If so, the module | 24 | This support is also available as a module. If so, the module |
25 | will be called ds2490.ko. | 25 | will be called ds2490. |
26 | 26 | ||
27 | config W1_MASTER_DS2482 | 27 | config W1_MASTER_DS2482 |
28 | tristate "Maxim DS2482 I2C to 1-Wire bridge" | 28 | tristate "Maxim DS2482 I2C to 1-Wire bridge" |
@@ -56,7 +56,7 @@ config W1_MASTER_GPIO | |||
56 | GPIO pins. This driver uses the GPIO API to control the wire. | 56 | GPIO pins. This driver uses the GPIO API to control the wire. |
57 | 57 | ||
58 | This support is also available as a module. If so, the module | 58 | This support is also available as a module. If so, the module |
59 | will be called w1-gpio.ko. | 59 | will be called w1-gpio. |
60 | 60 | ||
61 | config HDQ_MASTER_OMAP | 61 | config HDQ_MASTER_OMAP |
62 | tristate "OMAP HDQ driver" | 62 | tristate "OMAP HDQ driver" |
diff --git a/drivers/w1/masters/w1-gpio.c b/drivers/w1/masters/w1-gpio.c index a411702413d6..6f8866d6a905 100644 --- a/drivers/w1/masters/w1-gpio.c +++ b/drivers/w1/masters/w1-gpio.c | |||
@@ -74,6 +74,9 @@ static int __init w1_gpio_probe(struct platform_device *pdev) | |||
74 | if (err) | 74 | if (err) |
75 | goto free_gpio; | 75 | goto free_gpio; |
76 | 76 | ||
77 | if (pdata->enable_external_pullup) | ||
78 | pdata->enable_external_pullup(1); | ||
79 | |||
77 | platform_set_drvdata(pdev, master); | 80 | platform_set_drvdata(pdev, master); |
78 | 81 | ||
79 | return 0; | 82 | return 0; |
@@ -91,6 +94,9 @@ static int __exit w1_gpio_remove(struct platform_device *pdev) | |||
91 | struct w1_bus_master *master = platform_get_drvdata(pdev); | 94 | struct w1_bus_master *master = platform_get_drvdata(pdev); |
92 | struct w1_gpio_platform_data *pdata = pdev->dev.platform_data; | 95 | struct w1_gpio_platform_data *pdata = pdev->dev.platform_data; |
93 | 96 | ||
97 | if (pdata->enable_external_pullup) | ||
98 | pdata->enable_external_pullup(0); | ||
99 | |||
94 | w1_remove_master_device(master); | 100 | w1_remove_master_device(master); |
95 | gpio_free(pdata->pin); | 101 | gpio_free(pdata->pin); |
96 | kfree(master); | 102 | kfree(master); |
@@ -98,12 +104,41 @@ static int __exit w1_gpio_remove(struct platform_device *pdev) | |||
98 | return 0; | 104 | return 0; |
99 | } | 105 | } |
100 | 106 | ||
107 | #ifdef CONFIG_PM | ||
108 | |||
109 | static int w1_gpio_suspend(struct platform_device *pdev, pm_message_t state) | ||
110 | { | ||
111 | struct w1_gpio_platform_data *pdata = pdev->dev.platform_data; | ||
112 | |||
113 | if (pdata->enable_external_pullup) | ||
114 | pdata->enable_external_pullup(0); | ||
115 | |||
116 | return 0; | ||
117 | } | ||
118 | |||
119 | static int w1_gpio_resume(struct platform_device *pdev) | ||
120 | { | ||
121 | struct w1_gpio_platform_data *pdata = pdev->dev.platform_data; | ||
122 | |||
123 | if (pdata->enable_external_pullup) | ||
124 | pdata->enable_external_pullup(1); | ||
125 | |||
126 | return 0; | ||
127 | } | ||
128 | |||
129 | #else | ||
130 | #define w1_gpio_suspend NULL | ||
131 | #define w1_gpio_resume NULL | ||
132 | #endif | ||
133 | |||
101 | static struct platform_driver w1_gpio_driver = { | 134 | static struct platform_driver w1_gpio_driver = { |
102 | .driver = { | 135 | .driver = { |
103 | .name = "w1-gpio", | 136 | .name = "w1-gpio", |
104 | .owner = THIS_MODULE, | 137 | .owner = THIS_MODULE, |
105 | }, | 138 | }, |
106 | .remove = __exit_p(w1_gpio_remove), | 139 | .remove = __exit_p(w1_gpio_remove), |
140 | .suspend = w1_gpio_suspend, | ||
141 | .resume = w1_gpio_resume, | ||
107 | }; | 142 | }; |
108 | 143 | ||
109 | static int __init w1_gpio_init(void) | 144 | static int __init w1_gpio_init(void) |