i2c-octeon.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633
  1. /*
  2. * (C) Copyright 2009-2010
  3. * Nokia Siemens Networks, michael.lawnick.ext@nsn.com
  4. *
  5. * Portions Copyright (C) 2010, 2011 Cavium Networks, Inc.
  6. *
  7. * This is a driver for the i2c adapter in Cavium Networks' OCTEON processors.
  8. *
  9. * This file is licensed under the terms of the GNU General Public
  10. * License version 2. This program is licensed "as is" without any
  11. * warranty of any kind, whether express or implied.
  12. */
  13. #include <linux/platform_device.h>
  14. #include <linux/interrupt.h>
  15. #include <linux/kernel.h>
  16. #include <linux/module.h>
  17. #include <linux/delay.h>
  18. #include <linux/sched.h>
  19. #include <linux/slab.h>
  20. #include <linux/i2c.h>
  21. #include <linux/io.h>
  22. #include <linux/of.h>
  23. #include <asm/octeon/octeon.h>
  24. #define DRV_NAME "i2c-octeon"
  25. /* The previous out-of-tree version was implicitly version 1.0. */
  26. #define DRV_VERSION "2.0"
  27. /* register offsets */
  28. #define SW_TWSI 0x00
  29. #define TWSI_INT 0x10
  30. /* Controller command patterns */
  31. #define SW_TWSI_V 0x8000000000000000ull
  32. #define SW_TWSI_EOP_TWSI_DATA 0x0C00000100000000ull
  33. #define SW_TWSI_EOP_TWSI_CTL 0x0C00000200000000ull
  34. #define SW_TWSI_EOP_TWSI_CLKCTL 0x0C00000300000000ull
  35. #define SW_TWSI_EOP_TWSI_STAT 0x0C00000300000000ull
  36. #define SW_TWSI_EOP_TWSI_RST 0x0C00000700000000ull
  37. #define SW_TWSI_OP_TWSI_CLK 0x0800000000000000ull
  38. #define SW_TWSI_R 0x0100000000000000ull
  39. /* Controller command and status bits */
  40. #define TWSI_CTL_CE 0x80
  41. #define TWSI_CTL_ENAB 0x40
  42. #define TWSI_CTL_STA 0x20
  43. #define TWSI_CTL_STP 0x10
  44. #define TWSI_CTL_IFLG 0x08
  45. #define TWSI_CTL_AAK 0x04
  46. /* Some status values */
  47. #define STAT_START 0x08
  48. #define STAT_RSTART 0x10
  49. #define STAT_TXADDR_ACK 0x18
  50. #define STAT_TXDATA_ACK 0x28
  51. #define STAT_RXADDR_ACK 0x40
  52. #define STAT_RXDATA_ACK 0x50
  53. #define STAT_IDLE 0xF8
  54. struct octeon_i2c {
  55. wait_queue_head_t queue;
  56. struct i2c_adapter adap;
  57. int irq;
  58. u32 twsi_freq;
  59. int sys_freq;
  60. resource_size_t twsi_phys;
  61. void __iomem *twsi_base;
  62. resource_size_t regsize;
  63. struct device *dev;
  64. };
  65. /**
  66. * octeon_i2c_write_sw - write an I2C core register.
  67. * @i2c: The struct octeon_i2c.
  68. * @eop_reg: Register selector.
  69. * @data: Value to be written.
  70. *
  71. * The I2C core registers are accessed indirectly via the SW_TWSI CSR.
  72. */
  73. static void octeon_i2c_write_sw(struct octeon_i2c *i2c,
  74. u64 eop_reg,
  75. u8 data)
  76. {
  77. u64 tmp;
  78. __raw_writeq(SW_TWSI_V | eop_reg | data, i2c->twsi_base + SW_TWSI);
  79. do {
  80. tmp = __raw_readq(i2c->twsi_base + SW_TWSI);
  81. } while ((tmp & SW_TWSI_V) != 0);
  82. }
  83. /**
  84. * octeon_i2c_read_sw - write an I2C core register.
  85. * @i2c: The struct octeon_i2c.
  86. * @eop_reg: Register selector.
  87. *
  88. * Returns the data.
  89. *
  90. * The I2C core registers are accessed indirectly via the SW_TWSI CSR.
  91. */
  92. static u8 octeon_i2c_read_sw(struct octeon_i2c *i2c, u64 eop_reg)
  93. {
  94. u64 tmp;
  95. __raw_writeq(SW_TWSI_V | eop_reg | SW_TWSI_R, i2c->twsi_base + SW_TWSI);
  96. do {
  97. tmp = __raw_readq(i2c->twsi_base + SW_TWSI);
  98. } while ((tmp & SW_TWSI_V) != 0);
  99. return tmp & 0xFF;
  100. }
  101. /**
  102. * octeon_i2c_write_int - write the TWSI_INT register
  103. * @i2c: The struct octeon_i2c.
  104. * @data: Value to be written.
  105. */
  106. static void octeon_i2c_write_int(struct octeon_i2c *i2c, u64 data)
  107. {
  108. __raw_writeq(data, i2c->twsi_base + TWSI_INT);
  109. __raw_readq(i2c->twsi_base + TWSI_INT);
  110. }
  111. /**
  112. * octeon_i2c_int_enable - enable the TS interrupt.
  113. * @i2c: The struct octeon_i2c.
  114. *
  115. * The interrupt will be asserted when there is non-STAT_IDLE state in
  116. * the SW_TWSI_EOP_TWSI_STAT register.
  117. */
  118. static void octeon_i2c_int_enable(struct octeon_i2c *i2c)
  119. {
  120. octeon_i2c_write_int(i2c, 0x40);
  121. }
  122. /**
  123. * octeon_i2c_int_disable - disable the TS interrupt.
  124. * @i2c: The struct octeon_i2c.
  125. */
  126. static void octeon_i2c_int_disable(struct octeon_i2c *i2c)
  127. {
  128. octeon_i2c_write_int(i2c, 0);
  129. }
  130. /**
  131. * octeon_i2c_unblock - unblock the bus.
  132. * @i2c: The struct octeon_i2c.
  133. *
  134. * If there was a reset while a device was driving 0 to bus,
  135. * bus is blocked. We toggle it free manually by some clock
  136. * cycles and send a stop.
  137. */
  138. static void octeon_i2c_unblock(struct octeon_i2c *i2c)
  139. {
  140. int i;
  141. dev_dbg(i2c->dev, "%s\n", __func__);
  142. for (i = 0; i < 9; i++) {
  143. octeon_i2c_write_int(i2c, 0x0);
  144. udelay(5);
  145. octeon_i2c_write_int(i2c, 0x200);
  146. udelay(5);
  147. }
  148. octeon_i2c_write_int(i2c, 0x300);
  149. udelay(5);
  150. octeon_i2c_write_int(i2c, 0x100);
  151. udelay(5);
  152. octeon_i2c_write_int(i2c, 0x0);
  153. }
  154. /**
  155. * octeon_i2c_isr - the interrupt service routine.
  156. * @int: The irq, unused.
  157. * @dev_id: Our struct octeon_i2c.
  158. */
  159. static irqreturn_t octeon_i2c_isr(int irq, void *dev_id)
  160. {
  161. struct octeon_i2c *i2c = dev_id;
  162. octeon_i2c_int_disable(i2c);
  163. wake_up(&i2c->queue);
  164. return IRQ_HANDLED;
  165. }
  166. static int octeon_i2c_test_iflg(struct octeon_i2c *i2c)
  167. {
  168. return (octeon_i2c_read_sw(i2c, SW_TWSI_EOP_TWSI_CTL) & TWSI_CTL_IFLG) != 0;
  169. }
  170. /**
  171. * octeon_i2c_wait - wait for the IFLG to be set.
  172. * @i2c: The struct octeon_i2c.
  173. *
  174. * Returns 0 on success, otherwise a negative errno.
  175. */
  176. static int octeon_i2c_wait(struct octeon_i2c *i2c)
  177. {
  178. long result;
  179. octeon_i2c_int_enable(i2c);
  180. result = wait_event_timeout(i2c->queue,
  181. octeon_i2c_test_iflg(i2c),
  182. i2c->adap.timeout);
  183. octeon_i2c_int_disable(i2c);
  184. if (result == 0) {
  185. dev_dbg(i2c->dev, "%s: timeout\n", __func__);
  186. return -ETIMEDOUT;
  187. }
  188. return 0;
  189. }
  190. /**
  191. * octeon_i2c_start - send START to the bus.
  192. * @i2c: The struct octeon_i2c.
  193. *
  194. * Returns 0 on success, otherwise a negative errno.
  195. */
  196. static int octeon_i2c_start(struct octeon_i2c *i2c)
  197. {
  198. u8 data;
  199. int result;
  200. octeon_i2c_write_sw(i2c, SW_TWSI_EOP_TWSI_CTL,
  201. TWSI_CTL_ENAB | TWSI_CTL_STA);
  202. result = octeon_i2c_wait(i2c);
  203. if (result) {
  204. if (octeon_i2c_read_sw(i2c, SW_TWSI_EOP_TWSI_STAT) == STAT_IDLE) {
  205. /*
  206. * Controller refused to send start flag May
  207. * be a client is holding SDA low - let's try
  208. * to free it.
  209. */
  210. octeon_i2c_unblock(i2c);
  211. octeon_i2c_write_sw(i2c, SW_TWSI_EOP_TWSI_CTL,
  212. TWSI_CTL_ENAB | TWSI_CTL_STA);
  213. result = octeon_i2c_wait(i2c);
  214. }
  215. if (result)
  216. return result;
  217. }
  218. data = octeon_i2c_read_sw(i2c, SW_TWSI_EOP_TWSI_STAT);
  219. if ((data != STAT_START) && (data != STAT_RSTART)) {
  220. dev_err(i2c->dev, "%s: bad status (0x%x)\n", __func__, data);
  221. return -EIO;
  222. }
  223. return 0;
  224. }
  225. /**
  226. * octeon_i2c_stop - send STOP to the bus.
  227. * @i2c: The struct octeon_i2c.
  228. *
  229. * Returns 0 on success, otherwise a negative errno.
  230. */
  231. static int octeon_i2c_stop(struct octeon_i2c *i2c)
  232. {
  233. u8 data;
  234. octeon_i2c_write_sw(i2c, SW_TWSI_EOP_TWSI_CTL,
  235. TWSI_CTL_ENAB | TWSI_CTL_STP);
  236. data = octeon_i2c_read_sw(i2c, SW_TWSI_EOP_TWSI_STAT);
  237. if (data != STAT_IDLE) {
  238. dev_err(i2c->dev, "%s: bad status(0x%x)\n", __func__, data);
  239. return -EIO;
  240. }
  241. return 0;
  242. }
  243. /**
  244. * octeon_i2c_write - send data to the bus.
  245. * @i2c: The struct octeon_i2c.
  246. * @target: Target address.
  247. * @data: Pointer to the data to be sent.
  248. * @length: Length of the data.
  249. *
  250. * The address is sent over the bus, then the data.
  251. *
  252. * Returns 0 on success, otherwise a negative errno.
  253. */
  254. static int octeon_i2c_write(struct octeon_i2c *i2c, int target,
  255. const u8 *data, int length)
  256. {
  257. int i, result;
  258. u8 tmp;
  259. result = octeon_i2c_start(i2c);
  260. if (result)
  261. return result;
  262. octeon_i2c_write_sw(i2c, SW_TWSI_EOP_TWSI_DATA, target << 1);
  263. octeon_i2c_write_sw(i2c, SW_TWSI_EOP_TWSI_CTL, TWSI_CTL_ENAB);
  264. result = octeon_i2c_wait(i2c);
  265. if (result)
  266. return result;
  267. for (i = 0; i < length; i++) {
  268. tmp = octeon_i2c_read_sw(i2c, SW_TWSI_EOP_TWSI_STAT);
  269. if ((tmp != STAT_TXADDR_ACK) && (tmp != STAT_TXDATA_ACK)) {
  270. dev_err(i2c->dev,
  271. "%s: bad status before write (0x%x)\n",
  272. __func__, tmp);
  273. return -EIO;
  274. }
  275. octeon_i2c_write_sw(i2c, SW_TWSI_EOP_TWSI_DATA, data[i]);
  276. octeon_i2c_write_sw(i2c, SW_TWSI_EOP_TWSI_CTL, TWSI_CTL_ENAB);
  277. result = octeon_i2c_wait(i2c);
  278. if (result)
  279. return result;
  280. }
  281. return 0;
  282. }
  283. /**
  284. * octeon_i2c_read - receive data from the bus.
  285. * @i2c: The struct octeon_i2c.
  286. * @target: Target address.
  287. * @data: Pointer to the location to store the datae .
  288. * @length: Length of the data.
  289. *
  290. * The address is sent over the bus, then the data is read.
  291. *
  292. * Returns 0 on success, otherwise a negative errno.
  293. */
  294. static int octeon_i2c_read(struct octeon_i2c *i2c, int target,
  295. u8 *data, int length)
  296. {
  297. int i, result;
  298. u8 tmp;
  299. if (length < 1)
  300. return -EINVAL;
  301. result = octeon_i2c_start(i2c);
  302. if (result)
  303. return result;
  304. octeon_i2c_write_sw(i2c, SW_TWSI_EOP_TWSI_DATA, (target<<1) | 1);
  305. octeon_i2c_write_sw(i2c, SW_TWSI_EOP_TWSI_CTL, TWSI_CTL_ENAB);
  306. result = octeon_i2c_wait(i2c);
  307. if (result)
  308. return result;
  309. for (i = 0; i < length; i++) {
  310. tmp = octeon_i2c_read_sw(i2c, SW_TWSI_EOP_TWSI_STAT);
  311. if ((tmp != STAT_RXDATA_ACK) && (tmp != STAT_RXADDR_ACK)) {
  312. dev_err(i2c->dev,
  313. "%s: bad status before read (0x%x)\n",
  314. __func__, tmp);
  315. return -EIO;
  316. }
  317. if (i+1 < length)
  318. octeon_i2c_write_sw(i2c, SW_TWSI_EOP_TWSI_CTL,
  319. TWSI_CTL_ENAB | TWSI_CTL_AAK);
  320. else
  321. octeon_i2c_write_sw(i2c, SW_TWSI_EOP_TWSI_CTL,
  322. TWSI_CTL_ENAB);
  323. result = octeon_i2c_wait(i2c);
  324. if (result)
  325. return result;
  326. data[i] = octeon_i2c_read_sw(i2c, SW_TWSI_EOP_TWSI_DATA);
  327. }
  328. return 0;
  329. }
  330. /**
  331. * octeon_i2c_xfer - The driver's master_xfer function.
  332. * @adap: Pointer to the i2c_adapter structure.
  333. * @msgs: Pointer to the messages to be processed.
  334. * @num: Length of the MSGS array.
  335. *
  336. * Returns the number of messages processed, or a negative errno on
  337. * failure.
  338. */
  339. static int octeon_i2c_xfer(struct i2c_adapter *adap,
  340. struct i2c_msg *msgs,
  341. int num)
  342. {
  343. struct i2c_msg *pmsg;
  344. int i;
  345. int ret = 0;
  346. struct octeon_i2c *i2c = i2c_get_adapdata(adap);
  347. for (i = 0; ret == 0 && i < num; i++) {
  348. pmsg = &msgs[i];
  349. dev_dbg(i2c->dev,
  350. "Doing %s %d byte(s) to/from 0x%02x - %d of %d messages\n",
  351. pmsg->flags & I2C_M_RD ? "read" : "write",
  352. pmsg->len, pmsg->addr, i + 1, num);
  353. if (pmsg->flags & I2C_M_RD)
  354. ret = octeon_i2c_read(i2c, pmsg->addr, pmsg->buf,
  355. pmsg->len);
  356. else
  357. ret = octeon_i2c_write(i2c, pmsg->addr, pmsg->buf,
  358. pmsg->len);
  359. }
  360. octeon_i2c_stop(i2c);
  361. return (ret != 0) ? ret : num;
  362. }
  363. static u32 octeon_i2c_functionality(struct i2c_adapter *adap)
  364. {
  365. return I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL;
  366. }
  367. static const struct i2c_algorithm octeon_i2c_algo = {
  368. .master_xfer = octeon_i2c_xfer,
  369. .functionality = octeon_i2c_functionality,
  370. };
  371. static struct i2c_adapter octeon_i2c_ops = {
  372. .owner = THIS_MODULE,
  373. .name = "OCTEON adapter",
  374. .algo = &octeon_i2c_algo,
  375. .timeout = HZ / 50,
  376. };
  377. /**
  378. * octeon_i2c_setclock - Calculate and set clock divisors.
  379. */
  380. static int octeon_i2c_setclock(struct octeon_i2c *i2c)
  381. {
  382. int tclk, thp_base, inc, thp_idx, mdiv_idx, ndiv_idx, foscl, diff;
  383. int thp = 0x18, mdiv = 2, ndiv = 0, delta_hz = 1000000;
  384. for (ndiv_idx = 0; ndiv_idx < 8 && delta_hz != 0; ndiv_idx++) {
  385. /*
  386. * An mdiv value of less than 2 seems to not work well
  387. * with ds1337 RTCs, so we constrain it to larger
  388. * values.
  389. */
  390. for (mdiv_idx = 15; mdiv_idx >= 2 && delta_hz != 0; mdiv_idx--) {
  391. /*
  392. * For given ndiv and mdiv values check the
  393. * two closest thp values.
  394. */
  395. tclk = i2c->twsi_freq * (mdiv_idx + 1) * 10;
  396. tclk *= (1 << ndiv_idx);
  397. thp_base = (i2c->sys_freq / (tclk * 2)) - 1;
  398. for (inc = 0; inc <= 1; inc++) {
  399. thp_idx = thp_base + inc;
  400. if (thp_idx < 5 || thp_idx > 0xff)
  401. continue;
  402. foscl = i2c->sys_freq / (2 * (thp_idx + 1));
  403. foscl = foscl / (1 << ndiv_idx);
  404. foscl = foscl / (mdiv_idx + 1) / 10;
  405. diff = abs(foscl - i2c->twsi_freq);
  406. if (diff < delta_hz) {
  407. delta_hz = diff;
  408. thp = thp_idx;
  409. mdiv = mdiv_idx;
  410. ndiv = ndiv_idx;
  411. }
  412. }
  413. }
  414. }
  415. octeon_i2c_write_sw(i2c, SW_TWSI_OP_TWSI_CLK, thp);
  416. octeon_i2c_write_sw(i2c, SW_TWSI_EOP_TWSI_CLKCTL, (mdiv << 3) | ndiv);
  417. return 0;
  418. }
  419. static int octeon_i2c_initlowlevel(struct octeon_i2c *i2c)
  420. {
  421. u8 status;
  422. int tries;
  423. /* disable high level controller, enable bus access */
  424. octeon_i2c_write_sw(i2c, SW_TWSI_EOP_TWSI_CTL, TWSI_CTL_ENAB);
  425. /* reset controller */
  426. octeon_i2c_write_sw(i2c, SW_TWSI_EOP_TWSI_RST, 0);
  427. for (tries = 10; tries; tries--) {
  428. udelay(1);
  429. status = octeon_i2c_read_sw(i2c, SW_TWSI_EOP_TWSI_STAT);
  430. if (status == STAT_IDLE)
  431. return 0;
  432. }
  433. dev_err(i2c->dev, "%s: TWSI_RST failed! (0x%x)\n", __func__, status);
  434. return -EIO;
  435. }
  436. static int octeon_i2c_probe(struct platform_device *pdev)
  437. {
  438. int irq, result = 0;
  439. struct octeon_i2c *i2c;
  440. struct resource *res_mem;
  441. /* All adaptors have an irq. */
  442. irq = platform_get_irq(pdev, 0);
  443. if (irq < 0)
  444. return irq;
  445. i2c = devm_kzalloc(&pdev->dev, sizeof(*i2c), GFP_KERNEL);
  446. if (!i2c) {
  447. dev_err(&pdev->dev, "kzalloc failed\n");
  448. result = -ENOMEM;
  449. goto out;
  450. }
  451. i2c->dev = &pdev->dev;
  452. res_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
  453. if (res_mem == NULL) {
  454. dev_err(i2c->dev, "found no memory resource\n");
  455. result = -ENXIO;
  456. goto out;
  457. }
  458. i2c->twsi_phys = res_mem->start;
  459. i2c->regsize = resource_size(res_mem);
  460. /*
  461. * "clock-rate" is a legacy binding, the official binding is
  462. * "clock-frequency". Try the official one first and then
  463. * fall back if it doesn't exist.
  464. */
  465. if (of_property_read_u32(pdev->dev.of_node,
  466. "clock-frequency", &i2c->twsi_freq) &&
  467. of_property_read_u32(pdev->dev.of_node,
  468. "clock-rate", &i2c->twsi_freq)) {
  469. dev_err(i2c->dev,
  470. "no I2C 'clock-rate' or 'clock-frequency' property\n");
  471. result = -ENXIO;
  472. goto out;
  473. }
  474. i2c->sys_freq = octeon_get_io_clock_rate();
  475. if (!devm_request_mem_region(&pdev->dev, i2c->twsi_phys, i2c->regsize,
  476. res_mem->name)) {
  477. dev_err(i2c->dev, "request_mem_region failed\n");
  478. goto out;
  479. }
  480. i2c->twsi_base = devm_ioremap(&pdev->dev, i2c->twsi_phys, i2c->regsize);
  481. init_waitqueue_head(&i2c->queue);
  482. i2c->irq = irq;
  483. result = devm_request_irq(&pdev->dev, i2c->irq,
  484. octeon_i2c_isr, 0, DRV_NAME, i2c);
  485. if (result < 0) {
  486. dev_err(i2c->dev, "failed to attach interrupt\n");
  487. goto out;
  488. }
  489. result = octeon_i2c_initlowlevel(i2c);
  490. if (result) {
  491. dev_err(i2c->dev, "init low level failed\n");
  492. goto out;
  493. }
  494. result = octeon_i2c_setclock(i2c);
  495. if (result) {
  496. dev_err(i2c->dev, "clock init failed\n");
  497. goto out;
  498. }
  499. i2c->adap = octeon_i2c_ops;
  500. i2c->adap.dev.parent = &pdev->dev;
  501. i2c->adap.dev.of_node = pdev->dev.of_node;
  502. i2c_set_adapdata(&i2c->adap, i2c);
  503. platform_set_drvdata(pdev, i2c);
  504. result = i2c_add_adapter(&i2c->adap);
  505. if (result < 0) {
  506. dev_err(i2c->dev, "failed to add adapter\n");
  507. goto out;
  508. }
  509. dev_info(i2c->dev, "version %s\n", DRV_VERSION);
  510. return 0;
  511. out:
  512. return result;
  513. };
  514. static int octeon_i2c_remove(struct platform_device *pdev)
  515. {
  516. struct octeon_i2c *i2c = platform_get_drvdata(pdev);
  517. i2c_del_adapter(&i2c->adap);
  518. return 0;
  519. };
  520. static struct of_device_id octeon_i2c_match[] = {
  521. {
  522. .compatible = "cavium,octeon-3860-twsi",
  523. },
  524. {},
  525. };
  526. MODULE_DEVICE_TABLE(of, octeon_i2c_match);
  527. static struct platform_driver octeon_i2c_driver = {
  528. .probe = octeon_i2c_probe,
  529. .remove = octeon_i2c_remove,
  530. .driver = {
  531. .name = DRV_NAME,
  532. .of_match_table = octeon_i2c_match,
  533. },
  534. };
  535. module_platform_driver(octeon_i2c_driver);
  536. MODULE_AUTHOR("Michael Lawnick <michael.lawnick.ext@nsn.com>");
  537. MODULE_DESCRIPTION("I2C-Bus adapter for Cavium OCTEON processors");
  538. MODULE_LICENSE("GPL");
  539. MODULE_VERSION(DRV_VERSION);