2 * File: sound/soc/codecs/ad1938.c
3 * Author: Barry Song <Barry.Song@analog.com>
5 * Created: June 04 2009
6 * Description: Driver for AD1938 sound chip
9 * Copyright 2009 Analog Devices Inc.
11 * Bugs: Enter bugs at http://blackfin.uclinux.org/
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 2 of the License, or
16 * (at your option) any later version.
18 * This program is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
23 * You should have received a copy of the GNU General Public License
24 * along with this program; if not, see the file COPYING, or write
25 * to the Free Software Foundation, Inc.,
26 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
29 #include <linux/init.h>
30 #include <linux/module.h>
31 #include <linux/version.h>
32 #include <linux/kernel.h>
33 #include <linux/device.h>
34 #include <sound/core.h>
35 #include <sound/pcm.h>
36 #include <sound/pcm_params.h>
37 #include <sound/initval.h>
38 #include <sound/soc.h>
39 #include <sound/tlv.h>
40 #include <sound/soc-dapm.h>
41 #include <linux/spi/spi.h>
44 /* codec private data */
46 struct snd_soc_codec codec
;
47 u8 reg_cache
[AD1938_NUM_REGS
];
50 static struct snd_soc_codec
*ad1938_codec
;
51 struct snd_soc_codec_device soc_codec_dev_ad1938
;
52 static int ad1938_register(struct ad1938_priv
*ad1938
);
53 static void ad1938_unregister(struct ad1938_priv
*ad1938
);
56 * AD1938 volume/mute/de-emphasis etc. controls
58 static const char *ad1938_deemp
[] = {"None", "48kHz", "44.1kHz", "32kHz"};
60 static const struct soc_enum ad1938_deemp_enum
=
61 SOC_ENUM_SINGLE(AD1938_DAC_CTRL2
, 1, 4, ad1938_deemp
);
63 static const struct snd_kcontrol_new ad1938_snd_controls
[] = {
64 /* DAC volume control */
65 SOC_DOUBLE_R("DAC1 Volume", AD1938_DAC_L1_VOL
,
66 AD1938_DAC_R1_VOL
, 0, 0xFF, 1),
67 SOC_DOUBLE_R("DAC2 Volume", AD1938_DAC_L2_VOL
,
68 AD1938_DAC_R2_VOL
, 0, 0xFF, 1),
69 SOC_DOUBLE_R("DAC3 Volume", AD1938_DAC_L3_VOL
,
70 AD1938_DAC_R3_VOL
, 0, 0xFF, 1),
71 SOC_DOUBLE_R("DAC4 Volume", AD1938_DAC_L4_VOL
,
72 AD1938_DAC_R4_VOL
, 0, 0xFF, 1),
74 /* ADC switch control */
75 SOC_DOUBLE("ADC1 Switch", AD1938_ADC_CTRL0
, AD1938_ADCL1_MUTE
,
76 AD1938_ADCR1_MUTE
, 1, 1),
77 SOC_DOUBLE("ADC2 Switch", AD1938_ADC_CTRL0
, AD1938_ADCL2_MUTE
,
78 AD1938_ADCR2_MUTE
, 1, 1),
80 /* DAC switch control */
81 SOC_DOUBLE("DAC1 Switch", AD1938_DAC_CHNL_MUTE
, AD1938_DACL1_MUTE
,
82 AD1938_DACR1_MUTE
, 1, 1),
83 SOC_DOUBLE("DAC2 Switch", AD1938_DAC_CHNL_MUTE
, AD1938_DACL2_MUTE
,
84 AD1938_DACR2_MUTE
, 1, 1),
85 SOC_DOUBLE("DAC3 Switch", AD1938_DAC_CHNL_MUTE
, AD1938_DACL3_MUTE
,
86 AD1938_DACR3_MUTE
, 1, 1),
87 SOC_DOUBLE("DAC4 Switch", AD1938_DAC_CHNL_MUTE
, AD1938_DACL4_MUTE
,
88 AD1938_DACR4_MUTE
, 1, 1),
90 /* ADC high-pass filter */
91 SOC_SINGLE("ADC High Pass Filter Switch", AD1938_ADC_CTRL0
,
92 AD1938_ADC_HIGHPASS_FILTER
, 1, 0),
95 SOC_ENUM("Playback Deemphasis", ad1938_deemp_enum
),
98 static const struct snd_soc_dapm_widget ad1938_dapm_widgets
[] = {
99 SND_SOC_DAPM_DAC("DAC", "Playback", AD1938_DAC_CTRL0
, 0, 1),
100 SND_SOC_DAPM_ADC("ADC", "Capture", SND_SOC_NOPM
, 0, 0),
101 SND_SOC_DAPM_SUPPLY("ADC_PWR", AD1938_ADC_CTRL0
, 0, 1, NULL
, 0),
102 SND_SOC_DAPM_OUTPUT("DAC1OUT"),
103 SND_SOC_DAPM_OUTPUT("DAC2OUT"),
104 SND_SOC_DAPM_OUTPUT("DAC3OUT"),
105 SND_SOC_DAPM_OUTPUT("DAC4OUT"),
106 SND_SOC_DAPM_INPUT("ADC1IN"),
107 SND_SOC_DAPM_INPUT("ADC2IN"),
110 static const struct snd_soc_dapm_route audio_paths
[] = {
111 { "DAC", NULL
, "ADC_PWR" },
112 { "ADC", NULL
, "ADC_PWR" },
113 { "DAC1OUT", "DAC1 Switch", "DAC" },
114 { "DAC2OUT", "DAC2 Switch", "DAC" },
115 { "DAC3OUT", "DAC3 Switch", "DAC" },
116 { "DAC4OUT", "DAC4 Switch", "DAC" },
117 { "ADC", "ADC1 Switch", "ADC1IN" },
118 { "ADC", "ADC2 Switch", "ADC2IN" },
125 static int ad1938_mute(struct snd_soc_dai
*dai
, int mute
)
127 struct snd_soc_codec
*codec
= dai
->codec
;
130 reg
= codec
->read(codec
, AD1938_DAC_CTRL2
);
131 reg
= (mute
> 0) ? reg
| AD1938_DAC_MASTER_MUTE
: reg
&
132 (~AD1938_DAC_MASTER_MUTE
);
133 codec
->write(codec
, AD1938_DAC_CTRL2
, reg
);
138 static inline int ad1938_pll_powerctrl(struct snd_soc_codec
*codec
, int cmd
)
140 int reg
= codec
->read(codec
, AD1938_PLL_CLK_CTRL0
);
141 reg
= (cmd
> 0) ? reg
& (~AD1938_PLL_POWERDOWN
) : reg
|
142 AD1938_PLL_POWERDOWN
;
143 codec
->write(codec
, AD1938_PLL_CLK_CTRL0
, reg
);
148 static int ad1938_set_tdm_slot(struct snd_soc_dai
*dai
, unsigned int tx_mask
,
149 unsigned int mask
, int slots
, int width
)
151 struct snd_soc_codec
*codec
= dai
->codec
;
152 int dac_reg
= codec
->read(codec
, AD1938_DAC_CTRL1
);
153 int adc_reg
= codec
->read(codec
, AD1938_ADC_CTRL2
);
155 dac_reg
&= ~AD1938_DAC_CHAN_MASK
;
156 adc_reg
&= ~AD1938_ADC_CHAN_MASK
;
160 dac_reg
|= AD1938_DAC_2_CHANNELS
<< AD1938_DAC_CHAN_SHFT
;
161 adc_reg
|= AD1938_ADC_2_CHANNELS
<< AD1938_ADC_CHAN_SHFT
;
164 dac_reg
|= AD1938_DAC_4_CHANNELS
<< AD1938_DAC_CHAN_SHFT
;
165 adc_reg
|= AD1938_ADC_4_CHANNELS
<< AD1938_ADC_CHAN_SHFT
;
168 dac_reg
|= AD1938_DAC_8_CHANNELS
<< AD1938_DAC_CHAN_SHFT
;
169 adc_reg
|= AD1938_ADC_8_CHANNELS
<< AD1938_ADC_CHAN_SHFT
;
172 dac_reg
|= AD1938_DAC_16_CHANNELS
<< AD1938_DAC_CHAN_SHFT
;
173 adc_reg
|= AD1938_ADC_16_CHANNELS
<< AD1938_ADC_CHAN_SHFT
;
179 codec
->write(codec
, AD1938_DAC_CTRL1
, dac_reg
);
180 codec
->write(codec
, AD1938_ADC_CTRL2
, adc_reg
);
185 static int ad1938_set_dai_fmt(struct snd_soc_dai
*codec_dai
,
188 struct snd_soc_codec
*codec
= codec_dai
->codec
;
189 int adc_reg
, dac_reg
;
191 adc_reg
= codec
->read(codec
, AD1938_ADC_CTRL2
);
192 dac_reg
= codec
->read(codec
, AD1938_DAC_CTRL1
);
194 /* At present, the driver only support AUX ADC mode(SND_SOC_DAIFMT_I2S
195 * with TDM) and ADC&DAC TDM mode(SND_SOC_DAIFMT_DSP_A)
197 switch (fmt
& SND_SOC_DAIFMT_FORMAT_MASK
) {
198 case SND_SOC_DAIFMT_I2S
:
199 adc_reg
&= ~AD1938_ADC_SERFMT_MASK
;
200 adc_reg
|= AD1938_ADC_SERFMT_TDM
;
202 case SND_SOC_DAIFMT_DSP_A
:
203 adc_reg
&= ~AD1938_ADC_SERFMT_MASK
;
204 adc_reg
|= AD1938_ADC_SERFMT_AUX
;
210 switch (fmt
& SND_SOC_DAIFMT_INV_MASK
) {
211 case SND_SOC_DAIFMT_NB_NF
: /* normal bit clock + frame */
212 adc_reg
&= ~AD1938_ADC_LEFT_HIGH
;
213 adc_reg
&= ~AD1938_ADC_BCLK_INV
;
214 dac_reg
&= ~AD1938_DAC_LEFT_HIGH
;
215 dac_reg
&= ~AD1938_DAC_BCLK_INV
;
217 case SND_SOC_DAIFMT_NB_IF
: /* normal bclk + invert frm */
218 adc_reg
|= AD1938_ADC_LEFT_HIGH
;
219 adc_reg
&= ~AD1938_ADC_BCLK_INV
;
220 dac_reg
|= AD1938_DAC_LEFT_HIGH
;
221 dac_reg
&= ~AD1938_DAC_BCLK_INV
;
223 case SND_SOC_DAIFMT_IB_NF
: /* invert bclk + normal frm */
224 adc_reg
&= ~AD1938_ADC_LEFT_HIGH
;
225 adc_reg
|= AD1938_ADC_BCLK_INV
;
226 dac_reg
&= ~AD1938_DAC_LEFT_HIGH
;
227 dac_reg
|= AD1938_DAC_BCLK_INV
;
230 case SND_SOC_DAIFMT_IB_IF
: /* invert bclk + frm */
231 adc_reg
|= AD1938_ADC_LEFT_HIGH
;
232 adc_reg
|= AD1938_ADC_BCLK_INV
;
233 dac_reg
|= AD1938_DAC_LEFT_HIGH
;
234 dac_reg
|= AD1938_DAC_BCLK_INV
;
240 switch (fmt
& SND_SOC_DAIFMT_MASTER_MASK
) {
241 case SND_SOC_DAIFMT_CBM_CFM
: /* codec clk & frm master */
242 adc_reg
|= AD1938_ADC_LCR_MASTER
;
243 adc_reg
|= AD1938_ADC_BCLK_MASTER
;
244 dac_reg
|= AD1938_DAC_LCR_MASTER
;
245 dac_reg
|= AD1938_DAC_BCLK_MASTER
;
247 case SND_SOC_DAIFMT_CBS_CFM
: /* codec clk slave & frm master */
248 adc_reg
|= AD1938_ADC_LCR_MASTER
;
249 adc_reg
&= ~AD1938_ADC_BCLK_MASTER
;
250 dac_reg
|= AD1938_DAC_LCR_MASTER
;
251 dac_reg
&= ~AD1938_DAC_BCLK_MASTER
;
253 case SND_SOC_DAIFMT_CBM_CFS
: /* codec clk master & frame slave */
254 adc_reg
&= ~AD1938_ADC_LCR_MASTER
;
255 adc_reg
|= AD1938_ADC_BCLK_MASTER
;
256 dac_reg
&= ~AD1938_DAC_LCR_MASTER
;
257 dac_reg
|= AD1938_DAC_BCLK_MASTER
;
259 case SND_SOC_DAIFMT_CBS_CFS
: /* codec clk & frm slave */
260 adc_reg
&= ~AD1938_ADC_LCR_MASTER
;
261 adc_reg
&= ~AD1938_ADC_BCLK_MASTER
;
262 dac_reg
&= ~AD1938_DAC_LCR_MASTER
;
263 dac_reg
&= ~AD1938_DAC_BCLK_MASTER
;
269 codec
->write(codec
, AD1938_ADC_CTRL2
, adc_reg
);
270 codec
->write(codec
, AD1938_DAC_CTRL1
, dac_reg
);
275 static int ad1938_hw_params(struct snd_pcm_substream
*substream
,
276 struct snd_pcm_hw_params
*params
,
277 struct snd_soc_dai
*dai
)
279 int word_len
= 0, reg
= 0;
281 struct snd_soc_pcm_runtime
*rtd
= substream
->private_data
;
282 struct snd_soc_device
*socdev
= rtd
->socdev
;
283 struct snd_soc_codec
*codec
= socdev
->card
->codec
;
286 switch (params_format(params
)) {
287 case SNDRV_PCM_FORMAT_S16_LE
:
290 case SNDRV_PCM_FORMAT_S20_3LE
:
293 case SNDRV_PCM_FORMAT_S24_LE
:
294 case SNDRV_PCM_FORMAT_S32_LE
:
299 reg
= codec
->read(codec
, AD1938_DAC_CTRL2
);
300 reg
= (reg
& (~AD1938_DAC_WORD_LEN_MASK
)) | word_len
;
301 codec
->write(codec
, AD1938_DAC_CTRL2
, reg
);
303 reg
= codec
->read(codec
, AD1938_ADC_CTRL1
);
304 reg
= (reg
& (~AD1938_ADC_WORD_LEN_MASK
)) | word_len
;
305 codec
->write(codec
, AD1938_ADC_CTRL1
, reg
);
310 static int ad1938_set_bias_level(struct snd_soc_codec
*codec
,
311 enum snd_soc_bias_level level
)
314 case SND_SOC_BIAS_ON
:
315 ad1938_pll_powerctrl(codec
, 1);
317 case SND_SOC_BIAS_PREPARE
:
319 case SND_SOC_BIAS_STANDBY
:
320 case SND_SOC_BIAS_OFF
:
321 ad1938_pll_powerctrl(codec
, 0);
324 codec
->bias_level
= level
;
329 * interface to read/write ad1938 register
332 #define AD1938_SPI_ADDR 0x4
333 #define AD1938_SPI_READ 0x1
334 #define AD1938_SPI_BUFLEN 3
337 * write to the ad1938 register space
340 static int ad1938_write_reg(struct snd_soc_codec
*codec
, unsigned int reg
,
343 u8
*reg_cache
= codec
->reg_cache
;
346 if (value
!= reg_cache
[reg
]) {
347 uint8_t buf
[AD1938_SPI_BUFLEN
];
348 struct spi_transfer t
= {
350 .len
= AD1938_SPI_BUFLEN
,
352 struct spi_message m
;
354 buf
[0] = AD1938_SPI_ADDR
<< 1;
357 spi_message_init(&m
);
358 spi_message_add_tail(&t
, &m
);
359 ret
= spi_sync(codec
->control_data
, &m
);
361 reg_cache
[reg
] = value
;
368 * read from the ad1938 register space cache
371 static unsigned int ad1938_read_reg_cache(struct snd_soc_codec
*codec
,
374 u8
*reg_cache
= codec
->reg_cache
;
376 if (reg
>= codec
->reg_cache_size
)
379 return reg_cache
[reg
];
383 * read from the ad1938 register space
386 static unsigned int ad1938_read_reg(struct snd_soc_codec
*codec
,
389 char w_buf
[AD1938_SPI_BUFLEN
];
390 char r_buf
[AD1938_SPI_BUFLEN
];
393 struct spi_transfer t
= {
396 .len
= AD1938_SPI_BUFLEN
,
398 struct spi_message m
;
400 w_buf
[0] = (AD1938_SPI_ADDR
<< 1) | AD1938_SPI_READ
;
404 spi_message_init(&m
);
405 spi_message_add_tail(&t
, &m
);
406 ret
= spi_sync(codec
->control_data
, &m
);
413 static int ad1938_fill_cache(struct snd_soc_codec
*codec
)
416 u8
*reg_cache
= codec
->reg_cache
;
417 struct spi_device
*spi
= codec
->control_data
;
419 for (i
= 0; i
< codec
->reg_cache_size
; i
++) {
420 int ret
= ad1938_read_reg(codec
, i
);
422 dev_err(&spi
->dev
, "AD1938 SPI read failure\n");
431 static int __devinit
ad1938_spi_probe(struct spi_device
*spi
)
433 struct snd_soc_codec
*codec
;
434 struct ad1938_priv
*ad1938
;
436 ad1938
= kzalloc(sizeof(struct ad1938_priv
), GFP_KERNEL
);
440 codec
= &ad1938
->codec
;
441 codec
->control_data
= spi
;
442 codec
->dev
= &spi
->dev
;
444 dev_set_drvdata(&spi
->dev
, ad1938
);
446 return ad1938_register(ad1938
);
449 static int __devexit
ad1938_spi_remove(struct spi_device
*spi
)
451 struct ad1938_priv
*ad1938
= dev_get_drvdata(&spi
->dev
);
453 ad1938_unregister(ad1938
);
457 static struct spi_driver ad1938_spi_driver
= {
460 .bus
= &spi_bus_type
,
461 .owner
= THIS_MODULE
,
463 .probe
= ad1938_spi_probe
,
464 .remove
= __devexit_p(ad1938_spi_remove
),
467 static struct snd_soc_dai_ops ad1938_dai_ops
= {
468 .hw_params
= ad1938_hw_params
,
469 .digital_mute
= ad1938_mute
,
470 .set_tdm_slot
= ad1938_set_tdm_slot
,
471 .set_fmt
= ad1938_set_dai_fmt
,
474 /* codec DAI instance */
475 struct snd_soc_dai ad1938_dai
= {
478 .stream_name
= "Playback",
481 .rates
= SNDRV_PCM_RATE_48000
,
482 .formats
= SNDRV_PCM_FMTBIT_S32_LE
| SNDRV_PCM_FMTBIT_S16_LE
|
483 SNDRV_PCM_FMTBIT_S20_3LE
| SNDRV_PCM_FMTBIT_S24_LE
,
486 .stream_name
= "Capture",
489 .rates
= SNDRV_PCM_RATE_48000
,
490 .formats
= SNDRV_PCM_FMTBIT_S32_LE
| SNDRV_PCM_FMTBIT_S16_LE
|
491 SNDRV_PCM_FMTBIT_S20_3LE
| SNDRV_PCM_FMTBIT_S24_LE
,
493 .ops
= &ad1938_dai_ops
,
495 EXPORT_SYMBOL_GPL(ad1938_dai
);
497 static int ad1938_register(struct ad1938_priv
*ad1938
)
500 struct snd_soc_codec
*codec
= &ad1938
->codec
;
503 dev_err(codec
->dev
, "Another ad1938 is registered\n");
507 mutex_init(&codec
->mutex
);
508 INIT_LIST_HEAD(&codec
->dapm_widgets
);
509 INIT_LIST_HEAD(&codec
->dapm_paths
);
510 codec
->private_data
= ad1938
;
511 codec
->reg_cache
= ad1938
->reg_cache
;
512 codec
->reg_cache_size
= AD1938_NUM_REGS
;
513 codec
->name
= "AD1938";
514 codec
->owner
= THIS_MODULE
;
515 codec
->dai
= &ad1938_dai
;
517 codec
->write
= ad1938_write_reg
;
518 codec
->read
= ad1938_read_reg_cache
;
519 INIT_LIST_HEAD(&codec
->dapm_widgets
);
520 INIT_LIST_HEAD(&codec
->dapm_paths
);
522 ad1938_dai
.dev
= codec
->dev
;
523 ad1938_codec
= codec
;
525 /* default setting for ad1938 */
527 /* unmute dac channels */
528 codec
->write(codec
, AD1938_DAC_CHNL_MUTE
, 0x0);
529 /* de-emphasis: 48kHz, powedown dac */
530 codec
->write(codec
, AD1938_DAC_CTRL2
, 0x1A);
531 /* powerdown dac, dac in tdm mode */
532 codec
->write(codec
, AD1938_DAC_CTRL0
, 0x41);
533 /* high-pass filter enable */
534 codec
->write(codec
, AD1938_ADC_CTRL0
, 0x3);
535 /* sata delay=1, adc aux mode */
536 codec
->write(codec
, AD1938_ADC_CTRL1
, 0x43);
537 /* pll input: mclki/xi */
538 codec
->write(codec
, AD1938_PLL_CLK_CTRL0
, 0x9D);
539 codec
->write(codec
, AD1938_PLL_CLK_CTRL1
, 0x04);
541 ad1938_fill_cache(codec
);
543 ret
= snd_soc_register_codec(codec
);
545 dev_err(codec
->dev
, "Failed to register codec: %d\n", ret
);
550 ret
= snd_soc_register_dai(&ad1938_dai
);
552 dev_err(codec
->dev
, "Failed to register DAI: %d\n", ret
);
553 snd_soc_unregister_codec(codec
);
561 static void ad1938_unregister(struct ad1938_priv
*ad1938
)
563 ad1938_set_bias_level(&ad1938
->codec
, SND_SOC_BIAS_OFF
);
564 snd_soc_unregister_dai(&ad1938_dai
);
565 snd_soc_unregister_codec(&ad1938
->codec
);
570 static int ad1938_probe(struct platform_device
*pdev
)
572 struct snd_soc_device
*socdev
= platform_get_drvdata(pdev
);
573 struct snd_soc_codec
*codec
;
576 if (ad1938_codec
== NULL
) {
577 dev_err(&pdev
->dev
, "Codec device not registered\n");
581 socdev
->card
->codec
= ad1938_codec
;
582 codec
= ad1938_codec
;
585 ret
= snd_soc_new_pcms(socdev
, SNDRV_DEFAULT_IDX1
, SNDRV_DEFAULT_STR1
);
587 dev_err(codec
->dev
, "failed to create pcms: %d\n", ret
);
591 snd_soc_add_controls(codec
, ad1938_snd_controls
,
592 ARRAY_SIZE(ad1938_snd_controls
));
593 snd_soc_dapm_new_controls(codec
, ad1938_dapm_widgets
,
594 ARRAY_SIZE(ad1938_dapm_widgets
));
595 snd_soc_dapm_add_routes(codec
, audio_paths
, ARRAY_SIZE(audio_paths
));
596 snd_soc_dapm_new_widgets(codec
);
598 ad1938_set_bias_level(codec
, SND_SOC_BIAS_STANDBY
);
600 ret
= snd_soc_init_card(socdev
);
602 dev_err(codec
->dev
, "failed to register card: %d\n", ret
);
609 snd_soc_free_pcms(socdev
);
610 snd_soc_dapm_free(socdev
);
615 /* power down chip */
616 static int ad1938_remove(struct platform_device
*pdev
)
618 struct snd_soc_device
*socdev
= platform_get_drvdata(pdev
);
620 snd_soc_free_pcms(socdev
);
621 snd_soc_dapm_free(socdev
);
627 static int ad1938_suspend(struct platform_device
*pdev
,
630 struct snd_soc_device
*socdev
= platform_get_drvdata(pdev
);
631 struct snd_soc_codec
*codec
= socdev
->card
->codec
;
633 ad1938_set_bias_level(codec
, SND_SOC_BIAS_OFF
);
637 static int ad1938_resume(struct platform_device
*pdev
)
639 struct snd_soc_device
*socdev
= platform_get_drvdata(pdev
);
640 struct snd_soc_codec
*codec
= socdev
->card
->codec
;
642 if (codec
->suspend_bias_level
== SND_SOC_BIAS_ON
)
643 ad1938_set_bias_level(codec
, SND_SOC_BIAS_ON
);
648 #define ad1938_suspend NULL
649 #define ad1938_resume NULL
652 struct snd_soc_codec_device soc_codec_dev_ad1938
= {
653 .probe
= ad1938_probe
,
654 .remove
= ad1938_remove
,
655 .suspend
= ad1938_suspend
,
656 .resume
= ad1938_resume
,
658 EXPORT_SYMBOL_GPL(soc_codec_dev_ad1938
);
660 static int __init
ad1938_init(void)
664 ret
= spi_register_driver(&ad1938_spi_driver
);
666 printk(KERN_ERR
"Failed to register ad1938 SPI driver: %d\n",
672 module_init(ad1938_init
);
674 static void __exit
ad1938_exit(void)
676 spi_unregister_driver(&ad1938_spi_driver
);
678 module_exit(ad1938_exit
);
680 MODULE_DESCRIPTION("ASoC ad1938 driver");
681 MODULE_AUTHOR("Barry Song ");
682 MODULE_LICENSE("GPL");