rcar-gyroadc.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631
  1. /*
  2. * Renesas R-Car GyroADC driver
  3. *
  4. * Copyright 2016 Marek Vasut <marek.vasut@gmail.com>
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation; either version 2 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. */
  16. #include <linux/module.h>
  17. #include <linux/platform_device.h>
  18. #include <linux/delay.h>
  19. #include <linux/kernel.h>
  20. #include <linux/slab.h>
  21. #include <linux/io.h>
  22. #include <linux/clk.h>
  23. #include <linux/of.h>
  24. #include <linux/of_irq.h>
  25. #include <linux/regulator/consumer.h>
  26. #include <linux/of_platform.h>
  27. #include <linux/err.h>
  28. #include <linux/pm_runtime.h>
  29. #include <linux/iio/iio.h>
  30. #include <linux/iio/sysfs.h>
  31. #include <linux/iio/trigger.h>
  32. #define DRIVER_NAME "rcar-gyroadc"
  33. /* GyroADC registers. */
  34. #define RCAR_GYROADC_MODE_SELECT 0x00
  35. #define RCAR_GYROADC_MODE_SELECT_1_MB88101A 0x0
  36. #define RCAR_GYROADC_MODE_SELECT_2_ADCS7476 0x1
  37. #define RCAR_GYROADC_MODE_SELECT_3_MAX1162 0x3
  38. #define RCAR_GYROADC_START_STOP 0x04
  39. #define RCAR_GYROADC_START_STOP_START BIT(0)
  40. #define RCAR_GYROADC_CLOCK_LENGTH 0x08
  41. #define RCAR_GYROADC_1_25MS_LENGTH 0x0c
  42. #define RCAR_GYROADC_REALTIME_DATA(ch) (0x10 + ((ch) * 4))
  43. #define RCAR_GYROADC_100MS_ADDED_DATA(ch) (0x30 + ((ch) * 4))
  44. #define RCAR_GYROADC_10MS_AVG_DATA(ch) (0x50 + ((ch) * 4))
  45. #define RCAR_GYROADC_FIFO_STATUS 0x70
  46. #define RCAR_GYROADC_FIFO_STATUS_EMPTY(ch) BIT(0 + (4 * (ch)))
  47. #define RCAR_GYROADC_FIFO_STATUS_FULL(ch) BIT(1 + (4 * (ch)))
  48. #define RCAR_GYROADC_FIFO_STATUS_ERROR(ch) BIT(2 + (4 * (ch)))
  49. #define RCAR_GYROADC_INTR 0x74
  50. #define RCAR_GYROADC_INTR_INT BIT(0)
  51. #define RCAR_GYROADC_INTENR 0x78
  52. #define RCAR_GYROADC_INTENR_INTEN BIT(0)
  53. #define RCAR_GYROADC_SAMPLE_RATE 800 /* Hz */
  54. #define RCAR_GYROADC_RUNTIME_PM_DELAY_MS 2000
  55. enum rcar_gyroadc_model {
  56. RCAR_GYROADC_MODEL_DEFAULT,
  57. RCAR_GYROADC_MODEL_R8A7792,
  58. };
  59. struct rcar_gyroadc {
  60. struct device *dev;
  61. void __iomem *regs;
  62. struct clk *clk;
  63. struct regulator *vref[8];
  64. unsigned int num_channels;
  65. enum rcar_gyroadc_model model;
  66. unsigned int mode;
  67. unsigned int sample_width;
  68. };
  69. static void rcar_gyroadc_hw_init(struct rcar_gyroadc *priv)
  70. {
  71. const unsigned long clk_mhz = clk_get_rate(priv->clk) / 1000000;
  72. const unsigned long clk_mul =
  73. (priv->mode == RCAR_GYROADC_MODE_SELECT_1_MB88101A) ? 10 : 5;
  74. unsigned long clk_len = clk_mhz * clk_mul;
  75. /*
  76. * According to the R-Car Gen2 datasheet Rev. 1.01, Sept 08 2014,
  77. * page 77-7, clock length must be even number. If it's odd number,
  78. * add one.
  79. */
  80. if (clk_len & 1)
  81. clk_len++;
  82. /* Stop the GyroADC. */
  83. writel(0, priv->regs + RCAR_GYROADC_START_STOP);
  84. /* Disable IRQ on V2H. */
  85. if (priv->model == RCAR_GYROADC_MODEL_R8A7792)
  86. writel(0, priv->regs + RCAR_GYROADC_INTENR);
  87. /* Set mode and timing. */
  88. writel(priv->mode, priv->regs + RCAR_GYROADC_MODE_SELECT);
  89. writel(clk_len, priv->regs + RCAR_GYROADC_CLOCK_LENGTH);
  90. writel(clk_mhz * 1250, priv->regs + RCAR_GYROADC_1_25MS_LENGTH);
  91. }
  92. static void rcar_gyroadc_hw_start(struct rcar_gyroadc *priv)
  93. {
  94. /* Start sampling. */
  95. writel(RCAR_GYROADC_START_STOP_START,
  96. priv->regs + RCAR_GYROADC_START_STOP);
  97. /*
  98. * Wait for the first conversion to complete. This is longer than
  99. * the 1.25 mS in the datasheet because 1.25 mS is not enough for
  100. * the hardware to deliver the first sample and the hardware does
  101. * then return zeroes instead of valid data.
  102. */
  103. mdelay(3);
  104. }
  105. static void rcar_gyroadc_hw_stop(struct rcar_gyroadc *priv)
  106. {
  107. /* Stop the GyroADC. */
  108. writel(0, priv->regs + RCAR_GYROADC_START_STOP);
  109. }
  110. #define RCAR_GYROADC_CHAN(_idx) { \
  111. .type = IIO_VOLTAGE, \
  112. .indexed = 1, \
  113. .channel = (_idx), \
  114. .info_mask_separate = BIT(IIO_CHAN_INFO_RAW) | \
  115. BIT(IIO_CHAN_INFO_SCALE), \
  116. .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SAMP_FREQ), \
  117. }
  118. static const struct iio_chan_spec rcar_gyroadc_iio_channels_1[] = {
  119. RCAR_GYROADC_CHAN(0),
  120. RCAR_GYROADC_CHAN(1),
  121. RCAR_GYROADC_CHAN(2),
  122. RCAR_GYROADC_CHAN(3),
  123. };
  124. static const struct iio_chan_spec rcar_gyroadc_iio_channels_2[] = {
  125. RCAR_GYROADC_CHAN(0),
  126. RCAR_GYROADC_CHAN(1),
  127. RCAR_GYROADC_CHAN(2),
  128. RCAR_GYROADC_CHAN(3),
  129. RCAR_GYROADC_CHAN(4),
  130. RCAR_GYROADC_CHAN(5),
  131. RCAR_GYROADC_CHAN(6),
  132. RCAR_GYROADC_CHAN(7),
  133. };
  134. static const struct iio_chan_spec rcar_gyroadc_iio_channels_3[] = {
  135. RCAR_GYROADC_CHAN(0),
  136. RCAR_GYROADC_CHAN(1),
  137. RCAR_GYROADC_CHAN(2),
  138. RCAR_GYROADC_CHAN(3),
  139. RCAR_GYROADC_CHAN(4),
  140. RCAR_GYROADC_CHAN(5),
  141. RCAR_GYROADC_CHAN(6),
  142. RCAR_GYROADC_CHAN(7),
  143. };
  144. static int rcar_gyroadc_set_power(struct rcar_gyroadc *priv, bool on)
  145. {
  146. struct device *dev = priv->dev;
  147. int ret;
  148. if (on) {
  149. ret = pm_runtime_get_sync(dev);
  150. if (ret < 0)
  151. pm_runtime_put_noidle(dev);
  152. } else {
  153. pm_runtime_mark_last_busy(dev);
  154. ret = pm_runtime_put_autosuspend(dev);
  155. }
  156. return ret;
  157. }
  158. static int rcar_gyroadc_read_raw(struct iio_dev *indio_dev,
  159. struct iio_chan_spec const *chan,
  160. int *val, int *val2, long mask)
  161. {
  162. struct rcar_gyroadc *priv = iio_priv(indio_dev);
  163. struct regulator *consumer;
  164. unsigned int datareg = RCAR_GYROADC_REALTIME_DATA(chan->channel);
  165. unsigned int vref;
  166. int ret;
  167. /*
  168. * MB88101 is special in that it has only single regulator for
  169. * all four channels.
  170. */
  171. if (priv->mode == RCAR_GYROADC_MODE_SELECT_1_MB88101A)
  172. consumer = priv->vref[0];
  173. else
  174. consumer = priv->vref[chan->channel];
  175. switch (mask) {
  176. case IIO_CHAN_INFO_RAW:
  177. if (chan->type != IIO_VOLTAGE)
  178. return -EINVAL;
  179. /* Channel not connected. */
  180. if (!consumer)
  181. return -EINVAL;
  182. ret = iio_device_claim_direct_mode(indio_dev);
  183. if (ret)
  184. return ret;
  185. ret = rcar_gyroadc_set_power(priv, true);
  186. if (ret < 0) {
  187. iio_device_release_direct_mode(indio_dev);
  188. return ret;
  189. }
  190. *val = readl(priv->regs + datareg);
  191. *val &= BIT(priv->sample_width) - 1;
  192. ret = rcar_gyroadc_set_power(priv, false);
  193. iio_device_release_direct_mode(indio_dev);
  194. if (ret < 0)
  195. return ret;
  196. return IIO_VAL_INT;
  197. case IIO_CHAN_INFO_SCALE:
  198. /* Channel not connected. */
  199. if (!consumer)
  200. return -EINVAL;
  201. vref = regulator_get_voltage(consumer);
  202. *val = vref / 1000;
  203. *val2 = 1 << priv->sample_width;
  204. return IIO_VAL_FRACTIONAL;
  205. case IIO_CHAN_INFO_SAMP_FREQ:
  206. *val = RCAR_GYROADC_SAMPLE_RATE;
  207. return IIO_VAL_INT;
  208. default:
  209. return -EINVAL;
  210. }
  211. }
  212. static int rcar_gyroadc_reg_access(struct iio_dev *indio_dev,
  213. unsigned int reg, unsigned int writeval,
  214. unsigned int *readval)
  215. {
  216. struct rcar_gyroadc *priv = iio_priv(indio_dev);
  217. unsigned int maxreg = RCAR_GYROADC_FIFO_STATUS;
  218. if (readval == NULL)
  219. return -EINVAL;
  220. if (reg % 4)
  221. return -EINVAL;
  222. /* Handle the V2H case with extra interrupt block. */
  223. if (priv->model == RCAR_GYROADC_MODEL_R8A7792)
  224. maxreg = RCAR_GYROADC_INTENR;
  225. if (reg > maxreg)
  226. return -EINVAL;
  227. *readval = readl(priv->regs + reg);
  228. return 0;
  229. }
  230. static const struct iio_info rcar_gyroadc_iio_info = {
  231. .read_raw = rcar_gyroadc_read_raw,
  232. .debugfs_reg_access = rcar_gyroadc_reg_access,
  233. };
  234. static const struct of_device_id rcar_gyroadc_match[] = {
  235. {
  236. /* R-Car compatible GyroADC */
  237. .compatible = "renesas,rcar-gyroadc",
  238. .data = (void *)RCAR_GYROADC_MODEL_DEFAULT,
  239. }, {
  240. /* R-Car V2H specialty with interrupt registers. */
  241. .compatible = "renesas,r8a7792-gyroadc",
  242. .data = (void *)RCAR_GYROADC_MODEL_R8A7792,
  243. }, {
  244. /* sentinel */
  245. }
  246. };
  247. MODULE_DEVICE_TABLE(of, rcar_gyroadc_match);
  248. static const struct of_device_id rcar_gyroadc_child_match[] = {
  249. /* Mode 1 ADCs */
  250. {
  251. .compatible = "fujitsu,mb88101a",
  252. .data = (void *)RCAR_GYROADC_MODE_SELECT_1_MB88101A,
  253. },
  254. /* Mode 2 ADCs */
  255. {
  256. .compatible = "ti,adcs7476",
  257. .data = (void *)RCAR_GYROADC_MODE_SELECT_2_ADCS7476,
  258. }, {
  259. .compatible = "ti,adc121",
  260. .data = (void *)RCAR_GYROADC_MODE_SELECT_2_ADCS7476,
  261. }, {
  262. .compatible = "adi,ad7476",
  263. .data = (void *)RCAR_GYROADC_MODE_SELECT_2_ADCS7476,
  264. },
  265. /* Mode 3 ADCs */
  266. {
  267. .compatible = "maxim,max1162",
  268. .data = (void *)RCAR_GYROADC_MODE_SELECT_3_MAX1162,
  269. }, {
  270. .compatible = "maxim,max11100",
  271. .data = (void *)RCAR_GYROADC_MODE_SELECT_3_MAX1162,
  272. },
  273. { /* sentinel */ }
  274. };
  275. static int rcar_gyroadc_parse_subdevs(struct iio_dev *indio_dev)
  276. {
  277. const struct of_device_id *of_id;
  278. const struct iio_chan_spec *channels;
  279. struct rcar_gyroadc *priv = iio_priv(indio_dev);
  280. struct device *dev = priv->dev;
  281. struct device_node *np = dev->of_node;
  282. struct device_node *child;
  283. struct regulator *vref;
  284. unsigned int reg;
  285. unsigned int adcmode = -1, childmode;
  286. unsigned int sample_width;
  287. unsigned int num_channels;
  288. int ret, first = 1;
  289. for_each_child_of_node(np, child) {
  290. of_id = of_match_node(rcar_gyroadc_child_match, child);
  291. if (!of_id) {
  292. dev_err(dev, "Ignoring unsupported ADC \"%s\".",
  293. child->name);
  294. continue;
  295. }
  296. childmode = (uintptr_t)of_id->data;
  297. switch (childmode) {
  298. case RCAR_GYROADC_MODE_SELECT_1_MB88101A:
  299. sample_width = 12;
  300. channels = rcar_gyroadc_iio_channels_1;
  301. num_channels = ARRAY_SIZE(rcar_gyroadc_iio_channels_1);
  302. break;
  303. case RCAR_GYROADC_MODE_SELECT_2_ADCS7476:
  304. sample_width = 15;
  305. channels = rcar_gyroadc_iio_channels_2;
  306. num_channels = ARRAY_SIZE(rcar_gyroadc_iio_channels_2);
  307. break;
  308. case RCAR_GYROADC_MODE_SELECT_3_MAX1162:
  309. sample_width = 16;
  310. channels = rcar_gyroadc_iio_channels_3;
  311. num_channels = ARRAY_SIZE(rcar_gyroadc_iio_channels_3);
  312. break;
  313. default:
  314. return -EINVAL;
  315. }
  316. /*
  317. * MB88101 is special in that it's only a single chip taking
  318. * up all the CHS lines. Thus, the DT binding is also special
  319. * and has no reg property. If we run into such ADC, handle
  320. * it here.
  321. */
  322. if (childmode == RCAR_GYROADC_MODE_SELECT_1_MB88101A) {
  323. reg = 0;
  324. } else {
  325. ret = of_property_read_u32(child, "reg", &reg);
  326. if (ret) {
  327. dev_err(dev,
  328. "Failed to get child reg property of ADC \"%s\".\n",
  329. child->name);
  330. return ret;
  331. }
  332. /* Channel number is too high. */
  333. if (reg >= num_channels) {
  334. dev_err(dev,
  335. "Only %i channels supported with %s, but reg = <%i>.\n",
  336. num_channels, child->name, reg);
  337. return -EINVAL;
  338. }
  339. }
  340. /* Child node selected different mode than the rest. */
  341. if (!first && (adcmode != childmode)) {
  342. dev_err(dev,
  343. "Channel %i uses different ADC mode than the rest.\n",
  344. reg);
  345. return -EINVAL;
  346. }
  347. /* Channel is valid, grab the regulator. */
  348. dev->of_node = child;
  349. vref = devm_regulator_get(dev, "vref");
  350. dev->of_node = np;
  351. if (IS_ERR(vref)) {
  352. dev_dbg(dev, "Channel %i 'vref' supply not connected.\n",
  353. reg);
  354. return PTR_ERR(vref);
  355. }
  356. priv->vref[reg] = vref;
  357. if (!first)
  358. continue;
  359. /* First child node which passed sanity tests. */
  360. adcmode = childmode;
  361. first = 0;
  362. priv->num_channels = num_channels;
  363. priv->mode = childmode;
  364. priv->sample_width = sample_width;
  365. indio_dev->channels = channels;
  366. indio_dev->num_channels = num_channels;
  367. /*
  368. * MB88101 is special and we only have one such device
  369. * attached to the GyroADC at a time, so if we found it,
  370. * we can stop parsing here.
  371. */
  372. if (childmode == RCAR_GYROADC_MODE_SELECT_1_MB88101A)
  373. break;
  374. }
  375. if (first) {
  376. dev_err(dev, "No valid ADC channels found, aborting.\n");
  377. return -EINVAL;
  378. }
  379. return 0;
  380. }
  381. static void rcar_gyroadc_deinit_supplies(struct iio_dev *indio_dev)
  382. {
  383. struct rcar_gyroadc *priv = iio_priv(indio_dev);
  384. unsigned int i;
  385. for (i = 0; i < priv->num_channels; i++) {
  386. if (!priv->vref[i])
  387. continue;
  388. regulator_disable(priv->vref[i]);
  389. }
  390. }
  391. static int rcar_gyroadc_init_supplies(struct iio_dev *indio_dev)
  392. {
  393. struct rcar_gyroadc *priv = iio_priv(indio_dev);
  394. struct device *dev = priv->dev;
  395. unsigned int i;
  396. int ret;
  397. for (i = 0; i < priv->num_channels; i++) {
  398. if (!priv->vref[i])
  399. continue;
  400. ret = regulator_enable(priv->vref[i]);
  401. if (ret) {
  402. dev_err(dev, "Failed to enable regulator %i (ret=%i)\n",
  403. i, ret);
  404. goto err;
  405. }
  406. }
  407. return 0;
  408. err:
  409. rcar_gyroadc_deinit_supplies(indio_dev);
  410. return ret;
  411. }
  412. static int rcar_gyroadc_probe(struct platform_device *pdev)
  413. {
  414. struct device *dev = &pdev->dev;
  415. struct rcar_gyroadc *priv;
  416. struct iio_dev *indio_dev;
  417. struct resource *mem;
  418. int ret;
  419. indio_dev = devm_iio_device_alloc(dev, sizeof(*priv));
  420. if (!indio_dev) {
  421. dev_err(dev, "Failed to allocate IIO device.\n");
  422. return -ENOMEM;
  423. }
  424. priv = iio_priv(indio_dev);
  425. priv->dev = dev;
  426. mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
  427. priv->regs = devm_ioremap_resource(dev, mem);
  428. if (IS_ERR(priv->regs))
  429. return PTR_ERR(priv->regs);
  430. priv->clk = devm_clk_get(dev, "fck");
  431. if (IS_ERR(priv->clk)) {
  432. ret = PTR_ERR(priv->clk);
  433. if (ret != -EPROBE_DEFER)
  434. dev_err(dev, "Failed to get IF clock (ret=%i)\n", ret);
  435. return ret;
  436. }
  437. ret = rcar_gyroadc_parse_subdevs(indio_dev);
  438. if (ret)
  439. return ret;
  440. ret = rcar_gyroadc_init_supplies(indio_dev);
  441. if (ret)
  442. return ret;
  443. priv->model = (enum rcar_gyroadc_model)
  444. of_device_get_match_data(&pdev->dev);
  445. platform_set_drvdata(pdev, indio_dev);
  446. indio_dev->name = DRIVER_NAME;
  447. indio_dev->dev.parent = dev;
  448. indio_dev->dev.of_node = pdev->dev.of_node;
  449. indio_dev->info = &rcar_gyroadc_iio_info;
  450. indio_dev->modes = INDIO_DIRECT_MODE;
  451. ret = clk_prepare_enable(priv->clk);
  452. if (ret) {
  453. dev_err(dev, "Could not prepare or enable the IF clock.\n");
  454. goto err_clk_if_enable;
  455. }
  456. pm_runtime_set_autosuspend_delay(dev, RCAR_GYROADC_RUNTIME_PM_DELAY_MS);
  457. pm_runtime_use_autosuspend(dev);
  458. pm_runtime_enable(dev);
  459. pm_runtime_get_sync(dev);
  460. rcar_gyroadc_hw_init(priv);
  461. rcar_gyroadc_hw_start(priv);
  462. ret = iio_device_register(indio_dev);
  463. if (ret) {
  464. dev_err(dev, "Couldn't register IIO device.\n");
  465. goto err_iio_device_register;
  466. }
  467. pm_runtime_put_sync(dev);
  468. return 0;
  469. err_iio_device_register:
  470. rcar_gyroadc_hw_stop(priv);
  471. pm_runtime_put_sync(dev);
  472. pm_runtime_disable(dev);
  473. pm_runtime_set_suspended(dev);
  474. clk_disable_unprepare(priv->clk);
  475. err_clk_if_enable:
  476. rcar_gyroadc_deinit_supplies(indio_dev);
  477. return ret;
  478. }
  479. static int rcar_gyroadc_remove(struct platform_device *pdev)
  480. {
  481. struct iio_dev *indio_dev = platform_get_drvdata(pdev);
  482. struct rcar_gyroadc *priv = iio_priv(indio_dev);
  483. struct device *dev = priv->dev;
  484. iio_device_unregister(indio_dev);
  485. pm_runtime_get_sync(dev);
  486. rcar_gyroadc_hw_stop(priv);
  487. pm_runtime_put_sync(dev);
  488. pm_runtime_disable(dev);
  489. pm_runtime_set_suspended(dev);
  490. clk_disable_unprepare(priv->clk);
  491. rcar_gyroadc_deinit_supplies(indio_dev);
  492. return 0;
  493. }
  494. #if defined(CONFIG_PM)
  495. static int rcar_gyroadc_suspend(struct device *dev)
  496. {
  497. struct iio_dev *indio_dev = dev_get_drvdata(dev);
  498. struct rcar_gyroadc *priv = iio_priv(indio_dev);
  499. rcar_gyroadc_hw_stop(priv);
  500. return 0;
  501. }
  502. static int rcar_gyroadc_resume(struct device *dev)
  503. {
  504. struct iio_dev *indio_dev = dev_get_drvdata(dev);
  505. struct rcar_gyroadc *priv = iio_priv(indio_dev);
  506. rcar_gyroadc_hw_start(priv);
  507. return 0;
  508. }
  509. #endif
  510. static const struct dev_pm_ops rcar_gyroadc_pm_ops = {
  511. SET_RUNTIME_PM_OPS(rcar_gyroadc_suspend, rcar_gyroadc_resume, NULL)
  512. };
  513. static struct platform_driver rcar_gyroadc_driver = {
  514. .probe = rcar_gyroadc_probe,
  515. .remove = rcar_gyroadc_remove,
  516. .driver = {
  517. .name = DRIVER_NAME,
  518. .of_match_table = rcar_gyroadc_match,
  519. .pm = &rcar_gyroadc_pm_ops,
  520. },
  521. };
  522. module_platform_driver(rcar_gyroadc_driver);
  523. MODULE_AUTHOR("Marek Vasut <marek.vasut@gmail.com>");
  524. MODULE_DESCRIPTION("Renesas R-Car GyroADC driver");
  525. MODULE_LICENSE("GPL");