aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/blackfin
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2013-06-28 07:36:22 -0400
committerTakashi Iwai <tiwai@suse.de>2013-06-28 07:36:22 -0400
commitaccaf69da1d1e64bd77ac0caad77e4cfc3b654c7 (patch)
tree0402e4fad9cecd428c8c3c228a08f9e31eb63470 /sound/soc/blackfin
parent975cc02a904ae385721f1bdb65eb1bcf707dfaf1 (diff)
parent27516080b21cbcb936440d2a3171867860b9a881 (diff)
Merge tag 'asoc-v3.11-2' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-next
ASoC: More updates for v3.11 Some more fixes and enhancements, and also a bunch of refectoring for AC'97 support which enables more than one AC'97 controller driver to be built in.
Diffstat (limited to 'sound/soc/blackfin')
-rw-r--r--sound/soc/blackfin/bf5xx-ac97.c29
1 files changed, 15 insertions, 14 deletions
diff --git a/sound/soc/blackfin/bf5xx-ac97.c b/sound/soc/blackfin/bf5xx-ac97.c
index c66bef826ac5..efb1daecd0dd 100644
--- a/sound/soc/blackfin/bf5xx-ac97.c
+++ b/sound/soc/blackfin/bf5xx-ac97.c
@@ -198,13 +198,12 @@ static void bf5xx_ac97_cold_reset(struct snd_ac97 *ac97)
198#endif 198#endif
199} 199}
200 200
201struct snd_ac97_bus_ops soc_ac97_ops = { 201static struct snd_ac97_bus_ops bf5xx_ac97_ops = {
202 .read = bf5xx_ac97_read, 202 .read = bf5xx_ac97_read,
203 .write = bf5xx_ac97_write, 203 .write = bf5xx_ac97_write,
204 .warm_reset = bf5xx_ac97_warm_reset, 204 .warm_reset = bf5xx_ac97_warm_reset,
205 .reset = bf5xx_ac97_cold_reset, 205 .reset = bf5xx_ac97_cold_reset,
206}; 206};
207EXPORT_SYMBOL_GPL(soc_ac97_ops);
208 207
209#ifdef CONFIG_PM 208#ifdef CONFIG_PM
210static int bf5xx_ac97_suspend(struct snd_soc_dai *dai) 209static int bf5xx_ac97_suspend(struct snd_soc_dai *dai)
@@ -293,13 +292,14 @@ static int asoc_bfin_ac97_probe(struct platform_device *pdev)
293 292
294#ifdef CONFIG_SND_BF5XX_HAVE_COLD_RESET 293#ifdef CONFIG_SND_BF5XX_HAVE_COLD_RESET
295 /* Request PB3 as reset pin */ 294 /* Request PB3 as reset pin */
296 if (gpio_request(CONFIG_SND_BF5XX_RESET_GPIO_NUM, "SND_AD198x RESET")) { 295 ret = devm_gpio_request_one(&pdev->dev,
297 pr_err("Failed to request GPIO_%d for reset\n", 296 CONFIG_SND_BF5XX_RESET_GPIO_NUM,
298 CONFIG_SND_BF5XX_RESET_GPIO_NUM); 297 GPIOF_OUT_INIT_HIGH, "SND_AD198x RESET") {
299 ret = -1; 298 dev_err(&pdev->dev,
299 "Failed to request GPIO_%d for reset: %d\n",
300 CONFIG_SND_BF5XX_RESET_GPIO_NUM, ret);
300 goto gpio_err; 301 goto gpio_err;
301 } 302 }
302 gpio_direction_output(CONFIG_SND_BF5XX_RESET_GPIO_NUM, 1);
303#endif 303#endif
304 304
305 sport_handle = sport_init(pdev, 2, sizeof(struct ac97_frame), 305 sport_handle = sport_init(pdev, 2, sizeof(struct ac97_frame),
@@ -335,6 +335,12 @@ static int asoc_bfin_ac97_probe(struct platform_device *pdev)
335 goto sport_config_err; 335 goto sport_config_err;
336 } 336 }
337 337
338 ret = snd_soc_set_ac97_ops(&bf5xx_ac97_ops);
339 if (ret != 0) {
340 dev_err(&pdev->dev, "Failed to set AC'97 ops: %d\n", ret);
341 goto sport_config_err;
342 }
343
338 ret = snd_soc_register_component(&pdev->dev, &bfin_ac97_component, 344 ret = snd_soc_register_component(&pdev->dev, &bfin_ac97_component,
339 &bfin_ac97_dai, 1); 345 &bfin_ac97_dai, 1);
340 if (ret) { 346 if (ret) {
@@ -349,10 +355,7 @@ static int asoc_bfin_ac97_probe(struct platform_device *pdev)
349sport_config_err: 355sport_config_err:
350 sport_done(sport_handle); 356 sport_done(sport_handle);
351sport_err: 357sport_err:
352#ifdef CONFIG_SND_BF5XX_HAVE_COLD_RESET 358 snd_soc_set_ac97_ops(NULL);
353 gpio_free(CONFIG_SND_BF5XX_RESET_GPIO_NUM);
354gpio_err:
355#endif
356 359
357 return ret; 360 return ret;
358} 361}
@@ -363,9 +366,7 @@ static int asoc_bfin_ac97_remove(struct platform_device *pdev)
363 366
364 snd_soc_unregister_component(&pdev->dev); 367 snd_soc_unregister_component(&pdev->dev);
365 sport_done(sport_handle); 368 sport_done(sport_handle);
366#ifdef CONFIG_SND_BF5XX_HAVE_COLD_RESET 369 snd_soc_set_ac97_ops(NULL);
367 gpio_free(CONFIG_SND_BF5XX_RESET_GPIO_NUM);
368#endif
369 370
370 return 0; 371 return 0;
371} 372}