i2c-bcm-iproc.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583
  1. /*
  2. * Copyright (C) 2014 Broadcom Corporation
  3. *
  4. * This program is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU General Public License as
  6. * published by the Free Software Foundation version 2.
  7. *
  8. * This program is distributed "as is" WITHOUT ANY WARRANTY of any
  9. * kind, whether express or implied; without even the implied warranty
  10. * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. * GNU General Public License for more details.
  12. */
  13. #include <linux/delay.h>
  14. #include <linux/i2c.h>
  15. #include <linux/interrupt.h>
  16. #include <linux/io.h>
  17. #include <linux/kernel.h>
  18. #include <linux/module.h>
  19. #include <linux/platform_device.h>
  20. #include <linux/slab.h>
  21. #define CFG_OFFSET 0x00
  22. #define CFG_RESET_SHIFT 31
  23. #define CFG_EN_SHIFT 30
  24. #define CFG_M_RETRY_CNT_SHIFT 16
  25. #define CFG_M_RETRY_CNT_MASK 0x0f
  26. #define TIM_CFG_OFFSET 0x04
  27. #define TIM_CFG_MODE_400_SHIFT 31
  28. #define M_FIFO_CTRL_OFFSET 0x0c
  29. #define M_FIFO_RX_FLUSH_SHIFT 31
  30. #define M_FIFO_TX_FLUSH_SHIFT 30
  31. #define M_FIFO_RX_CNT_SHIFT 16
  32. #define M_FIFO_RX_CNT_MASK 0x7f
  33. #define M_FIFO_RX_THLD_SHIFT 8
  34. #define M_FIFO_RX_THLD_MASK 0x3f
  35. #define M_CMD_OFFSET 0x30
  36. #define M_CMD_START_BUSY_SHIFT 31
  37. #define M_CMD_STATUS_SHIFT 25
  38. #define M_CMD_STATUS_MASK 0x07
  39. #define M_CMD_STATUS_SUCCESS 0x0
  40. #define M_CMD_STATUS_LOST_ARB 0x1
  41. #define M_CMD_STATUS_NACK_ADDR 0x2
  42. #define M_CMD_STATUS_NACK_DATA 0x3
  43. #define M_CMD_STATUS_TIMEOUT 0x4
  44. #define M_CMD_PROTOCOL_SHIFT 9
  45. #define M_CMD_PROTOCOL_MASK 0xf
  46. #define M_CMD_PROTOCOL_BLK_WR 0x7
  47. #define M_CMD_PROTOCOL_BLK_RD 0x8
  48. #define M_CMD_PEC_SHIFT 8
  49. #define M_CMD_RD_CNT_SHIFT 0
  50. #define M_CMD_RD_CNT_MASK 0xff
  51. #define IE_OFFSET 0x38
  52. #define IE_M_RX_FIFO_FULL_SHIFT 31
  53. #define IE_M_RX_THLD_SHIFT 30
  54. #define IE_M_START_BUSY_SHIFT 28
  55. #define IE_M_TX_UNDERRUN_SHIFT 27
  56. #define IS_OFFSET 0x3c
  57. #define IS_M_RX_FIFO_FULL_SHIFT 31
  58. #define IS_M_RX_THLD_SHIFT 30
  59. #define IS_M_START_BUSY_SHIFT 28
  60. #define IS_M_TX_UNDERRUN_SHIFT 27
  61. #define M_TX_OFFSET 0x40
  62. #define M_TX_WR_STATUS_SHIFT 31
  63. #define M_TX_DATA_SHIFT 0
  64. #define M_TX_DATA_MASK 0xff
  65. #define M_RX_OFFSET 0x44
  66. #define M_RX_STATUS_SHIFT 30
  67. #define M_RX_STATUS_MASK 0x03
  68. #define M_RX_PEC_ERR_SHIFT 29
  69. #define M_RX_DATA_SHIFT 0
  70. #define M_RX_DATA_MASK 0xff
  71. #define I2C_TIMEOUT_MSEC 50000
  72. #define M_TX_RX_FIFO_SIZE 64
  73. enum bus_speed_index {
  74. I2C_SPD_100K = 0,
  75. I2C_SPD_400K,
  76. };
  77. struct bcm_iproc_i2c_dev {
  78. struct device *device;
  79. int irq;
  80. void __iomem *base;
  81. struct i2c_adapter adapter;
  82. unsigned int bus_speed;
  83. struct completion done;
  84. int xfer_is_done;
  85. struct i2c_msg *msg;
  86. /* bytes that have been transferred */
  87. unsigned int tx_bytes;
  88. };
  89. /*
  90. * Can be expanded in the future if more interrupt status bits are utilized
  91. */
  92. #define ISR_MASK (BIT(IS_M_START_BUSY_SHIFT) | BIT(IS_M_TX_UNDERRUN_SHIFT))
  93. static irqreturn_t bcm_iproc_i2c_isr(int irq, void *data)
  94. {
  95. struct bcm_iproc_i2c_dev *iproc_i2c = data;
  96. u32 status = readl(iproc_i2c->base + IS_OFFSET);
  97. status &= ISR_MASK;
  98. if (!status)
  99. return IRQ_NONE;
  100. /* TX FIFO is empty and we have more data to send */
  101. if (status & BIT(IS_M_TX_UNDERRUN_SHIFT)) {
  102. struct i2c_msg *msg = iproc_i2c->msg;
  103. unsigned int tx_bytes = msg->len - iproc_i2c->tx_bytes;
  104. unsigned int i;
  105. u32 val;
  106. /* can only fill up to the FIFO size */
  107. tx_bytes = min_t(unsigned int, tx_bytes, M_TX_RX_FIFO_SIZE);
  108. for (i = 0; i < tx_bytes; i++) {
  109. /* start from where we left over */
  110. unsigned int idx = iproc_i2c->tx_bytes + i;
  111. val = msg->buf[idx];
  112. /* mark the last byte */
  113. if (idx == msg->len - 1) {
  114. u32 tmp;
  115. val |= BIT(M_TX_WR_STATUS_SHIFT);
  116. /*
  117. * Since this is the last byte, we should
  118. * now disable TX FIFO underrun interrupt
  119. */
  120. tmp = readl(iproc_i2c->base + IE_OFFSET);
  121. tmp &= ~BIT(IE_M_TX_UNDERRUN_SHIFT);
  122. writel(tmp, iproc_i2c->base + IE_OFFSET);
  123. }
  124. /* load data into TX FIFO */
  125. writel(val, iproc_i2c->base + M_TX_OFFSET);
  126. }
  127. /* update number of transferred bytes */
  128. iproc_i2c->tx_bytes += tx_bytes;
  129. }
  130. if (status & BIT(IS_M_START_BUSY_SHIFT)) {
  131. iproc_i2c->xfer_is_done = 1;
  132. complete(&iproc_i2c->done);
  133. }
  134. writel(status, iproc_i2c->base + IS_OFFSET);
  135. return IRQ_HANDLED;
  136. }
  137. static int bcm_iproc_i2c_init(struct bcm_iproc_i2c_dev *iproc_i2c)
  138. {
  139. u32 val;
  140. /* put controller in reset */
  141. val = readl(iproc_i2c->base + CFG_OFFSET);
  142. val |= 1 << CFG_RESET_SHIFT;
  143. val &= ~(1 << CFG_EN_SHIFT);
  144. writel(val, iproc_i2c->base + CFG_OFFSET);
  145. /* wait 100 usec per spec */
  146. udelay(100);
  147. /* bring controller out of reset */
  148. val &= ~(1 << CFG_RESET_SHIFT);
  149. writel(val, iproc_i2c->base + CFG_OFFSET);
  150. /* flush TX/RX FIFOs and set RX FIFO threshold to zero */
  151. val = (1 << M_FIFO_RX_FLUSH_SHIFT) | (1 << M_FIFO_TX_FLUSH_SHIFT);
  152. writel(val, iproc_i2c->base + M_FIFO_CTRL_OFFSET);
  153. /* disable all interrupts */
  154. writel(0, iproc_i2c->base + IE_OFFSET);
  155. /* clear all pending interrupts */
  156. writel(0xffffffff, iproc_i2c->base + IS_OFFSET);
  157. return 0;
  158. }
  159. static void bcm_iproc_i2c_enable_disable(struct bcm_iproc_i2c_dev *iproc_i2c,
  160. bool enable)
  161. {
  162. u32 val;
  163. val = readl(iproc_i2c->base + CFG_OFFSET);
  164. if (enable)
  165. val |= BIT(CFG_EN_SHIFT);
  166. else
  167. val &= ~BIT(CFG_EN_SHIFT);
  168. writel(val, iproc_i2c->base + CFG_OFFSET);
  169. }
  170. static int bcm_iproc_i2c_check_status(struct bcm_iproc_i2c_dev *iproc_i2c,
  171. struct i2c_msg *msg)
  172. {
  173. u32 val;
  174. val = readl(iproc_i2c->base + M_CMD_OFFSET);
  175. val = (val >> M_CMD_STATUS_SHIFT) & M_CMD_STATUS_MASK;
  176. switch (val) {
  177. case M_CMD_STATUS_SUCCESS:
  178. return 0;
  179. case M_CMD_STATUS_LOST_ARB:
  180. dev_dbg(iproc_i2c->device, "lost bus arbitration\n");
  181. return -EAGAIN;
  182. case M_CMD_STATUS_NACK_ADDR:
  183. dev_dbg(iproc_i2c->device, "NAK addr:0x%02x\n", msg->addr);
  184. return -ENXIO;
  185. case M_CMD_STATUS_NACK_DATA:
  186. dev_dbg(iproc_i2c->device, "NAK data\n");
  187. return -ENXIO;
  188. case M_CMD_STATUS_TIMEOUT:
  189. dev_dbg(iproc_i2c->device, "bus timeout\n");
  190. return -ETIMEDOUT;
  191. default:
  192. dev_dbg(iproc_i2c->device, "unknown error code=%d\n", val);
  193. /* re-initialize i2c for recovery */
  194. bcm_iproc_i2c_enable_disable(iproc_i2c, false);
  195. bcm_iproc_i2c_init(iproc_i2c);
  196. bcm_iproc_i2c_enable_disable(iproc_i2c, true);
  197. return -EIO;
  198. }
  199. }
  200. static int bcm_iproc_i2c_xfer_single_msg(struct bcm_iproc_i2c_dev *iproc_i2c,
  201. struct i2c_msg *msg)
  202. {
  203. int ret, i;
  204. u8 addr;
  205. u32 val;
  206. unsigned int tx_bytes;
  207. unsigned long time_left = msecs_to_jiffies(I2C_TIMEOUT_MSEC);
  208. /* check if bus is busy */
  209. if (!!(readl(iproc_i2c->base + M_CMD_OFFSET) &
  210. BIT(M_CMD_START_BUSY_SHIFT))) {
  211. dev_warn(iproc_i2c->device, "bus is busy\n");
  212. return -EBUSY;
  213. }
  214. iproc_i2c->msg = msg;
  215. /* format and load slave address into the TX FIFO */
  216. addr = i2c_8bit_addr_from_msg(msg);
  217. writel(addr, iproc_i2c->base + M_TX_OFFSET);
  218. /*
  219. * For a write transaction, load data into the TX FIFO. Only allow
  220. * loading up to TX FIFO size - 1 bytes of data since the first byte
  221. * has been used up by the slave address
  222. */
  223. tx_bytes = min_t(unsigned int, msg->len, M_TX_RX_FIFO_SIZE - 1);
  224. if (!(msg->flags & I2C_M_RD)) {
  225. for (i = 0; i < tx_bytes; i++) {
  226. val = msg->buf[i];
  227. /* mark the last byte */
  228. if (i == msg->len - 1)
  229. val |= 1 << M_TX_WR_STATUS_SHIFT;
  230. writel(val, iproc_i2c->base + M_TX_OFFSET);
  231. }
  232. iproc_i2c->tx_bytes = tx_bytes;
  233. }
  234. /* mark as incomplete before starting the transaction */
  235. reinit_completion(&iproc_i2c->done);
  236. iproc_i2c->xfer_is_done = 0;
  237. /*
  238. * Enable the "start busy" interrupt, which will be triggered after the
  239. * transaction is done, i.e., the internal start_busy bit, transitions
  240. * from 1 to 0.
  241. */
  242. val = BIT(IE_M_START_BUSY_SHIFT);
  243. /*
  244. * If TX data size is larger than the TX FIFO, need to enable TX
  245. * underrun interrupt, which will be triggerred when the TX FIFO is
  246. * empty. When that happens we can then pump more data into the FIFO
  247. */
  248. if (!(msg->flags & I2C_M_RD) &&
  249. msg->len > iproc_i2c->tx_bytes)
  250. val |= BIT(IE_M_TX_UNDERRUN_SHIFT);
  251. writel(val, iproc_i2c->base + IE_OFFSET);
  252. /*
  253. * Now we can activate the transfer. For a read operation, specify the
  254. * number of bytes to read
  255. */
  256. val = BIT(M_CMD_START_BUSY_SHIFT);
  257. if (msg->flags & I2C_M_RD) {
  258. val |= (M_CMD_PROTOCOL_BLK_RD << M_CMD_PROTOCOL_SHIFT) |
  259. (msg->len << M_CMD_RD_CNT_SHIFT);
  260. } else {
  261. val |= (M_CMD_PROTOCOL_BLK_WR << M_CMD_PROTOCOL_SHIFT);
  262. }
  263. writel(val, iproc_i2c->base + M_CMD_OFFSET);
  264. time_left = wait_for_completion_timeout(&iproc_i2c->done, time_left);
  265. /* disable all interrupts */
  266. writel(0, iproc_i2c->base + IE_OFFSET);
  267. /* read it back to flush the write */
  268. readl(iproc_i2c->base + IE_OFFSET);
  269. /* make sure the interrupt handler isn't running */
  270. synchronize_irq(iproc_i2c->irq);
  271. if (!time_left && !iproc_i2c->xfer_is_done) {
  272. dev_err(iproc_i2c->device, "transaction timed out\n");
  273. /* flush FIFOs */
  274. val = (1 << M_FIFO_RX_FLUSH_SHIFT) |
  275. (1 << M_FIFO_TX_FLUSH_SHIFT);
  276. writel(val, iproc_i2c->base + M_FIFO_CTRL_OFFSET);
  277. return -ETIMEDOUT;
  278. }
  279. ret = bcm_iproc_i2c_check_status(iproc_i2c, msg);
  280. if (ret) {
  281. /* flush both TX/RX FIFOs */
  282. val = (1 << M_FIFO_RX_FLUSH_SHIFT) |
  283. (1 << M_FIFO_TX_FLUSH_SHIFT);
  284. writel(val, iproc_i2c->base + M_FIFO_CTRL_OFFSET);
  285. return ret;
  286. }
  287. /*
  288. * For a read operation, we now need to load the data from FIFO
  289. * into the memory buffer
  290. */
  291. if (msg->flags & I2C_M_RD) {
  292. for (i = 0; i < msg->len; i++) {
  293. msg->buf[i] = (readl(iproc_i2c->base + M_RX_OFFSET) >>
  294. M_RX_DATA_SHIFT) & M_RX_DATA_MASK;
  295. }
  296. }
  297. return 0;
  298. }
  299. static int bcm_iproc_i2c_xfer(struct i2c_adapter *adapter,
  300. struct i2c_msg msgs[], int num)
  301. {
  302. struct bcm_iproc_i2c_dev *iproc_i2c = i2c_get_adapdata(adapter);
  303. int ret, i;
  304. /* go through all messages */
  305. for (i = 0; i < num; i++) {
  306. ret = bcm_iproc_i2c_xfer_single_msg(iproc_i2c, &msgs[i]);
  307. if (ret) {
  308. dev_dbg(iproc_i2c->device, "xfer failed\n");
  309. return ret;
  310. }
  311. }
  312. return num;
  313. }
  314. static uint32_t bcm_iproc_i2c_functionality(struct i2c_adapter *adap)
  315. {
  316. return I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL;
  317. }
  318. static const struct i2c_algorithm bcm_iproc_algo = {
  319. .master_xfer = bcm_iproc_i2c_xfer,
  320. .functionality = bcm_iproc_i2c_functionality,
  321. };
  322. static struct i2c_adapter_quirks bcm_iproc_i2c_quirks = {
  323. /* need to reserve one byte in the FIFO for the slave address */
  324. .max_read_len = M_TX_RX_FIFO_SIZE - 1,
  325. };
  326. static int bcm_iproc_i2c_cfg_speed(struct bcm_iproc_i2c_dev *iproc_i2c)
  327. {
  328. unsigned int bus_speed;
  329. u32 val;
  330. int ret = of_property_read_u32(iproc_i2c->device->of_node,
  331. "clock-frequency", &bus_speed);
  332. if (ret < 0) {
  333. dev_info(iproc_i2c->device,
  334. "unable to interpret clock-frequency DT property\n");
  335. bus_speed = 100000;
  336. }
  337. if (bus_speed < 100000) {
  338. dev_err(iproc_i2c->device, "%d Hz bus speed not supported\n",
  339. bus_speed);
  340. dev_err(iproc_i2c->device,
  341. "valid speeds are 100khz and 400khz\n");
  342. return -EINVAL;
  343. } else if (bus_speed < 400000) {
  344. bus_speed = 100000;
  345. } else {
  346. bus_speed = 400000;
  347. }
  348. iproc_i2c->bus_speed = bus_speed;
  349. val = readl(iproc_i2c->base + TIM_CFG_OFFSET);
  350. val &= ~(1 << TIM_CFG_MODE_400_SHIFT);
  351. val |= (bus_speed == 400000) << TIM_CFG_MODE_400_SHIFT;
  352. writel(val, iproc_i2c->base + TIM_CFG_OFFSET);
  353. dev_info(iproc_i2c->device, "bus set to %u Hz\n", bus_speed);
  354. return 0;
  355. }
  356. static int bcm_iproc_i2c_probe(struct platform_device *pdev)
  357. {
  358. int irq, ret = 0;
  359. struct bcm_iproc_i2c_dev *iproc_i2c;
  360. struct i2c_adapter *adap;
  361. struct resource *res;
  362. iproc_i2c = devm_kzalloc(&pdev->dev, sizeof(*iproc_i2c),
  363. GFP_KERNEL);
  364. if (!iproc_i2c)
  365. return -ENOMEM;
  366. platform_set_drvdata(pdev, iproc_i2c);
  367. iproc_i2c->device = &pdev->dev;
  368. init_completion(&iproc_i2c->done);
  369. res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
  370. iproc_i2c->base = devm_ioremap_resource(iproc_i2c->device, res);
  371. if (IS_ERR(iproc_i2c->base))
  372. return PTR_ERR(iproc_i2c->base);
  373. ret = bcm_iproc_i2c_init(iproc_i2c);
  374. if (ret)
  375. return ret;
  376. ret = bcm_iproc_i2c_cfg_speed(iproc_i2c);
  377. if (ret)
  378. return ret;
  379. irq = platform_get_irq(pdev, 0);
  380. if (irq <= 0) {
  381. dev_err(iproc_i2c->device, "no irq resource\n");
  382. return irq;
  383. }
  384. iproc_i2c->irq = irq;
  385. ret = devm_request_irq(iproc_i2c->device, irq, bcm_iproc_i2c_isr, 0,
  386. pdev->name, iproc_i2c);
  387. if (ret < 0) {
  388. dev_err(iproc_i2c->device, "unable to request irq %i\n", irq);
  389. return ret;
  390. }
  391. bcm_iproc_i2c_enable_disable(iproc_i2c, true);
  392. adap = &iproc_i2c->adapter;
  393. i2c_set_adapdata(adap, iproc_i2c);
  394. strlcpy(adap->name, "Broadcom iProc I2C adapter", sizeof(adap->name));
  395. adap->algo = &bcm_iproc_algo;
  396. adap->quirks = &bcm_iproc_i2c_quirks;
  397. adap->dev.parent = &pdev->dev;
  398. adap->dev.of_node = pdev->dev.of_node;
  399. return i2c_add_adapter(adap);
  400. }
  401. static int bcm_iproc_i2c_remove(struct platform_device *pdev)
  402. {
  403. struct bcm_iproc_i2c_dev *iproc_i2c = platform_get_drvdata(pdev);
  404. /* make sure there's no pending interrupt when we remove the adapter */
  405. writel(0, iproc_i2c->base + IE_OFFSET);
  406. readl(iproc_i2c->base + IE_OFFSET);
  407. synchronize_irq(iproc_i2c->irq);
  408. i2c_del_adapter(&iproc_i2c->adapter);
  409. bcm_iproc_i2c_enable_disable(iproc_i2c, false);
  410. return 0;
  411. }
  412. #ifdef CONFIG_PM_SLEEP
  413. static int bcm_iproc_i2c_suspend(struct device *dev)
  414. {
  415. struct platform_device *pdev = to_platform_device(dev);
  416. struct bcm_iproc_i2c_dev *iproc_i2c = platform_get_drvdata(pdev);
  417. /* make sure there's no pending interrupt when we go into suspend */
  418. writel(0, iproc_i2c->base + IE_OFFSET);
  419. readl(iproc_i2c->base + IE_OFFSET);
  420. synchronize_irq(iproc_i2c->irq);
  421. /* now disable the controller */
  422. bcm_iproc_i2c_enable_disable(iproc_i2c, false);
  423. return 0;
  424. }
  425. static int bcm_iproc_i2c_resume(struct device *dev)
  426. {
  427. struct platform_device *pdev = to_platform_device(dev);
  428. struct bcm_iproc_i2c_dev *iproc_i2c = platform_get_drvdata(pdev);
  429. int ret;
  430. u32 val;
  431. /*
  432. * Power domain could have been shut off completely in system deep
  433. * sleep, so re-initialize the block here
  434. */
  435. ret = bcm_iproc_i2c_init(iproc_i2c);
  436. if (ret)
  437. return ret;
  438. /* configure to the desired bus speed */
  439. val = readl(iproc_i2c->base + TIM_CFG_OFFSET);
  440. val &= ~(1 << TIM_CFG_MODE_400_SHIFT);
  441. val |= (iproc_i2c->bus_speed == 400000) << TIM_CFG_MODE_400_SHIFT;
  442. writel(val, iproc_i2c->base + TIM_CFG_OFFSET);
  443. bcm_iproc_i2c_enable_disable(iproc_i2c, true);
  444. return 0;
  445. }
  446. static const struct dev_pm_ops bcm_iproc_i2c_pm_ops = {
  447. .suspend_late = &bcm_iproc_i2c_suspend,
  448. .resume_early = &bcm_iproc_i2c_resume
  449. };
  450. #define BCM_IPROC_I2C_PM_OPS (&bcm_iproc_i2c_pm_ops)
  451. #else
  452. #define BCM_IPROC_I2C_PM_OPS NULL
  453. #endif /* CONFIG_PM_SLEEP */
  454. static const struct of_device_id bcm_iproc_i2c_of_match[] = {
  455. { .compatible = "brcm,iproc-i2c" },
  456. { /* sentinel */ }
  457. };
  458. MODULE_DEVICE_TABLE(of, bcm_iproc_i2c_of_match);
  459. static struct platform_driver bcm_iproc_i2c_driver = {
  460. .driver = {
  461. .name = "bcm-iproc-i2c",
  462. .of_match_table = bcm_iproc_i2c_of_match,
  463. .pm = BCM_IPROC_I2C_PM_OPS,
  464. },
  465. .probe = bcm_iproc_i2c_probe,
  466. .remove = bcm_iproc_i2c_remove,
  467. };
  468. module_platform_driver(bcm_iproc_i2c_driver);
  469. MODULE_AUTHOR("Ray Jui <rjui@broadcom.com>");
  470. MODULE_DESCRIPTION("Broadcom iProc I2C Driver");
  471. MODULE_LICENSE("GPL v2");