wm8711.c 14 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 = snd_soc_codec_get_drvdata(codec);
  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 = snd_soc_codec_get_drvdata(codec);
  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. return 0;
  323. }
  324. static int wm8711_probe(struct platform_device *pdev)
  325. {
  326. struct snd_soc_device *socdev = platform_get_drvdata(pdev);
  327. struct snd_soc_codec *codec;
  328. int ret = 0;
  329. if (wm8711_codec == NULL) {
  330. dev_err(&pdev->dev, "Codec device not registered\n");
  331. return -ENODEV;
  332. }
  333. socdev->card->codec = wm8711_codec;
  334. codec = wm8711_codec;
  335. /* register pcms */
  336. ret = snd_soc_new_pcms(socdev, SNDRV_DEFAULT_IDX1, SNDRV_DEFAULT_STR1);
  337. if (ret < 0) {
  338. dev_err(codec->dev, "failed to create pcms: %d\n", ret);
  339. goto pcm_err;
  340. }
  341. snd_soc_add_controls(codec, wm8711_snd_controls,
  342. ARRAY_SIZE(wm8711_snd_controls));
  343. wm8711_add_widgets(codec);
  344. return ret;
  345. pcm_err:
  346. return ret;
  347. }
  348. /* power down chip */
  349. static int wm8711_remove(struct platform_device *pdev)
  350. {
  351. struct snd_soc_device *socdev = platform_get_drvdata(pdev);
  352. snd_soc_free_pcms(socdev);
  353. snd_soc_dapm_free(socdev);
  354. return 0;
  355. }
  356. struct snd_soc_codec_device soc_codec_dev_wm8711 = {
  357. .probe = wm8711_probe,
  358. .remove = wm8711_remove,
  359. .suspend = wm8711_suspend,
  360. .resume = wm8711_resume,
  361. };
  362. EXPORT_SYMBOL_GPL(soc_codec_dev_wm8711);
  363. static int wm8711_register(struct wm8711_priv *wm8711,
  364. enum snd_soc_control_type control)
  365. {
  366. int ret;
  367. struct snd_soc_codec *codec = &wm8711->codec;
  368. u16 reg;
  369. if (wm8711_codec) {
  370. dev_err(codec->dev, "Another WM8711 is registered\n");
  371. return -EINVAL;
  372. }
  373. mutex_init(&codec->mutex);
  374. INIT_LIST_HEAD(&codec->dapm_widgets);
  375. INIT_LIST_HEAD(&codec->dapm_paths);
  376. snd_soc_codec_set_drvdata(codec, wm8711);
  377. codec->name = "WM8711";
  378. codec->owner = THIS_MODULE;
  379. codec->bias_level = SND_SOC_BIAS_OFF;
  380. codec->set_bias_level = wm8711_set_bias_level;
  381. codec->dai = &wm8711_dai;
  382. codec->num_dai = 1;
  383. codec->reg_cache_size = WM8711_CACHEREGNUM;
  384. codec->reg_cache = &wm8711->reg_cache;
  385. memcpy(codec->reg_cache, wm8711_reg, sizeof(wm8711_reg));
  386. ret = snd_soc_codec_set_cache_io(codec, 7, 9, control);
  387. if (ret < 0) {
  388. dev_err(codec->dev, "Failed to set cache I/O: %d\n", ret);
  389. goto err;
  390. }
  391. ret = wm8711_reset(codec);
  392. if (ret < 0) {
  393. dev_err(codec->dev, "Failed to issue reset\n");
  394. goto err;
  395. }
  396. wm8711_dai.dev = codec->dev;
  397. wm8711_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
  398. /* Latch the update bits */
  399. reg = snd_soc_read(codec, WM8711_LOUT1V);
  400. snd_soc_write(codec, WM8711_LOUT1V, reg | 0x0100);
  401. reg = snd_soc_read(codec, WM8711_ROUT1V);
  402. snd_soc_write(codec, WM8711_ROUT1V, reg | 0x0100);
  403. wm8711_codec = codec;
  404. ret = snd_soc_register_codec(codec);
  405. if (ret != 0) {
  406. dev_err(codec->dev, "Failed to register codec: %d\n", ret);
  407. goto err;
  408. }
  409. ret = snd_soc_register_dai(&wm8711_dai);
  410. if (ret != 0) {
  411. dev_err(codec->dev, "Failed to register DAI: %d\n", ret);
  412. goto err_codec;
  413. }
  414. return 0;
  415. err_codec:
  416. snd_soc_unregister_codec(codec);
  417. err:
  418. kfree(wm8711);
  419. return ret;
  420. }
  421. static void wm8711_unregister(struct wm8711_priv *wm8711)
  422. {
  423. wm8711_set_bias_level(&wm8711->codec, SND_SOC_BIAS_OFF);
  424. snd_soc_unregister_dai(&wm8711_dai);
  425. snd_soc_unregister_codec(&wm8711->codec);
  426. kfree(wm8711);
  427. wm8711_codec = NULL;
  428. }
  429. #if defined(CONFIG_SPI_MASTER)
  430. static int __devinit wm8711_spi_probe(struct spi_device *spi)
  431. {
  432. struct snd_soc_codec *codec;
  433. struct wm8711_priv *wm8711;
  434. wm8711 = kzalloc(sizeof(struct wm8711_priv), GFP_KERNEL);
  435. if (wm8711 == NULL)
  436. return -ENOMEM;
  437. codec = &wm8711->codec;
  438. codec->control_data = spi;
  439. codec->dev = &spi->dev;
  440. dev_set_drvdata(&spi->dev, wm8711);
  441. return wm8711_register(wm8711, SND_SOC_SPI);
  442. }
  443. static int __devexit wm8711_spi_remove(struct spi_device *spi)
  444. {
  445. struct wm8711_priv *wm8711 = dev_get_drvdata(&spi->dev);
  446. wm8711_unregister(wm8711);
  447. return 0;
  448. }
  449. static struct spi_driver wm8711_spi_driver = {
  450. .driver = {
  451. .name = "wm8711",
  452. .bus = &spi_bus_type,
  453. .owner = THIS_MODULE,
  454. },
  455. .probe = wm8711_spi_probe,
  456. .remove = __devexit_p(wm8711_spi_remove),
  457. };
  458. #endif /* CONFIG_SPI_MASTER */
  459. #if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
  460. static __devinit int wm8711_i2c_probe(struct i2c_client *i2c,
  461. const struct i2c_device_id *id)
  462. {
  463. struct wm8711_priv *wm8711;
  464. struct snd_soc_codec *codec;
  465. wm8711 = kzalloc(sizeof(struct wm8711_priv), GFP_KERNEL);
  466. if (wm8711 == NULL)
  467. return -ENOMEM;
  468. codec = &wm8711->codec;
  469. codec->hw_write = (hw_write_t)i2c_master_send;
  470. i2c_set_clientdata(i2c, wm8711);
  471. codec->control_data = i2c;
  472. codec->dev = &i2c->dev;
  473. return wm8711_register(wm8711, SND_SOC_I2C);
  474. }
  475. static __devexit int wm8711_i2c_remove(struct i2c_client *client)
  476. {
  477. struct wm8711_priv *wm8711 = i2c_get_clientdata(client);
  478. wm8711_unregister(wm8711);
  479. return 0;
  480. }
  481. static const struct i2c_device_id wm8711_i2c_id[] = {
  482. { "wm8711", 0 },
  483. { }
  484. };
  485. MODULE_DEVICE_TABLE(i2c, wm8711_i2c_id);
  486. static struct i2c_driver wm8711_i2c_driver = {
  487. .driver = {
  488. .name = "WM8711 I2C Codec",
  489. .owner = THIS_MODULE,
  490. },
  491. .probe = wm8711_i2c_probe,
  492. .remove = __devexit_p(wm8711_i2c_remove),
  493. .id_table = wm8711_i2c_id,
  494. };
  495. #endif
  496. static int __init wm8711_modinit(void)
  497. {
  498. int ret;
  499. #if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
  500. ret = i2c_add_driver(&wm8711_i2c_driver);
  501. if (ret != 0) {
  502. printk(KERN_ERR "Failed to register WM8711 I2C driver: %d\n",
  503. ret);
  504. }
  505. #endif
  506. #if defined(CONFIG_SPI_MASTER)
  507. ret = spi_register_driver(&wm8711_spi_driver);
  508. if (ret != 0) {
  509. printk(KERN_ERR "Failed to register WM8711 SPI driver: %d\n",
  510. ret);
  511. }
  512. #endif
  513. return 0;
  514. }
  515. module_init(wm8711_modinit);
  516. static void __exit wm8711_exit(void)
  517. {
  518. #if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
  519. i2c_del_driver(&wm8711_i2c_driver);
  520. #endif
  521. #if defined(CONFIG_SPI_MASTER)
  522. spi_unregister_driver(&wm8711_spi_driver);
  523. #endif
  524. }
  525. module_exit(wm8711_exit);
  526. MODULE_DESCRIPTION("ASoC WM8711 driver");
  527. MODULE_AUTHOR("Mike Arthur");
  528. MODULE_LICENSE("GPL");