2 * ak4535.c -- AK4535 ALSA Soc Audio driver
4 * Copyright 2005 Openedhand Ltd.
6 * Author: Richard Purdie <richard@openedhand.com>
8 * Based on wm8753.c by Liam Girdwood
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
15 #include <linux/module.h>
16 #include <linux/moduleparam.h>
17 #include <linux/init.h>
18 #include <linux/delay.h>
20 #include <linux/i2c.h>
21 #include <linux/platform_device.h>
22 #include <sound/core.h>
23 #include <sound/pcm.h>
24 #include <sound/pcm_params.h>
25 #include <sound/soc.h>
26 #include <sound/soc-dapm.h>
27 #include <sound/initval.h>
31 #define AK4535_VERSION "0.3"
33 struct snd_soc_codec_device soc_codec_dev_ak4535
;
35 /* codec private data */
41 * ak4535 register cache
43 static const u16 ak4535_reg
[AK4535_CACHEREGNUM
] = {
44 0x0000, 0x0080, 0x0000, 0x0003,
45 0x0002, 0x0000, 0x0011, 0x0001,
46 0x0000, 0x0040, 0x0036, 0x0010,
47 0x0000, 0x0000, 0x0057, 0x0000,
51 * read ak4535 register cache
53 static inline unsigned int ak4535_read_reg_cache(struct snd_soc_codec
*codec
,
56 u16
*cache
= codec
->reg_cache
;
57 if (reg
>= AK4535_CACHEREGNUM
)
63 * write ak4535 register cache
65 static inline void ak4535_write_reg_cache(struct snd_soc_codec
*codec
,
66 u16 reg
, unsigned int value
)
68 u16
*cache
= codec
->reg_cache
;
69 if (reg
>= AK4535_CACHEREGNUM
)
75 * write to the AK4535 register space
77 static int ak4535_write(struct snd_soc_codec
*codec
, unsigned int reg
,
83 * D15..D8 AK4535 register offset
84 * D7...D0 register data
87 data
[1] = value
& 0xff;
89 ak4535_write_reg_cache(codec
, reg
, value
);
90 if (codec
->hw_write(codec
->control_data
, data
, 2) == 2)
96 static int ak4535_sync(struct snd_soc_codec
*codec
)
98 u16
*cache
= codec
->reg_cache
;
101 for (i
= 0; i
< AK4535_CACHEREGNUM
; i
++)
102 r
|= ak4535_write(codec
, i
, cache
[i
]);
107 static const char *ak4535_mono_gain
[] = {"+6dB", "-17dB"};
108 static const char *ak4535_mono_out
[] = {"(L + R)/2", "Hi-Z"};
109 static const char *ak4535_hp_out
[] = {"Stereo", "Mono"};
110 static const char *ak4535_deemp
[] = {"44.1kHz", "Off", "48kHz", "32kHz"};
111 static const char *ak4535_mic_select
[] = {"Internal", "External"};
113 static const struct soc_enum ak4535_enum
[] = {
114 SOC_ENUM_SINGLE(AK4535_SIG1
, 7, 2, ak4535_mono_gain
),
115 SOC_ENUM_SINGLE(AK4535_SIG1
, 6, 2, ak4535_mono_out
),
116 SOC_ENUM_SINGLE(AK4535_MODE2
, 2, 2, ak4535_hp_out
),
117 SOC_ENUM_SINGLE(AK4535_DAC
, 0, 4, ak4535_deemp
),
118 SOC_ENUM_SINGLE(AK4535_MIC
, 1, 2, ak4535_mic_select
),
121 static const struct snd_kcontrol_new ak4535_snd_controls
[] = {
122 SOC_SINGLE("ALC2 Switch", AK4535_SIG1
, 1, 1, 0),
123 SOC_ENUM("Mono 1 Output", ak4535_enum
[1]),
124 SOC_ENUM("Mono 1 Gain", ak4535_enum
[0]),
125 SOC_ENUM("Headphone Output", ak4535_enum
[2]),
126 SOC_ENUM("Playback Deemphasis", ak4535_enum
[3]),
127 SOC_SINGLE("Bass Volume", AK4535_DAC
, 2, 3, 0),
128 SOC_SINGLE("Mic Boost (+20dB) Switch", AK4535_MIC
, 0, 1, 0),
129 SOC_ENUM("Mic Select", ak4535_enum
[4]),
130 SOC_SINGLE("ALC Operation Time", AK4535_TIMER
, 0, 3, 0),
131 SOC_SINGLE("ALC Recovery Time", AK4535_TIMER
, 2, 3, 0),
132 SOC_SINGLE("ALC ZC Time", AK4535_TIMER
, 4, 3, 0),
133 SOC_SINGLE("ALC 1 Switch", AK4535_ALC1
, 5, 1, 0),
134 SOC_SINGLE("ALC 2 Switch", AK4535_ALC1
, 6, 1, 0),
135 SOC_SINGLE("ALC Volume", AK4535_ALC2
, 0, 127, 0),
136 SOC_SINGLE("Capture Volume", AK4535_PGA
, 0, 127, 0),
137 SOC_SINGLE("Left Playback Volume", AK4535_LATT
, 0, 127, 1),
138 SOC_SINGLE("Right Playback Volume", AK4535_RATT
, 0, 127, 1),
139 SOC_SINGLE("AUX Bypass Volume", AK4535_VOL
, 0, 15, 0),
140 SOC_SINGLE("Mic Sidetone Volume", AK4535_VOL
, 4, 7, 0),
144 static const struct snd_kcontrol_new ak4535_mono1_mixer_controls
[] = {
145 SOC_DAPM_SINGLE("Mic Sidetone Switch", AK4535_SIG1
, 4, 1, 0),
146 SOC_DAPM_SINGLE("Mono Playback Switch", AK4535_SIG1
, 5, 1, 0),
150 static const struct snd_kcontrol_new ak4535_stereo_mixer_controls
[] = {
151 SOC_DAPM_SINGLE("Mic Sidetone Switch", AK4535_SIG2
, 4, 1, 0),
152 SOC_DAPM_SINGLE("Playback Switch", AK4535_SIG2
, 7, 1, 0),
153 SOC_DAPM_SINGLE("Aux Bypass Switch", AK4535_SIG2
, 5, 1, 0),
157 static const struct snd_kcontrol_new ak4535_input_mixer_controls
[] = {
158 SOC_DAPM_SINGLE("Mic Capture Switch", AK4535_MIC
, 2, 1, 0),
159 SOC_DAPM_SINGLE("Aux Capture Switch", AK4535_MIC
, 5, 1, 0),
163 static const struct snd_kcontrol_new ak4535_input_mux_control
=
164 SOC_DAPM_ENUM("Input Select", ak4535_enum
[4]);
167 static const struct snd_kcontrol_new ak4535_hpl_control
=
168 SOC_DAPM_SINGLE("Switch", AK4535_SIG2
, 1, 1, 1);
171 static const struct snd_kcontrol_new ak4535_hpr_control
=
172 SOC_DAPM_SINGLE("Switch", AK4535_SIG2
, 0, 1, 1);
175 static const struct snd_kcontrol_new ak4535_mono2_control
=
176 SOC_DAPM_SINGLE("Switch", AK4535_SIG1
, 0, 1, 0);
178 /* Line out switch */
179 static const struct snd_kcontrol_new ak4535_line_control
=
180 SOC_DAPM_SINGLE("Switch", AK4535_SIG2
, 6, 1, 0);
182 /* ak4535 dapm widgets */
183 static const struct snd_soc_dapm_widget ak4535_dapm_widgets
[] = {
184 SND_SOC_DAPM_MIXER("Stereo Mixer", SND_SOC_NOPM
, 0, 0,
185 &ak4535_stereo_mixer_controls
[0],
186 ARRAY_SIZE(ak4535_stereo_mixer_controls
)),
187 SND_SOC_DAPM_MIXER("Mono1 Mixer", SND_SOC_NOPM
, 0, 0,
188 &ak4535_mono1_mixer_controls
[0],
189 ARRAY_SIZE(ak4535_mono1_mixer_controls
)),
190 SND_SOC_DAPM_MIXER("Input Mixer", SND_SOC_NOPM
, 0, 0,
191 &ak4535_input_mixer_controls
[0],
192 ARRAY_SIZE(ak4535_input_mixer_controls
)),
193 SND_SOC_DAPM_MUX("Input Mux", SND_SOC_NOPM
, 0, 0,
194 &ak4535_input_mux_control
),
195 SND_SOC_DAPM_DAC("DAC", "Playback", AK4535_PM2
, 0, 0),
196 SND_SOC_DAPM_SWITCH("Mono 2 Enable", SND_SOC_NOPM
, 0, 0,
197 &ak4535_mono2_control
),
198 /* speaker powersave bit */
199 SND_SOC_DAPM_PGA("Speaker Enable", AK4535_MODE2
, 0, 0, NULL
, 0),
200 SND_SOC_DAPM_SWITCH("Line Out Enable", SND_SOC_NOPM
, 0, 0,
201 &ak4535_line_control
),
202 SND_SOC_DAPM_SWITCH("Left HP Enable", SND_SOC_NOPM
, 0, 0,
203 &ak4535_hpl_control
),
204 SND_SOC_DAPM_SWITCH("Right HP Enable", SND_SOC_NOPM
, 0, 0,
205 &ak4535_hpr_control
),
206 SND_SOC_DAPM_OUTPUT("LOUT"),
207 SND_SOC_DAPM_OUTPUT("HPL"),
208 SND_SOC_DAPM_OUTPUT("ROUT"),
209 SND_SOC_DAPM_OUTPUT("HPR"),
210 SND_SOC_DAPM_OUTPUT("SPP"),
211 SND_SOC_DAPM_OUTPUT("SPN"),
212 SND_SOC_DAPM_OUTPUT("MOUT1"),
213 SND_SOC_DAPM_OUTPUT("MOUT2"),
214 SND_SOC_DAPM_OUTPUT("MICOUT"),
215 SND_SOC_DAPM_ADC("ADC", "Capture", AK4535_PM1
, 0, 0),
216 SND_SOC_DAPM_PGA("Spk Amp", AK4535_PM2
, 3, 0, NULL
, 0),
217 SND_SOC_DAPM_PGA("HP R Amp", AK4535_PM2
, 1, 0, NULL
, 0),
218 SND_SOC_DAPM_PGA("HP L Amp", AK4535_PM2
, 2, 0, NULL
, 0),
219 SND_SOC_DAPM_PGA("Mic", AK4535_PM1
, 1, 0, NULL
, 0),
220 SND_SOC_DAPM_PGA("Line Out", AK4535_PM1
, 4, 0, NULL
, 0),
221 SND_SOC_DAPM_PGA("Mono Out", AK4535_PM1
, 3, 0, NULL
, 0),
222 SND_SOC_DAPM_PGA("AUX In", AK4535_PM1
, 2, 0, NULL
, 0),
224 SND_SOC_DAPM_MICBIAS("Mic Int Bias", AK4535_MIC
, 3, 0),
225 SND_SOC_DAPM_MICBIAS("Mic Ext Bias", AK4535_MIC
, 4, 0),
226 SND_SOC_DAPM_INPUT("MICIN"),
227 SND_SOC_DAPM_INPUT("MICEXT"),
228 SND_SOC_DAPM_INPUT("AUX"),
229 SND_SOC_DAPM_INPUT("MIN"),
230 SND_SOC_DAPM_INPUT("AIN"),
233 static const struct snd_soc_dapm_route audio_map
[] = {
235 {"Stereo Mixer", "Playback Switch", "DAC"},
236 {"Stereo Mixer", "Mic Sidetone Switch", "Mic"},
237 {"Stereo Mixer", "Aux Bypass Switch", "AUX In"},
240 {"Mono1 Mixer", "Mic Sidetone Switch", "Mic"},
241 {"Mono1 Mixer", "Mono Playback Switch", "DAC"},
244 {"Mic", NULL
, "AIN"},
245 {"Input Mux", "Internal", "Mic Int Bias"},
246 {"Input Mux", "External", "Mic Ext Bias"},
247 {"Mic Int Bias", NULL
, "MICIN"},
248 {"Mic Ext Bias", NULL
, "MICEXT"},
249 {"MICOUT", NULL
, "Input Mux"},
252 {"LOUT", NULL
, "Line Out Enable"},
253 {"ROUT", NULL
, "Line Out Enable"},
254 {"Line Out Enable", "Switch", "Line Out"},
255 {"Line Out", NULL
, "Stereo Mixer"},
258 {"MOUT1", NULL
, "Mono Out"},
259 {"Mono Out", NULL
, "Mono1 Mixer"},
262 {"HPL", NULL
, "Left HP Enable"},
263 {"Left HP Enable", "Switch", "HP L Amp"},
264 {"HP L Amp", NULL
, "Stereo Mixer"},
267 {"HPR", NULL
, "Right HP Enable"},
268 {"Right HP Enable", "Switch", "HP R Amp"},
269 {"HP R Amp", NULL
, "Stereo Mixer"},
272 {"SPP", NULL
, "Speaker Enable"},
273 {"SPN", NULL
, "Speaker Enable"},
274 {"Speaker Enable", "Switch", "Spk Amp"},
275 {"Spk Amp", NULL
, "MIN"},
278 {"MOUT2", NULL
, "Mono 2 Enable"},
279 {"Mono 2 Enable", "Switch", "Stereo Mixer"},
282 {"Aux In", NULL
, "AUX"},
285 {"ADC", NULL
, "Input Mixer"},
286 {"Input Mixer", "Mic Capture Switch", "Mic"},
287 {"Input Mixer", "Aux Capture Switch", "Aux In"},
290 static int ak4535_add_widgets(struct snd_soc_codec
*codec
)
292 snd_soc_dapm_new_controls(codec
, ak4535_dapm_widgets
,
293 ARRAY_SIZE(ak4535_dapm_widgets
));
295 snd_soc_dapm_add_routes(codec
, audio_map
, ARRAY_SIZE(audio_map
));
297 snd_soc_dapm_new_widgets(codec
);
301 static int ak4535_set_dai_sysclk(struct snd_soc_dai
*codec_dai
,
302 int clk_id
, unsigned int freq
, int dir
)
304 struct snd_soc_codec
*codec
= codec_dai
->codec
;
305 struct ak4535_priv
*ak4535
= codec
->private_data
;
307 ak4535
->sysclk
= freq
;
311 static int ak4535_hw_params(struct snd_pcm_substream
*substream
,
312 struct snd_pcm_hw_params
*params
,
313 struct snd_soc_dai
*dai
)
315 struct snd_soc_pcm_runtime
*rtd
= substream
->private_data
;
316 struct snd_soc_device
*socdev
= rtd
->socdev
;
317 struct snd_soc_codec
*codec
= socdev
->card
->codec
;
318 struct ak4535_priv
*ak4535
= codec
->private_data
;
319 u8 mode2
= ak4535_read_reg_cache(codec
, AK4535_MODE2
) & ~(0x3 << 5);
320 int rate
= params_rate(params
), fs
= 256;
323 fs
= ak4535
->sysclk
/ rate
;
338 ak4535_write(codec
, AK4535_MODE2
, mode2
);
342 static int ak4535_set_dai_fmt(struct snd_soc_dai
*codec_dai
,
345 struct snd_soc_codec
*codec
= codec_dai
->codec
;
348 /* interface format */
349 switch (fmt
& SND_SOC_DAIFMT_FORMAT_MASK
) {
350 case SND_SOC_DAIFMT_I2S
:
353 case SND_SOC_DAIFMT_LEFT_J
:
360 /* use 32 fs for BCLK to save power */
363 ak4535_write(codec
, AK4535_MODE1
, mode1
);
367 static int ak4535_mute(struct snd_soc_dai
*dai
, int mute
)
369 struct snd_soc_codec
*codec
= dai
->codec
;
370 u16 mute_reg
= ak4535_read_reg_cache(codec
, AK4535_DAC
) & 0xffdf;
372 ak4535_write(codec
, AK4535_DAC
, mute_reg
);
374 ak4535_write(codec
, AK4535_DAC
, mute_reg
| 0x20);
378 static int ak4535_set_bias_level(struct snd_soc_codec
*codec
,
379 enum snd_soc_bias_level level
)
384 case SND_SOC_BIAS_ON
:
385 ak4535_mute(codec
->dai
, 0);
387 case SND_SOC_BIAS_PREPARE
:
388 ak4535_mute(codec
->dai
, 1);
390 case SND_SOC_BIAS_STANDBY
:
391 i
= ak4535_read_reg_cache(codec
, AK4535_PM1
);
392 ak4535_write(codec
, AK4535_PM1
, i
| 0x80);
393 i
= ak4535_read_reg_cache(codec
, AK4535_PM2
);
394 ak4535_write(codec
, AK4535_PM2
, i
& (~0x80));
396 case SND_SOC_BIAS_OFF
:
397 i
= ak4535_read_reg_cache(codec
, AK4535_PM1
);
398 ak4535_write(codec
, AK4535_PM1
, i
& (~0x80));
401 codec
->bias_level
= level
;
405 #define AK4535_RATES (SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_11025 |\
406 SNDRV_PCM_RATE_16000 | SNDRV_PCM_RATE_22050 |\
407 SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000)
409 static struct snd_soc_dai_ops ak4535_dai_ops
= {
410 .hw_params
= ak4535_hw_params
,
411 .set_fmt
= ak4535_set_dai_fmt
,
412 .digital_mute
= ak4535_mute
,
413 .set_sysclk
= ak4535_set_dai_sysclk
,
416 struct snd_soc_dai ak4535_dai
= {
419 .stream_name
= "Playback",
422 .rates
= AK4535_RATES
,
423 .formats
= SNDRV_PCM_FMTBIT_S16_LE
,},
425 .stream_name
= "Capture",
428 .rates
= AK4535_RATES
,
429 .formats
= SNDRV_PCM_FMTBIT_S16_LE
,},
430 .ops
= &ak4535_dai_ops
,
432 EXPORT_SYMBOL_GPL(ak4535_dai
);
434 static int ak4535_suspend(struct platform_device
*pdev
, pm_message_t state
)
436 struct snd_soc_device
*socdev
= platform_get_drvdata(pdev
);
437 struct snd_soc_codec
*codec
= socdev
->card
->codec
;
439 ak4535_set_bias_level(codec
, SND_SOC_BIAS_OFF
);
443 static int ak4535_resume(struct platform_device
*pdev
)
445 struct snd_soc_device
*socdev
= platform_get_drvdata(pdev
);
446 struct snd_soc_codec
*codec
= socdev
->card
->codec
;
448 ak4535_set_bias_level(codec
, SND_SOC_BIAS_STANDBY
);
449 ak4535_set_bias_level(codec
, codec
->suspend_bias_level
);
454 * initialise the AK4535 driver
455 * register the mixer and dsp interfaces with the kernel
457 static int ak4535_init(struct snd_soc_device
*socdev
)
459 struct snd_soc_codec
*codec
= socdev
->card
->codec
;
462 codec
->name
= "AK4535";
463 codec
->owner
= THIS_MODULE
;
464 codec
->read
= ak4535_read_reg_cache
;
465 codec
->write
= ak4535_write
;
466 codec
->set_bias_level
= ak4535_set_bias_level
;
467 codec
->dai
= &ak4535_dai
;
469 codec
->reg_cache_size
= ARRAY_SIZE(ak4535_reg
);
470 codec
->reg_cache
= kmemdup(ak4535_reg
, sizeof(ak4535_reg
), GFP_KERNEL
);
472 if (codec
->reg_cache
== NULL
)
476 ret
= snd_soc_new_pcms(socdev
, SNDRV_DEFAULT_IDX1
, SNDRV_DEFAULT_STR1
);
478 printk(KERN_ERR
"ak4535: failed to create pcms\n");
482 /* power on device */
483 ak4535_set_bias_level(codec
, SND_SOC_BIAS_STANDBY
);
485 snd_soc_add_controls(codec
, ak4535_snd_controls
,
486 ARRAY_SIZE(ak4535_snd_controls
));
487 ak4535_add_widgets(codec
);
488 ret
= snd_soc_init_card(socdev
);
490 printk(KERN_ERR
"ak4535: failed to register card\n");
497 snd_soc_free_pcms(socdev
);
498 snd_soc_dapm_free(socdev
);
500 kfree(codec
->reg_cache
);
505 static struct snd_soc_device
*ak4535_socdev
;
507 #if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
509 static int ak4535_i2c_probe(struct i2c_client
*i2c
,
510 const struct i2c_device_id
*id
)
512 struct snd_soc_device
*socdev
= ak4535_socdev
;
513 struct snd_soc_codec
*codec
= socdev
->card
->codec
;
516 i2c_set_clientdata(i2c
, codec
);
517 codec
->control_data
= i2c
;
519 ret
= ak4535_init(socdev
);
521 printk(KERN_ERR
"failed to initialise AK4535\n");
526 static int ak4535_i2c_remove(struct i2c_client
*client
)
528 struct snd_soc_codec
*codec
= i2c_get_clientdata(client
);
529 kfree(codec
->reg_cache
);
533 static const struct i2c_device_id ak4535_i2c_id
[] = {
537 MODULE_DEVICE_TABLE(i2c
, ak4535_i2c_id
);
539 static struct i2c_driver ak4535_i2c_driver
= {
541 .name
= "AK4535 I2C Codec",
542 .owner
= THIS_MODULE
,
544 .probe
= ak4535_i2c_probe
,
545 .remove
= ak4535_i2c_remove
,
546 .id_table
= ak4535_i2c_id
,
549 static int ak4535_add_i2c_device(struct platform_device
*pdev
,
550 const struct ak4535_setup_data
*setup
)
552 struct i2c_board_info info
;
553 struct i2c_adapter
*adapter
;
554 struct i2c_client
*client
;
557 ret
= i2c_add_driver(&ak4535_i2c_driver
);
559 dev_err(&pdev
->dev
, "can't add i2c driver\n");
563 memset(&info
, 0, sizeof(struct i2c_board_info
));
564 info
.addr
= setup
->i2c_address
;
565 strlcpy(info
.type
, "ak4535", I2C_NAME_SIZE
);
567 adapter
= i2c_get_adapter(setup
->i2c_bus
);
569 dev_err(&pdev
->dev
, "can't get i2c adapter %d\n",
574 client
= i2c_new_device(adapter
, &info
);
575 i2c_put_adapter(adapter
);
577 dev_err(&pdev
->dev
, "can't add i2c device at 0x%x\n",
578 (unsigned int)info
.addr
);
585 i2c_del_driver(&ak4535_i2c_driver
);
590 static int ak4535_probe(struct platform_device
*pdev
)
592 struct snd_soc_device
*socdev
= platform_get_drvdata(pdev
);
593 struct ak4535_setup_data
*setup
;
594 struct snd_soc_codec
*codec
;
595 struct ak4535_priv
*ak4535
;
598 printk(KERN_INFO
"AK4535 Audio Codec %s", AK4535_VERSION
);
600 setup
= socdev
->codec_data
;
601 codec
= kzalloc(sizeof(struct snd_soc_codec
), GFP_KERNEL
);
605 ak4535
= kzalloc(sizeof(struct ak4535_priv
), GFP_KERNEL
);
606 if (ak4535
== NULL
) {
611 codec
->private_data
= ak4535
;
612 socdev
->card
->codec
= codec
;
613 mutex_init(&codec
->mutex
);
614 INIT_LIST_HEAD(&codec
->dapm_widgets
);
615 INIT_LIST_HEAD(&codec
->dapm_paths
);
617 ak4535_socdev
= socdev
;
620 #if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
621 if (setup
->i2c_address
) {
622 codec
->hw_write
= (hw_write_t
)i2c_master_send
;
623 ret
= ak4535_add_i2c_device(pdev
, setup
);
628 kfree(codec
->private_data
);
634 /* power down chip */
635 static int ak4535_remove(struct platform_device
*pdev
)
637 struct snd_soc_device
*socdev
= platform_get_drvdata(pdev
);
638 struct snd_soc_codec
*codec
= socdev
->card
->codec
;
640 if (codec
->control_data
)
641 ak4535_set_bias_level(codec
, SND_SOC_BIAS_OFF
);
643 snd_soc_free_pcms(socdev
);
644 snd_soc_dapm_free(socdev
);
645 #if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
646 if (codec
->control_data
)
647 i2c_unregister_device(codec
->control_data
);
648 i2c_del_driver(&ak4535_i2c_driver
);
650 kfree(codec
->private_data
);
656 struct snd_soc_codec_device soc_codec_dev_ak4535
= {
657 .probe
= ak4535_probe
,
658 .remove
= ak4535_remove
,
659 .suspend
= ak4535_suspend
,
660 .resume
= ak4535_resume
,
662 EXPORT_SYMBOL_GPL(soc_codec_dev_ak4535
);
664 static int __init
ak4535_modinit(void)
666 return snd_soc_register_dai(&ak4535_dai
);
668 module_init(ak4535_modinit
);
670 static void __exit
ak4535_exit(void)
672 snd_soc_unregister_dai(&ak4535_dai
);
674 module_exit(ak4535_exit
);
676 MODULE_DESCRIPTION("Soc AK4535 driver");
677 MODULE_AUTHOR("Richard Purdie");
678 MODULE_LICENSE("GPL");