diff options
Diffstat (limited to 'sound/soc/omap/omap3evm.c')
| -rw-r--r-- | sound/soc/omap/omap3evm.c | 35 |
1 files changed, 8 insertions, 27 deletions
diff --git a/sound/soc/omap/omap3evm.c b/sound/soc/omap/omap3evm.c index dfcb344092e4..0daa04469836 100644 --- a/sound/soc/omap/omap3evm.c +++ b/sound/soc/omap/omap3evm.c | |||
| @@ -22,7 +22,6 @@ | |||
| 22 | #include <sound/core.h> | 22 | #include <sound/core.h> |
| 23 | #include <sound/pcm.h> | 23 | #include <sound/pcm.h> |
| 24 | #include <sound/soc.h> | 24 | #include <sound/soc.h> |
| 25 | #include <sound/soc-dapm.h> | ||
| 26 | 25 | ||
| 27 | #include <asm/mach-types.h> | 26 | #include <asm/mach-types.h> |
| 28 | #include <mach/hardware.h> | 27 | #include <mach/hardware.h> |
| @@ -31,14 +30,13 @@ | |||
| 31 | 30 | ||
| 32 | #include "omap-mcbsp.h" | 31 | #include "omap-mcbsp.h" |
| 33 | #include "omap-pcm.h" | 32 | #include "omap-pcm.h" |
| 34 | #include "../codecs/twl4030.h" | ||
| 35 | 33 | ||
| 36 | static int omap3evm_hw_params(struct snd_pcm_substream *substream, | 34 | static int omap3evm_hw_params(struct snd_pcm_substream *substream, |
| 37 | struct snd_pcm_hw_params *params) | 35 | struct snd_pcm_hw_params *params) |
| 38 | { | 36 | { |
| 39 | struct snd_soc_pcm_runtime *rtd = substream->private_data; | 37 | struct snd_soc_pcm_runtime *rtd = substream->private_data; |
| 40 | struct snd_soc_dai *codec_dai = rtd->dai->codec_dai; | 38 | struct snd_soc_dai *codec_dai = rtd->codec_dai; |
| 41 | struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai; | 39 | struct snd_soc_dai *cpu_dai = rtd->cpu_dai; |
| 42 | int ret; | 40 | int ret; |
| 43 | 41 | ||
| 44 | /* Set codec DAI configuration */ | 42 | /* Set codec DAI configuration */ |
| @@ -80,42 +78,28 @@ static struct snd_soc_ops omap3evm_ops = { | |||
| 80 | static struct snd_soc_dai_link omap3evm_dai = { | 78 | static struct snd_soc_dai_link omap3evm_dai = { |
| 81 | .name = "TWL4030", | 79 | .name = "TWL4030", |
| 82 | .stream_name = "TWL4030", | 80 | .stream_name = "TWL4030", |
| 83 | .cpu_dai = &omap_mcbsp_dai[0], | 81 | .cpu_dai_name = "omap-mcbsp-dai.1", |
| 84 | .codec_dai = &twl4030_dai[TWL4030_DAI_HIFI], | 82 | .codec_dai_name = "twl4030-hifi", |
| 83 | .platform_name = "omap-pcm-audio", | ||
| 84 | .codec_name = "twl4030-codec", | ||
| 85 | .ops = &omap3evm_ops, | 85 | .ops = &omap3evm_ops, |
| 86 | }; | 86 | }; |
| 87 | 87 | ||
| 88 | /* Audio machine driver */ | 88 | /* Audio machine driver */ |
| 89 | static struct snd_soc_card snd_soc_omap3evm = { | 89 | static struct snd_soc_card snd_soc_omap3evm = { |
| 90 | .name = "omap3evm", | 90 | .name = "omap3evm", |
| 91 | .platform = &omap_soc_platform, | ||
| 92 | .dai_link = &omap3evm_dai, | 91 | .dai_link = &omap3evm_dai, |
| 93 | .num_links = 1, | 92 | .num_links = 1, |
| 94 | }; | 93 | }; |
| 95 | 94 | ||
| 96 | /* twl4030 setup */ | ||
| 97 | static struct twl4030_setup_data twl4030_setup = { | ||
| 98 | .ramp_delay_value = 4, | ||
| 99 | .sysclk = 26000, | ||
| 100 | }; | ||
| 101 | |||
| 102 | /* Audio subsystem */ | ||
| 103 | static struct snd_soc_device omap3evm_snd_devdata = { | ||
| 104 | .card = &snd_soc_omap3evm, | ||
| 105 | .codec_dev = &soc_codec_dev_twl4030, | ||
| 106 | .codec_data = &twl4030_setup, | ||
| 107 | }; | ||
| 108 | |||
| 109 | static struct platform_device *omap3evm_snd_device; | 95 | static struct platform_device *omap3evm_snd_device; |
| 110 | 96 | ||
| 111 | static int __init omap3evm_soc_init(void) | 97 | static int __init omap3evm_soc_init(void) |
| 112 | { | 98 | { |
| 113 | int ret; | 99 | int ret; |
| 114 | 100 | ||
| 115 | if (!machine_is_omap3evm()) { | 101 | if (!machine_is_omap3evm()) |
| 116 | pr_err("Not OMAP3 EVM!\n"); | ||
| 117 | return -ENODEV; | 102 | return -ENODEV; |
| 118 | } | ||
| 119 | pr_info("OMAP3 EVM SoC init\n"); | 103 | pr_info("OMAP3 EVM SoC init\n"); |
| 120 | 104 | ||
| 121 | omap3evm_snd_device = platform_device_alloc("soc-audio", -1); | 105 | omap3evm_snd_device = platform_device_alloc("soc-audio", -1); |
| @@ -124,10 +108,7 @@ static int __init omap3evm_soc_init(void) | |||
| 124 | return -ENOMEM; | 108 | return -ENOMEM; |
| 125 | } | 109 | } |
| 126 | 110 | ||
| 127 | platform_set_drvdata(omap3evm_snd_device, &omap3evm_snd_devdata); | 111 | platform_set_drvdata(omap3evm_snd_device, &snd_soc_omap3evm); |
| 128 | omap3evm_snd_devdata.dev = &omap3evm_snd_device->dev; | ||
| 129 | *(unsigned int *)omap3evm_dai.cpu_dai->private_data = 1; | ||
| 130 | |||
| 131 | ret = platform_device_add(omap3evm_snd_device); | 112 | ret = platform_device_add(omap3evm_snd_device); |
| 132 | if (ret) | 113 | if (ret) |
| 133 | goto err1; | 114 | goto err1; |
