i2c-rcar.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634
  1. /*
  2. * Driver for the Renesas RCar I2C unit
  3. *
  4. * Copyright (C) 2014 Wolfram Sang <wsa@sang-engineering.com>
  5. *
  6. * Copyright (C) 2012-14 Renesas Solutions Corp.
  7. * Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
  8. *
  9. * This file is based on the drivers/i2c/busses/i2c-sh7760.c
  10. * (c) 2005-2008 MSC Vertriebsges.m.b.H, Manuel Lauss <mlau@msc-ge.com>
  11. *
  12. * This file used out-of-tree driver i2c-rcar.c
  13. * Copyright (C) 2011-2012 Renesas Electronics Corporation
  14. *
  15. * This program is free software; you can redistribute it and/or modify
  16. * it under the terms of the GNU General Public License as published by
  17. * the Free Software Foundation; version 2 of the License.
  18. *
  19. * This program is distributed in the hope that it will be useful,
  20. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  21. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  22. * GNU General Public License for more details.
  23. */
  24. #include <linux/clk.h>
  25. #include <linux/delay.h>
  26. #include <linux/err.h>
  27. #include <linux/interrupt.h>
  28. #include <linux/io.h>
  29. #include <linux/i2c.h>
  30. #include <linux/i2c/i2c-rcar.h>
  31. #include <linux/kernel.h>
  32. #include <linux/module.h>
  33. #include <linux/of_device.h>
  34. #include <linux/platform_device.h>
  35. #include <linux/pm_runtime.h>
  36. #include <linux/slab.h>
  37. #include <linux/spinlock.h>
  38. /* register offsets */
  39. #define ICSCR 0x00 /* slave ctrl */
  40. #define ICMCR 0x04 /* master ctrl */
  41. #define ICSSR 0x08 /* slave status */
  42. #define ICMSR 0x0C /* master status */
  43. #define ICSIER 0x10 /* slave irq enable */
  44. #define ICMIER 0x14 /* master irq enable */
  45. #define ICCCR 0x18 /* clock dividers */
  46. #define ICSAR 0x1C /* slave address */
  47. #define ICMAR 0x20 /* master address */
  48. #define ICRXTX 0x24 /* data port */
  49. /* ICMCR */
  50. #define MDBS (1 << 7) /* non-fifo mode switch */
  51. #define FSCL (1 << 6) /* override SCL pin */
  52. #define FSDA (1 << 5) /* override SDA pin */
  53. #define OBPC (1 << 4) /* override pins */
  54. #define MIE (1 << 3) /* master if enable */
  55. #define TSBE (1 << 2)
  56. #define FSB (1 << 1) /* force stop bit */
  57. #define ESG (1 << 0) /* en startbit gen */
  58. /* ICMSR (also for ICMIE) */
  59. #define MNR (1 << 6) /* nack received */
  60. #define MAL (1 << 5) /* arbitration lost */
  61. #define MST (1 << 4) /* sent a stop */
  62. #define MDE (1 << 3)
  63. #define MDT (1 << 2)
  64. #define MDR (1 << 1)
  65. #define MAT (1 << 0) /* slave addr xfer done */
  66. #define RCAR_BUS_PHASE_START (MDBS | MIE | ESG)
  67. #define RCAR_BUS_PHASE_DATA (MDBS | MIE)
  68. #define RCAR_BUS_PHASE_STOP (MDBS | MIE | FSB)
  69. #define RCAR_IRQ_SEND (MNR | MAL | MST | MAT | MDE)
  70. #define RCAR_IRQ_RECV (MNR | MAL | MST | MAT | MDR)
  71. #define RCAR_IRQ_STOP (MST)
  72. #define RCAR_IRQ_ACK_SEND (~(MAT | MDE))
  73. #define RCAR_IRQ_ACK_RECV (~(MAT | MDR))
  74. #define ID_LAST_MSG (1 << 0)
  75. #define ID_IOERROR (1 << 1)
  76. #define ID_DONE (1 << 2)
  77. #define ID_ARBLOST (1 << 3)
  78. #define ID_NACK (1 << 4)
  79. enum rcar_i2c_type {
  80. I2C_RCAR_GEN1,
  81. I2C_RCAR_GEN2,
  82. };
  83. struct rcar_i2c_priv {
  84. void __iomem *io;
  85. struct i2c_adapter adap;
  86. struct i2c_msg *msg;
  87. struct clk *clk;
  88. spinlock_t lock;
  89. wait_queue_head_t wait;
  90. int pos;
  91. u32 icccr;
  92. u32 flags;
  93. enum rcar_i2c_type devtype;
  94. };
  95. #define rcar_i2c_priv_to_dev(p) ((p)->adap.dev.parent)
  96. #define rcar_i2c_is_recv(p) ((p)->msg->flags & I2C_M_RD)
  97. #define rcar_i2c_flags_set(p, f) ((p)->flags |= (f))
  98. #define rcar_i2c_flags_has(p, f) ((p)->flags & (f))
  99. #define LOOP_TIMEOUT 1024
  100. static void rcar_i2c_write(struct rcar_i2c_priv *priv, int reg, u32 val)
  101. {
  102. writel(val, priv->io + reg);
  103. }
  104. static u32 rcar_i2c_read(struct rcar_i2c_priv *priv, int reg)
  105. {
  106. return readl(priv->io + reg);
  107. }
  108. static void rcar_i2c_init(struct rcar_i2c_priv *priv)
  109. {
  110. /*
  111. * reset slave mode.
  112. * slave mode is not used on this driver
  113. */
  114. rcar_i2c_write(priv, ICSIER, 0);
  115. rcar_i2c_write(priv, ICSAR, 0);
  116. rcar_i2c_write(priv, ICSCR, 0);
  117. rcar_i2c_write(priv, ICSSR, 0);
  118. /* reset master mode */
  119. rcar_i2c_write(priv, ICMIER, 0);
  120. rcar_i2c_write(priv, ICMCR, 0);
  121. rcar_i2c_write(priv, ICMSR, 0);
  122. rcar_i2c_write(priv, ICMAR, 0);
  123. }
  124. static int rcar_i2c_bus_barrier(struct rcar_i2c_priv *priv)
  125. {
  126. int i;
  127. for (i = 0; i < LOOP_TIMEOUT; i++) {
  128. /* make sure that bus is not busy */
  129. if (!(rcar_i2c_read(priv, ICMCR) & FSDA))
  130. return 0;
  131. udelay(1);
  132. }
  133. return -EBUSY;
  134. }
  135. static int rcar_i2c_clock_calculate(struct rcar_i2c_priv *priv,
  136. u32 bus_speed,
  137. struct device *dev)
  138. {
  139. u32 scgd, cdf;
  140. u32 round, ick;
  141. u32 scl;
  142. u32 cdf_width;
  143. unsigned long rate;
  144. switch (priv->devtype) {
  145. case I2C_RCAR_GEN1:
  146. cdf_width = 2;
  147. break;
  148. case I2C_RCAR_GEN2:
  149. cdf_width = 3;
  150. break;
  151. default:
  152. dev_err(dev, "device type error\n");
  153. return -EIO;
  154. }
  155. /*
  156. * calculate SCL clock
  157. * see
  158. * ICCCR
  159. *
  160. * ick = clkp / (1 + CDF)
  161. * SCL = ick / (20 + SCGD * 8 + F[(ticf + tr + intd) * ick])
  162. *
  163. * ick : I2C internal clock < 20 MHz
  164. * ticf : I2C SCL falling time = 35 ns here
  165. * tr : I2C SCL rising time = 200 ns here
  166. * intd : LSI internal delay = 50 ns here
  167. * clkp : peripheral_clk
  168. * F[] : integer up-valuation
  169. */
  170. rate = clk_get_rate(priv->clk);
  171. cdf = rate / 20000000;
  172. if (cdf >= 1 << cdf_width) {
  173. dev_err(dev, "Input clock %lu too high\n", rate);
  174. return -EIO;
  175. }
  176. ick = rate / (cdf + 1);
  177. /*
  178. * it is impossible to calculate large scale
  179. * number on u32. separate it
  180. *
  181. * F[(ticf + tr + intd) * ick]
  182. * = F[(35 + 200 + 50)ns * ick]
  183. * = F[285 * ick / 1000000000]
  184. * = F[(ick / 1000000) * 285 / 1000]
  185. */
  186. round = (ick + 500000) / 1000000 * 285;
  187. round = (round + 500) / 1000;
  188. /*
  189. * SCL = ick / (20 + SCGD * 8 + F[(ticf + tr + intd) * ick])
  190. *
  191. * Calculation result (= SCL) should be less than
  192. * bus_speed for hardware safety
  193. *
  194. * We could use something along the lines of
  195. * div = ick / (bus_speed + 1) + 1;
  196. * scgd = (div - 20 - round + 7) / 8;
  197. * scl = ick / (20 + (scgd * 8) + round);
  198. * (not fully verified) but that would get pretty involved
  199. */
  200. for (scgd = 0; scgd < 0x40; scgd++) {
  201. scl = ick / (20 + (scgd * 8) + round);
  202. if (scl <= bus_speed)
  203. goto scgd_find;
  204. }
  205. dev_err(dev, "it is impossible to calculate best SCL\n");
  206. return -EIO;
  207. scgd_find:
  208. dev_dbg(dev, "clk %d/%d(%lu), round %u, CDF:0x%x, SCGD: 0x%x\n",
  209. scl, bus_speed, clk_get_rate(priv->clk), round, cdf, scgd);
  210. /*
  211. * keep icccr value
  212. */
  213. priv->icccr = scgd << cdf_width | cdf;
  214. return 0;
  215. }
  216. static int rcar_i2c_prepare_msg(struct rcar_i2c_priv *priv)
  217. {
  218. int read = !!rcar_i2c_is_recv(priv);
  219. rcar_i2c_write(priv, ICMAR, (priv->msg->addr << 1) | read);
  220. rcar_i2c_write(priv, ICMSR, 0);
  221. rcar_i2c_write(priv, ICMCR, RCAR_BUS_PHASE_START);
  222. rcar_i2c_write(priv, ICMIER, read ? RCAR_IRQ_RECV : RCAR_IRQ_SEND);
  223. return 0;
  224. }
  225. /*
  226. * interrupt functions
  227. */
  228. static int rcar_i2c_irq_send(struct rcar_i2c_priv *priv, u32 msr)
  229. {
  230. struct i2c_msg *msg = priv->msg;
  231. /*
  232. * FIXME
  233. * sometimes, unknown interrupt happened.
  234. * Do nothing
  235. */
  236. if (!(msr & MDE))
  237. return 0;
  238. /*
  239. * If address transfer phase finished,
  240. * goto data phase.
  241. */
  242. if (msr & MAT)
  243. rcar_i2c_write(priv, ICMCR, RCAR_BUS_PHASE_DATA);
  244. if (priv->pos < msg->len) {
  245. /*
  246. * Prepare next data to ICRXTX register.
  247. * This data will go to _SHIFT_ register.
  248. *
  249. * *
  250. * [ICRXTX] -> [SHIFT] -> [I2C bus]
  251. */
  252. rcar_i2c_write(priv, ICRXTX, msg->buf[priv->pos]);
  253. priv->pos++;
  254. } else {
  255. /*
  256. * The last data was pushed to ICRXTX on _PREV_ empty irq.
  257. * It is on _SHIFT_ register, and will sent to I2C bus.
  258. *
  259. * *
  260. * [ICRXTX] -> [SHIFT] -> [I2C bus]
  261. */
  262. if (priv->flags & ID_LAST_MSG)
  263. /*
  264. * If current msg is the _LAST_ msg,
  265. * prepare stop condition here.
  266. * ID_DONE will be set on STOP irq.
  267. */
  268. rcar_i2c_write(priv, ICMCR, RCAR_BUS_PHASE_STOP);
  269. else
  270. /*
  271. * If current msg is _NOT_ last msg,
  272. * it doesn't call stop phase.
  273. * thus, there is no STOP irq.
  274. * return ID_DONE here.
  275. */
  276. return ID_DONE;
  277. }
  278. rcar_i2c_write(priv, ICMSR, RCAR_IRQ_ACK_SEND);
  279. return 0;
  280. }
  281. static int rcar_i2c_irq_recv(struct rcar_i2c_priv *priv, u32 msr)
  282. {
  283. struct i2c_msg *msg = priv->msg;
  284. /*
  285. * FIXME
  286. * sometimes, unknown interrupt happened.
  287. * Do nothing
  288. */
  289. if (!(msr & MDR))
  290. return 0;
  291. if (msr & MAT) {
  292. /*
  293. * Address transfer phase finished,
  294. * but, there is no data at this point.
  295. * Do nothing.
  296. */
  297. } else if (priv->pos < msg->len) {
  298. /*
  299. * get received data
  300. */
  301. msg->buf[priv->pos] = rcar_i2c_read(priv, ICRXTX);
  302. priv->pos++;
  303. }
  304. /*
  305. * If next received data is the _LAST_,
  306. * go to STOP phase,
  307. * otherwise, go to DATA phase.
  308. */
  309. if (priv->pos + 1 >= msg->len)
  310. rcar_i2c_write(priv, ICMCR, RCAR_BUS_PHASE_STOP);
  311. else
  312. rcar_i2c_write(priv, ICMCR, RCAR_BUS_PHASE_DATA);
  313. rcar_i2c_write(priv, ICMSR, RCAR_IRQ_ACK_RECV);
  314. return 0;
  315. }
  316. static irqreturn_t rcar_i2c_irq(int irq, void *ptr)
  317. {
  318. struct rcar_i2c_priv *priv = ptr;
  319. u32 msr;
  320. /*-------------- spin lock -----------------*/
  321. spin_lock(&priv->lock);
  322. msr = rcar_i2c_read(priv, ICMSR);
  323. /* Only handle interrupts that are currently enabled */
  324. msr &= rcar_i2c_read(priv, ICMIER);
  325. /* Arbitration lost */
  326. if (msr & MAL) {
  327. rcar_i2c_flags_set(priv, (ID_DONE | ID_ARBLOST));
  328. goto out;
  329. }
  330. /* Nack */
  331. if (msr & MNR) {
  332. /* go to stop phase */
  333. rcar_i2c_write(priv, ICMCR, RCAR_BUS_PHASE_STOP);
  334. rcar_i2c_write(priv, ICMIER, RCAR_IRQ_STOP);
  335. rcar_i2c_flags_set(priv, ID_NACK);
  336. goto out;
  337. }
  338. /* Stop */
  339. if (msr & MST) {
  340. rcar_i2c_flags_set(priv, ID_DONE);
  341. goto out;
  342. }
  343. if (rcar_i2c_is_recv(priv))
  344. rcar_i2c_flags_set(priv, rcar_i2c_irq_recv(priv, msr));
  345. else
  346. rcar_i2c_flags_set(priv, rcar_i2c_irq_send(priv, msr));
  347. out:
  348. if (rcar_i2c_flags_has(priv, ID_DONE)) {
  349. rcar_i2c_write(priv, ICMIER, 0);
  350. rcar_i2c_write(priv, ICMSR, 0);
  351. wake_up(&priv->wait);
  352. }
  353. spin_unlock(&priv->lock);
  354. /*-------------- spin unlock -----------------*/
  355. return IRQ_HANDLED;
  356. }
  357. static int rcar_i2c_master_xfer(struct i2c_adapter *adap,
  358. struct i2c_msg *msgs,
  359. int num)
  360. {
  361. struct rcar_i2c_priv *priv = i2c_get_adapdata(adap);
  362. struct device *dev = rcar_i2c_priv_to_dev(priv);
  363. unsigned long flags;
  364. int i, ret, timeout;
  365. pm_runtime_get_sync(dev);
  366. /*-------------- spin lock -----------------*/
  367. spin_lock_irqsave(&priv->lock, flags);
  368. rcar_i2c_init(priv);
  369. /* start clock */
  370. rcar_i2c_write(priv, ICCCR, priv->icccr);
  371. spin_unlock_irqrestore(&priv->lock, flags);
  372. /*-------------- spin unlock -----------------*/
  373. ret = rcar_i2c_bus_barrier(priv);
  374. if (ret < 0)
  375. goto out;
  376. for (i = 0; i < num; i++) {
  377. /* This HW can't send STOP after address phase */
  378. if (msgs[i].len == 0) {
  379. ret = -EOPNOTSUPP;
  380. break;
  381. }
  382. /*-------------- spin lock -----------------*/
  383. spin_lock_irqsave(&priv->lock, flags);
  384. /* init each data */
  385. priv->msg = &msgs[i];
  386. priv->pos = 0;
  387. priv->flags = 0;
  388. if (priv->msg == &msgs[num - 1])
  389. rcar_i2c_flags_set(priv, ID_LAST_MSG);
  390. ret = rcar_i2c_prepare_msg(priv);
  391. spin_unlock_irqrestore(&priv->lock, flags);
  392. /*-------------- spin unlock -----------------*/
  393. if (ret < 0)
  394. break;
  395. timeout = wait_event_timeout(priv->wait,
  396. rcar_i2c_flags_has(priv, ID_DONE),
  397. 5 * HZ);
  398. if (!timeout) {
  399. ret = -ETIMEDOUT;
  400. break;
  401. }
  402. if (rcar_i2c_flags_has(priv, ID_NACK)) {
  403. ret = -ENXIO;
  404. break;
  405. }
  406. if (rcar_i2c_flags_has(priv, ID_ARBLOST)) {
  407. ret = -EAGAIN;
  408. break;
  409. }
  410. if (rcar_i2c_flags_has(priv, ID_IOERROR)) {
  411. ret = -EIO;
  412. break;
  413. }
  414. ret = i + 1; /* The number of transfer */
  415. }
  416. out:
  417. pm_runtime_put(dev);
  418. if (ret < 0 && ret != -ENXIO)
  419. dev_err(dev, "error %d : %x\n", ret, priv->flags);
  420. return ret;
  421. }
  422. static u32 rcar_i2c_func(struct i2c_adapter *adap)
  423. {
  424. /* This HW can't do SMBUS_QUICK and NOSTART */
  425. return I2C_FUNC_I2C | (I2C_FUNC_SMBUS_EMUL & ~I2C_FUNC_SMBUS_QUICK);
  426. }
  427. static const struct i2c_algorithm rcar_i2c_algo = {
  428. .master_xfer = rcar_i2c_master_xfer,
  429. .functionality = rcar_i2c_func,
  430. };
  431. static const struct of_device_id rcar_i2c_dt_ids[] = {
  432. { .compatible = "renesas,i2c-rcar", .data = (void *)I2C_RCAR_GEN1 },
  433. { .compatible = "renesas,i2c-r8a7778", .data = (void *)I2C_RCAR_GEN1 },
  434. { .compatible = "renesas,i2c-r8a7779", .data = (void *)I2C_RCAR_GEN1 },
  435. { .compatible = "renesas,i2c-r8a7790", .data = (void *)I2C_RCAR_GEN2 },
  436. { .compatible = "renesas,i2c-r8a7791", .data = (void *)I2C_RCAR_GEN2 },
  437. { .compatible = "renesas,i2c-r8a7792", .data = (void *)I2C_RCAR_GEN2 },
  438. { .compatible = "renesas,i2c-r8a7793", .data = (void *)I2C_RCAR_GEN2 },
  439. { .compatible = "renesas,i2c-r8a7794", .data = (void *)I2C_RCAR_GEN2 },
  440. {},
  441. };
  442. MODULE_DEVICE_TABLE(of, rcar_i2c_dt_ids);
  443. static int rcar_i2c_probe(struct platform_device *pdev)
  444. {
  445. struct i2c_rcar_platform_data *pdata = dev_get_platdata(&pdev->dev);
  446. struct rcar_i2c_priv *priv;
  447. struct i2c_adapter *adap;
  448. struct resource *res;
  449. struct device *dev = &pdev->dev;
  450. u32 bus_speed;
  451. int irq, ret;
  452. priv = devm_kzalloc(dev, sizeof(struct rcar_i2c_priv), GFP_KERNEL);
  453. if (!priv)
  454. return -ENOMEM;
  455. priv->clk = devm_clk_get(dev, NULL);
  456. if (IS_ERR(priv->clk)) {
  457. dev_err(dev, "cannot get clock\n");
  458. return PTR_ERR(priv->clk);
  459. }
  460. bus_speed = 100000; /* default 100 kHz */
  461. ret = of_property_read_u32(dev->of_node, "clock-frequency", &bus_speed);
  462. if (ret < 0 && pdata && pdata->bus_speed)
  463. bus_speed = pdata->bus_speed;
  464. if (pdev->dev.of_node)
  465. priv->devtype = (long)of_match_device(rcar_i2c_dt_ids,
  466. dev)->data;
  467. else
  468. priv->devtype = platform_get_device_id(pdev)->driver_data;
  469. ret = rcar_i2c_clock_calculate(priv, bus_speed, dev);
  470. if (ret < 0)
  471. return ret;
  472. res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
  473. priv->io = devm_ioremap_resource(dev, res);
  474. if (IS_ERR(priv->io))
  475. return PTR_ERR(priv->io);
  476. irq = platform_get_irq(pdev, 0);
  477. init_waitqueue_head(&priv->wait);
  478. spin_lock_init(&priv->lock);
  479. adap = &priv->adap;
  480. adap->nr = pdev->id;
  481. adap->algo = &rcar_i2c_algo;
  482. adap->class = I2C_CLASS_DEPRECATED;
  483. adap->retries = 3;
  484. adap->dev.parent = dev;
  485. adap->dev.of_node = dev->of_node;
  486. i2c_set_adapdata(adap, priv);
  487. strlcpy(adap->name, pdev->name, sizeof(adap->name));
  488. ret = devm_request_irq(dev, irq, rcar_i2c_irq, 0,
  489. dev_name(dev), priv);
  490. if (ret < 0) {
  491. dev_err(dev, "cannot get irq %d\n", irq);
  492. return ret;
  493. }
  494. ret = i2c_add_numbered_adapter(adap);
  495. if (ret < 0) {
  496. dev_err(dev, "reg adap failed: %d\n", ret);
  497. return ret;
  498. }
  499. pm_runtime_enable(dev);
  500. platform_set_drvdata(pdev, priv);
  501. dev_info(dev, "probed\n");
  502. return 0;
  503. }
  504. static int rcar_i2c_remove(struct platform_device *pdev)
  505. {
  506. struct rcar_i2c_priv *priv = platform_get_drvdata(pdev);
  507. struct device *dev = &pdev->dev;
  508. i2c_del_adapter(&priv->adap);
  509. pm_runtime_disable(dev);
  510. return 0;
  511. }
  512. static struct platform_device_id rcar_i2c_id_table[] = {
  513. { "i2c-rcar", I2C_RCAR_GEN1 },
  514. { "i2c-rcar_gen1", I2C_RCAR_GEN1 },
  515. { "i2c-rcar_gen2", I2C_RCAR_GEN2 },
  516. {},
  517. };
  518. MODULE_DEVICE_TABLE(platform, rcar_i2c_id_table);
  519. static struct platform_driver rcar_i2c_driver = {
  520. .driver = {
  521. .name = "i2c-rcar",
  522. .owner = THIS_MODULE,
  523. .of_match_table = rcar_i2c_dt_ids,
  524. },
  525. .probe = rcar_i2c_probe,
  526. .remove = rcar_i2c_remove,
  527. .id_table = rcar_i2c_id_table,
  528. };
  529. module_platform_driver(rcar_i2c_driver);
  530. MODULE_LICENSE("GPL v2");
  531. MODULE_DESCRIPTION("Renesas R-Car I2C bus driver");
  532. MODULE_AUTHOR("Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>");