2 * wm8731.c -- WM8731 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 <linux/spi/spi.h>
23 #include <sound/core.h>
24 #include <sound/pcm.h>
25 #include <sound/pcm_params.h>
26 #include <sound/soc.h>
27 #include <sound/soc-dapm.h>
28 #include <sound/initval.h>
29 #include <sound/tlv.h>
33 static struct snd_soc_codec
*wm8731_codec
;
34 struct snd_soc_codec_device soc_codec_dev_wm8731
;
36 /* codec private data */
38 struct snd_soc_codec codec
;
39 u16 reg_cache
[WM8731_CACHEREGNUM
];
45 * wm8731 register cache
46 * We can't read the WM8731 register space when we are
47 * using 2 wire for device control, so we cache them instead.
48 * There is no point in caching the reset register
50 static const u16 wm8731_reg
[WM8731_CACHEREGNUM
] = {
51 0x0097, 0x0097, 0x0079, 0x0079,
52 0x000a, 0x0008, 0x009f, 0x000a,
56 #define wm8731_reset(c) snd_soc_write(c, WM8731_RESET, 0)
58 static const char *wm8731_input_select
[] = {"Line In", "Mic"};
59 static const char *wm8731_deemph
[] = {"None", "32Khz", "44.1Khz", "48Khz"};
61 static const struct soc_enum wm8731_enum
[] = {
62 SOC_ENUM_SINGLE(WM8731_APANA
, 2, 2, wm8731_input_select
),
63 SOC_ENUM_SINGLE(WM8731_APDIGI
, 1, 4, wm8731_deemph
),
66 static const DECLARE_TLV_DB_SCALE(in_tlv
, -3450, 150, 0);
67 static const DECLARE_TLV_DB_SCALE(sidetone_tlv
, -1500, 300, 0);
68 static const DECLARE_TLV_DB_SCALE(out_tlv
, -12100, 100, 1);
70 static const struct snd_kcontrol_new wm8731_snd_controls
[] = {
72 SOC_DOUBLE_R_TLV("Master Playback Volume", WM8731_LOUT1V
, WM8731_ROUT1V
,
74 SOC_DOUBLE_R("Master Playback ZC Switch", WM8731_LOUT1V
, WM8731_ROUT1V
,
77 SOC_DOUBLE_R_TLV("Capture Volume", WM8731_LINVOL
, WM8731_RINVOL
, 0, 31, 0,
79 SOC_DOUBLE_R("Line Capture Switch", WM8731_LINVOL
, WM8731_RINVOL
, 7, 1, 1),
81 SOC_SINGLE("Mic Boost (+20dB)", WM8731_APANA
, 0, 1, 0),
82 SOC_SINGLE("Mic Capture Switch", WM8731_APANA
, 1, 1, 1),
84 SOC_SINGLE_TLV("Sidetone Playback Volume", WM8731_APANA
, 6, 3, 1,
87 SOC_SINGLE("ADC High Pass Filter Switch", WM8731_APDIGI
, 0, 1, 1),
88 SOC_SINGLE("Store DC Offset Switch", WM8731_APDIGI
, 4, 1, 0),
90 SOC_ENUM("Playback De-emphasis", wm8731_enum
[1]),
94 static const struct snd_kcontrol_new wm8731_output_mixer_controls
[] = {
95 SOC_DAPM_SINGLE("Line Bypass Switch", WM8731_APANA
, 3, 1, 0),
96 SOC_DAPM_SINGLE("Mic Sidetone Switch", WM8731_APANA
, 5, 1, 0),
97 SOC_DAPM_SINGLE("HiFi Playback Switch", WM8731_APANA
, 4, 1, 0),
101 static const struct snd_kcontrol_new wm8731_input_mux_controls
=
102 SOC_DAPM_ENUM("Input Select", wm8731_enum
[0]);
104 static const struct snd_soc_dapm_widget wm8731_dapm_widgets
[] = {
105 SND_SOC_DAPM_MIXER("Output Mixer", WM8731_PWR
, 4, 1,
106 &wm8731_output_mixer_controls
[0],
107 ARRAY_SIZE(wm8731_output_mixer_controls
)),
108 SND_SOC_DAPM_DAC("DAC", "HiFi Playback", WM8731_PWR
, 3, 1),
109 SND_SOC_DAPM_OUTPUT("LOUT"),
110 SND_SOC_DAPM_OUTPUT("LHPOUT"),
111 SND_SOC_DAPM_OUTPUT("ROUT"),
112 SND_SOC_DAPM_OUTPUT("RHPOUT"),
113 SND_SOC_DAPM_ADC("ADC", "HiFi Capture", WM8731_PWR
, 2, 1),
114 SND_SOC_DAPM_MUX("Input Mux", SND_SOC_NOPM
, 0, 0, &wm8731_input_mux_controls
),
115 SND_SOC_DAPM_PGA("Line Input", WM8731_PWR
, 0, 1, NULL
, 0),
116 SND_SOC_DAPM_MICBIAS("Mic Bias", WM8731_PWR
, 1, 1),
117 SND_SOC_DAPM_INPUT("MICIN"),
118 SND_SOC_DAPM_INPUT("RLINEIN"),
119 SND_SOC_DAPM_INPUT("LLINEIN"),
122 static const struct snd_soc_dapm_route intercon
[] = {
124 {"Output Mixer", "Line Bypass Switch", "Line Input"},
125 {"Output Mixer", "HiFi Playback Switch", "DAC"},
126 {"Output Mixer", "Mic Sidetone Switch", "Mic Bias"},
129 {"RHPOUT", NULL
, "Output Mixer"},
130 {"ROUT", NULL
, "Output Mixer"},
131 {"LHPOUT", NULL
, "Output Mixer"},
132 {"LOUT", NULL
, "Output Mixer"},
135 {"Input Mux", "Line In", "Line Input"},
136 {"Input Mux", "Mic", "Mic Bias"},
137 {"ADC", NULL
, "Input Mux"},
140 {"Line Input", NULL
, "LLINEIN"},
141 {"Line Input", NULL
, "RLINEIN"},
142 {"Mic Bias", NULL
, "MICIN"},
145 static int wm8731_add_widgets(struct snd_soc_codec
*codec
)
147 snd_soc_dapm_new_controls(codec
, wm8731_dapm_widgets
,
148 ARRAY_SIZE(wm8731_dapm_widgets
));
150 snd_soc_dapm_add_routes(codec
, intercon
, ARRAY_SIZE(intercon
));
152 snd_soc_dapm_new_widgets(codec
);
165 /* codec mclk clock divider coefficients */
166 static const struct _coeff_div coeff_div
[] = {
168 {12288000, 48000, 256, 0x0, 0x0, 0x0},
169 {18432000, 48000, 384, 0x0, 0x1, 0x0},
170 {12000000, 48000, 250, 0x0, 0x0, 0x1},
173 {12288000, 32000, 384, 0x6, 0x0, 0x0},
174 {18432000, 32000, 576, 0x6, 0x1, 0x0},
175 {12000000, 32000, 375, 0x6, 0x0, 0x1},
178 {12288000, 8000, 1536, 0x3, 0x0, 0x0},
179 {18432000, 8000, 2304, 0x3, 0x1, 0x0},
180 {11289600, 8000, 1408, 0xb, 0x0, 0x0},
181 {16934400, 8000, 2112, 0xb, 0x1, 0x0},
182 {12000000, 8000, 1500, 0x3, 0x0, 0x1},
185 {12288000, 96000, 128, 0x7, 0x0, 0x0},
186 {18432000, 96000, 192, 0x7, 0x1, 0x0},
187 {12000000, 96000, 125, 0x7, 0x0, 0x1},
190 {11289600, 44100, 256, 0x8, 0x0, 0x0},
191 {16934400, 44100, 384, 0x8, 0x1, 0x0},
192 {12000000, 44100, 272, 0x8, 0x1, 0x1},
195 {11289600, 88200, 128, 0xf, 0x0, 0x0},
196 {16934400, 88200, 192, 0xf, 0x1, 0x0},
197 {12000000, 88200, 136, 0xf, 0x1, 0x1},
200 static inline int get_coeff(int mclk
, int rate
)
204 for (i
= 0; i
< ARRAY_SIZE(coeff_div
); i
++) {
205 if (coeff_div
[i
].rate
== rate
&& coeff_div
[i
].mclk
== mclk
)
211 static int wm8731_hw_params(struct snd_pcm_substream
*substream
,
212 struct snd_pcm_hw_params
*params
,
213 struct snd_soc_dai
*dai
)
215 struct snd_soc_pcm_runtime
*rtd
= substream
->private_data
;
216 struct snd_soc_device
*socdev
= rtd
->socdev
;
217 struct snd_soc_codec
*codec
= socdev
->card
->codec
;
218 struct wm8731_priv
*wm8731
= codec
->private_data
;
219 u16 iface
= snd_soc_read(codec
, WM8731_IFACE
) & 0xfff3;
220 int i
= get_coeff(wm8731
->sysclk
, params_rate(params
));
221 u16 srate
= (coeff_div
[i
].sr
<< 2) |
222 (coeff_div
[i
].bosr
<< 1) | coeff_div
[i
].usb
;
224 snd_soc_write(codec
, WM8731_SRATE
, srate
);
227 switch (params_format(params
)) {
228 case SNDRV_PCM_FORMAT_S16_LE
:
230 case SNDRV_PCM_FORMAT_S20_3LE
:
233 case SNDRV_PCM_FORMAT_S24_LE
:
238 snd_soc_write(codec
, WM8731_IFACE
, iface
);
242 static int wm8731_pcm_prepare(struct snd_pcm_substream
*substream
,
243 struct snd_soc_dai
*dai
)
245 struct snd_soc_pcm_runtime
*rtd
= substream
->private_data
;
246 struct snd_soc_device
*socdev
= rtd
->socdev
;
247 struct snd_soc_codec
*codec
= socdev
->card
->codec
;
250 snd_soc_write(codec
, WM8731_ACTIVE
, 0x0001);
255 static void wm8731_shutdown(struct snd_pcm_substream
*substream
,
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
;
263 if (!codec
->active
) {
265 snd_soc_write(codec
, WM8731_ACTIVE
, 0x0);
269 static int wm8731_mute(struct snd_soc_dai
*dai
, int mute
)
271 struct snd_soc_codec
*codec
= dai
->codec
;
272 u16 mute_reg
= snd_soc_read(codec
, WM8731_APDIGI
) & 0xfff7;
275 snd_soc_write(codec
, WM8731_APDIGI
, mute_reg
| 0x8);
277 snd_soc_write(codec
, WM8731_APDIGI
, mute_reg
);
281 static int wm8731_set_dai_sysclk(struct snd_soc_dai
*codec_dai
,
282 int clk_id
, unsigned int freq
, int dir
)
284 struct snd_soc_codec
*codec
= codec_dai
->codec
;
285 struct wm8731_priv
*wm8731
= codec
->private_data
;
293 wm8731
->sysclk
= freq
;
300 static int wm8731_set_dai_fmt(struct snd_soc_dai
*codec_dai
,
303 struct snd_soc_codec
*codec
= codec_dai
->codec
;
306 /* set master/slave audio interface */
307 switch (fmt
& SND_SOC_DAIFMT_MASTER_MASK
) {
308 case SND_SOC_DAIFMT_CBM_CFM
:
311 case SND_SOC_DAIFMT_CBS_CFS
:
317 /* interface format */
318 switch (fmt
& SND_SOC_DAIFMT_FORMAT_MASK
) {
319 case SND_SOC_DAIFMT_I2S
:
322 case SND_SOC_DAIFMT_RIGHT_J
:
324 case SND_SOC_DAIFMT_LEFT_J
:
327 case SND_SOC_DAIFMT_DSP_A
:
330 case SND_SOC_DAIFMT_DSP_B
:
337 /* clock inversion */
338 switch (fmt
& SND_SOC_DAIFMT_INV_MASK
) {
339 case SND_SOC_DAIFMT_NB_NF
:
341 case SND_SOC_DAIFMT_IB_IF
:
344 case SND_SOC_DAIFMT_IB_NF
:
347 case SND_SOC_DAIFMT_NB_IF
:
355 snd_soc_write(codec
, WM8731_IFACE
, iface
);
359 static int wm8731_set_bias_level(struct snd_soc_codec
*codec
,
360 enum snd_soc_bias_level level
)
365 case SND_SOC_BIAS_ON
:
367 case SND_SOC_BIAS_PREPARE
:
369 case SND_SOC_BIAS_STANDBY
:
370 /* Clear PWROFF, gate CLKOUT, everything else as-is */
371 reg
= snd_soc_read(codec
, WM8731_PWR
) & 0xff7f;
372 snd_soc_write(codec
, WM8731_PWR
, reg
| 0x0040);
374 case SND_SOC_BIAS_OFF
:
375 snd_soc_write(codec
, WM8731_ACTIVE
, 0x0);
376 snd_soc_write(codec
, WM8731_PWR
, 0xffff);
379 codec
->bias_level
= level
;
383 #define WM8731_RATES (SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_11025 |\
384 SNDRV_PCM_RATE_16000 | SNDRV_PCM_RATE_22050 |\
385 SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 |\
386 SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_88200 |\
387 SNDRV_PCM_RATE_96000)
389 #define WM8731_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\
390 SNDRV_PCM_FMTBIT_S24_LE)
392 static struct snd_soc_dai_ops wm8731_dai_ops
= {
393 .prepare
= wm8731_pcm_prepare
,
394 .hw_params
= wm8731_hw_params
,
395 .shutdown
= wm8731_shutdown
,
396 .digital_mute
= wm8731_mute
,
397 .set_sysclk
= wm8731_set_dai_sysclk
,
398 .set_fmt
= wm8731_set_dai_fmt
,
401 struct snd_soc_dai wm8731_dai
= {
404 .stream_name
= "Playback",
407 .rates
= WM8731_RATES
,
408 .formats
= WM8731_FORMATS
,},
410 .stream_name
= "Capture",
413 .rates
= WM8731_RATES
,
414 .formats
= WM8731_FORMATS
,},
415 .ops
= &wm8731_dai_ops
,
416 .symmetric_rates
= 1,
418 EXPORT_SYMBOL_GPL(wm8731_dai
);
421 static int wm8731_suspend(struct platform_device
*pdev
, pm_message_t state
)
423 struct snd_soc_device
*socdev
= platform_get_drvdata(pdev
);
424 struct snd_soc_codec
*codec
= socdev
->card
->codec
;
426 snd_soc_write(codec
, WM8731_ACTIVE
, 0x0);
427 wm8731_set_bias_level(codec
, SND_SOC_BIAS_OFF
);
431 static int wm8731_resume(struct platform_device
*pdev
)
433 struct snd_soc_device
*socdev
= platform_get_drvdata(pdev
);
434 struct snd_soc_codec
*codec
= socdev
->card
->codec
;
437 u16
*cache
= codec
->reg_cache
;
439 /* Sync reg_cache with the hardware */
440 for (i
= 0; i
< ARRAY_SIZE(wm8731_reg
); i
++) {
441 data
[0] = (i
<< 1) | ((cache
[i
] >> 8) & 0x0001);
442 data
[1] = cache
[i
] & 0x00ff;
443 codec
->hw_write(codec
->control_data
, data
, 2);
445 wm8731_set_bias_level(codec
, SND_SOC_BIAS_STANDBY
);
446 wm8731_set_bias_level(codec
, codec
->suspend_bias_level
);
450 #define wm8731_suspend NULL
451 #define wm8731_resume NULL
454 static int wm8731_probe(struct platform_device
*pdev
)
456 struct snd_soc_device
*socdev
= platform_get_drvdata(pdev
);
457 struct snd_soc_codec
*codec
;
460 if (wm8731_codec
== NULL
) {
461 dev_err(&pdev
->dev
, "Codec device not registered\n");
465 socdev
->card
->codec
= wm8731_codec
;
466 codec
= wm8731_codec
;
469 ret
= snd_soc_new_pcms(socdev
, SNDRV_DEFAULT_IDX1
, SNDRV_DEFAULT_STR1
);
471 dev_err(codec
->dev
, "failed to create pcms: %d\n", ret
);
475 snd_soc_add_controls(codec
, wm8731_snd_controls
,
476 ARRAY_SIZE(wm8731_snd_controls
));
477 wm8731_add_widgets(codec
);
478 ret
= snd_soc_init_card(socdev
);
480 dev_err(codec
->dev
, "failed to register card: %d\n", ret
);
487 snd_soc_free_pcms(socdev
);
488 snd_soc_dapm_free(socdev
);
493 /* power down chip */
494 static int wm8731_remove(struct platform_device
*pdev
)
496 struct snd_soc_device
*socdev
= platform_get_drvdata(pdev
);
498 snd_soc_free_pcms(socdev
);
499 snd_soc_dapm_free(socdev
);
504 struct snd_soc_codec_device soc_codec_dev_wm8731
= {
505 .probe
= wm8731_probe
,
506 .remove
= wm8731_remove
,
507 .suspend
= wm8731_suspend
,
508 .resume
= wm8731_resume
,
510 EXPORT_SYMBOL_GPL(soc_codec_dev_wm8731
);
512 static int wm8731_register(struct wm8731_priv
*wm8731
,
513 enum snd_soc_control_type control
)
516 struct snd_soc_codec
*codec
= &wm8731
->codec
;
519 dev_err(codec
->dev
, "Another WM8731 is registered\n");
524 mutex_init(&codec
->mutex
);
525 INIT_LIST_HEAD(&codec
->dapm_widgets
);
526 INIT_LIST_HEAD(&codec
->dapm_paths
);
528 codec
->private_data
= wm8731
;
529 codec
->name
= "WM8731";
530 codec
->owner
= THIS_MODULE
;
531 codec
->bias_level
= SND_SOC_BIAS_OFF
;
532 codec
->set_bias_level
= wm8731_set_bias_level
;
533 codec
->dai
= &wm8731_dai
;
535 codec
->reg_cache_size
= WM8731_CACHEREGNUM
;
536 codec
->reg_cache
= &wm8731
->reg_cache
;
538 memcpy(codec
->reg_cache
, wm8731_reg
, sizeof(wm8731_reg
));
540 ret
= snd_soc_codec_set_cache_io(codec
, 7, 9, control
);
542 dev_err(codec
->dev
, "Failed to set cache I/O: %d\n", ret
);
546 ret
= wm8731_reset(codec
);
548 dev_err(codec
->dev
, "Failed to issue reset: %d\n", ret
);
552 wm8731_dai
.dev
= codec
->dev
;
554 wm8731_set_bias_level(codec
, SND_SOC_BIAS_STANDBY
);
556 /* Latch the update bits */
557 snd_soc_update_bits(codec
, WM8731_LOUT1V
, 0x100, 0);
558 snd_soc_update_bits(codec
, WM8731_ROUT1V
, 0x100, 0);
559 snd_soc_update_bits(codec
, WM8731_LINVOL
, 0x100, 0);
560 snd_soc_update_bits(codec
, WM8731_RINVOL
, 0x100, 0);
562 /* Disable bypass path by default */
563 snd_soc_update_bits(codec
, WM8731_APANA
, 0x4, 0);
565 wm8731_codec
= codec
;
567 ret
= snd_soc_register_codec(codec
);
569 dev_err(codec
->dev
, "Failed to register codec: %d\n", ret
);
573 ret
= snd_soc_register_dai(&wm8731_dai
);
575 dev_err(codec
->dev
, "Failed to register DAI: %d\n", ret
);
576 snd_soc_unregister_codec(codec
);
583 snd_soc_unregister_codec(codec
);
589 static void wm8731_unregister(struct wm8731_priv
*wm8731
)
591 wm8731_set_bias_level(&wm8731
->codec
, SND_SOC_BIAS_OFF
);
592 snd_soc_unregister_dai(&wm8731_dai
);
593 snd_soc_unregister_codec(&wm8731
->codec
);
598 #if defined(CONFIG_SPI_MASTER)
599 static int __devinit
wm8731_spi_probe(struct spi_device
*spi
)
601 struct snd_soc_codec
*codec
;
602 struct wm8731_priv
*wm8731
;
604 wm8731
= kzalloc(sizeof(struct wm8731_priv
), GFP_KERNEL
);
608 codec
= &wm8731
->codec
;
609 codec
->control_data
= spi
;
610 codec
->dev
= &spi
->dev
;
612 dev_set_drvdata(&spi
->dev
, wm8731
);
614 return wm8731_register(wm8731
, SND_SOC_SPI
);
617 static int __devexit
wm8731_spi_remove(struct spi_device
*spi
)
619 struct wm8731_priv
*wm8731
= dev_get_drvdata(&spi
->dev
);
621 wm8731_unregister(wm8731
);
627 static int wm8731_spi_suspend(struct spi_device
*spi
, pm_message_t msg
)
629 return snd_soc_suspend_device(&spi
->dev
);
632 static int wm8731_spi_resume(struct spi_device
*spi
)
634 return snd_soc_resume_device(&spi
->dev
);
637 #define wm8731_spi_suspend NULL
638 #define wm8731_spi_resume NULL
641 static struct spi_driver wm8731_spi_driver
= {
644 .bus
= &spi_bus_type
,
645 .owner
= THIS_MODULE
,
647 .probe
= wm8731_spi_probe
,
648 .suspend
= wm8731_spi_suspend
,
649 .resume
= wm8731_spi_resume
,
650 .remove
= __devexit_p(wm8731_spi_remove
),
652 #endif /* CONFIG_SPI_MASTER */
654 #if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
655 static __devinit
int wm8731_i2c_probe(struct i2c_client
*i2c
,
656 const struct i2c_device_id
*id
)
658 struct wm8731_priv
*wm8731
;
659 struct snd_soc_codec
*codec
;
661 wm8731
= kzalloc(sizeof(struct wm8731_priv
), GFP_KERNEL
);
665 codec
= &wm8731
->codec
;
667 i2c_set_clientdata(i2c
, wm8731
);
668 codec
->control_data
= i2c
;
670 codec
->dev
= &i2c
->dev
;
672 return wm8731_register(wm8731
, SND_SOC_I2C
);
675 static __devexit
int wm8731_i2c_remove(struct i2c_client
*client
)
677 struct wm8731_priv
*wm8731
= i2c_get_clientdata(client
);
678 wm8731_unregister(wm8731
);
683 static int wm8731_i2c_suspend(struct i2c_client
*i2c
, pm_message_t msg
)
685 return snd_soc_suspend_device(&i2c
->dev
);
688 static int wm8731_i2c_resume(struct i2c_client
*i2c
)
690 return snd_soc_resume_device(&i2c
->dev
);
693 #define wm8731_i2c_suspend NULL
694 #define wm8731_i2c_resume NULL
697 static const struct i2c_device_id wm8731_i2c_id
[] = {
701 MODULE_DEVICE_TABLE(i2c
, wm8731_i2c_id
);
703 static struct i2c_driver wm8731_i2c_driver
= {
705 .name
= "WM8731 I2C Codec",
706 .owner
= THIS_MODULE
,
708 .probe
= wm8731_i2c_probe
,
709 .remove
= __devexit_p(wm8731_i2c_remove
),
710 .suspend
= wm8731_i2c_suspend
,
711 .resume
= wm8731_i2c_resume
,
712 .id_table
= wm8731_i2c_id
,
716 static int __init
wm8731_modinit(void)
719 #if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
720 ret
= i2c_add_driver(&wm8731_i2c_driver
);
722 printk(KERN_ERR
"Failed to register WM8731 I2C driver: %d\n",
726 #if defined(CONFIG_SPI_MASTER)
727 ret
= spi_register_driver(&wm8731_spi_driver
);
729 printk(KERN_ERR
"Failed to register WM8731 SPI driver: %d\n",
735 module_init(wm8731_modinit
);
737 static void __exit
wm8731_exit(void)
739 #if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
740 i2c_del_driver(&wm8731_i2c_driver
);
742 #if defined(CONFIG_SPI_MASTER)
743 spi_unregister_driver(&wm8731_spi_driver
);
746 module_exit(wm8731_exit
);
748 MODULE_DESCRIPTION("ASoC WM8731 driver");
749 MODULE_AUTHOR("Richard Purdie");
750 MODULE_LICENSE("GPL");