wm8711.c 15 KB

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