diff options
author | Jon Smirl <jonsmirl@gmail.com> | 2009-05-26 08:34:14 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2009-05-26 16:13:02 -0400 |
commit | 6ffee43ecf8bfbe0bd74c9084c9772a59097d53b (patch) | |
tree | 19013a2bb9582b56afc17c24dbd7a231e3614136 /sound/soc/fsl | |
parent | a9262c4fd404654acd3684699047fa63206518c8 (diff) |
ASoC: Fabric bindings for STAC9766 on the Efika
Signed-off-by: Jon Smirl <jonsmirl@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/fsl')
-rw-r--r-- | sound/soc/fsl/Kconfig | 8 | ||||
-rw-r--r-- | sound/soc/fsl/Makefile | 1 | ||||
-rw-r--r-- | sound/soc/fsl/efika-audio-fabric.c | 90 |
3 files changed, 99 insertions, 0 deletions
diff --git a/sound/soc/fsl/Kconfig b/sound/soc/fsl/Kconfig index 79579ae5b241..f571c6eef58f 100644 --- a/sound/soc/fsl/Kconfig +++ b/sound/soc/fsl/Kconfig | |||
@@ -47,3 +47,11 @@ config SND_MPC52xx_SOC_PCM030 | |||
47 | help | 47 | help |
48 | Say Y if you want to add support for sound on the Phytec pcm030 baseboard. | 48 | Say Y if you want to add support for sound on the Phytec pcm030 baseboard. |
49 | 49 | ||
50 | config SND_MPC52xx_SOC_EFIKA | ||
51 | tristate "SoC AC97 Audio support for bbplan Efika and STAC9766" | ||
52 | depends on PPC_EFIKA | ||
53 | select SND_SOC_MPC5200_AC97 | ||
54 | select SND_SOC_STAC9766 | ||
55 | help | ||
56 | Say Y if you want to add support for sound on the Efika. | ||
57 | |||
diff --git a/sound/soc/fsl/Makefile b/sound/soc/fsl/Makefile index 66d88c86b5df..a83a73967ec6 100644 --- a/sound/soc/fsl/Makefile +++ b/sound/soc/fsl/Makefile | |||
@@ -17,4 +17,5 @@ obj-$(CONFIG_SND_SOC_MPC5200_AC97) += mpc5200_psc_ac97.o | |||
17 | 17 | ||
18 | # MPC5200 Machine Support | 18 | # MPC5200 Machine Support |
19 | obj-$(CONFIG_SND_MPC52xx_SOC_PCM030) += pcm030-audio-fabric.o | 19 | obj-$(CONFIG_SND_MPC52xx_SOC_PCM030) += pcm030-audio-fabric.o |
20 | obj-$(CONFIG_SND_MPC52xx_SOC_EFIKA) += efika-audio-fabric.o | ||
20 | 21 | ||
diff --git a/sound/soc/fsl/efika-audio-fabric.c b/sound/soc/fsl/efika-audio-fabric.c new file mode 100644 index 000000000000..85b0e7569504 --- /dev/null +++ b/sound/soc/fsl/efika-audio-fabric.c | |||
@@ -0,0 +1,90 @@ | |||
1 | /* | ||
2 | * Efika driver for the PSC of the Freescale MPC52xx | ||
3 | * configured as AC97 interface | ||
4 | * | ||
5 | * Copyright 2008 Jon Smirl, Digispeaker | ||
6 | * Author: Jon Smirl <jonsmirl@gmail.com> | ||
7 | * | ||
8 | * This file is licensed under the terms of the GNU General Public License | ||
9 | * version 2. This program is licensed "as is" without any warranty of any | ||
10 | * kind, whether express or implied. | ||
11 | */ | ||
12 | |||
13 | #include <linux/init.h> | ||
14 | #include <linux/module.h> | ||
15 | #include <linux/interrupt.h> | ||
16 | #include <linux/device.h> | ||
17 | #include <linux/delay.h> | ||
18 | #include <linux/of_device.h> | ||
19 | #include <linux/of_platform.h> | ||
20 | #include <linux/dma-mapping.h> | ||
21 | |||
22 | #include <sound/core.h> | ||
23 | #include <sound/pcm.h> | ||
24 | #include <sound/pcm_params.h> | ||
25 | #include <sound/initval.h> | ||
26 | #include <sound/soc.h> | ||
27 | #include <sound/soc-of-simple.h> | ||
28 | |||
29 | #include "mpc5200_dma.h" | ||
30 | #include "mpc5200_psc_ac97.h" | ||
31 | #include "../codecs/stac9766.h" | ||
32 | |||
33 | static struct snd_soc_device device; | ||
34 | static struct snd_soc_card card; | ||
35 | |||
36 | static struct snd_soc_dai_link efika_fabric_dai[] = { | ||
37 | { | ||
38 | .name = "AC97", | ||
39 | .stream_name = "AC97 Analog", | ||
40 | .codec_dai = &stac9766_dai[STAC9766_DAI_AC97_ANALOG], | ||
41 | .cpu_dai = &psc_ac97_dai[MPC5200_AC97_NORMAL], | ||
42 | }, | ||
43 | { | ||
44 | .name = "AC97", | ||
45 | .stream_name = "AC97 IEC958", | ||
46 | .codec_dai = &stac9766_dai[STAC9766_DAI_AC97_DIGITAL], | ||
47 | .cpu_dai = &psc_ac97_dai[MPC5200_AC97_SPDIF], | ||
48 | }, | ||
49 | }; | ||
50 | |||
51 | static __init int efika_fabric_init(void) | ||
52 | { | ||
53 | struct platform_device *pdev; | ||
54 | int rc; | ||
55 | |||
56 | if (!machine_is_compatible("bplan,efika")) | ||
57 | return -ENODEV; | ||
58 | |||
59 | card.platform = &mpc5200_audio_dma_platform; | ||
60 | card.name = "Efika"; | ||
61 | card.dai_link = efika_fabric_dai; | ||
62 | card.num_links = ARRAY_SIZE(efika_fabric_dai); | ||
63 | |||
64 | device.card = &card; | ||
65 | device.codec_dev = &soc_codec_dev_stac9766; | ||
66 | |||
67 | pdev = platform_device_alloc("soc-audio", 1); | ||
68 | if (!pdev) { | ||
69 | pr_err("efika_fabric_init: platform_device_alloc() failed\n"); | ||
70 | return -ENODEV; | ||
71 | } | ||
72 | |||
73 | platform_set_drvdata(pdev, &device); | ||
74 | device.dev = &pdev->dev; | ||
75 | |||
76 | rc = platform_device_add(pdev); | ||
77 | if (rc) { | ||
78 | pr_err("efika_fabric_init: platform_device_add() failed\n"); | ||
79 | return -ENODEV; | ||
80 | } | ||
81 | return 0; | ||
82 | } | ||
83 | |||
84 | module_init(efika_fabric_init); | ||
85 | |||
86 | |||
87 | MODULE_AUTHOR("Jon Smirl <jonsmirl@gmail.com>"); | ||
88 | MODULE_DESCRIPTION(DRV_NAME ": mpc5200 Efika fabric driver"); | ||
89 | MODULE_LICENSE("GPL"); | ||
90 | |||