2 * DA7210 ALSA Soc codec driver
4 * Copyright (c) 2009 Dialog Semiconductor
5 * Written by David Chen <Dajun.chen@diasemi.com>
7 * Copyright (C) 2009 Renesas Solutions Corp.
8 * Cleanups by Kuninori Morimoto <morimoto.kuninori@renesas.com>
10 * Tested on SuperH Ecovec24 board with S16/S24 LE in 48KHz using I2S
12 * This program is free software; you can redistribute it and/or modify it
13 * under the terms of the GNU General Public License as published by the
14 * Free Software Foundation; either version 2 of the License, or (at your
15 * option) any later version.
18 #include <linux/module.h>
19 #include <linux/moduleparam.h>
20 #include <linux/kernel.h>
21 #include <linux/init.h>
22 #include <linux/delay.h>
24 #include <linux/i2c.h>
25 #include <linux/platform_device.h>
26 #include <sound/core.h>
27 #include <sound/pcm.h>
28 #include <sound/pcm_params.h>
29 #include <sound/soc.h>
30 #include <sound/soc-dapm.h>
31 #include <sound/tlv.h>
32 #include <sound/initval.h>
33 #include <asm/div64.h>
37 /* DA7210 register space */
38 #define DA7210_STATUS 0x02
39 #define DA7210_STARTUP1 0x03
40 #define DA7210_MIC_L 0x07
41 #define DA7210_MIC_R 0x08
42 #define DA7210_INMIX_L 0x0D
43 #define DA7210_INMIX_R 0x0E
44 #define DA7210_ADC_HPF 0x0F
45 #define DA7210_ADC 0x10
46 #define DA7210_DAC_HPF 0x14
47 #define DA7210_DAC_L 0x15
48 #define DA7210_DAC_R 0x16
49 #define DA7210_DAC_SEL 0x17
50 #define DA7210_OUTMIX_L 0x1C
51 #define DA7210_OUTMIX_R 0x1D
52 #define DA7210_HP_L_VOL 0x21
53 #define DA7210_HP_R_VOL 0x22
54 #define DA7210_HP_CFG 0x23
55 #define DA7210_DAI_SRC_SEL 0x25
56 #define DA7210_DAI_CFG1 0x26
57 #define DA7210_DAI_CFG3 0x28
58 #define DA7210_PLL_DIV1 0x29
59 #define DA7210_PLL_DIV2 0x2A
60 #define DA7210_PLL_DIV3 0x2B
61 #define DA7210_PLL 0x2C
62 #define DA7210_A_HID_UNLOCK 0x8A
63 #define DA7210_A_TEST_UNLOCK 0x8B
64 #define DA7210_A_PLL1 0x90
65 #define DA7210_A_CP_MODE 0xA7
67 /* STARTUP1 bit fields */
68 #define DA7210_SC_MST_EN (1 << 0)
70 /* MIC_L bit fields */
71 #define DA7210_MICBIAS_EN (1 << 6)
72 #define DA7210_MIC_L_EN (1 << 7)
74 /* MIC_R bit fields */
75 #define DA7210_MIC_R_EN (1 << 7)
77 /* INMIX_L bit fields */
78 #define DA7210_IN_L_EN (1 << 7)
80 /* INMIX_R bit fields */
81 #define DA7210_IN_R_EN (1 << 7)
84 #define DA7210_ADC_L_EN (1 << 3)
85 #define DA7210_ADC_R_EN (1 << 7)
87 /* DAC/ADC HPF fields */
88 #define DA7210_VOICE_F0_MASK (0x7 << 4)
89 #define DA7210_VOICE_F0_25 (1 << 4)
90 #define DA7210_VOICE_EN (1 << 7)
92 /* DAC_SEL bit fields */
93 #define DA7210_DAC_L_SRC_DAI_L (4 << 0)
94 #define DA7210_DAC_L_EN (1 << 3)
95 #define DA7210_DAC_R_SRC_DAI_R (5 << 4)
96 #define DA7210_DAC_R_EN (1 << 7)
98 /* OUTMIX_L bit fields */
99 #define DA7210_OUT_L_EN (1 << 7)
101 /* OUTMIX_R bit fields */
102 #define DA7210_OUT_R_EN (1 << 7)
104 /* HP_CFG bit fields */
105 #define DA7210_HP_2CAP_MODE (1 << 1)
106 #define DA7210_HP_SENSE_EN (1 << 2)
107 #define DA7210_HP_L_EN (1 << 3)
108 #define DA7210_HP_MODE (1 << 6)
109 #define DA7210_HP_R_EN (1 << 7)
111 /* DAI_SRC_SEL bit fields */
112 #define DA7210_DAI_OUT_L_SRC (6 << 0)
113 #define DA7210_DAI_OUT_R_SRC (7 << 4)
115 /* DAI_CFG1 bit fields */
116 #define DA7210_DAI_WORD_S16_LE (0 << 0)
117 #define DA7210_DAI_WORD_S24_LE (2 << 0)
118 #define DA7210_DAI_FLEN_64BIT (1 << 2)
119 #define DA7210_DAI_MODE_MASTER (1 << 7)
121 /* DAI_CFG3 bit fields */
122 #define DA7210_DAI_FORMAT_I2SMODE (0 << 0)
123 #define DA7210_DAI_OE (1 << 3)
124 #define DA7210_DAI_EN (1 << 7)
126 /*PLL_DIV3 bit fields */
127 #define DA7210_MCLK_RANGE_10_20_MHZ (1 << 4)
128 #define DA7210_PLL_BYP (1 << 6)
131 #define DA7210_PLL_FS_MASK (0xF << 0)
132 #define DA7210_PLL_FS_8000 (0x1 << 0)
133 #define DA7210_PLL_FS_11025 (0x2 << 0)
134 #define DA7210_PLL_FS_12000 (0x3 << 0)
135 #define DA7210_PLL_FS_16000 (0x5 << 0)
136 #define DA7210_PLL_FS_22050 (0x6 << 0)
137 #define DA7210_PLL_FS_24000 (0x7 << 0)
138 #define DA7210_PLL_FS_32000 (0x9 << 0)
139 #define DA7210_PLL_FS_44100 (0xA << 0)
140 #define DA7210_PLL_FS_48000 (0xB << 0)
141 #define DA7210_PLL_FS_88200 (0xE << 0)
142 #define DA7210_PLL_FS_96000 (0xF << 0)
143 #define DA7210_PLL_EN (0x1 << 7)
145 #define DA7210_VERSION "0.0.1"
147 /* Codec private data */
149 struct snd_soc_codec codec
;
152 static struct snd_soc_codec
*da7210_codec
;
157 static const u8 da7210_reg
[] = {
158 0x00, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* R0 - R7 */
159 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, /* R8 - RF */
160 0x00, 0x00, 0x00, 0x00, 0x08, 0x10, 0x10, 0x54, /* R10 - R17 */
161 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* R18 - R1F */
162 0x00, 0x00, 0x00, 0x02, 0x00, 0x76, 0x00, 0x00, /* R20 - R27 */
163 0x04, 0x00, 0x00, 0x30, 0x2A, 0x00, 0x40, 0x00, /* R28 - R2F */
164 0x40, 0x00, 0x40, 0x00, 0x40, 0x00, 0x40, 0x00, /* R30 - R37 */
165 0x40, 0x00, 0x40, 0x00, 0x40, 0x00, 0x00, 0x00, /* R38 - R3F */
166 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* R40 - R4F */
167 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* R48 - R4F */
168 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* R50 - R57 */
169 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* R58 - R5F */
170 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* R60 - R67 */
171 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* R68 - R6F */
172 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* R70 - R77 */
173 0x00, 0x00, 0x00, 0x00, 0x00, 0x54, 0x54, 0x00, /* R78 - R7F */
174 0x00, 0x00, 0x2C, 0x00, 0x00, 0x00, 0x00, 0x00, /* R80 - R87 */
179 * Read da7210 register cache
181 static inline u32
da7210_read_reg_cache(struct snd_soc_codec
*codec
, u32 reg
)
183 u8
*cache
= codec
->reg_cache
;
184 BUG_ON(reg
> ARRAY_SIZE(da7210_reg
));
189 * Write to the da7210 register space
191 static int da7210_write(struct snd_soc_codec
*codec
, u32 reg
, u32 value
)
193 u8
*cache
= codec
->reg_cache
;
196 BUG_ON(codec
->volatile_register
);
198 data
[0] = reg
& 0xff;
199 data
[1] = value
& 0xff;
201 if (reg
>= codec
->reg_cache_size
)
204 if (2 != codec
->hw_write(codec
->control_data
, data
, 2))
212 * Read from the da7210 register space.
214 static inline u32
da7210_read(struct snd_soc_codec
*codec
, u32 reg
)
216 if (DA7210_STATUS
== reg
)
217 return i2c_smbus_read_byte_data(codec
->control_data
, reg
);
219 return da7210_read_reg_cache(codec
, reg
);
222 static int da7210_startup(struct snd_pcm_substream
*substream
,
223 struct snd_soc_dai
*dai
)
225 int is_play
= substream
->stream
== SNDRV_PCM_STREAM_PLAYBACK
;
226 struct snd_soc_codec
*codec
= dai
->codec
;
229 /* PlayBack Volume 40 */
230 snd_soc_update_bits(codec
, DA7210_HP_L_VOL
, 0x3F, 40);
231 snd_soc_update_bits(codec
, DA7210_HP_R_VOL
, 0x3F, 40);
234 snd_soc_update_bits(codec
, DA7210_OUTMIX_L
, 0x1F, 0x10);
235 snd_soc_update_bits(codec
, DA7210_OUTMIX_R
, 0x1F, 0x10);
239 snd_soc_update_bits(codec
, DA7210_MIC_L
, 0x7, 0x7);
240 snd_soc_update_bits(codec
, DA7210_MIC_R
, 0x7, 0x7);
243 snd_soc_update_bits(codec
, DA7210_INMIX_L
, 0x1F, 0x1);
244 snd_soc_update_bits(codec
, DA7210_INMIX_R
, 0x1F, 0x1);
251 * Set PCM DAI word length.
253 static int da7210_hw_params(struct snd_pcm_substream
*substream
,
254 struct snd_pcm_hw_params
*params
,
255 struct snd_soc_dai
*dai
)
257 struct snd_soc_pcm_runtime
*rtd
= substream
->private_data
;
258 struct snd_soc_device
*socdev
= rtd
->socdev
;
259 struct snd_soc_codec
*codec
= socdev
->card
->codec
;
261 u32 hpf_reg
, hpf_mask
, hpf_value
;
264 /* set DAI source to Left and Right ADC */
265 da7210_write(codec
, DA7210_DAI_SRC_SEL
,
266 DA7210_DAI_OUT_R_SRC
| DA7210_DAI_OUT_L_SRC
);
269 da7210_write(codec
, DA7210_DAI_CFG3
, DA7210_DAI_OE
| DA7210_DAI_EN
);
271 dai_cfg1
= 0xFC & da7210_read(codec
, DA7210_DAI_CFG1
);
273 switch (params_format(params
)) {
274 case SNDRV_PCM_FORMAT_S16_LE
:
275 dai_cfg1
|= DA7210_DAI_WORD_S16_LE
;
277 case SNDRV_PCM_FORMAT_S24_LE
:
278 dai_cfg1
|= DA7210_DAI_WORD_S24_LE
;
284 da7210_write(codec
, DA7210_DAI_CFG1
, dai_cfg1
);
286 hpf_reg
= (SNDRV_PCM_STREAM_PLAYBACK
== substream
->stream
) ?
287 DA7210_DAC_HPF
: DA7210_ADC_HPF
;
289 switch (params_rate(params
)) {
291 fs
= DA7210_PLL_FS_8000
;
292 hpf_mask
= DA7210_VOICE_F0_MASK
| DA7210_VOICE_EN
;
293 hpf_value
= DA7210_VOICE_F0_25
| DA7210_VOICE_EN
;
294 bypass
= DA7210_PLL_BYP
;
297 fs
= DA7210_PLL_FS_11025
;
298 hpf_mask
= DA7210_VOICE_F0_MASK
| DA7210_VOICE_EN
;
299 hpf_value
= DA7210_VOICE_F0_25
| DA7210_VOICE_EN
;
303 fs
= DA7210_PLL_FS_12000
;
304 hpf_mask
= DA7210_VOICE_F0_MASK
| DA7210_VOICE_EN
;
305 hpf_value
= DA7210_VOICE_F0_25
| DA7210_VOICE_EN
;
306 bypass
= DA7210_PLL_BYP
;
309 fs
= DA7210_PLL_FS_16000
;
310 hpf_mask
= DA7210_VOICE_F0_MASK
| DA7210_VOICE_EN
;
311 hpf_value
= DA7210_VOICE_F0_25
| DA7210_VOICE_EN
;
312 bypass
= DA7210_PLL_BYP
;
315 fs
= DA7210_PLL_FS_22050
;
316 hpf_mask
= DA7210_VOICE_EN
;
321 fs
= DA7210_PLL_FS_32000
;
322 hpf_mask
= DA7210_VOICE_EN
;
324 bypass
= DA7210_PLL_BYP
;
327 fs
= DA7210_PLL_FS_44100
;
328 hpf_mask
= DA7210_VOICE_EN
;
333 fs
= DA7210_PLL_FS_48000
;
334 hpf_mask
= DA7210_VOICE_EN
;
336 bypass
= DA7210_PLL_BYP
;
339 fs
= DA7210_PLL_FS_88200
;
340 hpf_mask
= DA7210_VOICE_EN
;
345 fs
= DA7210_PLL_FS_96000
;
346 hpf_mask
= DA7210_VOICE_EN
;
348 bypass
= DA7210_PLL_BYP
;
354 /* Disable active mode */
355 snd_soc_update_bits(codec
, DA7210_STARTUP1
, DA7210_SC_MST_EN
, 0);
357 snd_soc_update_bits(codec
, hpf_reg
, hpf_mask
, hpf_value
);
358 snd_soc_update_bits(codec
, DA7210_PLL
, DA7210_PLL_FS_MASK
, fs
);
359 snd_soc_update_bits(codec
, DA7210_PLL_DIV3
, DA7210_PLL_BYP
, bypass
);
361 /* Enable active mode */
362 snd_soc_update_bits(codec
, DA7210_STARTUP1
,
363 DA7210_SC_MST_EN
, DA7210_SC_MST_EN
);
369 * Set DAI mode and Format
371 static int da7210_set_dai_fmt(struct snd_soc_dai
*codec_dai
, u32 fmt
)
373 struct snd_soc_codec
*codec
= codec_dai
->codec
;
377 dai_cfg1
= 0x7f & da7210_read(codec
, DA7210_DAI_CFG1
);
378 dai_cfg3
= 0xfc & da7210_read(codec
, DA7210_DAI_CFG3
);
380 switch (fmt
& SND_SOC_DAIFMT_MASTER_MASK
) {
381 case SND_SOC_DAIFMT_CBM_CFM
:
382 dai_cfg1
|= DA7210_DAI_MODE_MASTER
;
390 * It support I2S only now
392 switch (fmt
& SND_SOC_DAIFMT_FORMAT_MASK
) {
393 case SND_SOC_DAIFMT_I2S
:
394 dai_cfg3
|= DA7210_DAI_FORMAT_I2SMODE
;
402 * It support 64bit data transmission only now
404 dai_cfg1
|= DA7210_DAI_FLEN_64BIT
;
406 da7210_write(codec
, DA7210_DAI_CFG1
, dai_cfg1
);
407 da7210_write(codec
, DA7210_DAI_CFG3
, dai_cfg3
);
412 #define DA7210_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S24_LE)
415 static struct snd_soc_dai_ops da7210_dai_ops
= {
416 .startup
= da7210_startup
,
417 .hw_params
= da7210_hw_params
,
418 .set_fmt
= da7210_set_dai_fmt
,
421 struct snd_soc_dai da7210_dai
= {
422 .name
= "DA7210 IIS",
424 /* playback capabilities */
426 .stream_name
= "Playback",
429 .rates
= SNDRV_PCM_RATE_8000_96000
,
430 .formats
= DA7210_FORMATS
,
432 /* capture capabilities */
434 .stream_name
= "Capture",
437 .rates
= SNDRV_PCM_RATE_8000_96000
,
438 .formats
= DA7210_FORMATS
,
440 .ops
= &da7210_dai_ops
,
441 .symmetric_rates
= 1,
443 EXPORT_SYMBOL_GPL(da7210_dai
);
446 * Initialize the DA7210 driver
447 * register the mixer and dsp interfaces with the kernel
449 static int da7210_init(struct da7210_priv
*da7210
)
451 struct snd_soc_codec
*codec
= &da7210
->codec
;
455 dev_err(codec
->dev
, "Another da7210 is registered\n");
459 mutex_init(&codec
->mutex
);
460 INIT_LIST_HEAD(&codec
->dapm_widgets
);
461 INIT_LIST_HEAD(&codec
->dapm_paths
);
463 snd_soc_codec_set_drvdata(codec
, da7210
);
464 codec
->name
= "DA7210";
465 codec
->owner
= THIS_MODULE
;
466 codec
->read
= da7210_read
;
467 codec
->write
= da7210_write
;
468 codec
->dai
= &da7210_dai
;
470 codec
->hw_write
= (hw_write_t
)i2c_master_send
;
471 codec
->reg_cache_size
= ARRAY_SIZE(da7210_reg
);
472 codec
->reg_cache
= kmemdup(da7210_reg
,
473 sizeof(da7210_reg
), GFP_KERNEL
);
475 if (!codec
->reg_cache
)
478 da7210_dai
.dev
= codec
->dev
;
479 da7210_codec
= codec
;
481 ret
= snd_soc_register_codec(codec
);
483 dev_err(codec
->dev
, "Failed to register CODEC: %d\n", ret
);
487 ret
= snd_soc_register_dai(&da7210_dai
);
489 dev_err(codec
->dev
, "Failed to register DAI: %d\n", ret
);
495 * This driver use fixed value here
496 * And below settings expects MCLK = 12.288MHz
498 * When you select different MCLK, please check...
499 * DA7210_PLL_DIV1 val
500 * DA7210_PLL_DIV2 val
501 * DA7210_PLL_DIV3 val
502 * DA7210_PLL_DIV3 :: DA7210_MCLK_RANGExxx
506 * make sure that DA7210 use bypass mode before start up
508 da7210_write(codec
, DA7210_STARTUP1
, 0);
509 da7210_write(codec
, DA7210_PLL_DIV3
,
510 DA7210_MCLK_RANGE_10_20_MHZ
| DA7210_PLL_BYP
);
516 /* Enable Left & Right MIC PGA and Mic Bias */
517 da7210_write(codec
, DA7210_MIC_L
, DA7210_MIC_L_EN
| DA7210_MICBIAS_EN
);
518 da7210_write(codec
, DA7210_MIC_R
, DA7210_MIC_R_EN
);
520 /* Enable Left and Right input PGA */
521 da7210_write(codec
, DA7210_INMIX_L
, DA7210_IN_L_EN
);
522 da7210_write(codec
, DA7210_INMIX_R
, DA7210_IN_R_EN
);
524 /* Enable Left and Right ADC */
525 da7210_write(codec
, DA7210_ADC
, DA7210_ADC_L_EN
| DA7210_ADC_R_EN
);
531 /* Enable Left and Right DAC */
532 da7210_write(codec
, DA7210_DAC_SEL
,
533 DA7210_DAC_L_SRC_DAI_L
| DA7210_DAC_L_EN
|
534 DA7210_DAC_R_SRC_DAI_R
| DA7210_DAC_R_EN
);
536 /* Enable Left and Right out PGA */
537 da7210_write(codec
, DA7210_OUTMIX_L
, DA7210_OUT_L_EN
);
538 da7210_write(codec
, DA7210_OUTMIX_R
, DA7210_OUT_R_EN
);
540 /* Enable Left and Right HeadPhone PGA */
541 da7210_write(codec
, DA7210_HP_CFG
,
542 DA7210_HP_2CAP_MODE
| DA7210_HP_SENSE_EN
|
543 DA7210_HP_L_EN
| DA7210_HP_MODE
| DA7210_HP_R_EN
);
545 /* Diable PLL and bypass it */
546 da7210_write(codec
, DA7210_PLL
, DA7210_PLL_FS_48000
);
549 * If 48kHz sound came, it use bypass mode,
550 * and when it is 44.1kHz, it use PLL.
552 * This time, this driver sets PLL always ON
553 * and controls bypass/PLL mode by switching
554 * DA7210_PLL_DIV3 :: DA7210_PLL_BYP bit.
555 * see da7210_hw_params
557 da7210_write(codec
, DA7210_PLL_DIV1
, 0xE5); /* MCLK = 12.288MHz */
558 da7210_write(codec
, DA7210_PLL_DIV2
, 0x99);
559 da7210_write(codec
, DA7210_PLL_DIV3
, 0x0A |
560 DA7210_MCLK_RANGE_10_20_MHZ
| DA7210_PLL_BYP
);
561 snd_soc_update_bits(codec
, DA7210_PLL
, DA7210_PLL_EN
, DA7210_PLL_EN
);
563 /* As suggested by Dialog */
564 da7210_write(codec
, DA7210_A_HID_UNLOCK
, 0x8B); /* unlock */
565 da7210_write(codec
, DA7210_A_TEST_UNLOCK
, 0xB4);
566 da7210_write(codec
, DA7210_A_PLL1
, 0x01);
567 da7210_write(codec
, DA7210_A_CP_MODE
, 0x7C);
568 da7210_write(codec
, DA7210_A_HID_UNLOCK
, 0x00); /* re-lock */
569 da7210_write(codec
, DA7210_A_TEST_UNLOCK
, 0x00);
571 /* Activate all enabled subsystem */
572 da7210_write(codec
, DA7210_STARTUP1
, DA7210_SC_MST_EN
);
577 kfree(codec
->reg_cache
);
578 codec
->reg_cache
= NULL
;
584 #if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
585 static int __devinit
da7210_i2c_probe(struct i2c_client
*i2c
,
586 const struct i2c_device_id
*id
)
588 struct da7210_priv
*da7210
;
589 struct snd_soc_codec
*codec
;
592 da7210
= kzalloc(sizeof(struct da7210_priv
), GFP_KERNEL
);
596 codec
= &da7210
->codec
;
597 codec
->dev
= &i2c
->dev
;
599 i2c_set_clientdata(i2c
, da7210
);
600 codec
->control_data
= i2c
;
602 ret
= da7210_init(da7210
);
604 pr_err("Failed to initialise da7210 audio codec\n");
609 static int __devexit
da7210_i2c_remove(struct i2c_client
*client
)
611 struct da7210_priv
*da7210
= i2c_get_clientdata(client
);
613 snd_soc_unregister_dai(&da7210_dai
);
614 kfree(da7210
->codec
.reg_cache
);
621 static const struct i2c_device_id da7210_i2c_id
[] = {
625 MODULE_DEVICE_TABLE(i2c
, da7210_i2c_id
);
627 /* I2C codec control layer */
628 static struct i2c_driver da7210_i2c_driver
= {
630 .name
= "DA7210 I2C Codec",
631 .owner
= THIS_MODULE
,
633 .probe
= da7210_i2c_probe
,
634 .remove
= __devexit_p(da7210_i2c_remove
),
635 .id_table
= da7210_i2c_id
,
639 static int da7210_probe(struct platform_device
*pdev
)
641 struct snd_soc_device
*socdev
= platform_get_drvdata(pdev
);
642 struct snd_soc_codec
*codec
;
646 dev_err(&pdev
->dev
, "Codec device not registered\n");
650 socdev
->card
->codec
= da7210_codec
;
651 codec
= da7210_codec
;
654 ret
= snd_soc_new_pcms(socdev
, SNDRV_DEFAULT_IDX1
, SNDRV_DEFAULT_STR1
);
658 dev_info(&pdev
->dev
, "DA7210 Audio Codec %s\n", DA7210_VERSION
);
664 static int da7210_remove(struct platform_device
*pdev
)
666 struct snd_soc_device
*socdev
= platform_get_drvdata(pdev
);
668 snd_soc_free_pcms(socdev
);
669 snd_soc_dapm_free(socdev
);
674 struct snd_soc_codec_device soc_codec_dev_da7210
= {
675 .probe
= da7210_probe
,
676 .remove
= da7210_remove
,
678 EXPORT_SYMBOL_GPL(soc_codec_dev_da7210
);
680 static int __init
da7210_modinit(void)
683 #if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
684 ret
= i2c_add_driver(&da7210_i2c_driver
);
688 module_init(da7210_modinit
);
690 static void __exit
da7210_exit(void)
692 #if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
693 i2c_del_driver(&da7210_i2c_driver
);
696 module_exit(da7210_exit
);
698 MODULE_DESCRIPTION("ASoC DA7210 driver");
699 MODULE_AUTHOR("David Chen, Kuninori Morimoto");
700 MODULE_LICENSE("GPL");