wm8711.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634
  1. /*
  2. * wm8711.c -- WM8711 ALSA SoC Audio driver
  3. *
  4. * Copyright 2006 Wolfson Microelectronics
  5. *
  6. * Author: Mike Arthur <linux@wolfsonmicro.com>
  7. *
  8. * Based on wm8731.c by Richard Purdie
  9. *
  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.
  13. */
  14. #include <linux/module.h>
  15. #include <linux/moduleparam.h>
  16. #include <linux/init.h>
  17. #include <linux/delay.h>
  18. #include <linux/pm.h>
  19. #include <linux/i2c.h>
  20. #include <linux/platform_device.h>
  21. #include <linux/spi/spi.h>
  22. #include <linux/slab.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/tlv.h>
  29. #include <sound/initval.h>
  30. #include "wm8711.h"
  31. static struct snd_soc_codec *wm8711_codec;
  32. /* codec private data */
  33. struct wm8711_priv {
  34. struct snd_soc_codec codec;
  35. u16 reg_cache[WM8711_CACHEREGNUM];
  36. unsigned int sysclk;
  37. };
  38. /*
  39. * wm8711 register cache
  40. * We can't read the WM8711 register space when we are
  41. * using 2 wire for device control, so we cache them instead.
  42. * There is no point in caching the reset register
  43. */
  44. static const u16 wm8711_reg[WM8711_CACHEREGNUM] = {
  45. 0x0079, 0x0079, 0x000a, 0x0008,
  46. 0x009f, 0x000a, 0x0000, 0x0000
  47. };
  48. #define wm8711_reset(c) snd_soc_write(c, WM8711_RESET, 0)
  49. static const DECLARE_TLV_DB_SCALE(out_tlv, -12100, 100, 1);
  50. static const struct snd_kcontrol_new wm8711_snd_controls[] = {
  51. SOC_DOUBLE_R_TLV("Master Playback Volume", WM8711_LOUT1V, WM8711_ROUT1V,
  52. 0, 127, 0, out_tlv),
  53. SOC_DOUBLE_R("Master Playback ZC Switch", WM8711_LOUT1V, WM8711_ROUT1V,
  54. 7, 1, 0),
  55. };
  56. /* Output Mixer */
  57. static const struct snd_kcontrol_new wm8711_output_mixer_controls[] = {
  58. SOC_DAPM_SINGLE("Line Bypass Switch", WM8711_APANA, 3, 1, 0),
  59. SOC_DAPM_SINGLE("HiFi Playback Switch", WM8711_APANA, 4, 1, 0),
  60. };
  61. static const struct snd_soc_dapm_widget wm8711_dapm_widgets[] = {
  62. SND_SOC_DAPM_MIXER("Output Mixer", WM8711_PWR, 4, 1,
  63. &wm8711_output_mixer_controls[0],
  64. ARRAY_SIZE(wm8711_output_mixer_controls)),
  65. SND_SOC_DAPM_DAC("DAC", "HiFi Playback", WM8711_PWR, 3, 1),
  66. SND_SOC_DAPM_OUTPUT("LOUT"),
  67. SND_SOC_DAPM_OUTPUT("LHPOUT"),
  68. SND_SOC_DAPM_OUTPUT("ROUT"),
  69. SND_SOC_DAPM_OUTPUT("RHPOUT"),
  70. };
  71. static const struct snd_soc_dapm_route intercon[] = {
  72. /* output mixer */
  73. {"Output Mixer", "Line Bypass Switch", "Line Input"},
  74. {"Output Mixer", "HiFi Playback Switch", "DAC"},
  75. /* outputs */
  76. {"RHPOUT", NULL, "Output Mixer"},
  77. {"ROUT", NULL, "Output Mixer"},
  78. {"LHPOUT", NULL, "Output Mixer"},
  79. {"LOUT", NULL, "Output Mixer"},
  80. };
  81. static int wm8711_add_widgets(struct snd_soc_codec *codec)
  82. {
  83. snd_soc_dapm_new_controls(codec, wm8711_dapm_widgets,
  84. ARRAY_SIZE(wm8711_dapm_widgets));
  85. snd_soc_dapm_add_routes(codec, intercon, ARRAY_SIZE(intercon));
  86. return 0;
  87. }
  88. struct _coeff_div {
  89. u32 mclk;
  90. u32 rate;
  91. u16 fs;
  92. u8 sr:4;
  93. u8 bosr:1;
  94. u8 usb:1;
  95. };
  96. /* codec mclk clock divider coefficients */
  97. static const struct _coeff_div coeff_div[] = {
  98. /* 48k */
  99. {12288000, 48000, 256, 0x0, 0x0, 0x0},
  100. {18432000, 48000, 384, 0x0, 0x1, 0x0},
  101. {12000000, 48000, 250, 0x0, 0x0, 0x1},
  102. /* 32k */
  103. {12288000, 32000, 384, 0x6, 0x0, 0x0},
  104. {18432000, 32000, 576, 0x6, 0x1, 0x0},
  105. {12000000, 32000, 375, 0x6, 0x0, 0x1},
  106. /* 8k */
  107. {12288000, 8000, 1536, 0x3, 0x0, 0x0},
  108. {18432000, 8000, 2304, 0x3, 0x1, 0x0},
  109. {11289600, 8000, 1408, 0xb, 0x0, 0x0},
  110. {16934400, 8000, 2112, 0xb, 0x1, 0x0},
  111. {12000000, 8000, 1500, 0x3, 0x0, 0x1},
  112. /* 96k */
  113. {12288000, 96000, 128, 0x7, 0x0, 0x0},
  114. {18432000, 96000, 192, 0x7, 0x1, 0x0},
  115. {12000000, 96000, 125, 0x7, 0x0, 0x1},
  116. /* 44.1k */
  117. {11289600, 44100, 256, 0x8, 0x0, 0x0},
  118. {16934400, 44100, 384, 0x8, 0x1, 0x0},
  119. {12000000, 44100, 272, 0x8, 0x1, 0x1},
  120. /* 88.2k */
  121. {11289600, 88200, 128, 0xf, 0x0, 0x0},
  122. {16934400, 88200, 192, 0xf, 0x1, 0x0},
  123. {12000000, 88200, 136, 0xf, 0x1, 0x1},
  124. };
  125. static inline int get_coeff(int mclk, int rate)
  126. {
  127. int i;
  128. for (i = 0; i < ARRAY_SIZE(coeff_div); i++) {
  129. if (coeff_div[i].rate == rate && coeff_div[i].mclk == mclk)
  130. return i;
  131. }
  132. return 0;
  133. }
  134. static int wm8711_hw_params(struct snd_pcm_substream *substream,
  135. struct snd_pcm_hw_params *params,
  136. struct snd_soc_dai *dai)
  137. {
  138. struct snd_soc_codec *codec = dai->codec;
  139. struct wm8711_priv *wm8711 = codec->private_data;
  140. u16 iface = snd_soc_read(codec, WM8711_IFACE) & 0xfffc;
  141. int i = get_coeff(wm8711->sysclk, params_rate(params));
  142. u16 srate = (coeff_div[i].sr << 2) |
  143. (coeff_div[i].bosr << 1) | coeff_div[i].usb;
  144. snd_soc_write(codec, WM8711_SRATE, srate);
  145. /* bit size */
  146. switch (params_format(params)) {
  147. case SNDRV_PCM_FORMAT_S16_LE:
  148. break;
  149. case SNDRV_PCM_FORMAT_S20_3LE:
  150. iface |= 0x0004;
  151. break;
  152. case SNDRV_PCM_FORMAT_S24_LE:
  153. iface |= 0x0008;
  154. break;
  155. }
  156. snd_soc_write(codec, WM8711_IFACE, iface);
  157. return 0;
  158. }
  159. static int wm8711_pcm_prepare(struct snd_pcm_substream *substream,
  160. struct snd_soc_dai *dai)
  161. {
  162. struct snd_soc_codec *codec = dai->codec;
  163. /* set active */
  164. snd_soc_write(codec, WM8711_ACTIVE, 0x0001);
  165. return 0;
  166. }
  167. static void wm8711_shutdown(struct snd_pcm_substream *substream,
  168. struct snd_soc_dai *dai)
  169. {
  170. struct snd_soc_codec *codec = dai->codec;
  171. /* deactivate */
  172. if (!codec->active) {
  173. udelay(50);
  174. snd_soc_write(codec, WM8711_ACTIVE, 0x0);
  175. }
  176. }
  177. static int wm8711_mute(struct snd_soc_dai *dai, int mute)
  178. {
  179. struct snd_soc_codec *codec = dai->codec;
  180. u16 mute_reg = snd_soc_read(codec, WM8711_APDIGI) & 0xfff7;
  181. if (mute)
  182. snd_soc_write(codec, WM8711_APDIGI, mute_reg | 0x8);
  183. else
  184. snd_soc_write(codec, WM8711_APDIGI, mute_reg);
  185. return 0;
  186. }
  187. static int wm8711_set_dai_sysclk(struct snd_soc_dai *codec_dai,
  188. int clk_id, unsigned int freq, int dir)
  189. {
  190. struct snd_soc_codec *codec = codec_dai->codec;
  191. struct wm8711_priv *wm8711 = codec->private_data;
  192. switch (freq) {
  193. case 11289600:
  194. case 12000000:
  195. case 12288000:
  196. case 16934400:
  197. case 18432000:
  198. wm8711->sysclk = freq;
  199. return 0;
  200. }
  201. return -EINVAL;
  202. }
  203. static int wm8711_set_dai_fmt(struct snd_soc_dai *codec_dai,
  204. unsigned int fmt)
  205. {
  206. struct snd_soc_codec *codec = codec_dai->codec;
  207. u16 iface = 0;
  208. /* set master/slave audio interface */
  209. switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) {
  210. case SND_SOC_DAIFMT_CBM_CFM:
  211. iface |= 0x0040;
  212. break;
  213. case SND_SOC_DAIFMT_CBS_CFS:
  214. break;
  215. default:
  216. return -EINVAL;
  217. }
  218. /* interface format */
  219. switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
  220. case SND_SOC_DAIFMT_I2S:
  221. iface |= 0x0002;
  222. break;
  223. case SND_SOC_DAIFMT_RIGHT_J:
  224. break;
  225. case SND_SOC_DAIFMT_LEFT_J:
  226. iface |= 0x0001;
  227. break;
  228. case SND_SOC_DAIFMT_DSP_A:
  229. iface |= 0x0003;
  230. break;
  231. case SND_SOC_DAIFMT_DSP_B:
  232. iface |= 0x0013;
  233. break;
  234. default:
  235. return -EINVAL;
  236. }
  237. /* clock inversion */
  238. switch (fmt & SND_SOC_DAIFMT_INV_MASK) {
  239. case SND_SOC_DAIFMT_NB_NF:
  240. break;
  241. case SND_SOC_DAIFMT_IB_IF:
  242. iface |= 0x0090;
  243. break;
  244. case SND_SOC_DAIFMT_IB_NF:
  245. iface |= 0x0080;
  246. break;
  247. case SND_SOC_DAIFMT_NB_IF:
  248. iface |= 0x0010;
  249. break;
  250. default:
  251. return -EINVAL;
  252. }
  253. /* set iface */
  254. snd_soc_write(codec, WM8711_IFACE, iface);
  255. return 0;
  256. }
  257. static int wm8711_set_bias_level(struct snd_soc_codec *codec,
  258. enum snd_soc_bias_level level)
  259. {
  260. u16 reg = snd_soc_read(codec, WM8711_PWR) & 0xff7f;
  261. switch (level) {
  262. case SND_SOC_BIAS_ON:
  263. snd_soc_write(codec, WM8711_PWR, reg);
  264. break;
  265. case SND_SOC_BIAS_PREPARE:
  266. break;
  267. case SND_SOC_BIAS_STANDBY:
  268. snd_soc_write(codec, WM8711_PWR, reg | 0x0040);
  269. break;
  270. case SND_SOC_BIAS_OFF:
  271. snd_soc_write(codec, WM8711_ACTIVE, 0x0);
  272. snd_soc_write(codec, WM8711_PWR, 0xffff);
  273. break;
  274. }
  275. codec->bias_level = level;
  276. return 0;
  277. }
  278. #define WM8711_RATES SNDRV_PCM_RATE_8000_96000
  279. #define WM8711_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\
  280. SNDRV_PCM_FMTBIT_S24_LE)
  281. static struct snd_soc_dai_ops wm8711_ops = {
  282. .prepare = wm8711_pcm_prepare,
  283. .hw_params = wm8711_hw_params,
  284. .shutdown = wm8711_shutdown,
  285. .digital_mute = wm8711_mute,
  286. .set_sysclk = wm8711_set_dai_sysclk,
  287. .set_fmt = wm8711_set_dai_fmt,
  288. };
  289. struct snd_soc_dai wm8711_dai = {
  290. .name = "WM8711",
  291. .playback = {
  292. .stream_name = "Playback",
  293. .channels_min = 1,
  294. .channels_max = 2,
  295. .rates = WM8711_RATES,
  296. .formats = WM8711_FORMATS,
  297. },
  298. .ops = &wm8711_ops,
  299. };
  300. EXPORT_SYMBOL_GPL(wm8711_dai);
  301. static int wm8711_suspend(struct platform_device *pdev, pm_message_t state)
  302. {
  303. struct snd_soc_device *socdev = platform_get_drvdata(pdev);
  304. struct snd_soc_codec *codec = socdev->card->codec;
  305. snd_soc_write(codec, WM8711_ACTIVE, 0x0);
  306. wm8711_set_bias_level(codec, SND_SOC_BIAS_OFF);
  307. return 0;
  308. }
  309. static int wm8711_resume(struct platform_device *pdev)
  310. {
  311. struct snd_soc_device *socdev = platform_get_drvdata(pdev);
  312. struct snd_soc_codec *codec = socdev->card->codec;
  313. int i;
  314. u8 data[2];
  315. u16 *cache = codec->reg_cache;
  316. /* Sync reg_cache with the hardware */
  317. for (i = 0; i < ARRAY_SIZE(wm8711_reg); i++) {
  318. data[0] = (i << 1) | ((cache[i] >> 8) & 0x0001);
  319. data[1] = cache[i] & 0x00ff;
  320. codec->hw_write(codec->control_data, data, 2);
  321. }
  322. wm8711_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
  323. wm8711_set_bias_level(codec, codec->suspend_bias_level);
  324. return 0;
  325. }
  326. static int wm8711_probe(struct platform_device *pdev)
  327. {
  328. struct snd_soc_device *socdev = platform_get_drvdata(pdev);
  329. struct snd_soc_codec *codec;
  330. int ret = 0;
  331. if (wm8711_codec == NULL) {
  332. dev_err(&pdev->dev, "Codec device not registered\n");
  333. return -ENODEV;
  334. }
  335. socdev->card->codec = wm8711_codec;
  336. codec = wm8711_codec;
  337. /* register pcms */
  338. ret = snd_soc_new_pcms(socdev, SNDRV_DEFAULT_IDX1, SNDRV_DEFAULT_STR1);
  339. if (ret < 0) {
  340. dev_err(codec->dev, "failed to create pcms: %d\n", ret);
  341. goto pcm_err;
  342. }
  343. snd_soc_add_controls(codec, wm8711_snd_controls,
  344. ARRAY_SIZE(wm8711_snd_controls));
  345. wm8711_add_widgets(codec);
  346. return ret;
  347. pcm_err:
  348. return ret;
  349. }
  350. /* power down chip */
  351. static int wm8711_remove(struct platform_device *pdev)
  352. {
  353. struct snd_soc_device *socdev = platform_get_drvdata(pdev);
  354. snd_soc_free_pcms(socdev);
  355. snd_soc_dapm_free(socdev);
  356. return 0;
  357. }
  358. struct snd_soc_codec_device soc_codec_dev_wm8711 = {
  359. .probe = wm8711_probe,
  360. .remove = wm8711_remove,
  361. .suspend = wm8711_suspend,
  362. .resume = wm8711_resume,
  363. };
  364. EXPORT_SYMBOL_GPL(soc_codec_dev_wm8711);
  365. static int wm8711_register(struct wm8711_priv *wm8711,
  366. enum snd_soc_control_type control)
  367. {
  368. int ret;
  369. struct snd_soc_codec *codec = &wm8711->codec;
  370. u16 reg;
  371. if (wm8711_codec) {
  372. dev_err(codec->dev, "Another WM8711 is registered\n");
  373. return -EINVAL;
  374. }
  375. mutex_init(&codec->mutex);
  376. INIT_LIST_HEAD(&codec->dapm_widgets);
  377. INIT_LIST_HEAD(&codec->dapm_paths);
  378. codec->private_data = wm8711;
  379. codec->name = "WM8711";
  380. codec->owner = THIS_MODULE;
  381. codec->bias_level = SND_SOC_BIAS_OFF;
  382. codec->set_bias_level = wm8711_set_bias_level;
  383. codec->dai = &wm8711_dai;
  384. codec->num_dai = 1;
  385. codec->reg_cache_size = WM8711_CACHEREGNUM;
  386. codec->reg_cache = &wm8711->reg_cache;
  387. memcpy(codec->reg_cache, wm8711_reg, sizeof(wm8711_reg));
  388. ret = snd_soc_codec_set_cache_io(codec, 7, 9, control);
  389. if (ret < 0) {
  390. dev_err(codec->dev, "Failed to set cache I/O: %d\n", ret);
  391. goto err;
  392. }
  393. ret = wm8711_reset(codec);
  394. if (ret < 0) {
  395. dev_err(codec->dev, "Failed to issue reset\n");
  396. goto err;
  397. }
  398. wm8711_dai.dev = codec->dev;
  399. wm8711_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
  400. /* Latch the update bits */
  401. reg = snd_soc_read(codec, WM8711_LOUT1V);
  402. snd_soc_write(codec, WM8711_LOUT1V, reg | 0x0100);
  403. reg = snd_soc_read(codec, WM8711_ROUT1V);
  404. snd_soc_write(codec, WM8711_ROUT1V, reg | 0x0100);
  405. wm8711_codec = codec;
  406. ret = snd_soc_register_codec(codec);
  407. if (ret != 0) {
  408. dev_err(codec->dev, "Failed to register codec: %d\n", ret);
  409. goto err;
  410. }
  411. ret = snd_soc_register_dai(&wm8711_dai);
  412. if (ret != 0) {
  413. dev_err(codec->dev, "Failed to register DAI: %d\n", ret);
  414. goto err_codec;
  415. }
  416. return 0;
  417. err_codec:
  418. snd_soc_unregister_codec(codec);
  419. err:
  420. kfree(wm8711);
  421. return ret;
  422. }
  423. static void wm8711_unregister(struct wm8711_priv *wm8711)
  424. {
  425. wm8711_set_bias_level(&wm8711->codec, SND_SOC_BIAS_OFF);
  426. snd_soc_unregister_dai(&wm8711_dai);
  427. snd_soc_unregister_codec(&wm8711->codec);
  428. kfree(wm8711);
  429. wm8711_codec = NULL;
  430. }
  431. #if defined(CONFIG_SPI_MASTER)
  432. static int __devinit wm8711_spi_probe(struct spi_device *spi)
  433. {
  434. struct snd_soc_codec *codec;
  435. struct wm8711_priv *wm8711;
  436. wm8711 = kzalloc(sizeof(struct wm8711_priv), GFP_KERNEL);
  437. if (wm8711 == NULL)
  438. return -ENOMEM;
  439. codec = &wm8711->codec;
  440. codec->control_data = spi;
  441. codec->dev = &spi->dev;
  442. dev_set_drvdata(&spi->dev, wm8711);
  443. return wm8711_register(wm8711, SND_SOC_SPI);
  444. }
  445. static int __devexit wm8711_spi_remove(struct spi_device *spi)
  446. {
  447. struct wm8711_priv *wm8711 = dev_get_drvdata(&spi->dev);
  448. wm8711_unregister(wm8711);
  449. return 0;
  450. }
  451. static struct spi_driver wm8711_spi_driver = {
  452. .driver = {
  453. .name = "wm8711",
  454. .bus = &spi_bus_type,
  455. .owner = THIS_MODULE,
  456. },
  457. .probe = wm8711_spi_probe,
  458. .remove = __devexit_p(wm8711_spi_remove),
  459. };
  460. #endif /* CONFIG_SPI_MASTER */
  461. #if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
  462. static __devinit int wm8711_i2c_probe(struct i2c_client *i2c,
  463. const struct i2c_device_id *id)
  464. {
  465. struct wm8711_priv *wm8711;
  466. struct snd_soc_codec *codec;
  467. wm8711 = kzalloc(sizeof(struct wm8711_priv), GFP_KERNEL);
  468. if (wm8711 == NULL)
  469. return -ENOMEM;
  470. codec = &wm8711->codec;
  471. codec->hw_write = (hw_write_t)i2c_master_send;
  472. i2c_set_clientdata(i2c, wm8711);
  473. codec->control_data = i2c;
  474. codec->dev = &i2c->dev;
  475. return wm8711_register(wm8711, SND_SOC_I2C);
  476. }
  477. static __devexit int wm8711_i2c_remove(struct i2c_client *client)
  478. {
  479. struct wm8711_priv *wm8711 = i2c_get_clientdata(client);
  480. wm8711_unregister(wm8711);
  481. return 0;
  482. }
  483. static const struct i2c_device_id wm8711_i2c_id[] = {
  484. { "wm8711", 0 },
  485. { }
  486. };
  487. MODULE_DEVICE_TABLE(i2c, wm8711_i2c_id);
  488. static struct i2c_driver wm8711_i2c_driver = {
  489. .driver = {
  490. .name = "WM8711 I2C Codec",
  491. .owner = THIS_MODULE,
  492. },
  493. .probe = wm8711_i2c_probe,
  494. .remove = __devexit_p(wm8711_i2c_remove),
  495. .id_table = wm8711_i2c_id,
  496. };
  497. #endif
  498. static int __init wm8711_modinit(void)
  499. {
  500. int ret;
  501. #if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
  502. ret = i2c_add_driver(&wm8711_i2c_driver);
  503. if (ret != 0) {
  504. printk(KERN_ERR "Failed to register WM8711 I2C driver: %d\n",
  505. ret);
  506. }
  507. #endif
  508. #if defined(CONFIG_SPI_MASTER)
  509. ret = spi_register_driver(&wm8711_spi_driver);
  510. if (ret != 0) {
  511. printk(KERN_ERR "Failed to register WM8711 SPI driver: %d\n",
  512. ret);
  513. }
  514. #endif
  515. return 0;
  516. }
  517. module_init(wm8711_modinit);
  518. static void __exit wm8711_exit(void)
  519. {
  520. #if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
  521. i2c_del_driver(&wm8711_i2c_driver);
  522. #endif
  523. #if defined(CONFIG_SPI_MASTER)
  524. spi_unregister_driver(&wm8711_spi_driver);
  525. #endif
  526. }
  527. module_exit(wm8711_exit);
  528. MODULE_DESCRIPTION("ASoC WM8711 driver");
  529. MODULE_AUTHOR("Mike Arthur");
  530. MODULE_LICENSE("GPL");