blob: 70ab6077fa55b354880e6b4a4c0b31883f6c5b9b [file] [log] [blame]
Ian Molton2aceefe2009-01-16 11:04:18 +00001/*
2 * wm9705.c -- ALSA Soc WM9705 codec support
3 *
4 * Copyright 2008 Ian Molton <spyro@f2s.com>
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; Version 2 of the License only.
9 *
10 */
11
12#include <linux/init.h>
Tejun Heo5a0e3ad2010-03-24 17:04:11 +090013#include <linux/slab.h>
Ian Molton2aceefe2009-01-16 11:04:18 +000014#include <linux/module.h>
15#include <linux/kernel.h>
16#include <linux/device.h>
Lars-Peter Clausen206964e2016-10-21 10:27:07 +020017#include <linux/regmap.h>
Ian Molton2aceefe2009-01-16 11:04:18 +000018#include <sound/core.h>
19#include <sound/pcm.h>
20#include <sound/ac97_codec.h>
21#include <sound/initval.h>
22#include <sound/soc.h>
Ian Molton2aceefe2009-01-16 11:04:18 +000023
Mark Brown01e097d2009-01-23 15:07:45 +000024#include "wm9705.h"
25
Lars-Peter Clausen6e0b73a2015-07-21 21:53:04 +020026#define WM9705_VENDOR_ID 0x574d4c05
27#define WM9705_VENDOR_ID_MASK 0xffffffff
28
Lars-Peter Clausen206964e2016-10-21 10:27:07 +020029static const struct reg_default wm9705_reg_defaults[] = {
30 { 0x02, 0x8000 },
31 { 0x04, 0x8000 },
32 { 0x06, 0x8000 },
33 { 0x0a, 0x8000 },
34 { 0x0c, 0x8008 },
35 { 0x0e, 0x8008 },
36 { 0x10, 0x8808 },
37 { 0x12, 0x8808 },
38 { 0x14, 0x8808 },
39 { 0x16, 0x8808 },
40 { 0x18, 0x8808 },
41 { 0x1a, 0x0000 },
42 { 0x1c, 0x8000 },
43 { 0x20, 0x0000 },
44 { 0x22, 0x0000 },
45 { 0x26, 0x000f },
46 { 0x28, 0x0605 },
47 { 0x2a, 0x0000 },
48 { 0x2c, 0xbb80 },
49 { 0x32, 0xbb80 },
50 { 0x34, 0x2000 },
51 { 0x5a, 0x0000 },
52 { 0x5c, 0x0000 },
53 { 0x72, 0x0808 },
54 { 0x74, 0x0000 },
55 { 0x76, 0x0006 },
56 { 0x78, 0x0000 },
57 { 0x7a, 0x0000 },
58};
59
60static const struct regmap_config wm9705_regmap_config = {
61 .reg_bits = 16,
62 .reg_stride = 2,
63 .val_bits = 16,
64 .max_register = 0x7e,
65 .cache_type = REGCACHE_RBTREE,
66
67 .volatile_reg = regmap_ac97_default_volatile,
68
69 .reg_defaults = wm9705_reg_defaults,
70 .num_reg_defaults = ARRAY_SIZE(wm9705_reg_defaults),
Ian Molton2aceefe2009-01-16 11:04:18 +000071};
72
73static const struct snd_kcontrol_new wm9705_snd_ac97_controls[] = {
74 SOC_DOUBLE("Master Playback Volume", AC97_MASTER, 8, 0, 31, 1),
75 SOC_SINGLE("Master Playback Switch", AC97_MASTER, 15, 1, 1),
76 SOC_DOUBLE("Headphone Playback Volume", AC97_HEADPHONE, 8, 0, 31, 1),
77 SOC_SINGLE("Headphone Playback Switch", AC97_HEADPHONE, 15, 1, 1),
78 SOC_DOUBLE("PCM Playback Volume", AC97_PCM, 8, 0, 31, 1),
79 SOC_SINGLE("PCM Playback Switch", AC97_PCM, 15, 1, 1),
80 SOC_SINGLE("Mono Playback Volume", AC97_MASTER_MONO, 0, 31, 1),
81 SOC_SINGLE("Mono Playback Switch", AC97_MASTER_MONO, 15, 1, 1),
82 SOC_SINGLE("PCBeep Playback Volume", AC97_PC_BEEP, 1, 15, 1),
83 SOC_SINGLE("Phone Playback Volume", AC97_PHONE, 0, 31, 1),
84 SOC_DOUBLE("Line Playback Volume", AC97_LINE, 8, 0, 31, 1),
85 SOC_DOUBLE("CD Playback Volume", AC97_CD, 8, 0, 31, 1),
86 SOC_SINGLE("Mic Playback Volume", AC97_MIC, 0, 31, 1),
87 SOC_SINGLE("Mic 20dB Boost Switch", AC97_MIC, 6, 1, 0),
Ian Molton927b0ae2009-01-19 17:23:11 +000088 SOC_DOUBLE("Capture Volume", AC97_REC_GAIN, 8, 0, 15, 0),
89 SOC_SINGLE("Capture Switch", AC97_REC_GAIN, 15, 1, 1),
Ian Molton2aceefe2009-01-16 11:04:18 +000090};
91
92static const char *wm9705_mic[] = {"Mic 1", "Mic 2"};
93static const char *wm9705_rec_sel[] = {"Mic", "CD", "NC", "NC",
94 "Line", "Stereo Mix", "Mono Mix", "Phone"};
95
Takashi Iwai09981dc2014-02-18 10:47:00 +010096static SOC_ENUM_SINGLE_DECL(wm9705_enum_mic,
97 AC97_GENERAL_PURPOSE, 8, wm9705_mic);
98static SOC_ENUM_SINGLE_DECL(wm9705_enum_rec_l,
99 AC97_REC_SEL, 8, wm9705_rec_sel);
100static SOC_ENUM_SINGLE_DECL(wm9705_enum_rec_r,
101 AC97_REC_SEL, 0, wm9705_rec_sel);
Ian Molton2aceefe2009-01-16 11:04:18 +0000102
103/* Headphone Mixer */
104static const struct snd_kcontrol_new wm9705_hp_mixer_controls[] = {
105 SOC_DAPM_SINGLE("PCBeep Playback Switch", AC97_PC_BEEP, 15, 1, 1),
106 SOC_DAPM_SINGLE("CD Playback Switch", AC97_CD, 15, 1, 1),
107 SOC_DAPM_SINGLE("Mic Playback Switch", AC97_MIC, 15, 1, 1),
108 SOC_DAPM_SINGLE("Phone Playback Switch", AC97_PHONE, 15, 1, 1),
109 SOC_DAPM_SINGLE("Line Playback Switch", AC97_LINE, 15, 1, 1),
110};
111
112/* Mic source */
113static const struct snd_kcontrol_new wm9705_mic_src_controls =
114 SOC_DAPM_ENUM("Route", wm9705_enum_mic);
115
116/* Capture source */
117static const struct snd_kcontrol_new wm9705_capture_selectl_controls =
118 SOC_DAPM_ENUM("Route", wm9705_enum_rec_l);
119static const struct snd_kcontrol_new wm9705_capture_selectr_controls =
120 SOC_DAPM_ENUM("Route", wm9705_enum_rec_r);
121
122/* DAPM widgets */
123static const struct snd_soc_dapm_widget wm9705_dapm_widgets[] = {
124 SND_SOC_DAPM_MUX("Mic Source", SND_SOC_NOPM, 0, 0,
125 &wm9705_mic_src_controls),
126 SND_SOC_DAPM_MUX("Left Capture Source", SND_SOC_NOPM, 0, 0,
127 &wm9705_capture_selectl_controls),
128 SND_SOC_DAPM_MUX("Right Capture Source", SND_SOC_NOPM, 0, 0,
129 &wm9705_capture_selectr_controls),
130 SND_SOC_DAPM_DAC("Left DAC", "Left HiFi Playback",
131 SND_SOC_NOPM, 0, 0),
132 SND_SOC_DAPM_DAC("Right DAC", "Right HiFi Playback",
133 SND_SOC_NOPM, 0, 0),
134 SND_SOC_DAPM_MIXER_NAMED_CTL("HP Mixer", SND_SOC_NOPM, 0, 0,
135 &wm9705_hp_mixer_controls[0],
136 ARRAY_SIZE(wm9705_hp_mixer_controls)),
137 SND_SOC_DAPM_MIXER("Mono Mixer", SND_SOC_NOPM, 0, 0, NULL, 0),
138 SND_SOC_DAPM_ADC("Left ADC", "Left HiFi Capture", SND_SOC_NOPM, 0, 0),
139 SND_SOC_DAPM_ADC("Right ADC", "Right HiFi Capture", SND_SOC_NOPM, 0, 0),
140 SND_SOC_DAPM_PGA("Headphone PGA", SND_SOC_NOPM, 0, 0, NULL, 0),
141 SND_SOC_DAPM_PGA("Speaker PGA", SND_SOC_NOPM, 0, 0, NULL, 0),
142 SND_SOC_DAPM_PGA("Line PGA", SND_SOC_NOPM, 0, 0, NULL, 0),
143 SND_SOC_DAPM_PGA("Line out PGA", SND_SOC_NOPM, 0, 0, NULL, 0),
144 SND_SOC_DAPM_PGA("Mono PGA", SND_SOC_NOPM, 0, 0, NULL, 0),
145 SND_SOC_DAPM_PGA("Phone PGA", SND_SOC_NOPM, 0, 0, NULL, 0),
146 SND_SOC_DAPM_PGA("Mic PGA", SND_SOC_NOPM, 0, 0, NULL, 0),
147 SND_SOC_DAPM_PGA("PCBEEP PGA", SND_SOC_NOPM, 0, 0, NULL, 0),
148 SND_SOC_DAPM_PGA("CD PGA", SND_SOC_NOPM, 0, 0, NULL, 0),
149 SND_SOC_DAPM_PGA("ADC PGA", SND_SOC_NOPM, 0, 0, NULL, 0),
150 SND_SOC_DAPM_OUTPUT("HPOUTL"),
151 SND_SOC_DAPM_OUTPUT("HPOUTR"),
152 SND_SOC_DAPM_OUTPUT("LOUT"),
153 SND_SOC_DAPM_OUTPUT("ROUT"),
154 SND_SOC_DAPM_OUTPUT("MONOOUT"),
155 SND_SOC_DAPM_INPUT("PHONE"),
156 SND_SOC_DAPM_INPUT("LINEINL"),
157 SND_SOC_DAPM_INPUT("LINEINR"),
158 SND_SOC_DAPM_INPUT("CDINL"),
159 SND_SOC_DAPM_INPUT("CDINR"),
160 SND_SOC_DAPM_INPUT("PCBEEP"),
161 SND_SOC_DAPM_INPUT("MIC1"),
162 SND_SOC_DAPM_INPUT("MIC2"),
163};
164
165/* Audio map
166 * WM9705 has no switches to disable the route from the inputs to the HP mixer
167 * so in order to prevent active inputs from forcing the audio outputs to be
168 * constantly enabled, we use the mutes on those inputs to simulate such
169 * controls.
170 */
Lu Guanqun97a58d62011-03-30 21:53:13 +0800171static const struct snd_soc_dapm_route wm9705_audio_map[] = {
Ian Molton2aceefe2009-01-16 11:04:18 +0000172 /* HP mixer */
173 {"HP Mixer", "PCBeep Playback Switch", "PCBEEP PGA"},
174 {"HP Mixer", "CD Playback Switch", "CD PGA"},
175 {"HP Mixer", "Mic Playback Switch", "Mic PGA"},
176 {"HP Mixer", "Phone Playback Switch", "Phone PGA"},
177 {"HP Mixer", "Line Playback Switch", "Line PGA"},
178 {"HP Mixer", NULL, "Left DAC"},
179 {"HP Mixer", NULL, "Right DAC"},
180
181 /* mono mixer */
182 {"Mono Mixer", NULL, "HP Mixer"},
183
184 /* outputs */
185 {"Headphone PGA", NULL, "HP Mixer"},
186 {"HPOUTL", NULL, "Headphone PGA"},
187 {"HPOUTR", NULL, "Headphone PGA"},
188 {"Line out PGA", NULL, "HP Mixer"},
189 {"LOUT", NULL, "Line out PGA"},
190 {"ROUT", NULL, "Line out PGA"},
191 {"Mono PGA", NULL, "Mono Mixer"},
192 {"MONOOUT", NULL, "Mono PGA"},
193
194 /* inputs */
195 {"CD PGA", NULL, "CDINL"},
196 {"CD PGA", NULL, "CDINR"},
197 {"Line PGA", NULL, "LINEINL"},
198 {"Line PGA", NULL, "LINEINR"},
199 {"Phone PGA", NULL, "PHONE"},
200 {"Mic Source", "Mic 1", "MIC1"},
201 {"Mic Source", "Mic 2", "MIC2"},
202 {"Mic PGA", NULL, "Mic Source"},
203 {"PCBEEP PGA", NULL, "PCBEEP"},
204
205 /* Left capture selector */
206 {"Left Capture Source", "Mic", "Mic Source"},
207 {"Left Capture Source", "CD", "CDINL"},
208 {"Left Capture Source", "Line", "LINEINL"},
209 {"Left Capture Source", "Stereo Mix", "HP Mixer"},
210 {"Left Capture Source", "Mono Mix", "HP Mixer"},
211 {"Left Capture Source", "Phone", "PHONE"},
212
213 /* Right capture source */
214 {"Right Capture Source", "Mic", "Mic Source"},
215 {"Right Capture Source", "CD", "CDINR"},
216 {"Right Capture Source", "Line", "LINEINR"},
217 {"Right Capture Source", "Stereo Mix", "HP Mixer"},
218 {"Right Capture Source", "Mono Mix", "HP Mixer"},
219 {"Right Capture Source", "Phone", "PHONE"},
220
221 {"ADC PGA", NULL, "Left Capture Source"},
222 {"ADC PGA", NULL, "Right Capture Source"},
223
224 /* ADC's */
225 {"Left ADC", NULL, "ADC PGA"},
226 {"Right ADC", NULL, "ADC PGA"},
227};
228
Ian Molton2aceefe2009-01-16 11:04:18 +0000229static unsigned int ac97_read(struct snd_soc_codec *codec, unsigned int reg)
230{
Lars-Peter Clausen206964e2016-10-21 10:27:07 +0200231 return snd_soc_read(codec, reg);
Ian Molton2aceefe2009-01-16 11:04:18 +0000232}
233
234static int ac97_write(struct snd_soc_codec *codec, unsigned int reg,
235 unsigned int val)
236{
Lars-Peter Clausen206964e2016-10-21 10:27:07 +0200237 return snd_soc_write(codec, reg, val);
Ian Molton2aceefe2009-01-16 11:04:18 +0000238}
239
240static int ac97_prepare(struct snd_pcm_substream *substream,
241 struct snd_soc_dai *dai)
242{
Mark Browne6968a12012-04-04 15:58:16 +0100243 struct snd_soc_codec *codec = dai->codec;
Ian Molton2aceefe2009-01-16 11:04:18 +0000244 int reg;
245 u16 vra;
246
247 vra = ac97_read(codec, AC97_EXTENDED_STATUS);
248 ac97_write(codec, AC97_EXTENDED_STATUS, vra | 0x1);
249
250 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
251 reg = AC97_PCM_FRONT_DAC_RATE;
252 else
253 reg = AC97_PCM_LR_ADC_RATE;
254
Fabio Estevam019ec502012-04-10 19:38:24 -0300255 return ac97_write(codec, reg, substream->runtime->rate);
Ian Molton2aceefe2009-01-16 11:04:18 +0000256}
257
258#define WM9705_AC97_RATES (SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_11025 | \
259 SNDRV_PCM_RATE_16000 | SNDRV_PCM_RATE_22050 | \
260 SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 | \
261 SNDRV_PCM_RATE_48000)
262
Lars-Peter Clausen85e76522011-11-23 11:40:40 +0100263static const struct snd_soc_dai_ops wm9705_dai_ops = {
Eric Miao6335d052009-03-03 09:41:00 +0800264 .prepare = ac97_prepare,
265};
266
Liam Girdwoodf0fba2a2010-03-17 20:15:21 +0000267static struct snd_soc_dai_driver wm9705_dai[] = {
Ian Molton2aceefe2009-01-16 11:04:18 +0000268 {
Liam Girdwoodf0fba2a2010-03-17 20:15:21 +0000269 .name = "wm9705-hifi",
Ian Molton2aceefe2009-01-16 11:04:18 +0000270 .playback = {
271 .stream_name = "HiFi Playback",
272 .channels_min = 1,
273 .channels_max = 2,
274 .rates = WM9705_AC97_RATES,
Mark Brown33f503c2009-05-02 12:24:55 +0100275 .formats = SND_SOC_STD_AC97_FMTS,
Ian Molton2aceefe2009-01-16 11:04:18 +0000276 },
277 .capture = {
278 .stream_name = "HiFi Capture",
279 .channels_min = 1,
280 .channels_max = 2,
281 .rates = WM9705_AC97_RATES,
Mark Brown33f503c2009-05-02 12:24:55 +0100282 .formats = SND_SOC_STD_AC97_FMTS,
Ian Molton2aceefe2009-01-16 11:04:18 +0000283 },
Eric Miao6335d052009-03-03 09:41:00 +0800284 .ops = &wm9705_dai_ops,
Ian Molton2aceefe2009-01-16 11:04:18 +0000285 },
286 {
Liam Girdwoodf0fba2a2010-03-17 20:15:21 +0000287 .name = "wm9705-aux",
Ian Molton2aceefe2009-01-16 11:04:18 +0000288 .playback = {
289 .stream_name = "Aux Playback",
290 .channels_min = 1,
291 .channels_max = 1,
292 .rates = WM9705_AC97_RATES,
293 .formats = SNDRV_PCM_FMTBIT_S16_LE,
294 },
295 }
296};
Ian Molton2aceefe2009-01-16 11:04:18 +0000297
Mark Brown0a11b162009-04-02 15:49:41 +0100298#ifdef CONFIG_PM
Lars-Peter Clausen84b315e2011-12-02 10:18:28 +0100299static int wm9705_soc_suspend(struct snd_soc_codec *codec)
Mark Brown0a11b162009-04-02 15:49:41 +0100300{
Lars-Peter Clausen206964e2016-10-21 10:27:07 +0200301 regcache_cache_bypass(codec->component.regmap, true);
302 ac97_write(codec, AC97_POWERDOWN, 0xffff);
303 regcache_cache_bypass(codec->component.regmap, false);
Mark Brown0a11b162009-04-02 15:49:41 +0100304
305 return 0;
306}
307
Liam Girdwoodf0fba2a2010-03-17 20:15:21 +0000308static int wm9705_soc_resume(struct snd_soc_codec *codec)
Mark Brown0a11b162009-04-02 15:49:41 +0100309{
Lars-Peter Clausen358a8bb2014-11-10 22:41:53 +0100310 struct snd_ac97 *ac97 = snd_soc_codec_get_drvdata(codec);
Lars-Peter Clausen206964e2016-10-21 10:27:07 +0200311 int ret;
Mark Brown0a11b162009-04-02 15:49:41 +0100312
Lars-Peter Clausen6e0b73a2015-07-21 21:53:04 +0200313 ret = snd_ac97_reset(ac97, true, WM9705_VENDOR_ID,
314 WM9705_VENDOR_ID_MASK);
Lars-Peter Clausen9cf766f2014-10-30 21:01:03 +0100315 if (ret < 0)
Mark Brown0a11b162009-04-02 15:49:41 +0100316 return ret;
Mark Brown0a11b162009-04-02 15:49:41 +0100317
Lars-Peter Clausen206964e2016-10-21 10:27:07 +0200318 regcache_sync(codec->component.regmap);
Mark Brown0a11b162009-04-02 15:49:41 +0100319
320 return 0;
321}
322#else
323#define wm9705_soc_suspend NULL
324#define wm9705_soc_resume NULL
325#endif
326
Liam Girdwoodf0fba2a2010-03-17 20:15:21 +0000327static int wm9705_soc_probe(struct snd_soc_codec *codec)
Ian Molton2aceefe2009-01-16 11:04:18 +0000328{
Lars-Peter Clausen358a8bb2014-11-10 22:41:53 +0100329 struct snd_ac97 *ac97;
Lars-Peter Clausen206964e2016-10-21 10:27:07 +0200330 struct regmap *regmap;
331 int ret;
Ian Molton2aceefe2009-01-16 11:04:18 +0000332
Lars-Peter Clausen6e0b73a2015-07-21 21:53:04 +0200333 ac97 = snd_soc_new_ac97_codec(codec, WM9705_VENDOR_ID,
334 WM9705_VENDOR_ID_MASK);
Lars-Peter Clausen358a8bb2014-11-10 22:41:53 +0100335 if (IS_ERR(ac97)) {
Lars-Peter Clausen9cf766f2014-10-30 21:01:03 +0100336 dev_err(codec->dev, "Failed to register AC97 codec\n");
Lars-Peter Clausen6e0b73a2015-07-21 21:53:04 +0200337 return PTR_ERR(ac97);
Ian Molton2aceefe2009-01-16 11:04:18 +0000338 }
339
Lars-Peter Clausen206964e2016-10-21 10:27:07 +0200340 regmap = regmap_init_ac97(ac97, &wm9705_regmap_config);
341 if (IS_ERR(regmap)) {
342 ret = PTR_ERR(regmap);
343 goto err_free_ac97_codec;
344 }
345
Lars-Peter Clausenf8d71be2015-01-23 16:21:37 +0100346 snd_soc_codec_set_drvdata(codec, ac97);
Lars-Peter Clausen206964e2016-10-21 10:27:07 +0200347 snd_soc_codec_init_regmap(codec, regmap);
Ian Molton2aceefe2009-01-16 11:04:18 +0000348
Ian Molton2aceefe2009-01-16 11:04:18 +0000349 return 0;
Lars-Peter Clausen206964e2016-10-21 10:27:07 +0200350err_free_ac97_codec:
351 snd_soc_free_ac97_codec(ac97);
352 return ret;
Ian Molton2aceefe2009-01-16 11:04:18 +0000353}
354
Liam Girdwoodf0fba2a2010-03-17 20:15:21 +0000355static int wm9705_soc_remove(struct snd_soc_codec *codec)
Ian Molton2aceefe2009-01-16 11:04:18 +0000356{
Lars-Peter Clausen358a8bb2014-11-10 22:41:53 +0100357 struct snd_ac97 *ac97 = snd_soc_codec_get_drvdata(codec);
358
Lars-Peter Clausen206964e2016-10-21 10:27:07 +0200359 snd_soc_codec_exit_regmap(codec);
Lars-Peter Clausen358a8bb2014-11-10 22:41:53 +0100360 snd_soc_free_ac97_codec(ac97);
Ian Molton2aceefe2009-01-16 11:04:18 +0000361 return 0;
362}
363
Julia Lawallf802d6c2016-08-31 23:52:27 +0200364static const struct snd_soc_codec_driver soc_codec_dev_wm9705 = {
Ian Molton2aceefe2009-01-16 11:04:18 +0000365 .probe = wm9705_soc_probe,
366 .remove = wm9705_soc_remove,
Mark Brown0a11b162009-04-02 15:49:41 +0100367 .suspend = wm9705_soc_suspend,
368 .resume = wm9705_soc_resume,
Lars-Peter Clausend7cabb02014-10-30 21:01:04 +0100369
Kuninori Morimoto2fa1f302016-08-08 09:35:34 +0000370 .component_driver = {
371 .controls = wm9705_snd_ac97_controls,
372 .num_controls = ARRAY_SIZE(wm9705_snd_ac97_controls),
373 .dapm_widgets = wm9705_dapm_widgets,
374 .num_dapm_widgets = ARRAY_SIZE(wm9705_dapm_widgets),
375 .dapm_routes = wm9705_audio_map,
376 .num_dapm_routes = ARRAY_SIZE(wm9705_audio_map),
377 },
Ian Molton2aceefe2009-01-16 11:04:18 +0000378};
Liam Girdwoodf0fba2a2010-03-17 20:15:21 +0000379
Bill Pemberton7a79e942012-12-07 09:26:37 -0500380static int wm9705_probe(struct platform_device *pdev)
Liam Girdwoodf0fba2a2010-03-17 20:15:21 +0000381{
382 return snd_soc_register_codec(&pdev->dev,
383 &soc_codec_dev_wm9705, wm9705_dai, ARRAY_SIZE(wm9705_dai));
384}
385
Bill Pemberton7a79e942012-12-07 09:26:37 -0500386static int wm9705_remove(struct platform_device *pdev)
Liam Girdwoodf0fba2a2010-03-17 20:15:21 +0000387{
388 snd_soc_unregister_codec(&pdev->dev);
389 return 0;
390}
391
392static struct platform_driver wm9705_codec_driver = {
393 .driver = {
394 .name = "wm9705-codec",
Liam Girdwoodf0fba2a2010-03-17 20:15:21 +0000395 },
396
397 .probe = wm9705_probe,
Bill Pemberton7a79e942012-12-07 09:26:37 -0500398 .remove = wm9705_remove,
Liam Girdwoodf0fba2a2010-03-17 20:15:21 +0000399};
400
Mark Brown5bbcc3c2011-11-23 22:52:08 +0000401module_platform_driver(wm9705_codec_driver);
Ian Molton2aceefe2009-01-16 11:04:18 +0000402
403MODULE_DESCRIPTION("ASoC WM9705 driver");
404MODULE_AUTHOR("Ian Molton");
405MODULE_LICENSE("GPL v2");