aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/ux500
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-12-13 14:51:23 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2012-12-13 14:51:23 -0500
commit046e7d685bc370fd4c879ab6635ad3f69e6673d1 (patch)
tree36b981f8d1f2bfd348c1479acbe3a9426d35c377 /sound/soc/ux500
parentfe504c5c745aeb767d978fbedeb94775fd4cb69c (diff)
parent6eb827d23577a4efec2b10a9c4cc9ded268a1d1c (diff)
Merge tag 'sound-3.8' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
Pull sound updates from Takashi Iwai: "This update contains a fairly wide range of changes all over in sound subdirectory, mainly because of UAPI header moves by David and __dev* annotation removals by Bill. Other highlights are: - Introduced the support for wallclock timestamps in ALSA PCM core - Add the poll loop implementation for HD-audio jack detection - Yet more VGA-switcheroo fixes for HD-audio - New VIA HD-audio codec support - More fixes on resource management in USB audio and MIDI drivers - More quirks for USB-audio ASUS Xonar U3, Reloop Play, Focusrite, Roland VG-99, etc - Add support for FastTrack C400 usb-audio - Clean ups in many drivers regarding firmware loading - Add PSC724 Ultiimate Edge support to ice1712 - A few hdspm driver updates - New Stanton SCS.1d/1m FireWire driver - Standardisation of the logging in ASoC codes - DT and dmaengine support for ASoC Atmel - Support for Wolfson ADSP cores - New drivers for Freescale/iVeia P1022 and Maxim MAX98090 - Lots of other ASoC driver fixes and developments" Fix up trivial conflicts. And go out on a limb and assume the dts file 'status' field of one of the conflicting things was supposed to be "disabled", not "disable" like in pretty much all other cases. * tag 'sound-3.8' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (341 commits) ALSA: hda - Move runtime PM check to runtime_idle callback ALSA: hda - Add stereo-dmic fixup for Acer Aspire One 522 ALSA: hda - Avoid doubly suspend after vga switcheroo ALSA: usb-audio: Enable S/PDIF on the ASUS Xonar U3 ALSA: hda - Check validity of CORB/RIRB WP reads ALSA: hda - use usleep_range in link reset and change timeout check ALSA: HDA: VIA: Add support for codec VT1808. ALSA: HDA: VIA Add support for codec VT1705CF. ASoC: codecs: remove __dev* attributes ASoC: utils: remove __dev* attributes ASoC: ux500: remove __dev* attributes ASoC: txx9: remove __dev* attributes ASoC: tegra: remove __dev* attributes ASoC: spear: remove __dev* attributes ASoC: sh: remove __dev* attributes ASoC: s6000: remove __dev* attributes ASoC: OMAP: remove __dev* attributes ASoC: nuc900: remove __dev* attributes ASoC: mxs: remove __dev* attributes ASoC: kirkwood: remove __dev* attributes ...
Diffstat (limited to 'sound/soc/ux500')
-rw-r--r--sound/soc/ux500/mop500.c14
-rw-r--r--sound/soc/ux500/ux500_msp_dai.c59
-rw-r--r--sound/soc/ux500/ux500_msp_dai.h1
-rw-r--r--sound/soc/ux500/ux500_pcm.c19
-rw-r--r--sound/soc/ux500/ux500_pcm.h3
5 files changed, 65 insertions, 31 deletions
diff --git a/sound/soc/ux500/mop500.c b/sound/soc/ux500/mop500.c
index 54f7e25b6f7d..ae6990738783 100644
--- a/sound/soc/ux500/mop500.c
+++ b/sound/soc/ux500/mop500.c
@@ -33,7 +33,7 @@ struct snd_soc_dai_link mop500_dai_links[] = {
33 .stream_name = "ab8500_0", 33 .stream_name = "ab8500_0",
34 .cpu_dai_name = "ux500-msp-i2s.1", 34 .cpu_dai_name = "ux500-msp-i2s.1",
35 .codec_dai_name = "ab8500-codec-dai.0", 35 .codec_dai_name = "ab8500-codec-dai.0",
36 .platform_name = "ux500-pcm.0", 36 .platform_name = "ux500-msp-i2s.1",
37 .codec_name = "ab8500-codec.0", 37 .codec_name = "ab8500-codec.0",
38 .init = mop500_ab8500_machine_init, 38 .init = mop500_ab8500_machine_init,
39 .ops = mop500_ab8500_ops, 39 .ops = mop500_ab8500_ops,
@@ -43,7 +43,7 @@ struct snd_soc_dai_link mop500_dai_links[] = {
43 .stream_name = "ab8500_1", 43 .stream_name = "ab8500_1",
44 .cpu_dai_name = "ux500-msp-i2s.3", 44 .cpu_dai_name = "ux500-msp-i2s.3",
45 .codec_dai_name = "ab8500-codec-dai.1", 45 .codec_dai_name = "ab8500-codec-dai.1",
46 .platform_name = "ux500-pcm.0", 46 .platform_name = "ux500-msp-i2s.3",
47 .codec_name = "ab8500-codec.0", 47 .codec_name = "ab8500-codec.0",
48 .init = NULL, 48 .init = NULL,
49 .ops = mop500_ab8500_ops, 49 .ops = mop500_ab8500_ops,
@@ -71,8 +71,8 @@ static void mop500_of_node_put(void)
71 } 71 }
72} 72}
73 73
74static int __devinit mop500_of_probe(struct platform_device *pdev, 74static int mop500_of_probe(struct platform_device *pdev,
75 struct device_node *np) 75 struct device_node *np)
76{ 76{
77 struct device_node *codec_np, *msp_np[2]; 77 struct device_node *codec_np, *msp_np[2];
78 int i; 78 int i;
@@ -99,7 +99,7 @@ static int __devinit mop500_of_probe(struct platform_device *pdev,
99 return 0; 99 return 0;
100} 100}
101 101
102static int __devinit mop500_probe(struct platform_device *pdev) 102static int mop500_probe(struct platform_device *pdev)
103{ 103{
104 struct device_node *np = pdev->dev.of_node; 104 struct device_node *np = pdev->dev.of_node;
105 int ret; 105 int ret;
@@ -136,7 +136,7 @@ static int __devinit mop500_probe(struct platform_device *pdev)
136 return ret; 136 return ret;
137} 137}
138 138
139static int __devexit mop500_remove(struct platform_device *pdev) 139static int mop500_remove(struct platform_device *pdev)
140{ 140{
141 struct snd_soc_card *mop500_card = platform_get_drvdata(pdev); 141 struct snd_soc_card *mop500_card = platform_get_drvdata(pdev);
142 142
@@ -161,7 +161,7 @@ static struct platform_driver snd_soc_mop500_driver = {
161 .of_match_table = snd_soc_mop500_match, 161 .of_match_table = snd_soc_mop500_match,
162 }, 162 },
163 .probe = mop500_probe, 163 .probe = mop500_probe,
164 .remove = __devexit_p(mop500_remove), 164 .remove = mop500_remove,
165}; 165};
166 166
167module_platform_driver(snd_soc_mop500_driver); 167module_platform_driver(snd_soc_mop500_driver);
diff --git a/sound/soc/ux500/ux500_msp_dai.c b/sound/soc/ux500/ux500_msp_dai.c
index be94bf9bf94f..94a3e5705aaa 100644
--- a/sound/soc/ux500/ux500_msp_dai.c
+++ b/sound/soc/ux500/ux500_msp_dai.c
@@ -28,6 +28,7 @@
28 28
29#include "ux500_msp_i2s.h" 29#include "ux500_msp_i2s.h"
30#include "ux500_msp_dai.h" 30#include "ux500_msp_dai.h"
31#include "ux500_pcm.h"
31 32
32static int setup_pcm_multichan(struct snd_soc_dai *dai, 33static int setup_pcm_multichan(struct snd_soc_dai *dai,
33 struct ux500_msp_config *msp_config) 34 struct ux500_msp_config *msp_config)
@@ -398,11 +399,28 @@ static int ux500_msp_dai_startup(struct snd_pcm_substream *substream,
398 return ret; 399 return ret;
399 } 400 }
400 401
401 /* Enable clock */ 402 /* Prepare and enable clocks */
402 dev_dbg(dai->dev, "%s: Enabling MSP-clock.\n", __func__); 403 dev_dbg(dai->dev, "%s: Enabling MSP-clocks.\n", __func__);
403 clk_enable(drvdata->clk); 404 ret = clk_prepare_enable(drvdata->pclk);
405 if (ret) {
406 dev_err(drvdata->msp->dev,
407 "%s: Failed to prepare/enable pclk!\n", __func__);
408 goto err_pclk;
409 }
404 410
405 return 0; 411 ret = clk_prepare_enable(drvdata->clk);
412 if (ret) {
413 dev_err(drvdata->msp->dev,
414 "%s: Failed to prepare/enable clk!\n", __func__);
415 goto err_clk;
416 }
417
418 return ret;
419err_clk:
420 clk_disable_unprepare(drvdata->pclk);
421err_pclk:
422 regulator_disable(drvdata->reg_vape);
423 return ret;
406} 424}
407 425
408static void ux500_msp_dai_shutdown(struct snd_pcm_substream *substream, 426static void ux500_msp_dai_shutdown(struct snd_pcm_substream *substream,
@@ -428,8 +446,9 @@ static void ux500_msp_dai_shutdown(struct snd_pcm_substream *substream,
428 __func__, dai->id, snd_pcm_stream_str(substream)); 446 __func__, dai->id, snd_pcm_stream_str(substream));
429 } 447 }
430 448
431 /* Disable clock */ 449 /* Disable and unprepare clocks */
432 clk_disable(drvdata->clk); 450 clk_disable_unprepare(drvdata->clk);
451 clk_disable_unprepare(drvdata->pclk);
433 452
434 /* Disable regulator */ 453 /* Disable regulator */
435 ret = regulator_disable(drvdata->reg_vape); 454 ret = regulator_disable(drvdata->reg_vape);
@@ -749,7 +768,7 @@ static struct snd_soc_dai_driver ux500_msp_dai_drv[UX500_NBR_OF_DAI] = {
749 }, 768 },
750}; 769};
751 770
752static int __devinit ux500_msp_drv_probe(struct platform_device *pdev) 771static int ux500_msp_drv_probe(struct platform_device *pdev)
753{ 772{
754 struct ux500_msp_i2s_drvdata *drvdata; 773 struct ux500_msp_i2s_drvdata *drvdata;
755 int ret = 0; 774 int ret = 0;
@@ -780,6 +799,14 @@ static int __devinit ux500_msp_drv_probe(struct platform_device *pdev)
780 } 799 }
781 prcmu_qos_add_requirement(PRCMU_QOS_APE_OPP, (char *)pdev->name, 50); 800 prcmu_qos_add_requirement(PRCMU_QOS_APE_OPP, (char *)pdev->name, 50);
782 801
802 drvdata->pclk = clk_get(&pdev->dev, "apb_pclk");
803 if (IS_ERR(drvdata->pclk)) {
804 ret = (int)PTR_ERR(drvdata->pclk);
805 dev_err(&pdev->dev, "%s: ERROR: clk_get of pclk failed (%d)!\n",
806 __func__, ret);
807 goto err_pclk;
808 }
809
783 drvdata->clk = clk_get(&pdev->dev, NULL); 810 drvdata->clk = clk_get(&pdev->dev, NULL);
784 if (IS_ERR(drvdata->clk)) { 811 if (IS_ERR(drvdata->clk)) {
785 ret = (int)PTR_ERR(drvdata->clk); 812 ret = (int)PTR_ERR(drvdata->clk);
@@ -806,27 +833,41 @@ static int __devinit ux500_msp_drv_probe(struct platform_device *pdev)
806 goto err_init_msp; 833 goto err_init_msp;
807 } 834 }
808 835
836 ret = ux500_pcm_register_platform(pdev);
837 if (ret < 0) {
838 dev_err(&pdev->dev,
839 "Error: %s: Failed to register PCM platform device!\n",
840 __func__);
841 goto err_reg_plat;
842 }
843
809 return 0; 844 return 0;
810 845
846err_reg_plat:
847 snd_soc_unregister_dais(&pdev->dev, ARRAY_SIZE(ux500_msp_dai_drv));
811err_init_msp: 848err_init_msp:
812 clk_put(drvdata->clk); 849 clk_put(drvdata->clk);
813
814err_clk: 850err_clk:
851 clk_put(drvdata->pclk);
852err_pclk:
815 devm_regulator_put(drvdata->reg_vape); 853 devm_regulator_put(drvdata->reg_vape);
816 854
817 return ret; 855 return ret;
818} 856}
819 857
820static int __devexit ux500_msp_drv_remove(struct platform_device *pdev) 858static int ux500_msp_drv_remove(struct platform_device *pdev)
821{ 859{
822 struct ux500_msp_i2s_drvdata *drvdata = dev_get_drvdata(&pdev->dev); 860 struct ux500_msp_i2s_drvdata *drvdata = dev_get_drvdata(&pdev->dev);
823 861
862 ux500_pcm_unregister_platform(pdev);
863
824 snd_soc_unregister_dais(&pdev->dev, ARRAY_SIZE(ux500_msp_dai_drv)); 864 snd_soc_unregister_dais(&pdev->dev, ARRAY_SIZE(ux500_msp_dai_drv));
825 865
826 devm_regulator_put(drvdata->reg_vape); 866 devm_regulator_put(drvdata->reg_vape);
827 prcmu_qos_remove_requirement(PRCMU_QOS_APE_OPP, "ux500_msp_i2s"); 867 prcmu_qos_remove_requirement(PRCMU_QOS_APE_OPP, "ux500_msp_i2s");
828 868
829 clk_put(drvdata->clk); 869 clk_put(drvdata->clk);
870 clk_put(drvdata->pclk);
830 871
831 ux500_msp_i2s_cleanup_msp(pdev, drvdata->msp); 872 ux500_msp_i2s_cleanup_msp(pdev, drvdata->msp);
832 873
diff --git a/sound/soc/ux500/ux500_msp_dai.h b/sound/soc/ux500/ux500_msp_dai.h
index 98202a34a5dd..9c778d9c3838 100644
--- a/sound/soc/ux500/ux500_msp_dai.h
+++ b/sound/soc/ux500/ux500_msp_dai.h
@@ -69,6 +69,7 @@ struct ux500_msp_i2s_drvdata {
69 /* Clocks */ 69 /* Clocks */
70 unsigned int master_clk; 70 unsigned int master_clk;
71 struct clk *clk; 71 struct clk *clk;
72 struct clk *pclk;
72 73
73 /* Regulators */ 74 /* Regulators */
74 int vape_opp_constraint; 75 int vape_opp_constraint;
diff --git a/sound/soc/ux500/ux500_pcm.c b/sound/soc/ux500/ux500_pcm.c
index b55b79f7536c..846fa82a58d0 100644
--- a/sound/soc/ux500/ux500_pcm.c
+++ b/sound/soc/ux500/ux500_pcm.c
@@ -281,7 +281,7 @@ static struct snd_soc_platform_driver ux500_pcm_soc_drv = {
281 .pcm_new = ux500_pcm_new, 281 .pcm_new = ux500_pcm_new,
282}; 282};
283 283
284static int __devexit ux500_pcm_drv_probe(struct platform_device *pdev) 284int ux500_pcm_register_platform(struct platform_device *pdev)
285{ 285{
286 int ret; 286 int ret;
287 287
@@ -295,23 +295,12 @@ static int __devexit ux500_pcm_drv_probe(struct platform_device *pdev)
295 295
296 return 0; 296 return 0;
297} 297}
298EXPORT_SYMBOL_GPL(ux500_pcm_register_platform);
298 299
299static int __devinit ux500_pcm_drv_remove(struct platform_device *pdev) 300int ux500_pcm_unregister_platform(struct platform_device *pdev)
300{ 301{
301 snd_soc_unregister_platform(&pdev->dev); 302 snd_soc_unregister_platform(&pdev->dev);
302 303
303 return 0; 304 return 0;
304} 305}
305 306EXPORT_SYMBOL_GPL(ux500_pcm_unregister_platform);
306static struct platform_driver ux500_pcm_driver = {
307 .driver = {
308 .name = "ux500-pcm",
309 .owner = THIS_MODULE,
310 },
311
312 .probe = ux500_pcm_drv_probe,
313 .remove = __devexit_p(ux500_pcm_drv_remove),
314};
315module_platform_driver(ux500_pcm_driver);
316
317MODULE_LICENSE("GPL v2");
diff --git a/sound/soc/ux500/ux500_pcm.h b/sound/soc/ux500/ux500_pcm.h
index 77ed44d371e9..76d344476afc 100644
--- a/sound/soc/ux500/ux500_pcm.h
+++ b/sound/soc/ux500/ux500_pcm.h
@@ -32,4 +32,7 @@
32#define UX500_PLATFORM_PERIODS_MAX 48 32#define UX500_PLATFORM_PERIODS_MAX 48
33#define UX500_PLATFORM_BUFFER_BYTES_MAX (2048 * PAGE_SIZE) 33#define UX500_PLATFORM_BUFFER_BYTES_MAX (2048 * PAGE_SIZE)
34 34
35int ux500_pcm_register_platform(struct platform_device *pdev);
36int ux500_pcm_unregister_platform(struct platform_device *pdev);
37
35#endif 38#endif