diff options
-rw-r--r-- | sound/arm/pxa2xx-ac97-lib.c | 27 | ||||
-rw-r--r-- | sound/soc/pxa/brownstone.c | 1 | ||||
-rw-r--r-- | sound/soc/pxa/corgi.c | 1 | ||||
-rw-r--r-- | sound/soc/pxa/e740_wm9705.c | 1 | ||||
-rw-r--r-- | sound/soc/pxa/e750_wm9705.c | 1 | ||||
-rw-r--r-- | sound/soc/pxa/e800_wm9712.c | 1 | ||||
-rw-r--r-- | sound/soc/pxa/imote2.c | 1 | ||||
-rw-r--r-- | sound/soc/pxa/mioa701_wm9713.c | 1 | ||||
-rw-r--r-- | sound/soc/pxa/palm27x.c | 1 | ||||
-rw-r--r-- | sound/soc/pxa/poodle.c | 1 | ||||
-rw-r--r-- | sound/soc/pxa/pxa2xx-ac97.c | 56 | ||||
-rw-r--r-- | sound/soc/pxa/tosa.c | 1 | ||||
-rw-r--r-- | sound/soc/pxa/ttc-dkb.c | 1 |
13 files changed, 46 insertions, 48 deletions
diff --git a/sound/arm/pxa2xx-ac97-lib.c b/sound/arm/pxa2xx-ac97-lib.c index e6f4633b8dd5..99a466822a7d 100644 --- a/sound/arm/pxa2xx-ac97-lib.c +++ b/sound/arm/pxa2xx-ac97-lib.c | |||
@@ -117,8 +117,7 @@ static inline void pxa_ac97_warm_pxa25x(void) | |||
117 | { | 117 | { |
118 | gsr_bits = 0; | 118 | gsr_bits = 0; |
119 | 119 | ||
120 | GCR |= GCR_WARM_RST | GCR_PRIRDY_IEN | GCR_SECRDY_IEN; | 120 | GCR |= GCR_WARM_RST; |
121 | wait_event_timeout(gsr_wq, gsr_bits & (GSR_PCR | GSR_SCR), 1); | ||
122 | } | 121 | } |
123 | 122 | ||
124 | static inline void pxa_ac97_cold_pxa25x(void) | 123 | static inline void pxa_ac97_cold_pxa25x(void) |
@@ -129,8 +128,6 @@ static inline void pxa_ac97_cold_pxa25x(void) | |||
129 | gsr_bits = 0; | 128 | gsr_bits = 0; |
130 | 129 | ||
131 | GCR = GCR_COLD_RST; | 130 | GCR = GCR_COLD_RST; |
132 | GCR |= GCR_CDONE_IE|GCR_SDONE_IE; | ||
133 | wait_event_timeout(gsr_wq, gsr_bits & (GSR_PCR | GSR_SCR), 1); | ||
134 | } | 131 | } |
135 | #endif | 132 | #endif |
136 | 133 | ||
@@ -149,8 +146,6 @@ static inline void pxa_ac97_warm_pxa27x(void) | |||
149 | 146 | ||
150 | static inline void pxa_ac97_cold_pxa27x(void) | 147 | static inline void pxa_ac97_cold_pxa27x(void) |
151 | { | 148 | { |
152 | unsigned int timeout; | ||
153 | |||
154 | GCR &= GCR_COLD_RST; /* clear everything but nCRST */ | 149 | GCR &= GCR_COLD_RST; /* clear everything but nCRST */ |
155 | GCR &= ~GCR_COLD_RST; /* then assert nCRST */ | 150 | GCR &= ~GCR_COLD_RST; /* then assert nCRST */ |
156 | 151 | ||
@@ -161,29 +156,20 @@ static inline void pxa_ac97_cold_pxa27x(void) | |||
161 | udelay(5); | 156 | udelay(5); |
162 | clk_disable(ac97conf_clk); | 157 | clk_disable(ac97conf_clk); |
163 | GCR = GCR_COLD_RST | GCR_WARM_RST; | 158 | GCR = GCR_COLD_RST | GCR_WARM_RST; |
164 | timeout = 100; /* wait for the codec-ready bit to be set */ | ||
165 | while (!((GSR | gsr_bits) & (GSR_PCR | GSR_SCR)) && timeout--) | ||
166 | mdelay(1); | ||
167 | } | 159 | } |
168 | #endif | 160 | #endif |
169 | 161 | ||
170 | #ifdef CONFIG_PXA3xx | 162 | #ifdef CONFIG_PXA3xx |
171 | static inline void pxa_ac97_warm_pxa3xx(void) | 163 | static inline void pxa_ac97_warm_pxa3xx(void) |
172 | { | 164 | { |
173 | int timeout = 100; | ||
174 | |||
175 | gsr_bits = 0; | 165 | gsr_bits = 0; |
176 | 166 | ||
177 | /* Can't use interrupts */ | 167 | /* Can't use interrupts */ |
178 | GCR |= GCR_WARM_RST; | 168 | GCR |= GCR_WARM_RST; |
179 | while (!((GSR | gsr_bits) & (GSR_PCR | GSR_SCR)) && timeout--) | ||
180 | mdelay(1); | ||
181 | } | 169 | } |
182 | 170 | ||
183 | static inline void pxa_ac97_cold_pxa3xx(void) | 171 | static inline void pxa_ac97_cold_pxa3xx(void) |
184 | { | 172 | { |
185 | int timeout = 1000; | ||
186 | |||
187 | /* Hold CLKBPB for 100us */ | 173 | /* Hold CLKBPB for 100us */ |
188 | GCR = 0; | 174 | GCR = 0; |
189 | GCR = GCR_CLKBPB; | 175 | GCR = GCR_CLKBPB; |
@@ -199,14 +185,13 @@ static inline void pxa_ac97_cold_pxa3xx(void) | |||
199 | GCR &= ~(GCR_PRIRDY_IEN|GCR_SECRDY_IEN); | 185 | GCR &= ~(GCR_PRIRDY_IEN|GCR_SECRDY_IEN); |
200 | 186 | ||
201 | GCR = GCR_WARM_RST | GCR_COLD_RST; | 187 | GCR = GCR_WARM_RST | GCR_COLD_RST; |
202 | while (!(GSR & (GSR_PCR | GSR_SCR)) && timeout--) | ||
203 | mdelay(10); | ||
204 | } | 188 | } |
205 | #endif | 189 | #endif |
206 | 190 | ||
207 | bool pxa2xx_ac97_try_warm_reset(struct snd_ac97 *ac97) | 191 | bool pxa2xx_ac97_try_warm_reset(struct snd_ac97 *ac97) |
208 | { | 192 | { |
209 | unsigned long gsr; | 193 | unsigned long gsr; |
194 | unsigned int timeout = 100; | ||
210 | 195 | ||
211 | #ifdef CONFIG_PXA25x | 196 | #ifdef CONFIG_PXA25x |
212 | if (cpu_is_pxa25x()) | 197 | if (cpu_is_pxa25x()) |
@@ -224,6 +209,10 @@ bool pxa2xx_ac97_try_warm_reset(struct snd_ac97 *ac97) | |||
224 | else | 209 | else |
225 | #endif | 210 | #endif |
226 | BUG(); | 211 | BUG(); |
212 | |||
213 | while (!((GSR | gsr_bits) & (GSR_PCR | GSR_SCR)) && timeout--) | ||
214 | mdelay(1); | ||
215 | |||
227 | gsr = GSR | gsr_bits; | 216 | gsr = GSR | gsr_bits; |
228 | if (!(gsr & (GSR_PCR | GSR_SCR))) { | 217 | if (!(gsr & (GSR_PCR | GSR_SCR))) { |
229 | printk(KERN_INFO "%s: warm reset timeout (GSR=%#lx)\n", | 218 | printk(KERN_INFO "%s: warm reset timeout (GSR=%#lx)\n", |
@@ -239,6 +228,7 @@ EXPORT_SYMBOL_GPL(pxa2xx_ac97_try_warm_reset); | |||
239 | bool pxa2xx_ac97_try_cold_reset(struct snd_ac97 *ac97) | 228 | bool pxa2xx_ac97_try_cold_reset(struct snd_ac97 *ac97) |
240 | { | 229 | { |
241 | unsigned long gsr; | 230 | unsigned long gsr; |
231 | unsigned int timeout = 1000; | ||
242 | 232 | ||
243 | #ifdef CONFIG_PXA25x | 233 | #ifdef CONFIG_PXA25x |
244 | if (cpu_is_pxa25x()) | 234 | if (cpu_is_pxa25x()) |
@@ -257,6 +247,9 @@ bool pxa2xx_ac97_try_cold_reset(struct snd_ac97 *ac97) | |||
257 | #endif | 247 | #endif |
258 | BUG(); | 248 | BUG(); |
259 | 249 | ||
250 | while (!((GSR | gsr_bits) & (GSR_PCR | GSR_SCR)) && timeout--) | ||
251 | mdelay(1); | ||
252 | |||
260 | gsr = GSR | gsr_bits; | 253 | gsr = GSR | gsr_bits; |
261 | if (!(gsr & (GSR_PCR | GSR_SCR))) { | 254 | if (!(gsr & (GSR_PCR | GSR_SCR))) { |
262 | printk(KERN_INFO "%s: cold reset timeout (GSR=%#lx)\n", | 255 | printk(KERN_INFO "%s: cold reset timeout (GSR=%#lx)\n", |
diff --git a/sound/soc/pxa/brownstone.c b/sound/soc/pxa/brownstone.c index 5b7d969f89a9..08acdc236bf8 100644 --- a/sound/soc/pxa/brownstone.c +++ b/sound/soc/pxa/brownstone.c | |||
@@ -163,6 +163,7 @@ static struct platform_driver mmp_driver = { | |||
163 | .driver = { | 163 | .driver = { |
164 | .name = "brownstone-audio", | 164 | .name = "brownstone-audio", |
165 | .owner = THIS_MODULE, | 165 | .owner = THIS_MODULE, |
166 | .pm = &snd_soc_pm_ops, | ||
166 | }, | 167 | }, |
167 | .probe = brownstone_probe, | 168 | .probe = brownstone_probe, |
168 | .remove = brownstone_remove, | 169 | .remove = brownstone_remove, |
diff --git a/sound/soc/pxa/corgi.c b/sound/soc/pxa/corgi.c index f4cce1e80112..1853d41034bf 100644 --- a/sound/soc/pxa/corgi.c +++ b/sound/soc/pxa/corgi.c | |||
@@ -329,6 +329,7 @@ static struct platform_driver corgi_driver = { | |||
329 | .driver = { | 329 | .driver = { |
330 | .name = "corgi-audio", | 330 | .name = "corgi-audio", |
331 | .owner = THIS_MODULE, | 331 | .owner = THIS_MODULE, |
332 | .pm = &snd_soc_pm_ops, | ||
332 | }, | 333 | }, |
333 | .probe = corgi_probe, | 334 | .probe = corgi_probe, |
334 | .remove = corgi_remove, | 335 | .remove = corgi_remove, |
diff --git a/sound/soc/pxa/e740_wm9705.c b/sound/soc/pxa/e740_wm9705.c index 70d799b13f0d..44b5c09d296b 100644 --- a/sound/soc/pxa/e740_wm9705.c +++ b/sound/soc/pxa/e740_wm9705.c | |||
@@ -178,6 +178,7 @@ static struct platform_driver e740_driver = { | |||
178 | .driver = { | 178 | .driver = { |
179 | .name = "e740-audio", | 179 | .name = "e740-audio", |
180 | .owner = THIS_MODULE, | 180 | .owner = THIS_MODULE, |
181 | .pm = &snd_soc_pm_ops, | ||
181 | }, | 182 | }, |
182 | .probe = e740_probe, | 183 | .probe = e740_probe, |
183 | .remove = e740_remove, | 184 | .remove = e740_remove, |
diff --git a/sound/soc/pxa/e750_wm9705.c b/sound/soc/pxa/e750_wm9705.c index f94d2ab51351..c34e447eb991 100644 --- a/sound/soc/pxa/e750_wm9705.c +++ b/sound/soc/pxa/e750_wm9705.c | |||
@@ -160,6 +160,7 @@ static struct platform_driver e750_driver = { | |||
160 | .driver = { | 160 | .driver = { |
161 | .name = "e750-audio", | 161 | .name = "e750-audio", |
162 | .owner = THIS_MODULE, | 162 | .owner = THIS_MODULE, |
163 | .pm = &snd_soc_pm_ops, | ||
163 | }, | 164 | }, |
164 | .probe = e750_probe, | 165 | .probe = e750_probe, |
165 | .remove = e750_remove, | 166 | .remove = e750_remove, |
diff --git a/sound/soc/pxa/e800_wm9712.c b/sound/soc/pxa/e800_wm9712.c index 8768a640dd71..3137f800b43f 100644 --- a/sound/soc/pxa/e800_wm9712.c +++ b/sound/soc/pxa/e800_wm9712.c | |||
@@ -150,6 +150,7 @@ static struct platform_driver e800_driver = { | |||
150 | .driver = { | 150 | .driver = { |
151 | .name = "e800-audio", | 151 | .name = "e800-audio", |
152 | .owner = THIS_MODULE, | 152 | .owner = THIS_MODULE, |
153 | .pm = &snd_soc_pm_ops, | ||
153 | }, | 154 | }, |
154 | .probe = e800_probe, | 155 | .probe = e800_probe, |
155 | .remove = e800_remove, | 156 | .remove = e800_remove, |
diff --git a/sound/soc/pxa/imote2.c b/sound/soc/pxa/imote2.c index eef1f7b7b38e..fd2f4eda1fd3 100644 --- a/sound/soc/pxa/imote2.c +++ b/sound/soc/pxa/imote2.c | |||
@@ -91,6 +91,7 @@ static struct platform_driver imote2_driver = { | |||
91 | .driver = { | 91 | .driver = { |
92 | .name = "imote2-audio", | 92 | .name = "imote2-audio", |
93 | .owner = THIS_MODULE, | 93 | .owner = THIS_MODULE, |
94 | .pm = &snd_soc_pm_ops, | ||
94 | }, | 95 | }, |
95 | .probe = imote2_probe, | 96 | .probe = imote2_probe, |
96 | .remove = imote2_remove, | 97 | .remove = imote2_remove, |
diff --git a/sound/soc/pxa/mioa701_wm9713.c b/sound/soc/pxa/mioa701_wm9713.c index bbea7780eac6..160c5245448f 100644 --- a/sound/soc/pxa/mioa701_wm9713.c +++ b/sound/soc/pxa/mioa701_wm9713.c | |||
@@ -215,6 +215,7 @@ static struct platform_driver mioa701_wm9713_driver = { | |||
215 | .driver = { | 215 | .driver = { |
216 | .name = "mioa701-wm9713", | 216 | .name = "mioa701-wm9713", |
217 | .owner = THIS_MODULE, | 217 | .owner = THIS_MODULE, |
218 | .pm = &snd_soc_pm_ops, | ||
218 | }, | 219 | }, |
219 | }; | 220 | }; |
220 | 221 | ||
diff --git a/sound/soc/pxa/palm27x.c b/sound/soc/pxa/palm27x.c index e1ffcdd9a649..3284c4b901cb 100644 --- a/sound/soc/pxa/palm27x.c +++ b/sound/soc/pxa/palm27x.c | |||
@@ -181,6 +181,7 @@ static struct platform_driver palm27x_wm9712_driver = { | |||
181 | .driver = { | 181 | .driver = { |
182 | .name = "palm27x-asoc", | 182 | .name = "palm27x-asoc", |
183 | .owner = THIS_MODULE, | 183 | .owner = THIS_MODULE, |
184 | .pm = &snd_soc_pm_ops, | ||
184 | }, | 185 | }, |
185 | }; | 186 | }; |
186 | 187 | ||
diff --git a/sound/soc/pxa/poodle.c b/sound/soc/pxa/poodle.c index fafe46355c31..c93e138d8dc3 100644 --- a/sound/soc/pxa/poodle.c +++ b/sound/soc/pxa/poodle.c | |||
@@ -303,6 +303,7 @@ static struct platform_driver poodle_driver = { | |||
303 | .driver = { | 303 | .driver = { |
304 | .name = "poodle-audio", | 304 | .name = "poodle-audio", |
305 | .owner = THIS_MODULE, | 305 | .owner = THIS_MODULE, |
306 | .pm = &snd_soc_pm_ops, | ||
306 | }, | 307 | }, |
307 | .probe = poodle_probe, | 308 | .probe = poodle_probe, |
308 | .remove = poodle_remove, | 309 | .remove = poodle_remove, |
diff --git a/sound/soc/pxa/pxa2xx-ac97.c b/sound/soc/pxa/pxa2xx-ac97.c index f1059d999de6..ae956e3f4b9d 100644 --- a/sound/soc/pxa/pxa2xx-ac97.c +++ b/sound/soc/pxa/pxa2xx-ac97.c | |||
@@ -89,33 +89,6 @@ static struct snd_dmaengine_dai_dma_data pxa2xx_ac97_pcm_mic_mono_in = { | |||
89 | .filter_data = &pxa2xx_ac97_pcm_aux_mic_mono_req, | 89 | .filter_data = &pxa2xx_ac97_pcm_aux_mic_mono_req, |
90 | }; | 90 | }; |
91 | 91 | ||
92 | #ifdef CONFIG_PM | ||
93 | static int pxa2xx_ac97_suspend(struct snd_soc_dai *dai) | ||
94 | { | ||
95 | return pxa2xx_ac97_hw_suspend(); | ||
96 | } | ||
97 | |||
98 | static int pxa2xx_ac97_resume(struct snd_soc_dai *dai) | ||
99 | { | ||
100 | return pxa2xx_ac97_hw_resume(); | ||
101 | } | ||
102 | |||
103 | #else | ||
104 | #define pxa2xx_ac97_suspend NULL | ||
105 | #define pxa2xx_ac97_resume NULL | ||
106 | #endif | ||
107 | |||
108 | static int pxa2xx_ac97_probe(struct snd_soc_dai *dai) | ||
109 | { | ||
110 | return pxa2xx_ac97_hw_probe(to_platform_device(dai->dev)); | ||
111 | } | ||
112 | |||
113 | static int pxa2xx_ac97_remove(struct snd_soc_dai *dai) | ||
114 | { | ||
115 | pxa2xx_ac97_hw_remove(to_platform_device(dai->dev)); | ||
116 | return 0; | ||
117 | } | ||
118 | |||
119 | static int pxa2xx_ac97_hw_params(struct snd_pcm_substream *substream, | 92 | static int pxa2xx_ac97_hw_params(struct snd_pcm_substream *substream, |
120 | struct snd_pcm_hw_params *params, | 93 | struct snd_pcm_hw_params *params, |
121 | struct snd_soc_dai *cpu_dai) | 94 | struct snd_soc_dai *cpu_dai) |
@@ -185,10 +158,6 @@ static struct snd_soc_dai_driver pxa_ac97_dai_driver[] = { | |||
185 | { | 158 | { |
186 | .name = "pxa2xx-ac97", | 159 | .name = "pxa2xx-ac97", |
187 | .ac97_control = 1, | 160 | .ac97_control = 1, |
188 | .probe = pxa2xx_ac97_probe, | ||
189 | .remove = pxa2xx_ac97_remove, | ||
190 | .suspend = pxa2xx_ac97_suspend, | ||
191 | .resume = pxa2xx_ac97_resume, | ||
192 | .playback = { | 161 | .playback = { |
193 | .stream_name = "AC97 Playback", | 162 | .stream_name = "AC97 Playback", |
194 | .channels_min = 2, | 163 | .channels_min = 2, |
@@ -246,6 +215,12 @@ static int pxa2xx_ac97_dev_probe(struct platform_device *pdev) | |||
246 | return -ENXIO; | 215 | return -ENXIO; |
247 | } | 216 | } |
248 | 217 | ||
218 | ret = pxa2xx_ac97_hw_probe(pdev); | ||
219 | if (ret) { | ||
220 | dev_err(&pdev->dev, "PXA2xx AC97 hw probe error (%d)\n", ret); | ||
221 | return ret; | ||
222 | } | ||
223 | |||
249 | ret = snd_soc_set_ac97_ops(&pxa2xx_ac97_ops); | 224 | ret = snd_soc_set_ac97_ops(&pxa2xx_ac97_ops); |
250 | if (ret != 0) | 225 | if (ret != 0) |
251 | return ret; | 226 | return ret; |
@@ -262,15 +237,34 @@ static int pxa2xx_ac97_dev_remove(struct platform_device *pdev) | |||
262 | { | 237 | { |
263 | snd_soc_unregister_component(&pdev->dev); | 238 | snd_soc_unregister_component(&pdev->dev); |
264 | snd_soc_set_ac97_ops(NULL); | 239 | snd_soc_set_ac97_ops(NULL); |
240 | pxa2xx_ac97_hw_remove(pdev); | ||
265 | return 0; | 241 | return 0; |
266 | } | 242 | } |
267 | 243 | ||
244 | #ifdef CONFIG_PM_SLEEP | ||
245 | static int pxa2xx_ac97_dev_suspend(struct device *dev) | ||
246 | { | ||
247 | return pxa2xx_ac97_hw_suspend(); | ||
248 | } | ||
249 | |||
250 | static int pxa2xx_ac97_dev_resume(struct device *dev) | ||
251 | { | ||
252 | return pxa2xx_ac97_hw_resume(); | ||
253 | } | ||
254 | |||
255 | static SIMPLE_DEV_PM_OPS(pxa2xx_ac97_pm_ops, | ||
256 | pxa2xx_ac97_dev_suspend, pxa2xx_ac97_dev_resume); | ||
257 | #endif | ||
258 | |||
268 | static struct platform_driver pxa2xx_ac97_driver = { | 259 | static struct platform_driver pxa2xx_ac97_driver = { |
269 | .probe = pxa2xx_ac97_dev_probe, | 260 | .probe = pxa2xx_ac97_dev_probe, |
270 | .remove = pxa2xx_ac97_dev_remove, | 261 | .remove = pxa2xx_ac97_dev_remove, |
271 | .driver = { | 262 | .driver = { |
272 | .name = "pxa2xx-ac97", | 263 | .name = "pxa2xx-ac97", |
273 | .owner = THIS_MODULE, | 264 | .owner = THIS_MODULE, |
265 | #ifdef CONFIG_PM_SLEEP | ||
266 | .pm = &pxa2xx_ac97_pm_ops, | ||
267 | #endif | ||
274 | }, | 268 | }, |
275 | }; | 269 | }; |
276 | 270 | ||
diff --git a/sound/soc/pxa/tosa.c b/sound/soc/pxa/tosa.c index a3fe19123f07..1d9c2ed223bc 100644 --- a/sound/soc/pxa/tosa.c +++ b/sound/soc/pxa/tosa.c | |||
@@ -275,6 +275,7 @@ static struct platform_driver tosa_driver = { | |||
275 | .driver = { | 275 | .driver = { |
276 | .name = "tosa-audio", | 276 | .name = "tosa-audio", |
277 | .owner = THIS_MODULE, | 277 | .owner = THIS_MODULE, |
278 | .pm = &snd_soc_pm_ops, | ||
278 | }, | 279 | }, |
279 | .probe = tosa_probe, | 280 | .probe = tosa_probe, |
280 | .remove = tosa_remove, | 281 | .remove = tosa_remove, |
diff --git a/sound/soc/pxa/ttc-dkb.c b/sound/soc/pxa/ttc-dkb.c index 13c9ee0cb83b..0b535b570622 100644 --- a/sound/soc/pxa/ttc-dkb.c +++ b/sound/soc/pxa/ttc-dkb.c | |||
@@ -160,6 +160,7 @@ static struct platform_driver ttc_dkb_driver = { | |||
160 | .driver = { | 160 | .driver = { |
161 | .name = "ttc-dkb-audio", | 161 | .name = "ttc-dkb-audio", |
162 | .owner = THIS_MODULE, | 162 | .owner = THIS_MODULE, |
163 | .pm = &snd_soc_pm_ops, | ||
163 | }, | 164 | }, |
164 | .probe = ttc_dkb_probe, | 165 | .probe = ttc_dkb_probe, |
165 | .remove = ttc_dkb_remove, | 166 | .remove = ttc_dkb_remove, |