i2c-rcar.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635
  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) & 0xFF)
  73. #define RCAR_IRQ_ACK_RECV (~(MAT | MDR) & 0xFF)
  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 >= 1U << 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 void 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. }
  224. /*
  225. * interrupt functions
  226. */
  227. static int rcar_i2c_irq_send(struct rcar_i2c_priv *priv, u32 msr)
  228. {
  229. struct i2c_msg *msg = priv->msg;
  230. /*
  231. * FIXME
  232. * sometimes, unknown interrupt happened.
  233. * Do nothing
  234. */
  235. if (!(msr & MDE))
  236. return 0;
  237. /*
  238. * If address transfer phase finished,
  239. * goto data phase.
  240. */
  241. if (msr & MAT)
  242. rcar_i2c_write(priv, ICMCR, RCAR_BUS_PHASE_DATA);
  243. if (priv->pos < msg->len) {
  244. /*
  245. * Prepare next data to ICRXTX register.
  246. * This data will go to _SHIFT_ register.
  247. *
  248. * *
  249. * [ICRXTX] -> [SHIFT] -> [I2C bus]
  250. */
  251. rcar_i2c_write(priv, ICRXTX, msg->buf[priv->pos]);
  252. priv->pos++;
  253. } else {
  254. /*
  255. * The last data was pushed to ICRXTX on _PREV_ empty irq.
  256. * It is on _SHIFT_ register, and will sent to I2C bus.
  257. *
  258. * *
  259. * [ICRXTX] -> [SHIFT] -> [I2C bus]
  260. */
  261. if (priv->flags & ID_LAST_MSG)
  262. /*
  263. * If current msg is the _LAST_ msg,
  264. * prepare stop condition here.
  265. * ID_DONE will be set on STOP irq.
  266. */
  267. rcar_i2c_write(priv, ICMCR, RCAR_BUS_PHASE_STOP);
  268. else
  269. /*
  270. * If current msg is _NOT_ last msg,
  271. * it doesn't call stop phase.
  272. * thus, there is no STOP irq.
  273. * return ID_DONE here.
  274. */
  275. return ID_DONE;
  276. }
  277. rcar_i2c_write(priv, ICMSR, RCAR_IRQ_ACK_SEND);
  278. return 0;
  279. }
  280. static int rcar_i2c_irq_recv(struct rcar_i2c_priv *priv, u32 msr)
  281. {
  282. struct i2c_msg *msg = priv->msg;
  283. /*
  284. * FIXME
  285. * sometimes, unknown interrupt happened.
  286. * Do nothing
  287. */
  288. if (!(msr & MDR))
  289. return 0;
  290. if (msr & MAT) {
  291. /*
  292. * Address transfer phase finished,
  293. * but, there is no data at this point.
  294. * Do nothing.
  295. */
  296. } else if (priv->pos < msg->len) {
  297. /*
  298. * get received data
  299. */
  300. msg->buf[priv->pos] = rcar_i2c_read(priv, ICRXTX);
  301. priv->pos++;
  302. }
  303. /*
  304. * If next received data is the _LAST_,
  305. * go to STOP phase,
  306. * otherwise, go to DATA phase.
  307. */
  308. if (priv->pos + 1 >= msg->len)
  309. rcar_i2c_write(priv, ICMCR, RCAR_BUS_PHASE_STOP);
  310. else
  311. rcar_i2c_write(priv, ICMCR, RCAR_BUS_PHASE_DATA);
  312. rcar_i2c_write(priv, ICMSR, RCAR_IRQ_ACK_RECV);
  313. return 0;
  314. }
  315. static irqreturn_t rcar_i2c_irq(int irq, void *ptr)
  316. {
  317. struct rcar_i2c_priv *priv = ptr;
  318. irqreturn_t result = IRQ_HANDLED;
  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. if (!msr) {
  326. result = IRQ_NONE;
  327. goto exit;
  328. }
  329. /* Arbitration lost */
  330. if (msr & MAL) {
  331. rcar_i2c_flags_set(priv, (ID_DONE | ID_ARBLOST));
  332. goto out;
  333. }
  334. /* Nack */
  335. if (msr & MNR) {
  336. /* go to stop phase */
  337. rcar_i2c_write(priv, ICMCR, RCAR_BUS_PHASE_STOP);
  338. rcar_i2c_write(priv, ICMIER, RCAR_IRQ_STOP);
  339. rcar_i2c_flags_set(priv, ID_NACK);
  340. goto out;
  341. }
  342. /* Stop */
  343. if (msr & MST) {
  344. rcar_i2c_flags_set(priv, ID_DONE);
  345. goto out;
  346. }
  347. if (rcar_i2c_is_recv(priv))
  348. rcar_i2c_flags_set(priv, rcar_i2c_irq_recv(priv, msr));
  349. else
  350. rcar_i2c_flags_set(priv, rcar_i2c_irq_send(priv, msr));
  351. out:
  352. if (rcar_i2c_flags_has(priv, ID_DONE)) {
  353. rcar_i2c_write(priv, ICMIER, 0);
  354. rcar_i2c_write(priv, ICMSR, 0);
  355. wake_up(&priv->wait);
  356. }
  357. exit:
  358. spin_unlock(&priv->lock);
  359. /*-------------- spin unlock -----------------*/
  360. return result;
  361. }
  362. static int rcar_i2c_master_xfer(struct i2c_adapter *adap,
  363. struct i2c_msg *msgs,
  364. int num)
  365. {
  366. struct rcar_i2c_priv *priv = i2c_get_adapdata(adap);
  367. struct device *dev = rcar_i2c_priv_to_dev(priv);
  368. unsigned long flags;
  369. int i, ret, timeout;
  370. pm_runtime_get_sync(dev);
  371. /*-------------- spin lock -----------------*/
  372. spin_lock_irqsave(&priv->lock, flags);
  373. rcar_i2c_init(priv);
  374. /* start clock */
  375. rcar_i2c_write(priv, ICCCR, priv->icccr);
  376. spin_unlock_irqrestore(&priv->lock, flags);
  377. /*-------------- spin unlock -----------------*/
  378. ret = rcar_i2c_bus_barrier(priv);
  379. if (ret < 0)
  380. goto out;
  381. for (i = 0; i < num; i++) {
  382. /* This HW can't send STOP after address phase */
  383. if (msgs[i].len == 0) {
  384. ret = -EOPNOTSUPP;
  385. break;
  386. }
  387. /*-------------- spin lock -----------------*/
  388. spin_lock_irqsave(&priv->lock, flags);
  389. /* init each data */
  390. priv->msg = &msgs[i];
  391. priv->pos = 0;
  392. priv->flags = 0;
  393. if (i == num - 1)
  394. rcar_i2c_flags_set(priv, ID_LAST_MSG);
  395. rcar_i2c_prepare_msg(priv);
  396. spin_unlock_irqrestore(&priv->lock, flags);
  397. /*-------------- spin unlock -----------------*/
  398. timeout = wait_event_timeout(priv->wait,
  399. rcar_i2c_flags_has(priv, ID_DONE),
  400. 5 * HZ);
  401. if (!timeout) {
  402. ret = -ETIMEDOUT;
  403. break;
  404. }
  405. if (rcar_i2c_flags_has(priv, ID_NACK)) {
  406. ret = -ENXIO;
  407. break;
  408. }
  409. if (rcar_i2c_flags_has(priv, ID_ARBLOST)) {
  410. ret = -EAGAIN;
  411. break;
  412. }
  413. if (rcar_i2c_flags_has(priv, ID_IOERROR)) {
  414. ret = -EIO;
  415. break;
  416. }
  417. ret = i + 1; /* The number of transfer */
  418. }
  419. out:
  420. pm_runtime_put(dev);
  421. if (ret < 0 && ret != -ENXIO)
  422. dev_err(dev, "error %d : %x\n", ret, priv->flags);
  423. return ret;
  424. }
  425. static u32 rcar_i2c_func(struct i2c_adapter *adap)
  426. {
  427. /* This HW can't do SMBUS_QUICK and NOSTART */
  428. return I2C_FUNC_I2C | (I2C_FUNC_SMBUS_EMUL & ~I2C_FUNC_SMBUS_QUICK);
  429. }
  430. static const struct i2c_algorithm rcar_i2c_algo = {
  431. .master_xfer = rcar_i2c_master_xfer,
  432. .functionality = rcar_i2c_func,
  433. };
  434. static const struct of_device_id rcar_i2c_dt_ids[] = {
  435. { .compatible = "renesas,i2c-rcar", .data = (void *)I2C_RCAR_GEN1 },
  436. { .compatible = "renesas,i2c-r8a7778", .data = (void *)I2C_RCAR_GEN1 },
  437. { .compatible = "renesas,i2c-r8a7779", .data = (void *)I2C_RCAR_GEN1 },
  438. { .compatible = "renesas,i2c-r8a7790", .data = (void *)I2C_RCAR_GEN2 },
  439. { .compatible = "renesas,i2c-r8a7791", .data = (void *)I2C_RCAR_GEN2 },
  440. { .compatible = "renesas,i2c-r8a7792", .data = (void *)I2C_RCAR_GEN2 },
  441. { .compatible = "renesas,i2c-r8a7793", .data = (void *)I2C_RCAR_GEN2 },
  442. { .compatible = "renesas,i2c-r8a7794", .data = (void *)I2C_RCAR_GEN2 },
  443. {},
  444. };
  445. MODULE_DEVICE_TABLE(of, rcar_i2c_dt_ids);
  446. static int rcar_i2c_probe(struct platform_device *pdev)
  447. {
  448. struct i2c_rcar_platform_data *pdata = dev_get_platdata(&pdev->dev);
  449. struct rcar_i2c_priv *priv;
  450. struct i2c_adapter *adap;
  451. struct resource *res;
  452. struct device *dev = &pdev->dev;
  453. u32 bus_speed;
  454. int irq, ret;
  455. priv = devm_kzalloc(dev, sizeof(struct rcar_i2c_priv), GFP_KERNEL);
  456. if (!priv)
  457. return -ENOMEM;
  458. priv->clk = devm_clk_get(dev, NULL);
  459. if (IS_ERR(priv->clk)) {
  460. dev_err(dev, "cannot get clock\n");
  461. return PTR_ERR(priv->clk);
  462. }
  463. bus_speed = 100000; /* default 100 kHz */
  464. ret = of_property_read_u32(dev->of_node, "clock-frequency", &bus_speed);
  465. if (ret < 0 && pdata && pdata->bus_speed)
  466. bus_speed = pdata->bus_speed;
  467. if (pdev->dev.of_node)
  468. priv->devtype = (long)of_match_device(rcar_i2c_dt_ids,
  469. dev)->data;
  470. else
  471. priv->devtype = platform_get_device_id(pdev)->driver_data;
  472. ret = rcar_i2c_clock_calculate(priv, bus_speed, dev);
  473. if (ret < 0)
  474. return ret;
  475. res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
  476. priv->io = devm_ioremap_resource(dev, res);
  477. if (IS_ERR(priv->io))
  478. return PTR_ERR(priv->io);
  479. irq = platform_get_irq(pdev, 0);
  480. init_waitqueue_head(&priv->wait);
  481. spin_lock_init(&priv->lock);
  482. adap = &priv->adap;
  483. adap->nr = pdev->id;
  484. adap->algo = &rcar_i2c_algo;
  485. adap->class = I2C_CLASS_DEPRECATED;
  486. adap->retries = 3;
  487. adap->dev.parent = dev;
  488. adap->dev.of_node = dev->of_node;
  489. i2c_set_adapdata(adap, priv);
  490. strlcpy(adap->name, pdev->name, sizeof(adap->name));
  491. ret = devm_request_irq(dev, irq, rcar_i2c_irq, 0,
  492. dev_name(dev), priv);
  493. if (ret < 0) {
  494. dev_err(dev, "cannot get irq %d\n", irq);
  495. return ret;
  496. }
  497. ret = i2c_add_numbered_adapter(adap);
  498. if (ret < 0) {
  499. dev_err(dev, "reg adap failed: %d\n", ret);
  500. return ret;
  501. }
  502. pm_runtime_enable(dev);
  503. platform_set_drvdata(pdev, priv);
  504. dev_info(dev, "probed\n");
  505. return 0;
  506. }
  507. static int rcar_i2c_remove(struct platform_device *pdev)
  508. {
  509. struct rcar_i2c_priv *priv = platform_get_drvdata(pdev);
  510. struct device *dev = &pdev->dev;
  511. i2c_del_adapter(&priv->adap);
  512. pm_runtime_disable(dev);
  513. return 0;
  514. }
  515. static struct platform_device_id rcar_i2c_id_table[] = {
  516. { "i2c-rcar", I2C_RCAR_GEN1 },
  517. { "i2c-rcar_gen1", I2C_RCAR_GEN1 },
  518. { "i2c-rcar_gen2", I2C_RCAR_GEN2 },
  519. {},
  520. };
  521. MODULE_DEVICE_TABLE(platform, rcar_i2c_id_table);
  522. static struct platform_driver rcar_i2c_driver = {
  523. .driver = {
  524. .name = "i2c-rcar",
  525. .owner = THIS_MODULE,
  526. .of_match_table = rcar_i2c_dt_ids,
  527. },
  528. .probe = rcar_i2c_probe,
  529. .remove = rcar_i2c_remove,
  530. .id_table = rcar_i2c_id_table,
  531. };
  532. module_platform_driver(rcar_i2c_driver);
  533. MODULE_LICENSE("GPL v2");
  534. MODULE_DESCRIPTION("Renesas R-Car I2C bus driver");
  535. MODULE_AUTHOR("Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>");