diff options
Diffstat (limited to 'sound/soc/atmel/snd-soc-afeb9260.c')
-rw-r--r-- | sound/soc/atmel/snd-soc-afeb9260.c | 35 |
1 files changed, 9 insertions, 26 deletions
diff --git a/sound/soc/atmel/snd-soc-afeb9260.c b/sound/soc/atmel/snd-soc-afeb9260.c index 23349de27313..e3d283561c19 100644 --- a/sound/soc/atmel/snd-soc-afeb9260.c +++ b/sound/soc/atmel/snd-soc-afeb9260.c | |||
@@ -46,8 +46,8 @@ static int afeb9260_hw_params(struct snd_pcm_substream *substream, | |||
46 | struct snd_pcm_hw_params *params) | 46 | struct snd_pcm_hw_params *params) |
47 | { | 47 | { |
48 | struct snd_soc_pcm_runtime *rtd = substream->private_data; | 48 | struct snd_soc_pcm_runtime *rtd = substream->private_data; |
49 | struct snd_soc_dai *codec_dai = rtd->dai->codec_dai; | 49 | struct snd_soc_dai *codec_dai = rtd->codec_dai; |
50 | struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai; | 50 | struct snd_soc_dai *cpu_dai = rtd->cpu_dai; |
51 | int err; | 51 | int err; |
52 | 52 | ||
53 | /* Set codec DAI configuration */ | 53 | /* Set codec DAI configuration */ |
@@ -102,8 +102,9 @@ static const struct snd_soc_dapm_route audio_map[] = { | |||
102 | {"MICIN", NULL, "Mic Jack"}, | 102 | {"MICIN", NULL, "Mic Jack"}, |
103 | }; | 103 | }; |
104 | 104 | ||
105 | static int afeb9260_tlv320aic23_init(struct snd_soc_codec *codec) | 105 | static int afeb9260_tlv320aic23_init(struct snd_soc_pcm_runtime *rtd) |
106 | { | 106 | { |
107 | struct snd_soc_codec *codec = rtd->codec; | ||
107 | 108 | ||
108 | /* Add afeb9260 specific widgets */ | 109 | /* Add afeb9260 specific widgets */ |
109 | snd_soc_dapm_new_controls(codec, tlv320aic23_dapm_widgets, | 110 | snd_soc_dapm_new_controls(codec, tlv320aic23_dapm_widgets, |
@@ -125,8 +126,10 @@ static int afeb9260_tlv320aic23_init(struct snd_soc_codec *codec) | |||
125 | static struct snd_soc_dai_link afeb9260_dai = { | 126 | static struct snd_soc_dai_link afeb9260_dai = { |
126 | .name = "TLV320AIC23", | 127 | .name = "TLV320AIC23", |
127 | .stream_name = "AIC23", | 128 | .stream_name = "AIC23", |
128 | .cpu_dai = &atmel_ssc_dai[0], | 129 | .cpu_dai_name = "atmel-ssc-dai.0", |
129 | .codec_dai = &tlv320aic23_dai, | 130 | .codec_dai_name = "tlv320aic23-hifi", |
131 | .platform_name = "atmel_pcm-audio", | ||
132 | .codec_name = "tlv320aic23-codec.0-0x1a", | ||
130 | .init = afeb9260_tlv320aic23_init, | 133 | .init = afeb9260_tlv320aic23_init, |
131 | .ops = &afeb9260_ops, | 134 | .ops = &afeb9260_ops, |
132 | }; | 135 | }; |
@@ -134,37 +137,20 @@ static struct snd_soc_dai_link afeb9260_dai = { | |||
134 | /* Audio machine driver */ | 137 | /* Audio machine driver */ |
135 | static struct snd_soc_card snd_soc_machine_afeb9260 = { | 138 | static struct snd_soc_card snd_soc_machine_afeb9260 = { |
136 | .name = "AFEB9260", | 139 | .name = "AFEB9260", |
137 | .platform = &atmel_soc_platform, | ||
138 | .dai_link = &afeb9260_dai, | 140 | .dai_link = &afeb9260_dai, |
139 | .num_links = 1, | 141 | .num_links = 1, |
140 | }; | 142 | }; |
141 | 143 | ||
142 | /* Audio subsystem */ | ||
143 | static struct snd_soc_device afeb9260_snd_devdata = { | ||
144 | .card = &snd_soc_machine_afeb9260, | ||
145 | .codec_dev = &soc_codec_dev_tlv320aic23, | ||
146 | }; | ||
147 | |||
148 | static struct platform_device *afeb9260_snd_device; | 144 | static struct platform_device *afeb9260_snd_device; |
149 | 145 | ||
150 | static int __init afeb9260_soc_init(void) | 146 | static int __init afeb9260_soc_init(void) |
151 | { | 147 | { |
152 | int err; | 148 | int err; |
153 | struct device *dev; | 149 | struct device *dev; |
154 | struct atmel_ssc_info *ssc_p = afeb9260_dai.cpu_dai->private_data; | ||
155 | struct ssc_device *ssc = NULL; | ||
156 | 150 | ||
157 | if (!(machine_is_afeb9260())) | 151 | if (!(machine_is_afeb9260())) |
158 | return -ENODEV; | 152 | return -ENODEV; |
159 | 153 | ||
160 | ssc = ssc_request(0); | ||
161 | if (IS_ERR(ssc)) { | ||
162 | printk(KERN_ERR "ASoC: Failed to request SSC 0\n"); | ||
163 | err = PTR_ERR(ssc); | ||
164 | ssc = NULL; | ||
165 | goto err_ssc; | ||
166 | } | ||
167 | ssc_p->ssc = ssc; | ||
168 | 154 | ||
169 | afeb9260_snd_device = platform_device_alloc("soc-audio", -1); | 155 | afeb9260_snd_device = platform_device_alloc("soc-audio", -1); |
170 | if (!afeb9260_snd_device) { | 156 | if (!afeb9260_snd_device) { |
@@ -172,8 +158,7 @@ static int __init afeb9260_soc_init(void) | |||
172 | return -ENOMEM; | 158 | return -ENOMEM; |
173 | } | 159 | } |
174 | 160 | ||
175 | platform_set_drvdata(afeb9260_snd_device, &afeb9260_snd_devdata); | 161 | platform_set_drvdata(afeb9260_snd_device, &snd_soc_machine_afeb9260); |
176 | afeb9260_snd_devdata.dev = &afeb9260_snd_device->dev; | ||
177 | err = platform_device_add(afeb9260_snd_device); | 162 | err = platform_device_add(afeb9260_snd_device); |
178 | if (err) | 163 | if (err) |
179 | goto err1; | 164 | goto err1; |
@@ -184,9 +169,7 @@ static int __init afeb9260_soc_init(void) | |||
184 | err1: | 169 | err1: |
185 | platform_device_del(afeb9260_snd_device); | 170 | platform_device_del(afeb9260_snd_device); |
186 | platform_device_put(afeb9260_snd_device); | 171 | platform_device_put(afeb9260_snd_device); |
187 | err_ssc: | ||
188 | return err; | 172 | return err; |
189 | |||
190 | } | 173 | } |
191 | 174 | ||
192 | static void __exit afeb9260_soc_exit(void) | 175 | static void __exit afeb9260_soc_exit(void) |