wm8994-core.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694
  1. /*
  2. * wm8994-core.c -- Device access for Wolfson WM8994
  3. *
  4. * Copyright 2009 Wolfson Microelectronics PLC.
  5. *
  6. * Author: Mark Brown <broonie@opensource.wolfsonmicro.com>
  7. *
  8. * This program is free software; you can redistribute it and/or modify it
  9. * under the terms of the GNU General Public License as published by the
  10. * Free Software Foundation; either version 2 of the License, or (at your
  11. * option) any later version.
  12. *
  13. */
  14. #include <linux/kernel.h>
  15. #include <linux/module.h>
  16. #include <linux/slab.h>
  17. #include <linux/i2c.h>
  18. #include <linux/delay.h>
  19. #include <linux/mfd/core.h>
  20. #include <linux/pm_runtime.h>
  21. #include <linux/regulator/consumer.h>
  22. #include <linux/regulator/machine.h>
  23. #include <linux/mfd/wm8994/core.h>
  24. #include <linux/mfd/wm8994/pdata.h>
  25. #include <linux/mfd/wm8994/registers.h>
  26. static int wm8994_read(struct wm8994 *wm8994, unsigned short reg,
  27. int bytes, void *dest)
  28. {
  29. int ret, i;
  30. u16 *buf = dest;
  31. BUG_ON(bytes % 2);
  32. BUG_ON(bytes <= 0);
  33. ret = wm8994->read_dev(wm8994, reg, bytes, dest);
  34. if (ret < 0)
  35. return ret;
  36. for (i = 0; i < bytes / 2; i++) {
  37. dev_vdbg(wm8994->dev, "Read %04x from R%d(0x%x)\n",
  38. be16_to_cpu(buf[i]), reg + i, reg + i);
  39. }
  40. return 0;
  41. }
  42. /**
  43. * wm8994_reg_read: Read a single WM8994 register.
  44. *
  45. * @wm8994: Device to read from.
  46. * @reg: Register to read.
  47. */
  48. int wm8994_reg_read(struct wm8994 *wm8994, unsigned short reg)
  49. {
  50. unsigned short val;
  51. int ret;
  52. mutex_lock(&wm8994->io_lock);
  53. ret = wm8994_read(wm8994, reg, 2, &val);
  54. mutex_unlock(&wm8994->io_lock);
  55. if (ret < 0)
  56. return ret;
  57. else
  58. return be16_to_cpu(val);
  59. }
  60. EXPORT_SYMBOL_GPL(wm8994_reg_read);
  61. /**
  62. * wm8994_bulk_read: Read multiple WM8994 registers
  63. *
  64. * @wm8994: Device to read from
  65. * @reg: First register
  66. * @count: Number of registers
  67. * @buf: Buffer to fill. The data will be returned big endian.
  68. */
  69. int wm8994_bulk_read(struct wm8994 *wm8994, unsigned short reg,
  70. int count, u16 *buf)
  71. {
  72. int ret;
  73. mutex_lock(&wm8994->io_lock);
  74. ret = wm8994_read(wm8994, reg, count * 2, buf);
  75. mutex_unlock(&wm8994->io_lock);
  76. return ret;
  77. }
  78. EXPORT_SYMBOL_GPL(wm8994_bulk_read);
  79. static int wm8994_write(struct wm8994 *wm8994, unsigned short reg,
  80. int bytes, const void *src)
  81. {
  82. const u16 *buf = src;
  83. int i;
  84. BUG_ON(bytes % 2);
  85. BUG_ON(bytes <= 0);
  86. for (i = 0; i < bytes / 2; i++) {
  87. dev_vdbg(wm8994->dev, "Write %04x to R%d(0x%x)\n",
  88. be16_to_cpu(buf[i]), reg + i, reg + i);
  89. }
  90. return wm8994->write_dev(wm8994, reg, bytes, src);
  91. }
  92. /**
  93. * wm8994_reg_write: Write a single WM8994 register.
  94. *
  95. * @wm8994: Device to write to.
  96. * @reg: Register to write to.
  97. * @val: Value to write.
  98. */
  99. int wm8994_reg_write(struct wm8994 *wm8994, unsigned short reg,
  100. unsigned short val)
  101. {
  102. int ret;
  103. val = cpu_to_be16(val);
  104. mutex_lock(&wm8994->io_lock);
  105. ret = wm8994_write(wm8994, reg, 2, &val);
  106. mutex_unlock(&wm8994->io_lock);
  107. return ret;
  108. }
  109. EXPORT_SYMBOL_GPL(wm8994_reg_write);
  110. /**
  111. * wm8994_bulk_write: Write multiple WM8994 registers
  112. *
  113. * @wm8994: Device to write to
  114. * @reg: First register
  115. * @count: Number of registers
  116. * @buf: Buffer to write from. Data must be big-endian formatted.
  117. */
  118. int wm8994_bulk_write(struct wm8994 *wm8994, unsigned short reg,
  119. int count, const u16 *buf)
  120. {
  121. int ret;
  122. mutex_lock(&wm8994->io_lock);
  123. ret = wm8994_write(wm8994, reg, count * 2, buf);
  124. mutex_unlock(&wm8994->io_lock);
  125. return ret;
  126. }
  127. EXPORT_SYMBOL_GPL(wm8994_bulk_write);
  128. /**
  129. * wm8994_set_bits: Set the value of a bitfield in a WM8994 register
  130. *
  131. * @wm8994: Device to write to.
  132. * @reg: Register to write to.
  133. * @mask: Mask of bits to set.
  134. * @val: Value to set (unshifted)
  135. */
  136. int wm8994_set_bits(struct wm8994 *wm8994, unsigned short reg,
  137. unsigned short mask, unsigned short val)
  138. {
  139. int ret;
  140. u16 r;
  141. mutex_lock(&wm8994->io_lock);
  142. ret = wm8994_read(wm8994, reg, 2, &r);
  143. if (ret < 0)
  144. goto out;
  145. r = be16_to_cpu(r);
  146. r &= ~mask;
  147. r |= val;
  148. r = cpu_to_be16(r);
  149. ret = wm8994_write(wm8994, reg, 2, &r);
  150. out:
  151. mutex_unlock(&wm8994->io_lock);
  152. return ret;
  153. }
  154. EXPORT_SYMBOL_GPL(wm8994_set_bits);
  155. static struct mfd_cell wm8994_regulator_devs[] = {
  156. {
  157. .name = "wm8994-ldo",
  158. .id = 1,
  159. .pm_runtime_no_callbacks = true,
  160. },
  161. {
  162. .name = "wm8994-ldo",
  163. .id = 2,
  164. .pm_runtime_no_callbacks = true,
  165. },
  166. };
  167. static struct resource wm8994_codec_resources[] = {
  168. {
  169. .start = WM8994_IRQ_TEMP_SHUT,
  170. .end = WM8994_IRQ_TEMP_WARN,
  171. .flags = IORESOURCE_IRQ,
  172. },
  173. };
  174. static struct resource wm8994_gpio_resources[] = {
  175. {
  176. .start = WM8994_IRQ_GPIO(1),
  177. .end = WM8994_IRQ_GPIO(11),
  178. .flags = IORESOURCE_IRQ,
  179. },
  180. };
  181. static struct mfd_cell wm8994_devs[] = {
  182. {
  183. .name = "wm8994-codec",
  184. .num_resources = ARRAY_SIZE(wm8994_codec_resources),
  185. .resources = wm8994_codec_resources,
  186. },
  187. {
  188. .name = "wm8994-gpio",
  189. .num_resources = ARRAY_SIZE(wm8994_gpio_resources),
  190. .resources = wm8994_gpio_resources,
  191. .pm_runtime_no_callbacks = true,
  192. },
  193. };
  194. /*
  195. * Supplies for the main bulk of CODEC; the LDO supplies are ignored
  196. * and should be handled via the standard regulator API supply
  197. * management.
  198. */
  199. static const char *wm8994_main_supplies[] = {
  200. "DBVDD",
  201. "DCVDD",
  202. "AVDD1",
  203. "AVDD2",
  204. "CPVDD",
  205. "SPKVDD1",
  206. "SPKVDD2",
  207. };
  208. static const char *wm8958_main_supplies[] = {
  209. "DBVDD1",
  210. "DBVDD2",
  211. "DBVDD3",
  212. "DCVDD",
  213. "AVDD1",
  214. "AVDD2",
  215. "CPVDD",
  216. "SPKVDD1",
  217. "SPKVDD2",
  218. };
  219. #ifdef CONFIG_PM
  220. static int wm8994_suspend(struct device *dev)
  221. {
  222. struct wm8994 *wm8994 = dev_get_drvdata(dev);
  223. int ret;
  224. /* Don't actually go through with the suspend if the CODEC is
  225. * still active (eg, for audio passthrough from CP. */
  226. ret = wm8994_reg_read(wm8994, WM8994_POWER_MANAGEMENT_1);
  227. if (ret < 0) {
  228. dev_err(dev, "Failed to read power status: %d\n", ret);
  229. } else if (ret & WM8994_VMID_SEL_MASK) {
  230. dev_dbg(dev, "CODEC still active, ignoring suspend\n");
  231. return 0;
  232. }
  233. /* GPIO configuration state is saved here since we may be configuring
  234. * the GPIO alternate functions even if we're not using the gpiolib
  235. * driver for them.
  236. */
  237. ret = wm8994_read(wm8994, WM8994_GPIO_1, WM8994_NUM_GPIO_REGS * 2,
  238. &wm8994->gpio_regs);
  239. if (ret < 0)
  240. dev_err(dev, "Failed to save GPIO registers: %d\n", ret);
  241. /* For similar reasons we also stash the regulator states */
  242. ret = wm8994_read(wm8994, WM8994_LDO_1, WM8994_NUM_LDO_REGS * 2,
  243. &wm8994->ldo_regs);
  244. if (ret < 0)
  245. dev_err(dev, "Failed to save LDO registers: %d\n", ret);
  246. /* Explicitly put the device into reset in case regulators
  247. * don't get disabled in order to ensure consistent restart.
  248. */
  249. wm8994_reg_write(wm8994, WM8994_SOFTWARE_RESET, 0x8994);
  250. wm8994->suspended = true;
  251. ret = regulator_bulk_disable(wm8994->num_supplies,
  252. wm8994->supplies);
  253. if (ret != 0) {
  254. dev_err(dev, "Failed to disable supplies: %d\n", ret);
  255. return ret;
  256. }
  257. return 0;
  258. }
  259. static int wm8994_resume(struct device *dev)
  260. {
  261. struct wm8994 *wm8994 = dev_get_drvdata(dev);
  262. int ret, i;
  263. /* We may have lied to the PM core about suspending */
  264. if (!wm8994->suspended)
  265. return 0;
  266. ret = regulator_bulk_enable(wm8994->num_supplies,
  267. wm8994->supplies);
  268. if (ret != 0) {
  269. dev_err(dev, "Failed to enable supplies: %d\n", ret);
  270. return ret;
  271. }
  272. /* Write register at a time as we use the cache on the CPU so store
  273. * it in native endian.
  274. */
  275. for (i = 0; i < ARRAY_SIZE(wm8994->irq_masks_cur); i++) {
  276. ret = wm8994_reg_write(wm8994, WM8994_INTERRUPT_STATUS_1_MASK
  277. + i, wm8994->irq_masks_cur[i]);
  278. if (ret < 0)
  279. dev_err(dev, "Failed to restore interrupt masks: %d\n",
  280. ret);
  281. }
  282. ret = wm8994_write(wm8994, WM8994_LDO_1, WM8994_NUM_LDO_REGS * 2,
  283. &wm8994->ldo_regs);
  284. if (ret < 0)
  285. dev_err(dev, "Failed to restore LDO registers: %d\n", ret);
  286. ret = wm8994_write(wm8994, WM8994_GPIO_1, WM8994_NUM_GPIO_REGS * 2,
  287. &wm8994->gpio_regs);
  288. if (ret < 0)
  289. dev_err(dev, "Failed to restore GPIO registers: %d\n", ret);
  290. wm8994->suspended = false;
  291. return 0;
  292. }
  293. #endif
  294. #ifdef CONFIG_REGULATOR
  295. static int wm8994_ldo_in_use(struct wm8994_pdata *pdata, int ldo)
  296. {
  297. struct wm8994_ldo_pdata *ldo_pdata;
  298. if (!pdata)
  299. return 0;
  300. ldo_pdata = &pdata->ldo[ldo];
  301. if (!ldo_pdata->init_data)
  302. return 0;
  303. return ldo_pdata->init_data->num_consumer_supplies != 0;
  304. }
  305. #else
  306. static int wm8994_ldo_in_use(struct wm8994_pdata *pdata, int ldo)
  307. {
  308. return 0;
  309. }
  310. #endif
  311. /*
  312. * Instantiate the generic non-control parts of the device.
  313. */
  314. static int wm8994_device_init(struct wm8994 *wm8994, int irq)
  315. {
  316. struct wm8994_pdata *pdata = wm8994->dev->platform_data;
  317. const char *devname;
  318. int ret, i;
  319. mutex_init(&wm8994->io_lock);
  320. dev_set_drvdata(wm8994->dev, wm8994);
  321. /* Add the on-chip regulators first for bootstrapping */
  322. ret = mfd_add_devices(wm8994->dev, -1,
  323. wm8994_regulator_devs,
  324. ARRAY_SIZE(wm8994_regulator_devs),
  325. NULL, 0);
  326. if (ret != 0) {
  327. dev_err(wm8994->dev, "Failed to add children: %d\n", ret);
  328. goto err;
  329. }
  330. switch (wm8994->type) {
  331. case WM8994:
  332. wm8994->num_supplies = ARRAY_SIZE(wm8994_main_supplies);
  333. break;
  334. case WM8958:
  335. wm8994->num_supplies = ARRAY_SIZE(wm8958_main_supplies);
  336. break;
  337. default:
  338. BUG();
  339. goto err;
  340. }
  341. wm8994->supplies = kzalloc(sizeof(struct regulator_bulk_data) *
  342. wm8994->num_supplies,
  343. GFP_KERNEL);
  344. if (!wm8994->supplies) {
  345. ret = -ENOMEM;
  346. goto err;
  347. }
  348. switch (wm8994->type) {
  349. case WM8994:
  350. for (i = 0; i < ARRAY_SIZE(wm8994_main_supplies); i++)
  351. wm8994->supplies[i].supply = wm8994_main_supplies[i];
  352. break;
  353. case WM8958:
  354. for (i = 0; i < ARRAY_SIZE(wm8958_main_supplies); i++)
  355. wm8994->supplies[i].supply = wm8958_main_supplies[i];
  356. break;
  357. default:
  358. BUG();
  359. goto err;
  360. }
  361. ret = regulator_bulk_get(wm8994->dev, wm8994->num_supplies,
  362. wm8994->supplies);
  363. if (ret != 0) {
  364. dev_err(wm8994->dev, "Failed to get supplies: %d\n", ret);
  365. goto err_supplies;
  366. }
  367. ret = regulator_bulk_enable(wm8994->num_supplies,
  368. wm8994->supplies);
  369. if (ret != 0) {
  370. dev_err(wm8994->dev, "Failed to enable supplies: %d\n", ret);
  371. goto err_get;
  372. }
  373. ret = wm8994_reg_read(wm8994, WM8994_SOFTWARE_RESET);
  374. if (ret < 0) {
  375. dev_err(wm8994->dev, "Failed to read ID register\n");
  376. goto err_enable;
  377. }
  378. switch (ret) {
  379. case 0x8994:
  380. devname = "WM8994";
  381. if (wm8994->type != WM8994)
  382. dev_warn(wm8994->dev, "Device registered as type %d\n",
  383. wm8994->type);
  384. wm8994->type = WM8994;
  385. break;
  386. case 0x8958:
  387. devname = "WM8958";
  388. if (wm8994->type != WM8958)
  389. dev_warn(wm8994->dev, "Device registered as type %d\n",
  390. wm8994->type);
  391. wm8994->type = WM8958;
  392. break;
  393. default:
  394. dev_err(wm8994->dev, "Device is not a WM8994, ID is %x\n",
  395. ret);
  396. ret = -EINVAL;
  397. goto err_enable;
  398. }
  399. ret = wm8994_reg_read(wm8994, WM8994_CHIP_REVISION);
  400. if (ret < 0) {
  401. dev_err(wm8994->dev, "Failed to read revision register: %d\n",
  402. ret);
  403. goto err_enable;
  404. }
  405. switch (wm8994->type) {
  406. case WM8994:
  407. switch (ret) {
  408. case 0:
  409. case 1:
  410. dev_warn(wm8994->dev,
  411. "revision %c not fully supported\n",
  412. 'A' + ret);
  413. break;
  414. default:
  415. break;
  416. }
  417. break;
  418. default:
  419. break;
  420. }
  421. dev_info(wm8994->dev, "%s revision %c\n", devname, 'A' + ret);
  422. if (pdata) {
  423. wm8994->irq_base = pdata->irq_base;
  424. wm8994->gpio_base = pdata->gpio_base;
  425. /* GPIO configuration is only applied if it's non-zero */
  426. for (i = 0; i < ARRAY_SIZE(pdata->gpio_defaults); i++) {
  427. if (pdata->gpio_defaults[i]) {
  428. wm8994_set_bits(wm8994, WM8994_GPIO_1 + i,
  429. 0xffff,
  430. pdata->gpio_defaults[i]);
  431. }
  432. }
  433. }
  434. /* In some system designs where the regulators are not in use,
  435. * we can achieve a small reduction in leakage currents by
  436. * floating LDO outputs. This bit makes no difference if the
  437. * LDOs are enabled, it only affects cases where the LDOs were
  438. * in operation and are then disabled.
  439. */
  440. for (i = 0; i < WM8994_NUM_LDO_REGS; i++) {
  441. if (wm8994_ldo_in_use(pdata, i))
  442. wm8994_set_bits(wm8994, WM8994_LDO_1 + i,
  443. WM8994_LDO1_DISCH, WM8994_LDO1_DISCH);
  444. else
  445. wm8994_set_bits(wm8994, WM8994_LDO_1 + i,
  446. WM8994_LDO1_DISCH, 0);
  447. }
  448. wm8994_irq_init(wm8994);
  449. ret = mfd_add_devices(wm8994->dev, -1,
  450. wm8994_devs, ARRAY_SIZE(wm8994_devs),
  451. NULL, 0);
  452. if (ret != 0) {
  453. dev_err(wm8994->dev, "Failed to add children: %d\n", ret);
  454. goto err_irq;
  455. }
  456. pm_runtime_enable(wm8994->dev);
  457. pm_runtime_resume(wm8994->dev);
  458. return 0;
  459. err_irq:
  460. wm8994_irq_exit(wm8994);
  461. err_enable:
  462. regulator_bulk_disable(wm8994->num_supplies,
  463. wm8994->supplies);
  464. err_get:
  465. regulator_bulk_free(wm8994->num_supplies, wm8994->supplies);
  466. err_supplies:
  467. kfree(wm8994->supplies);
  468. err:
  469. mfd_remove_devices(wm8994->dev);
  470. kfree(wm8994);
  471. return ret;
  472. }
  473. static void wm8994_device_exit(struct wm8994 *wm8994)
  474. {
  475. pm_runtime_disable(wm8994->dev);
  476. mfd_remove_devices(wm8994->dev);
  477. wm8994_irq_exit(wm8994);
  478. regulator_bulk_disable(wm8994->num_supplies,
  479. wm8994->supplies);
  480. regulator_bulk_free(wm8994->num_supplies, wm8994->supplies);
  481. kfree(wm8994->supplies);
  482. kfree(wm8994);
  483. }
  484. static int wm8994_i2c_read_device(struct wm8994 *wm8994, unsigned short reg,
  485. int bytes, void *dest)
  486. {
  487. struct i2c_client *i2c = wm8994->control_data;
  488. int ret;
  489. u16 r = cpu_to_be16(reg);
  490. ret = i2c_master_send(i2c, (unsigned char *)&r, 2);
  491. if (ret < 0)
  492. return ret;
  493. if (ret != 2)
  494. return -EIO;
  495. ret = i2c_master_recv(i2c, dest, bytes);
  496. if (ret < 0)
  497. return ret;
  498. if (ret != bytes)
  499. return -EIO;
  500. return 0;
  501. }
  502. static int wm8994_i2c_write_device(struct wm8994 *wm8994, unsigned short reg,
  503. int bytes, const void *src)
  504. {
  505. struct i2c_client *i2c = wm8994->control_data;
  506. struct i2c_msg xfer[2];
  507. int ret;
  508. reg = cpu_to_be16(reg);
  509. xfer[0].addr = i2c->addr;
  510. xfer[0].flags = 0;
  511. xfer[0].len = 2;
  512. xfer[0].buf = (char *)&reg;
  513. xfer[1].addr = i2c->addr;
  514. xfer[1].flags = I2C_M_NOSTART;
  515. xfer[1].len = bytes;
  516. xfer[1].buf = (char *)src;
  517. ret = i2c_transfer(i2c->adapter, xfer, 2);
  518. if (ret < 0)
  519. return ret;
  520. if (ret != 2)
  521. return -EIO;
  522. return 0;
  523. }
  524. static int wm8994_i2c_probe(struct i2c_client *i2c,
  525. const struct i2c_device_id *id)
  526. {
  527. struct wm8994 *wm8994;
  528. wm8994 = kzalloc(sizeof(struct wm8994), GFP_KERNEL);
  529. if (wm8994 == NULL)
  530. return -ENOMEM;
  531. i2c_set_clientdata(i2c, wm8994);
  532. wm8994->dev = &i2c->dev;
  533. wm8994->control_data = i2c;
  534. wm8994->read_dev = wm8994_i2c_read_device;
  535. wm8994->write_dev = wm8994_i2c_write_device;
  536. wm8994->irq = i2c->irq;
  537. wm8994->type = id->driver_data;
  538. return wm8994_device_init(wm8994, i2c->irq);
  539. }
  540. static int wm8994_i2c_remove(struct i2c_client *i2c)
  541. {
  542. struct wm8994 *wm8994 = i2c_get_clientdata(i2c);
  543. wm8994_device_exit(wm8994);
  544. return 0;
  545. }
  546. static const struct i2c_device_id wm8994_i2c_id[] = {
  547. { "wm8994", WM8994 },
  548. { "wm8958", WM8958 },
  549. { }
  550. };
  551. MODULE_DEVICE_TABLE(i2c, wm8994_i2c_id);
  552. static UNIVERSAL_DEV_PM_OPS(wm8994_pm_ops, wm8994_suspend, wm8994_resume,
  553. NULL);
  554. static struct i2c_driver wm8994_i2c_driver = {
  555. .driver = {
  556. .name = "wm8994",
  557. .owner = THIS_MODULE,
  558. .pm = &wm8994_pm_ops,
  559. },
  560. .probe = wm8994_i2c_probe,
  561. .remove = wm8994_i2c_remove,
  562. .id_table = wm8994_i2c_id,
  563. };
  564. static int __init wm8994_i2c_init(void)
  565. {
  566. int ret;
  567. ret = i2c_add_driver(&wm8994_i2c_driver);
  568. if (ret != 0)
  569. pr_err("Failed to register wm8994 I2C driver: %d\n", ret);
  570. return ret;
  571. }
  572. module_init(wm8994_i2c_init);
  573. static void __exit wm8994_i2c_exit(void)
  574. {
  575. i2c_del_driver(&wm8994_i2c_driver);
  576. }
  577. module_exit(wm8994_i2c_exit);
  578. MODULE_DESCRIPTION("Core support for the WM8994 audio CODEC");
  579. MODULE_LICENSE("GPL");
  580. MODULE_AUTHOR("Mark Brown <broonie@opensource.wolfsonmicro.com>");