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 <linux/slab.h>
27 #include <sound/core.h>
28 #include <sound/pcm.h>
29 #include <sound/pcm_params.h>
30 #include <sound/soc.h>
31 #include <sound/soc-dapm.h>
32 #include <sound/tlv.h>
33 #include <sound/initval.h>
34 #include <asm/div64.h>
38 /* DA7210 register space */
39 #define DA7210_STATUS 0x02
40 #define DA7210_STARTUP1 0x03
41 #define DA7210_MIC_L 0x07
42 #define DA7210_MIC_R 0x08
43 #define DA7210_INMIX_L 0x0D
44 #define DA7210_INMIX_R 0x0E
45 #define DA7210_ADC_HPF 0x0F
46 #define DA7210_ADC 0x10
47 #define DA7210_DAC_HPF 0x14
48 #define DA7210_DAC_L 0x15
49 #define DA7210_DAC_R 0x16
50 #define DA7210_DAC_SEL 0x17
51 #define DA7210_OUTMIX_L 0x1C
52 #define DA7210_OUTMIX_R 0x1D
53 #define DA7210_HP_L_VOL 0x21
54 #define DA7210_HP_R_VOL 0x22
55 #define DA7210_HP_CFG 0x23
56 #define DA7210_DAI_SRC_SEL 0x25
57 #define DA7210_DAI_CFG1 0x26
58 #define DA7210_DAI_CFG3 0x28
59 #define DA7210_PLL_DIV1 0x29
60 #define DA7210_PLL_DIV2 0x2A
61 #define DA7210_PLL_DIV3 0x2B
62 #define DA7210_PLL 0x2C
63 #define DA7210_A_HID_UNLOCK 0x8A
64 #define DA7210_A_TEST_UNLOCK 0x8B
65 #define DA7210_A_PLL1 0x90
66 #define DA7210_A_CP_MODE 0xA7
68 /* STARTUP1 bit fields */
69 #define DA7210_SC_MST_EN (1 << 0)
71 /* MIC_L bit fields */
72 #define DA7210_MICBIAS_EN (1 << 6)
73 #define DA7210_MIC_L_EN (1 << 7)
75 /* MIC_R bit fields */
76 #define DA7210_MIC_R_EN (1 << 7)
78 /* INMIX_L bit fields */
79 #define DA7210_IN_L_EN (1 << 7)
81 /* INMIX_R bit fields */
82 #define DA7210_IN_R_EN (1 << 7)
85 #define DA7210_ADC_L_EN (1 << 3)
86 #define DA7210_ADC_R_EN (1 << 7)
88 /* DAC/ADC HPF fields */
89 #define DA7210_VOICE_F0_MASK (0x7 << 4)
90 #define DA7210_VOICE_F0_25 (1 << 4)
91 #define DA7210_VOICE_EN (1 << 7)
93 /* DAC_SEL bit fields */
94 #define DA7210_DAC_L_SRC_DAI_L (4 << 0)
95 #define DA7210_DAC_L_EN (1 << 3)
96 #define DA7210_DAC_R_SRC_DAI_R (5 << 4)
97 #define DA7210_DAC_R_EN (1 << 7)
99 /* OUTMIX_L bit fields */
100 #define DA7210_OUT_L_EN (1 << 7)
102 /* OUTMIX_R bit fields */
103 #define DA7210_OUT_R_EN (1 << 7)
105 /* HP_CFG bit fields */
106 #define DA7210_HP_2CAP_MODE (1 << 1)
107 #define DA7210_HP_SENSE_EN (1 << 2)
108 #define DA7210_HP_L_EN (1 << 3)
109 #define DA7210_HP_MODE (1 << 6)
110 #define DA7210_HP_R_EN (1 << 7)
112 /* DAI_SRC_SEL bit fields */
113 #define DA7210_DAI_OUT_L_SRC (6 << 0)
114 #define DA7210_DAI_OUT_R_SRC (7 << 4)
116 /* DAI_CFG1 bit fields */
117 #define DA7210_DAI_WORD_S16_LE (0 << 0)
118 #define DA7210_DAI_WORD_S24_LE (2 << 0)
119 #define DA7210_DAI_FLEN_64BIT (1 << 2)
120 #define DA7210_DAI_MODE_MASTER (1 << 7)
122 /* DAI_CFG3 bit fields */
123 #define DA7210_DAI_FORMAT_I2SMODE (0 << 0)
124 #define DA7210_DAI_OE (1 << 3)
125 #define DA7210_DAI_EN (1 << 7)
127 /*PLL_DIV3 bit fields */
128 #define DA7210_MCLK_RANGE_10_20_MHZ (1 << 4)
129 #define DA7210_PLL_BYP (1 << 6)
132 #define DA7210_PLL_FS_MASK (0xF << 0)
133 #define DA7210_PLL_FS_8000 (0x1 << 0)
134 #define DA7210_PLL_FS_11025 (0x2 << 0)
135 #define DA7210_PLL_FS_12000 (0x3 << 0)
136 #define DA7210_PLL_FS_16000 (0x5 << 0)
137 #define DA7210_PLL_FS_22050 (0x6 << 0)
138 #define DA7210_PLL_FS_24000 (0x7 << 0)
139 #define DA7210_PLL_FS_32000 (0x9 << 0)
140 #define DA7210_PLL_FS_44100 (0xA << 0)
141 #define DA7210_PLL_FS_48000 (0xB << 0)
142 #define DA7210_PLL_FS_88200 (0xE << 0)
143 #define DA7210_PLL_FS_96000 (0xF << 0)
144 #define DA7210_PLL_EN (0x1 << 7)
146 #define DA7210_VERSION "0.0.1"
148 /* Codec private data */
150 struct snd_soc_codec codec
;
153 static struct snd_soc_codec
*da7210_codec
;
158 static const u8 da7210_reg
[] = {
159 0x00, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* R0 - R7 */
160 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, /* R8 - RF */
161 0x00, 0x00, 0x00, 0x00, 0x08, 0x10, 0x10, 0x54, /* R10 - R17 */
162 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* R18 - R1F */
163 0x00, 0x00, 0x00, 0x02, 0x00, 0x76, 0x00, 0x00, /* R20 - R27 */
164 0x04, 0x00, 0x00, 0x30, 0x2A, 0x00, 0x40, 0x00, /* R28 - R2F */
165 0x40, 0x00, 0x40, 0x00, 0x40, 0x00, 0x40, 0x00, /* R30 - R37 */
166 0x40, 0x00, 0x40, 0x00, 0x40, 0x00, 0x00, 0x00, /* R38 - R3F */
167 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* R40 - R4F */
168 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* R48 - R4F */
169 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* R50 - R57 */
170 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* R58 - R5F */
171 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* R60 - R67 */
172 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* R68 - R6F */
173 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* R70 - R77 */
174 0x00, 0x00, 0x00, 0x00, 0x00, 0x54, 0x54, 0x00, /* R78 - R7F */
175 0x00, 0x00, 0x2C, 0x00, 0x00, 0x00, 0x00, 0x00, /* R80 - R87 */
180 * Read da7210 register cache
182 static inline u32
da7210_read_reg_cache(struct snd_soc_codec
*codec
, u32 reg
)
184 u8
*cache
= codec
->reg_cache
;
185 BUG_ON(reg
>= ARRAY_SIZE(da7210_reg
));
190 * Write to the da7210 register space
192 static int da7210_write(struct snd_soc_codec
*codec
, u32 reg
, u32 value
)
194 u8
*cache
= codec
->reg_cache
;
197 BUG_ON(codec
->volatile_register
);
199 data
[0] = reg
& 0xff;
200 data
[1] = value
& 0xff;
202 if (reg
>= codec
->reg_cache_size
)
205 if (2 != codec
->hw_write(codec
->control_data
, data
, 2))
213 * Read from the da7210 register space.
215 static inline u32
da7210_read(struct snd_soc_codec
*codec
, u32 reg
)
217 if (DA7210_STATUS
== reg
)
218 return i2c_smbus_read_byte_data(codec
->control_data
, reg
);
220 return da7210_read_reg_cache(codec
, reg
);
223 static int da7210_startup(struct snd_pcm_substream
*substream
,
224 struct snd_soc_dai
*dai
)
226 int is_play
= substream
->stream
== SNDRV_PCM_STREAM_PLAYBACK
;
227 struct snd_soc_codec
*codec
= dai
->codec
;
230 /* PlayBack Volume 40 */
231 snd_soc_update_bits(codec
, DA7210_HP_L_VOL
, 0x3F, 40);
232 snd_soc_update_bits(codec
, DA7210_HP_R_VOL
, 0x3F, 40);
235 snd_soc_update_bits(codec
, DA7210_OUTMIX_L
, 0x1F, 0x10);
236 snd_soc_update_bits(codec
, DA7210_OUTMIX_R
, 0x1F, 0x10);
240 snd_soc_update_bits(codec
, DA7210_MIC_L
, 0x7, 0x7);
241 snd_soc_update_bits(codec
, DA7210_MIC_R
, 0x7, 0x7);
244 snd_soc_update_bits(codec
, DA7210_INMIX_L
, 0x1F, 0x1);
245 snd_soc_update_bits(codec
, DA7210_INMIX_R
, 0x1F, 0x1);
252 * Set PCM DAI word length.
254 static int da7210_hw_params(struct snd_pcm_substream
*substream
,
255 struct snd_pcm_hw_params
*params
,
256 struct snd_soc_dai
*dai
)
258 struct snd_soc_pcm_runtime
*rtd
= substream
->private_data
;
259 struct snd_soc_device
*socdev
= rtd
->socdev
;
260 struct snd_soc_codec
*codec
= socdev
->card
->codec
;
262 u32 hpf_reg
, hpf_mask
, hpf_value
;
265 /* set DAI source to Left and Right ADC */
266 da7210_write(codec
, DA7210_DAI_SRC_SEL
,
267 DA7210_DAI_OUT_R_SRC
| DA7210_DAI_OUT_L_SRC
);
270 da7210_write(codec
, DA7210_DAI_CFG3
, DA7210_DAI_OE
| DA7210_DAI_EN
);
272 dai_cfg1
= 0xFC & da7210_read(codec
, DA7210_DAI_CFG1
);
274 switch (params_format(params
)) {
275 case SNDRV_PCM_FORMAT_S16_LE
:
276 dai_cfg1
|= DA7210_DAI_WORD_S16_LE
;
278 case SNDRV_PCM_FORMAT_S24_LE
:
279 dai_cfg1
|= DA7210_DAI_WORD_S24_LE
;
285 da7210_write(codec
, DA7210_DAI_CFG1
, dai_cfg1
);
287 hpf_reg
= (SNDRV_PCM_STREAM_PLAYBACK
== substream
->stream
) ?
288 DA7210_DAC_HPF
: DA7210_ADC_HPF
;
290 switch (params_rate(params
)) {
292 fs
= DA7210_PLL_FS_8000
;
293 hpf_mask
= DA7210_VOICE_F0_MASK
| DA7210_VOICE_EN
;
294 hpf_value
= DA7210_VOICE_F0_25
| DA7210_VOICE_EN
;
295 bypass
= DA7210_PLL_BYP
;
298 fs
= DA7210_PLL_FS_11025
;
299 hpf_mask
= DA7210_VOICE_F0_MASK
| DA7210_VOICE_EN
;
300 hpf_value
= DA7210_VOICE_F0_25
| DA7210_VOICE_EN
;
304 fs
= DA7210_PLL_FS_12000
;
305 hpf_mask
= DA7210_VOICE_F0_MASK
| DA7210_VOICE_EN
;
306 hpf_value
= DA7210_VOICE_F0_25
| DA7210_VOICE_EN
;
307 bypass
= DA7210_PLL_BYP
;
310 fs
= DA7210_PLL_FS_16000
;
311 hpf_mask
= DA7210_VOICE_F0_MASK
| DA7210_VOICE_EN
;
312 hpf_value
= DA7210_VOICE_F0_25
| DA7210_VOICE_EN
;
313 bypass
= DA7210_PLL_BYP
;
316 fs
= DA7210_PLL_FS_22050
;
317 hpf_mask
= DA7210_VOICE_EN
;
322 fs
= DA7210_PLL_FS_32000
;
323 hpf_mask
= DA7210_VOICE_EN
;
325 bypass
= DA7210_PLL_BYP
;
328 fs
= DA7210_PLL_FS_44100
;
329 hpf_mask
= DA7210_VOICE_EN
;
334 fs
= DA7210_PLL_FS_48000
;
335 hpf_mask
= DA7210_VOICE_EN
;
337 bypass
= DA7210_PLL_BYP
;
340 fs
= DA7210_PLL_FS_88200
;
341 hpf_mask
= DA7210_VOICE_EN
;
346 fs
= DA7210_PLL_FS_96000
;
347 hpf_mask
= DA7210_VOICE_EN
;
349 bypass
= DA7210_PLL_BYP
;
355 /* Disable active mode */
356 snd_soc_update_bits(codec
, DA7210_STARTUP1
, DA7210_SC_MST_EN
, 0);
358 snd_soc_update_bits(codec
, hpf_reg
, hpf_mask
, hpf_value
);
359 snd_soc_update_bits(codec
, DA7210_PLL
, DA7210_PLL_FS_MASK
, fs
);
360 snd_soc_update_bits(codec
, DA7210_PLL_DIV3
, DA7210_PLL_BYP
, bypass
);
362 /* Enable active mode */
363 snd_soc_update_bits(codec
, DA7210_STARTUP1
,
364 DA7210_SC_MST_EN
, DA7210_SC_MST_EN
);
370 * Set DAI mode and Format
372 static int da7210_set_dai_fmt(struct snd_soc_dai
*codec_dai
, u32 fmt
)
374 struct snd_soc_codec
*codec
= codec_dai
->codec
;
378 dai_cfg1
= 0x7f & da7210_read(codec
, DA7210_DAI_CFG1
);
379 dai_cfg3
= 0xfc & da7210_read(codec
, DA7210_DAI_CFG3
);
381 switch (fmt
& SND_SOC_DAIFMT_MASTER_MASK
) {
382 case SND_SOC_DAIFMT_CBM_CFM
:
383 dai_cfg1
|= DA7210_DAI_MODE_MASTER
;
391 * It support I2S only now
393 switch (fmt
& SND_SOC_DAIFMT_FORMAT_MASK
) {
394 case SND_SOC_DAIFMT_I2S
:
395 dai_cfg3
|= DA7210_DAI_FORMAT_I2SMODE
;
403 * It support 64bit data transmission only now
405 dai_cfg1
|= DA7210_DAI_FLEN_64BIT
;
407 da7210_write(codec
, DA7210_DAI_CFG1
, dai_cfg1
);
408 da7210_write(codec
, DA7210_DAI_CFG3
, dai_cfg3
);
413 #define DA7210_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S24_LE)
416 static struct snd_soc_dai_ops da7210_dai_ops
= {
417 .startup
= da7210_startup
,
418 .hw_params
= da7210_hw_params
,
419 .set_fmt
= da7210_set_dai_fmt
,
422 struct snd_soc_dai da7210_dai
= {
423 .name
= "DA7210 IIS",
425 /* playback capabilities */
427 .stream_name
= "Playback",
430 .rates
= SNDRV_PCM_RATE_8000_96000
,
431 .formats
= DA7210_FORMATS
,
433 /* capture capabilities */
435 .stream_name
= "Capture",
438 .rates
= SNDRV_PCM_RATE_8000_96000
,
439 .formats
= DA7210_FORMATS
,
441 .ops
= &da7210_dai_ops
,
442 .symmetric_rates
= 1,
444 EXPORT_SYMBOL_GPL(da7210_dai
);
447 * Initialize the DA7210 driver
448 * register the mixer and dsp interfaces with the kernel
450 static int da7210_init(struct da7210_priv
*da7210
)
452 struct snd_soc_codec
*codec
= &da7210
->codec
;
456 dev_err(codec
->dev
, "Another da7210 is registered\n");
460 mutex_init(&codec
->mutex
);
461 INIT_LIST_HEAD(&codec
->dapm_widgets
);
462 INIT_LIST_HEAD(&codec
->dapm_paths
);
464 snd_soc_codec_set_drvdata(codec
, da7210
);
465 codec
->name
= "DA7210";
466 codec
->owner
= THIS_MODULE
;
467 codec
->read
= da7210_read
;
468 codec
->write
= da7210_write
;
469 codec
->dai
= &da7210_dai
;
471 codec
->hw_write
= (hw_write_t
)i2c_master_send
;
472 codec
->reg_cache_size
= ARRAY_SIZE(da7210_reg
);
473 codec
->reg_cache
= kmemdup(da7210_reg
,
474 sizeof(da7210_reg
), GFP_KERNEL
);
476 if (!codec
->reg_cache
)
479 da7210_dai
.dev
= codec
->dev
;
480 da7210_codec
= codec
;
482 ret
= snd_soc_register_codec(codec
);
484 dev_err(codec
->dev
, "Failed to register CODEC: %d\n", ret
);
488 ret
= snd_soc_register_dai(&da7210_dai
);
490 dev_err(codec
->dev
, "Failed to register DAI: %d\n", ret
);
496 * This driver use fixed value here
497 * And below settings expects MCLK = 12.288MHz
499 * When you select different MCLK, please check...
500 * DA7210_PLL_DIV1 val
501 * DA7210_PLL_DIV2 val
502 * DA7210_PLL_DIV3 val
503 * DA7210_PLL_DIV3 :: DA7210_MCLK_RANGExxx
507 * make sure that DA7210 use bypass mode before start up
509 da7210_write(codec
, DA7210_STARTUP1
, 0);
510 da7210_write(codec
, DA7210_PLL_DIV3
,
511 DA7210_MCLK_RANGE_10_20_MHZ
| DA7210_PLL_BYP
);
517 /* Enable Left & Right MIC PGA and Mic Bias */
518 da7210_write(codec
, DA7210_MIC_L
, DA7210_MIC_L_EN
| DA7210_MICBIAS_EN
);
519 da7210_write(codec
, DA7210_MIC_R
, DA7210_MIC_R_EN
);
521 /* Enable Left and Right input PGA */
522 da7210_write(codec
, DA7210_INMIX_L
, DA7210_IN_L_EN
);
523 da7210_write(codec
, DA7210_INMIX_R
, DA7210_IN_R_EN
);
525 /* Enable Left and Right ADC */
526 da7210_write(codec
, DA7210_ADC
, DA7210_ADC_L_EN
| DA7210_ADC_R_EN
);
532 /* Enable Left and Right DAC */
533 da7210_write(codec
, DA7210_DAC_SEL
,
534 DA7210_DAC_L_SRC_DAI_L
| DA7210_DAC_L_EN
|
535 DA7210_DAC_R_SRC_DAI_R
| DA7210_DAC_R_EN
);
537 /* Enable Left and Right out PGA */
538 da7210_write(codec
, DA7210_OUTMIX_L
, DA7210_OUT_L_EN
);
539 da7210_write(codec
, DA7210_OUTMIX_R
, DA7210_OUT_R_EN
);
541 /* Enable Left and Right HeadPhone PGA */
542 da7210_write(codec
, DA7210_HP_CFG
,
543 DA7210_HP_2CAP_MODE
| DA7210_HP_SENSE_EN
|
544 DA7210_HP_L_EN
| DA7210_HP_MODE
| DA7210_HP_R_EN
);
546 /* Diable PLL and bypass it */
547 da7210_write(codec
, DA7210_PLL
, DA7210_PLL_FS_48000
);
550 * If 48kHz sound came, it use bypass mode,
551 * and when it is 44.1kHz, it use PLL.
553 * This time, this driver sets PLL always ON
554 * and controls bypass/PLL mode by switching
555 * DA7210_PLL_DIV3 :: DA7210_PLL_BYP bit.
556 * see da7210_hw_params
558 da7210_write(codec
, DA7210_PLL_DIV1
, 0xE5); /* MCLK = 12.288MHz */
559 da7210_write(codec
, DA7210_PLL_DIV2
, 0x99);
560 da7210_write(codec
, DA7210_PLL_DIV3
, 0x0A |
561 DA7210_MCLK_RANGE_10_20_MHZ
| DA7210_PLL_BYP
);
562 snd_soc_update_bits(codec
, DA7210_PLL
, DA7210_PLL_EN
, DA7210_PLL_EN
);
564 /* As suggested by Dialog */
565 da7210_write(codec
, DA7210_A_HID_UNLOCK
, 0x8B); /* unlock */
566 da7210_write(codec
, DA7210_A_TEST_UNLOCK
, 0xB4);
567 da7210_write(codec
, DA7210_A_PLL1
, 0x01);
568 da7210_write(codec
, DA7210_A_CP_MODE
, 0x7C);
569 da7210_write(codec
, DA7210_A_HID_UNLOCK
, 0x00); /* re-lock */
570 da7210_write(codec
, DA7210_A_TEST_UNLOCK
, 0x00);
572 /* Activate all enabled subsystem */
573 da7210_write(codec
, DA7210_STARTUP1
, DA7210_SC_MST_EN
);
578 kfree(codec
->reg_cache
);
579 codec
->reg_cache
= NULL
;
585 #if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
586 static int __devinit
da7210_i2c_probe(struct i2c_client
*i2c
,
587 const struct i2c_device_id
*id
)
589 struct da7210_priv
*da7210
;
590 struct snd_soc_codec
*codec
;
593 da7210
= kzalloc(sizeof(struct da7210_priv
), GFP_KERNEL
);
597 codec
= &da7210
->codec
;
598 codec
->dev
= &i2c
->dev
;
600 i2c_set_clientdata(i2c
, da7210
);
601 codec
->control_data
= i2c
;
603 ret
= da7210_init(da7210
);
605 pr_err("Failed to initialise da7210 audio codec\n");
610 static int __devexit
da7210_i2c_remove(struct i2c_client
*client
)
612 struct da7210_priv
*da7210
= i2c_get_clientdata(client
);
614 snd_soc_unregister_dai(&da7210_dai
);
615 kfree(da7210
->codec
.reg_cache
);
622 static const struct i2c_device_id da7210_i2c_id
[] = {
626 MODULE_DEVICE_TABLE(i2c
, da7210_i2c_id
);
628 /* I2C codec control layer */
629 static struct i2c_driver da7210_i2c_driver
= {
631 .name
= "DA7210 I2C Codec",
632 .owner
= THIS_MODULE
,
634 .probe
= da7210_i2c_probe
,
635 .remove
= __devexit_p(da7210_i2c_remove
),
636 .id_table
= da7210_i2c_id
,
640 static int da7210_probe(struct platform_device
*pdev
)
642 struct snd_soc_device
*socdev
= platform_get_drvdata(pdev
);
643 struct snd_soc_codec
*codec
;
647 dev_err(&pdev
->dev
, "Codec device not registered\n");
651 socdev
->card
->codec
= da7210_codec
;
652 codec
= da7210_codec
;
655 ret
= snd_soc_new_pcms(socdev
, SNDRV_DEFAULT_IDX1
, SNDRV_DEFAULT_STR1
);
659 dev_info(&pdev
->dev
, "DA7210 Audio Codec %s\n", DA7210_VERSION
);
665 static int da7210_remove(struct platform_device
*pdev
)
667 struct snd_soc_device
*socdev
= platform_get_drvdata(pdev
);
669 snd_soc_free_pcms(socdev
);
670 snd_soc_dapm_free(socdev
);
675 struct snd_soc_codec_device soc_codec_dev_da7210
= {
676 .probe
= da7210_probe
,
677 .remove
= da7210_remove
,
679 EXPORT_SYMBOL_GPL(soc_codec_dev_da7210
);
681 static int __init
da7210_modinit(void)
684 #if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
685 ret
= i2c_add_driver(&da7210_i2c_driver
);
689 module_init(da7210_modinit
);
691 static void __exit
da7210_exit(void)
693 #if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
694 i2c_del_driver(&da7210_i2c_driver
);
697 module_exit(da7210_exit
);
699 MODULE_DESCRIPTION("ASoC DA7210 driver");
700 MODULE_AUTHOR("David Chen, Kuninori Morimoto");
701 MODULE_LICENSE("GPL");