xref: /openbmc/linux/sound/soc/codecs/wm8728.c (revision 9fbad31a)
171cfc902SMark Brown /*
271cfc902SMark Brown  * wm8728.c  --  WM8728 ALSA SoC Audio driver
371cfc902SMark Brown  *
471cfc902SMark Brown  * Copyright 2008 Wolfson Microelectronics plc
571cfc902SMark Brown  *
671cfc902SMark Brown  * Author: Mark Brown <broonie@opensource.wolfsonmicro.com>
771cfc902SMark Brown  *
871cfc902SMark Brown  * This program is free software; you can redistribute it and/or modify
971cfc902SMark Brown  * it under the terms of the GNU General Public License version 2 as
1071cfc902SMark Brown  * published by the Free Software Foundation.
1171cfc902SMark Brown  */
1271cfc902SMark Brown 
1371cfc902SMark Brown #include <linux/module.h>
1471cfc902SMark Brown #include <linux/moduleparam.h>
1571cfc902SMark Brown #include <linux/init.h>
1671cfc902SMark Brown #include <linux/delay.h>
1771cfc902SMark Brown #include <linux/pm.h>
1871cfc902SMark Brown #include <linux/i2c.h>
1971cfc902SMark Brown #include <linux/platform_device.h>
20d16383efSMark Brown #include <linux/regmap.h>
2171cfc902SMark Brown #include <linux/spi/spi.h>
225a0e3ad6STejun Heo #include <linux/slab.h>
2345b4d043SMark Brown #include <linux/of_device.h>
2471cfc902SMark Brown #include <sound/core.h>
2571cfc902SMark Brown #include <sound/pcm.h>
2671cfc902SMark Brown #include <sound/pcm_params.h>
2771cfc902SMark Brown #include <sound/soc.h>
2871cfc902SMark Brown #include <sound/initval.h>
2971cfc902SMark Brown #include <sound/tlv.h>
3071cfc902SMark Brown 
3171cfc902SMark Brown #include "wm8728.h"
3271cfc902SMark Brown 
3371cfc902SMark Brown /*
3471cfc902SMark Brown  * We can't read the WM8728 register space so we cache them instead.
3571cfc902SMark Brown  * Note that the defaults here aren't the physical defaults, we latch
3671cfc902SMark Brown  * the volume update bits, mute the output and enable infinite zero
3771cfc902SMark Brown  * detect.
3871cfc902SMark Brown  */
39d16383efSMark Brown static const struct reg_default wm8728_reg_defaults[] = {
40d16383efSMark Brown 	{ 0, 0x1ff },
41d16383efSMark Brown 	{ 1, 0x1ff },
42d16383efSMark Brown 	{ 2, 0x001 },
43d16383efSMark Brown 	{ 3, 0x100 },
4471cfc902SMark Brown };
4571cfc902SMark Brown 
46f0fba2adSLiam Girdwood /* codec private data */
47f0fba2adSLiam Girdwood struct wm8728_priv {
48d16383efSMark Brown 	struct regmap *regmap;
49f0fba2adSLiam Girdwood };
50f0fba2adSLiam Girdwood 
5171cfc902SMark Brown static const DECLARE_TLV_DB_SCALE(wm8728_tlv, -12750, 50, 1);
5271cfc902SMark Brown 
5371cfc902SMark Brown static const struct snd_kcontrol_new wm8728_snd_controls[] = {
5471cfc902SMark Brown 
5571cfc902SMark Brown SOC_DOUBLE_R_TLV("Digital Playback Volume", WM8728_DACLVOL, WM8728_DACRVOL,
5671cfc902SMark Brown 		 0, 255, 0, wm8728_tlv),
5771cfc902SMark Brown 
5871cfc902SMark Brown SOC_SINGLE("Deemphasis", WM8728_DACCTL, 1, 1, 0),
5971cfc902SMark Brown };
6071cfc902SMark Brown 
6171cfc902SMark Brown /*
6271cfc902SMark Brown  * DAPM controls.
6371cfc902SMark Brown  */
6471cfc902SMark Brown static const struct snd_soc_dapm_widget wm8728_dapm_widgets[] = {
6571cfc902SMark Brown SND_SOC_DAPM_DAC("DAC", "HiFi Playback", SND_SOC_NOPM, 0, 0),
6671cfc902SMark Brown SND_SOC_DAPM_OUTPUT("VOUTL"),
6771cfc902SMark Brown SND_SOC_DAPM_OUTPUT("VOUTR"),
6871cfc902SMark Brown };
6971cfc902SMark Brown 
708428edf9SLu Guanqun static const struct snd_soc_dapm_route wm8728_intercon[] = {
7171cfc902SMark Brown 	{"VOUTL", NULL, "DAC"},
7271cfc902SMark Brown 	{"VOUTR", NULL, "DAC"},
7371cfc902SMark Brown };
7471cfc902SMark Brown 
7571cfc902SMark Brown static int wm8728_mute(struct snd_soc_dai *dai, int mute)
7671cfc902SMark Brown {
7771cfc902SMark Brown 	struct snd_soc_codec *codec = dai->codec;
7817a52fd6SMark Brown 	u16 mute_reg = snd_soc_read(codec, WM8728_DACCTL);
7971cfc902SMark Brown 
8071cfc902SMark Brown 	if (mute)
8117a52fd6SMark Brown 		snd_soc_write(codec, WM8728_DACCTL, mute_reg | 1);
8271cfc902SMark Brown 	else
8317a52fd6SMark Brown 		snd_soc_write(codec, WM8728_DACCTL, mute_reg & ~1);
8471cfc902SMark Brown 
8571cfc902SMark Brown 	return 0;
8671cfc902SMark Brown }
8771cfc902SMark Brown 
8871cfc902SMark Brown static int wm8728_hw_params(struct snd_pcm_substream *substream,
89dee89c4dSMark Brown 	struct snd_pcm_hw_params *params,
90dee89c4dSMark Brown 	struct snd_soc_dai *dai)
9171cfc902SMark Brown {
92e6968a17SMark Brown 	struct snd_soc_codec *codec = dai->codec;
9317a52fd6SMark Brown 	u16 dac = snd_soc_read(codec, WM8728_DACCTL);
9471cfc902SMark Brown 
9571cfc902SMark Brown 	dac &= ~0x18;
9671cfc902SMark Brown 
979fbad31aSMark Brown 	switch (params_width(params)) {
989fbad31aSMark Brown 	case 16:
9971cfc902SMark Brown 		break;
1009fbad31aSMark Brown 	case 20:
10171cfc902SMark Brown 		dac |= 0x10;
10271cfc902SMark Brown 		break;
1039fbad31aSMark Brown 	case 24:
10471cfc902SMark Brown 		dac |= 0x08;
10571cfc902SMark Brown 		break;
10671cfc902SMark Brown 	default:
10771cfc902SMark Brown 		return -EINVAL;
10871cfc902SMark Brown 	}
10971cfc902SMark Brown 
11017a52fd6SMark Brown 	snd_soc_write(codec, WM8728_DACCTL, dac);
11171cfc902SMark Brown 
11271cfc902SMark Brown 	return 0;
11371cfc902SMark Brown }
11471cfc902SMark Brown 
11571cfc902SMark Brown static int wm8728_set_dai_fmt(struct snd_soc_dai *codec_dai,
11671cfc902SMark Brown 		unsigned int fmt)
11771cfc902SMark Brown {
11871cfc902SMark Brown 	struct snd_soc_codec *codec = codec_dai->codec;
11917a52fd6SMark Brown 	u16 iface = snd_soc_read(codec, WM8728_IFCTL);
12071cfc902SMark Brown 
12171cfc902SMark Brown 	/* Currently only I2S is supported by the driver, though the
12271cfc902SMark Brown 	 * hardware is more flexible.
12371cfc902SMark Brown 	 */
12471cfc902SMark Brown 	switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
12571cfc902SMark Brown 	case SND_SOC_DAIFMT_I2S:
12671cfc902SMark Brown 		iface |= 1;
12771cfc902SMark Brown 		break;
12871cfc902SMark Brown 	default:
12971cfc902SMark Brown 		return -EINVAL;
13071cfc902SMark Brown 	}
13171cfc902SMark Brown 
13271cfc902SMark Brown 	/* The hardware only support full slave mode */
13371cfc902SMark Brown 	switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) {
13471cfc902SMark Brown 	case SND_SOC_DAIFMT_CBS_CFS:
13571cfc902SMark Brown 		break;
13671cfc902SMark Brown 	default:
13771cfc902SMark Brown 		return -EINVAL;
13871cfc902SMark Brown 	}
13971cfc902SMark Brown 
14071cfc902SMark Brown 	switch (fmt & SND_SOC_DAIFMT_INV_MASK) {
14171cfc902SMark Brown 	case SND_SOC_DAIFMT_NB_NF:
14271cfc902SMark Brown 		iface &= ~0x22;
14371cfc902SMark Brown 		break;
14471cfc902SMark Brown 	case SND_SOC_DAIFMT_IB_NF:
14571cfc902SMark Brown 		iface |=  0x20;
14671cfc902SMark Brown 		iface &= ~0x02;
14771cfc902SMark Brown 		break;
14871cfc902SMark Brown 	case SND_SOC_DAIFMT_NB_IF:
14971cfc902SMark Brown 		iface |= 0x02;
15071cfc902SMark Brown 		iface &= ~0x20;
15171cfc902SMark Brown 		break;
15271cfc902SMark Brown 	case SND_SOC_DAIFMT_IB_IF:
15371cfc902SMark Brown 		iface |= 0x22;
15471cfc902SMark Brown 		break;
15571cfc902SMark Brown 	default:
15671cfc902SMark Brown 		return -EINVAL;
15771cfc902SMark Brown 	}
15871cfc902SMark Brown 
15917a52fd6SMark Brown 	snd_soc_write(codec, WM8728_IFCTL, iface);
16071cfc902SMark Brown 	return 0;
16171cfc902SMark Brown }
16271cfc902SMark Brown 
16371cfc902SMark Brown static int wm8728_set_bias_level(struct snd_soc_codec *codec,
16471cfc902SMark Brown 				 enum snd_soc_bias_level level)
16571cfc902SMark Brown {
166d16383efSMark Brown 	struct wm8728_priv *wm8728 = snd_soc_codec_get_drvdata(codec);
16771cfc902SMark Brown 	u16 reg;
16871cfc902SMark Brown 
16971cfc902SMark Brown 	switch (level) {
17071cfc902SMark Brown 	case SND_SOC_BIAS_ON:
17171cfc902SMark Brown 	case SND_SOC_BIAS_PREPARE:
17271cfc902SMark Brown 	case SND_SOC_BIAS_STANDBY:
173ce6120ccSLiam Girdwood 		if (codec->dapm.bias_level == SND_SOC_BIAS_OFF) {
17471cfc902SMark Brown 			/* Power everything up... */
17517a52fd6SMark Brown 			reg = snd_soc_read(codec, WM8728_DACCTL);
17617a52fd6SMark Brown 			snd_soc_write(codec, WM8728_DACCTL, reg & ~0x4);
17771cfc902SMark Brown 
17871cfc902SMark Brown 			/* ..then sync in the register cache. */
179d16383efSMark Brown 			regcache_sync(wm8728->regmap);
18071cfc902SMark Brown 		}
18171cfc902SMark Brown 		break;
18271cfc902SMark Brown 
18371cfc902SMark Brown 	case SND_SOC_BIAS_OFF:
18417a52fd6SMark Brown 		reg = snd_soc_read(codec, WM8728_DACCTL);
18517a52fd6SMark Brown 		snd_soc_write(codec, WM8728_DACCTL, reg | 0x4);
18671cfc902SMark Brown 		break;
18771cfc902SMark Brown 	}
188ce6120ccSLiam Girdwood 	codec->dapm.bias_level = level;
18971cfc902SMark Brown 	return 0;
19071cfc902SMark Brown }
19171cfc902SMark Brown 
19271cfc902SMark Brown #define WM8728_RATES (SNDRV_PCM_RATE_8000_192000)
19371cfc902SMark Brown 
19471cfc902SMark Brown #define WM8728_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\
19571cfc902SMark Brown 	SNDRV_PCM_FMTBIT_S24_LE)
19671cfc902SMark Brown 
19785e7652dSLars-Peter Clausen static const struct snd_soc_dai_ops wm8728_dai_ops = {
1986335d055SEric Miao 	.hw_params	= wm8728_hw_params,
1996335d055SEric Miao 	.digital_mute	= wm8728_mute,
2006335d055SEric Miao 	.set_fmt	= wm8728_set_dai_fmt,
2016335d055SEric Miao };
2026335d055SEric Miao 
203f0fba2adSLiam Girdwood static struct snd_soc_dai_driver wm8728_dai = {
204f0fba2adSLiam Girdwood 	.name = "wm8728-hifi",
20571cfc902SMark Brown 	.playback = {
20671cfc902SMark Brown 		.stream_name = "Playback",
20771cfc902SMark Brown 		.channels_min = 2,
20871cfc902SMark Brown 		.channels_max = 2,
20971cfc902SMark Brown 		.rates = WM8728_RATES,
21071cfc902SMark Brown 		.formats = WM8728_FORMATS,
21171cfc902SMark Brown 	},
2126335d055SEric Miao 	.ops = &wm8728_dai_ops,
21371cfc902SMark Brown };
21471cfc902SMark Brown 
21584b315eeSLars-Peter Clausen static int wm8728_suspend(struct snd_soc_codec *codec)
21671cfc902SMark Brown {
21771cfc902SMark Brown 	wm8728_set_bias_level(codec, SND_SOC_BIAS_OFF);
21871cfc902SMark Brown 
21971cfc902SMark Brown 	return 0;
22071cfc902SMark Brown }
22171cfc902SMark Brown 
222f0fba2adSLiam Girdwood static int wm8728_resume(struct snd_soc_codec *codec)
22371cfc902SMark Brown {
22429e189c2SMark Brown 	wm8728_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
22571cfc902SMark Brown 
22671cfc902SMark Brown 	return 0;
22771cfc902SMark Brown }
22871cfc902SMark Brown 
229f0fba2adSLiam Girdwood static int wm8728_probe(struct snd_soc_codec *codec)
23071cfc902SMark Brown {
23171cfc902SMark Brown 	/* power on device */
23271cfc902SMark Brown 	wm8728_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
23371cfc902SMark Brown 
2345d6be5aaSXiubo Li 	return 0;
23571cfc902SMark Brown }
23671cfc902SMark Brown 
237f0fba2adSLiam Girdwood static int wm8728_remove(struct snd_soc_codec *codec)
23871cfc902SMark Brown {
239f0fba2adSLiam Girdwood 	wm8728_set_bias_level(codec, SND_SOC_BIAS_OFF);
240f0fba2adSLiam Girdwood 	return 0;
241f0fba2adSLiam Girdwood }
242f0fba2adSLiam Girdwood 
243f0fba2adSLiam Girdwood static struct snd_soc_codec_driver soc_codec_dev_wm8728 = {
244f0fba2adSLiam Girdwood 	.probe =	wm8728_probe,
245f0fba2adSLiam Girdwood 	.remove =	wm8728_remove,
246f0fba2adSLiam Girdwood 	.suspend =	wm8728_suspend,
247f0fba2adSLiam Girdwood 	.resume =	wm8728_resume,
248f0fba2adSLiam Girdwood 	.set_bias_level = wm8728_set_bias_level,
249e41d5a3bSMark Brown 	.controls = wm8728_snd_controls,
250e41d5a3bSMark Brown 	.num_controls = ARRAY_SIZE(wm8728_snd_controls),
2518428edf9SLu Guanqun 	.dapm_widgets = wm8728_dapm_widgets,
2528428edf9SLu Guanqun 	.num_dapm_widgets = ARRAY_SIZE(wm8728_dapm_widgets),
2538428edf9SLu Guanqun 	.dapm_routes = wm8728_intercon,
2548428edf9SLu Guanqun 	.num_dapm_routes = ARRAY_SIZE(wm8728_intercon),
255f0fba2adSLiam Girdwood };
256f0fba2adSLiam Girdwood 
25745b4d043SMark Brown static const struct of_device_id wm8728_of_match[] = {
25845b4d043SMark Brown 	{ .compatible = "wlf,wm8728", },
25945b4d043SMark Brown 	{ }
26045b4d043SMark Brown };
26145b4d043SMark Brown MODULE_DEVICE_TABLE(of, wm8728_of_match);
26245b4d043SMark Brown 
263d16383efSMark Brown static const struct regmap_config wm8728_regmap = {
264d16383efSMark Brown 	.reg_bits = 7,
265d16383efSMark Brown 	.val_bits = 9,
266d16383efSMark Brown 	.max_register = WM8728_IFCTL,
267d16383efSMark Brown 
268d16383efSMark Brown 	.reg_defaults = wm8728_reg_defaults,
269d16383efSMark Brown 	.num_reg_defaults = ARRAY_SIZE(wm8728_reg_defaults),
270d16383efSMark Brown 	.cache_type = REGCACHE_RBTREE,
271d16383efSMark Brown };
272d16383efSMark Brown 
273f0fba2adSLiam Girdwood #if defined(CONFIG_SPI_MASTER)
2747a79e94eSBill Pemberton static int wm8728_spi_probe(struct spi_device *spi)
275f0fba2adSLiam Girdwood {
276f0fba2adSLiam Girdwood 	struct wm8728_priv *wm8728;
27771cfc902SMark Brown 	int ret;
27871cfc902SMark Brown 
2791a9585b0SMark Brown 	wm8728 = devm_kzalloc(&spi->dev, sizeof(struct wm8728_priv),
2801a9585b0SMark Brown 			      GFP_KERNEL);
281f0fba2adSLiam Girdwood 	if (wm8728 == NULL)
282f0fba2adSLiam Girdwood 		return -ENOMEM;
28371cfc902SMark Brown 
284d16383efSMark Brown 	wm8728->regmap = devm_regmap_init_spi(spi, &wm8728_regmap);
285d16383efSMark Brown 	if (IS_ERR(wm8728->regmap))
286d16383efSMark Brown 		return PTR_ERR(wm8728->regmap);
287d16383efSMark Brown 
288f0fba2adSLiam Girdwood 	spi_set_drvdata(spi, wm8728);
289f0fba2adSLiam Girdwood 
290f0fba2adSLiam Girdwood 	ret = snd_soc_register_codec(&spi->dev,
291f0fba2adSLiam Girdwood 			&soc_codec_dev_wm8728, &wm8728_dai, 1);
2921a9585b0SMark Brown 
29371cfc902SMark Brown 	return ret;
29471cfc902SMark Brown }
29571cfc902SMark Brown 
2967a79e94eSBill Pemberton static int wm8728_spi_remove(struct spi_device *spi)
29771cfc902SMark Brown {
298f0fba2adSLiam Girdwood 	snd_soc_unregister_codec(&spi->dev);
2991a9585b0SMark Brown 
300f0fba2adSLiam Girdwood 	return 0;
301f0fba2adSLiam Girdwood }
302f0fba2adSLiam Girdwood 
303f0fba2adSLiam Girdwood static struct spi_driver wm8728_spi_driver = {
304f0fba2adSLiam Girdwood 	.driver = {
3050473e61bSMark Brown 		.name	= "wm8728",
306f0fba2adSLiam Girdwood 		.owner	= THIS_MODULE,
30745b4d043SMark Brown 		.of_match_table = wm8728_of_match,
308f0fba2adSLiam Girdwood 	},
309f0fba2adSLiam Girdwood 	.probe		= wm8728_spi_probe,
3107a79e94eSBill Pemberton 	.remove		= wm8728_spi_remove,
311f0fba2adSLiam Girdwood };
312f0fba2adSLiam Girdwood #endif /* CONFIG_SPI_MASTER */
313f0fba2adSLiam Girdwood 
3145c153716SFabio Estevam #if IS_ENABLED(CONFIG_I2C)
3157a79e94eSBill Pemberton static int wm8728_i2c_probe(struct i2c_client *i2c,
316f0fba2adSLiam Girdwood 			    const struct i2c_device_id *id)
317f0fba2adSLiam Girdwood {
318f0fba2adSLiam Girdwood 	struct wm8728_priv *wm8728;
319f0fba2adSLiam Girdwood 	int ret;
320f0fba2adSLiam Girdwood 
3211a9585b0SMark Brown 	wm8728 = devm_kzalloc(&i2c->dev, sizeof(struct wm8728_priv),
3221a9585b0SMark Brown 			      GFP_KERNEL);
323f0fba2adSLiam Girdwood 	if (wm8728 == NULL)
324f0fba2adSLiam Girdwood 		return -ENOMEM;
325f0fba2adSLiam Girdwood 
326d16383efSMark Brown 	wm8728->regmap = devm_regmap_init_i2c(i2c, &wm8728_regmap);
327d16383efSMark Brown 	if (IS_ERR(wm8728->regmap))
328d16383efSMark Brown 		return PTR_ERR(wm8728->regmap);
329d16383efSMark Brown 
330f0fba2adSLiam Girdwood 	i2c_set_clientdata(i2c, wm8728);
331f0fba2adSLiam Girdwood 
332f0fba2adSLiam Girdwood 	ret =  snd_soc_register_codec(&i2c->dev,
333f0fba2adSLiam Girdwood 			&soc_codec_dev_wm8728, &wm8728_dai, 1);
3341a9585b0SMark Brown 
335f0fba2adSLiam Girdwood 	return ret;
336f0fba2adSLiam Girdwood }
337f0fba2adSLiam Girdwood 
3387a79e94eSBill Pemberton static int wm8728_i2c_remove(struct i2c_client *client)
339f0fba2adSLiam Girdwood {
340f0fba2adSLiam Girdwood 	snd_soc_unregister_codec(&client->dev);
34171cfc902SMark Brown 	return 0;
34271cfc902SMark Brown }
34371cfc902SMark Brown 
34471cfc902SMark Brown static const struct i2c_device_id wm8728_i2c_id[] = {
34571cfc902SMark Brown 	{ "wm8728", 0 },
34671cfc902SMark Brown 	{ }
34771cfc902SMark Brown };
34871cfc902SMark Brown MODULE_DEVICE_TABLE(i2c, wm8728_i2c_id);
34971cfc902SMark Brown 
35071cfc902SMark Brown static struct i2c_driver wm8728_i2c_driver = {
35171cfc902SMark Brown 	.driver = {
3520473e61bSMark Brown 		.name = "wm8728",
35371cfc902SMark Brown 		.owner = THIS_MODULE,
35445b4d043SMark Brown 		.of_match_table = wm8728_of_match,
35571cfc902SMark Brown 	},
35671cfc902SMark Brown 	.probe =    wm8728_i2c_probe,
3577a79e94eSBill Pemberton 	.remove =   wm8728_i2c_remove,
35871cfc902SMark Brown 	.id_table = wm8728_i2c_id,
35971cfc902SMark Brown };
36071cfc902SMark Brown #endif
36171cfc902SMark Brown 
362c9b3a40fSTakashi Iwai static int __init wm8728_modinit(void)
36364089b84SMark Brown {
364f0fba2adSLiam Girdwood 	int ret = 0;
3655c153716SFabio Estevam #if IS_ENABLED(CONFIG_I2C)
366f0fba2adSLiam Girdwood 	ret = i2c_add_driver(&wm8728_i2c_driver);
367f0fba2adSLiam Girdwood 	if (ret != 0) {
368f0fba2adSLiam Girdwood 		printk(KERN_ERR "Failed to register wm8728 I2C driver: %d\n",
369f0fba2adSLiam Girdwood 		       ret);
370f0fba2adSLiam Girdwood 	}
371f0fba2adSLiam Girdwood #endif
372f0fba2adSLiam Girdwood #if defined(CONFIG_SPI_MASTER)
373f0fba2adSLiam Girdwood 	ret = spi_register_driver(&wm8728_spi_driver);
374f0fba2adSLiam Girdwood 	if (ret != 0) {
375f0fba2adSLiam Girdwood 		printk(KERN_ERR "Failed to register wm8728 SPI driver: %d\n",
376f0fba2adSLiam Girdwood 		       ret);
377f0fba2adSLiam Girdwood 	}
378f0fba2adSLiam Girdwood #endif
379f0fba2adSLiam Girdwood 	return ret;
38064089b84SMark Brown }
38164089b84SMark Brown module_init(wm8728_modinit);
38264089b84SMark Brown 
38364089b84SMark Brown static void __exit wm8728_exit(void)
38464089b84SMark Brown {
3855c153716SFabio Estevam #if IS_ENABLED(CONFIG_I2C)
386f0fba2adSLiam Girdwood 	i2c_del_driver(&wm8728_i2c_driver);
387f0fba2adSLiam Girdwood #endif
388f0fba2adSLiam Girdwood #if defined(CONFIG_SPI_MASTER)
389f0fba2adSLiam Girdwood 	spi_unregister_driver(&wm8728_spi_driver);
390f0fba2adSLiam Girdwood #endif
39164089b84SMark Brown }
39264089b84SMark Brown module_exit(wm8728_exit);
39364089b84SMark Brown 
39471cfc902SMark Brown MODULE_DESCRIPTION("ASoC WM8728 driver");
39571cfc902SMark Brown MODULE_AUTHOR("Mark Brown <broonie@opensource.wolfsonmicro.com>");
39671cfc902SMark Brown MODULE_LICENSE("GPL");
397