aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/omap/osk5912.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/omap/osk5912.c')
-rw-r--r--sound/soc/omap/osk5912.c50
1 files changed, 7 insertions, 43 deletions
diff --git a/sound/soc/omap/osk5912.c b/sound/soc/omap/osk5912.c
index 7e75e775fb4a..db91ccaf6c97 100644
--- a/sound/soc/omap/osk5912.c
+++ b/sound/soc/omap/osk5912.c
@@ -55,29 +55,8 @@ static int osk_hw_params(struct snd_pcm_substream *substream,
55{ 55{
56 struct snd_soc_pcm_runtime *rtd = substream->private_data; 56 struct snd_soc_pcm_runtime *rtd = substream->private_data;
57 struct snd_soc_dai *codec_dai = rtd->codec_dai; 57 struct snd_soc_dai *codec_dai = rtd->codec_dai;
58 struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
59 int err; 58 int err;
60 59
61 /* Set codec DAI configuration */
62 err = snd_soc_dai_set_fmt(codec_dai,
63 SND_SOC_DAIFMT_DSP_B |
64 SND_SOC_DAIFMT_NB_NF |
65 SND_SOC_DAIFMT_CBM_CFM);
66 if (err < 0) {
67 printk(KERN_ERR "can't set codec DAI configuration\n");
68 return err;
69 }
70
71 /* Set cpu DAI configuration */
72 err = snd_soc_dai_set_fmt(cpu_dai,
73 SND_SOC_DAIFMT_DSP_B |
74 SND_SOC_DAIFMT_NB_NF |
75 SND_SOC_DAIFMT_CBM_CFM);
76 if (err < 0) {
77 printk(KERN_ERR "can't set cpu DAI configuration\n");
78 return err;
79 }
80
81 /* Set the codec system clock for DAC and ADC */ 60 /* Set the codec system clock for DAC and ADC */
82 err = 61 err =
83 snd_soc_dai_set_sysclk(codec_dai, 0, CODEC_CLOCK, SND_SOC_CLOCK_IN); 62 snd_soc_dai_set_sysclk(codec_dai, 0, CODEC_CLOCK, SND_SOC_CLOCK_IN);
@@ -112,27 +91,6 @@ static const struct snd_soc_dapm_route audio_map[] = {
112 {"MICIN", NULL, "Mic Jack"}, 91 {"MICIN", NULL, "Mic Jack"},
113}; 92};
114 93
115static int osk_tlv320aic23_init(struct snd_soc_pcm_runtime *rtd)
116{
117 struct snd_soc_codec *codec = rtd->codec;
118 struct snd_soc_dapm_context *dapm = &codec->dapm;
119
120 /* Add osk5912 specific widgets */
121 snd_soc_dapm_new_controls(dapm, tlv320aic23_dapm_widgets,
122 ARRAY_SIZE(tlv320aic23_dapm_widgets));
123
124 /* Set up osk5912 specific audio path audio_map */
125 snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map));
126
127 snd_soc_dapm_enable_pin(dapm, "Headphone Jack");
128 snd_soc_dapm_enable_pin(dapm, "Line In");
129 snd_soc_dapm_enable_pin(dapm, "Mic Jack");
130
131 snd_soc_dapm_sync(dapm);
132
133 return 0;
134}
135
136/* Digital audio interface glue - connects codec <--> CPU */ 94/* Digital audio interface glue - connects codec <--> CPU */
137static struct snd_soc_dai_link osk_dai = { 95static struct snd_soc_dai_link osk_dai = {
138 .name = "TLV320AIC23", 96 .name = "TLV320AIC23",
@@ -141,7 +99,8 @@ static struct snd_soc_dai_link osk_dai = {
141 .codec_dai_name = "tlv320aic23-hifi", 99 .codec_dai_name = "tlv320aic23-hifi",
142 .platform_name = "omap-pcm-audio", 100 .platform_name = "omap-pcm-audio",
143 .codec_name = "tlv320aic23-codec", 101 .codec_name = "tlv320aic23-codec",
144 .init = osk_tlv320aic23_init, 102 .dai_fmt = SND_SOC_DAIFMT_DSP_B | SND_SOC_DAIFMT_NB_NF |
103 SND_SOC_DAIFMT_CBM_CFM,
145 .ops = &osk_ops, 104 .ops = &osk_ops,
146}; 105};
147 106
@@ -150,6 +109,11 @@ static struct snd_soc_card snd_soc_card_osk = {
150 .name = "OSK5912", 109 .name = "OSK5912",
151 .dai_link = &osk_dai, 110 .dai_link = &osk_dai,
152 .num_links = 1, 111 .num_links = 1,
112
113 .dapm_widgets = tlv320aic23_dapm_widgets,
114 .num_dapm_widgets = ARRAY_SIZE(tlv320aic23_dapm_widgets),
115 .dapm_routes = audio_map,
116 .num_dapm_routes = ARRAY_SIZE(audio_map),
153}; 117};
154 118
155static struct platform_device *osk_snd_device; 119static struct platform_device *osk_snd_device;