i2c-designware-common.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637
  1. // SPDX-License-Identifier: GPL-2.0-or-later
  2. /*
  3. * Synopsys DesignWare I2C adapter driver.
  4. *
  5. * Based on the TI DAVINCI I2C adapter driver.
  6. *
  7. * Copyright (C) 2006 Texas Instruments.
  8. * Copyright (C) 2007 MontaVista Software Inc.
  9. * Copyright (C) 2009 Provigent Ltd.
  10. */
  11. #include <linux/acpi.h>
  12. #include <linux/clk.h>
  13. #include <linux/delay.h>
  14. #include <linux/device.h>
  15. #include <linux/err.h>
  16. #include <linux/errno.h>
  17. #include <linux/export.h>
  18. #include <linux/i2c.h>
  19. #include <linux/interrupt.h>
  20. #include <linux/io.h>
  21. #include <linux/kernel.h>
  22. #include <linux/module.h>
  23. #include <linux/pm_runtime.h>
  24. #include <linux/regmap.h>
  25. #include <linux/swab.h>
  26. #include <linux/types.h>
  27. #include <linux/units.h>
  28. #include "i2c-designware-core.h"
  29. static char *abort_sources[] = {
  30. [ABRT_7B_ADDR_NOACK] =
  31. "slave address not acknowledged (7bit mode)",
  32. [ABRT_10ADDR1_NOACK] =
  33. "first address byte not acknowledged (10bit mode)",
  34. [ABRT_10ADDR2_NOACK] =
  35. "second address byte not acknowledged (10bit mode)",
  36. [ABRT_TXDATA_NOACK] =
  37. "data not acknowledged",
  38. [ABRT_GCALL_NOACK] =
  39. "no acknowledgement for a general call",
  40. [ABRT_GCALL_READ] =
  41. "read after general call",
  42. [ABRT_SBYTE_ACKDET] =
  43. "start byte acknowledged",
  44. [ABRT_SBYTE_NORSTRT] =
  45. "trying to send start byte when restart is disabled",
  46. [ABRT_10B_RD_NORSTRT] =
  47. "trying to read when restart is disabled (10bit mode)",
  48. [ABRT_MASTER_DIS] =
  49. "trying to use disabled adapter",
  50. [ARB_LOST] =
  51. "lost arbitration",
  52. [ABRT_SLAVE_FLUSH_TXFIFO] =
  53. "read command so flush old data in the TX FIFO",
  54. [ABRT_SLAVE_ARBLOST] =
  55. "slave lost the bus while transmitting data to a remote master",
  56. [ABRT_SLAVE_RD_INTX] =
  57. "incorrect slave-transmitter mode configuration",
  58. };
  59. static int dw_reg_read(void *context, unsigned int reg, unsigned int *val)
  60. {
  61. struct dw_i2c_dev *dev = context;
  62. *val = readl(dev->base + reg);
  63. return 0;
  64. }
  65. static int dw_reg_write(void *context, unsigned int reg, unsigned int val)
  66. {
  67. struct dw_i2c_dev *dev = context;
  68. writel(val, dev->base + reg);
  69. return 0;
  70. }
  71. static int dw_reg_read_swab(void *context, unsigned int reg, unsigned int *val)
  72. {
  73. struct dw_i2c_dev *dev = context;
  74. *val = swab32(readl(dev->base + reg));
  75. return 0;
  76. }
  77. static int dw_reg_write_swab(void *context, unsigned int reg, unsigned int val)
  78. {
  79. struct dw_i2c_dev *dev = context;
  80. writel(swab32(val), dev->base + reg);
  81. return 0;
  82. }
  83. static int dw_reg_read_word(void *context, unsigned int reg, unsigned int *val)
  84. {
  85. struct dw_i2c_dev *dev = context;
  86. *val = readw(dev->base + reg) |
  87. (readw(dev->base + reg + 2) << 16);
  88. return 0;
  89. }
  90. static int dw_reg_write_word(void *context, unsigned int reg, unsigned int val)
  91. {
  92. struct dw_i2c_dev *dev = context;
  93. writew(val, dev->base + reg);
  94. writew(val >> 16, dev->base + reg + 2);
  95. return 0;
  96. }
  97. /**
  98. * i2c_dw_init_regmap() - Initialize registers map
  99. * @dev: device private data
  100. *
  101. * Autodetects needed register access mode and creates the regmap with
  102. * corresponding read/write callbacks. This must be called before doing any
  103. * other register access.
  104. */
  105. int i2c_dw_init_regmap(struct dw_i2c_dev *dev)
  106. {
  107. struct regmap_config map_cfg = {
  108. .reg_bits = 32,
  109. .val_bits = 32,
  110. .reg_stride = 4,
  111. .disable_locking = true,
  112. .reg_read = dw_reg_read,
  113. .reg_write = dw_reg_write,
  114. .max_register = DW_IC_COMP_TYPE,
  115. };
  116. u32 reg;
  117. int ret;
  118. /*
  119. * Skip detecting the registers map configuration if the regmap has
  120. * already been provided by a higher code.
  121. */
  122. if (dev->map)
  123. return 0;
  124. ret = i2c_dw_acquire_lock(dev);
  125. if (ret)
  126. return ret;
  127. reg = readl(dev->base + DW_IC_COMP_TYPE);
  128. i2c_dw_release_lock(dev);
  129. if ((dev->flags & MODEL_MASK) == MODEL_AMD_NAVI_GPU)
  130. map_cfg.max_register = AMD_UCSI_INTR_REG;
  131. if (reg == swab32(DW_IC_COMP_TYPE_VALUE)) {
  132. map_cfg.reg_read = dw_reg_read_swab;
  133. map_cfg.reg_write = dw_reg_write_swab;
  134. } else if (reg == (DW_IC_COMP_TYPE_VALUE & 0x0000ffff)) {
  135. map_cfg.reg_read = dw_reg_read_word;
  136. map_cfg.reg_write = dw_reg_write_word;
  137. } else if (reg != DW_IC_COMP_TYPE_VALUE) {
  138. dev_err(dev->dev,
  139. "Unknown Synopsys component type: 0x%08x\n", reg);
  140. return -ENODEV;
  141. }
  142. /*
  143. * Note we'll check the return value of the regmap IO accessors only
  144. * at the probe stage. The rest of the code won't do this because
  145. * basically we have MMIO-based regmap so non of the read/write methods
  146. * can fail.
  147. */
  148. dev->map = devm_regmap_init(dev->dev, NULL, dev, &map_cfg);
  149. if (IS_ERR(dev->map)) {
  150. dev_err(dev->dev, "Failed to init the registers map\n");
  151. return PTR_ERR(dev->map);
  152. }
  153. return 0;
  154. }
  155. static const u32 supported_speeds[] = {
  156. I2C_MAX_HIGH_SPEED_MODE_FREQ,
  157. I2C_MAX_FAST_MODE_PLUS_FREQ,
  158. I2C_MAX_FAST_MODE_FREQ,
  159. I2C_MAX_STANDARD_MODE_FREQ,
  160. };
  161. int i2c_dw_validate_speed(struct dw_i2c_dev *dev)
  162. {
  163. struct i2c_timings *t = &dev->timings;
  164. unsigned int i;
  165. /*
  166. * Only standard mode at 100kHz, fast mode at 400kHz,
  167. * fast mode plus at 1MHz and high speed mode at 3.4MHz are supported.
  168. */
  169. for (i = 0; i < ARRAY_SIZE(supported_speeds); i++) {
  170. if (t->bus_freq_hz == supported_speeds[i])
  171. return 0;
  172. }
  173. dev_err(dev->dev,
  174. "%d Hz is unsupported, only 100kHz, 400kHz, 1MHz and 3.4MHz are supported\n",
  175. t->bus_freq_hz);
  176. return -EINVAL;
  177. }
  178. EXPORT_SYMBOL_GPL(i2c_dw_validate_speed);
  179. #ifdef CONFIG_ACPI
  180. #include <linux/dmi.h>
  181. /*
  182. * The HCNT/LCNT information coming from ACPI should be the most accurate
  183. * for given platform. However, some systems get it wrong. On such systems
  184. * we get better results by calculating those based on the input clock.
  185. */
  186. static const struct dmi_system_id i2c_dw_no_acpi_params[] = {
  187. {
  188. .ident = "Dell Inspiron 7348",
  189. .matches = {
  190. DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
  191. DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron 7348"),
  192. },
  193. },
  194. {}
  195. };
  196. static void i2c_dw_acpi_params(struct device *device, char method[],
  197. u16 *hcnt, u16 *lcnt, u32 *sda_hold)
  198. {
  199. struct acpi_buffer buf = { ACPI_ALLOCATE_BUFFER };
  200. acpi_handle handle = ACPI_HANDLE(device);
  201. union acpi_object *obj;
  202. if (dmi_check_system(i2c_dw_no_acpi_params))
  203. return;
  204. if (ACPI_FAILURE(acpi_evaluate_object(handle, method, NULL, &buf)))
  205. return;
  206. obj = (union acpi_object *)buf.pointer;
  207. if (obj->type == ACPI_TYPE_PACKAGE && obj->package.count == 3) {
  208. const union acpi_object *objs = obj->package.elements;
  209. *hcnt = (u16)objs[0].integer.value;
  210. *lcnt = (u16)objs[1].integer.value;
  211. *sda_hold = (u32)objs[2].integer.value;
  212. }
  213. kfree(buf.pointer);
  214. }
  215. int i2c_dw_acpi_configure(struct device *device)
  216. {
  217. struct dw_i2c_dev *dev = dev_get_drvdata(device);
  218. struct i2c_timings *t = &dev->timings;
  219. u32 ss_ht = 0, fp_ht = 0, hs_ht = 0, fs_ht = 0;
  220. /*
  221. * Try to get SDA hold time and *CNT values from an ACPI method for
  222. * selected speed modes.
  223. */
  224. i2c_dw_acpi_params(device, "SSCN", &dev->ss_hcnt, &dev->ss_lcnt, &ss_ht);
  225. i2c_dw_acpi_params(device, "FMCN", &dev->fs_hcnt, &dev->fs_lcnt, &fs_ht);
  226. i2c_dw_acpi_params(device, "FPCN", &dev->fp_hcnt, &dev->fp_lcnt, &fp_ht);
  227. i2c_dw_acpi_params(device, "HSCN", &dev->hs_hcnt, &dev->hs_lcnt, &hs_ht);
  228. switch (t->bus_freq_hz) {
  229. case I2C_MAX_STANDARD_MODE_FREQ:
  230. dev->sda_hold_time = ss_ht;
  231. break;
  232. case I2C_MAX_FAST_MODE_PLUS_FREQ:
  233. dev->sda_hold_time = fp_ht;
  234. break;
  235. case I2C_MAX_HIGH_SPEED_MODE_FREQ:
  236. dev->sda_hold_time = hs_ht;
  237. break;
  238. case I2C_MAX_FAST_MODE_FREQ:
  239. default:
  240. dev->sda_hold_time = fs_ht;
  241. break;
  242. }
  243. return 0;
  244. }
  245. EXPORT_SYMBOL_GPL(i2c_dw_acpi_configure);
  246. static u32 i2c_dw_acpi_round_bus_speed(struct device *device)
  247. {
  248. u32 acpi_speed;
  249. int i;
  250. acpi_speed = i2c_acpi_find_bus_speed(device);
  251. /*
  252. * Some DSTDs use a non standard speed, round down to the lowest
  253. * standard speed.
  254. */
  255. for (i = 0; i < ARRAY_SIZE(supported_speeds); i++) {
  256. if (acpi_speed >= supported_speeds[i])
  257. return supported_speeds[i];
  258. }
  259. return 0;
  260. }
  261. #else /* CONFIG_ACPI */
  262. static inline u32 i2c_dw_acpi_round_bus_speed(struct device *device) { return 0; }
  263. #endif /* CONFIG_ACPI */
  264. void i2c_dw_adjust_bus_speed(struct dw_i2c_dev *dev)
  265. {
  266. u32 acpi_speed = i2c_dw_acpi_round_bus_speed(dev->dev);
  267. struct i2c_timings *t = &dev->timings;
  268. /*
  269. * Find bus speed from the "clock-frequency" device property, ACPI
  270. * or by using fast mode if neither is set.
  271. */
  272. if (acpi_speed && t->bus_freq_hz)
  273. t->bus_freq_hz = min(t->bus_freq_hz, acpi_speed);
  274. else if (acpi_speed || t->bus_freq_hz)
  275. t->bus_freq_hz = max(t->bus_freq_hz, acpi_speed);
  276. else
  277. t->bus_freq_hz = I2C_MAX_FAST_MODE_FREQ;
  278. }
  279. EXPORT_SYMBOL_GPL(i2c_dw_adjust_bus_speed);
  280. u32 i2c_dw_scl_hcnt(u32 ic_clk, u32 tSYMBOL, u32 tf, int cond, int offset)
  281. {
  282. /*
  283. * DesignWare I2C core doesn't seem to have solid strategy to meet
  284. * the tHD;STA timing spec. Configuring _HCNT based on tHIGH spec
  285. * will result in violation of the tHD;STA spec.
  286. */
  287. if (cond)
  288. /*
  289. * Conditional expression:
  290. *
  291. * IC_[FS]S_SCL_HCNT + (1+4+3) >= IC_CLK * tHIGH
  292. *
  293. * This is based on the DW manuals, and represents an ideal
  294. * configuration. The resulting I2C bus speed will be
  295. * faster than any of the others.
  296. *
  297. * If your hardware is free from tHD;STA issue, try this one.
  298. */
  299. return DIV_ROUND_CLOSEST_ULL((u64)ic_clk * tSYMBOL, MICRO) -
  300. 8 + offset;
  301. else
  302. /*
  303. * Conditional expression:
  304. *
  305. * IC_[FS]S_SCL_HCNT + 3 >= IC_CLK * (tHD;STA + tf)
  306. *
  307. * This is just experimental rule; the tHD;STA period turned
  308. * out to be proportinal to (_HCNT + 3). With this setting,
  309. * we could meet both tHIGH and tHD;STA timing specs.
  310. *
  311. * If unsure, you'd better to take this alternative.
  312. *
  313. * The reason why we need to take into account "tf" here,
  314. * is the same as described in i2c_dw_scl_lcnt().
  315. */
  316. return DIV_ROUND_CLOSEST_ULL((u64)ic_clk * (tSYMBOL + tf), MICRO) -
  317. 3 + offset;
  318. }
  319. u32 i2c_dw_scl_lcnt(u32 ic_clk, u32 tLOW, u32 tf, int offset)
  320. {
  321. /*
  322. * Conditional expression:
  323. *
  324. * IC_[FS]S_SCL_LCNT + 1 >= IC_CLK * (tLOW + tf)
  325. *
  326. * DW I2C core starts counting the SCL CNTs for the LOW period
  327. * of the SCL clock (tLOW) as soon as it pulls the SCL line.
  328. * In order to meet the tLOW timing spec, we need to take into
  329. * account the fall time of SCL signal (tf). Default tf value
  330. * should be 0.3 us, for safety.
  331. */
  332. return DIV_ROUND_CLOSEST_ULL((u64)ic_clk * (tLOW + tf), MICRO) -
  333. 1 + offset;
  334. }
  335. int i2c_dw_set_sda_hold(struct dw_i2c_dev *dev)
  336. {
  337. u32 reg;
  338. int ret;
  339. ret = i2c_dw_acquire_lock(dev);
  340. if (ret)
  341. return ret;
  342. /* Configure SDA Hold Time if required */
  343. ret = regmap_read(dev->map, DW_IC_COMP_VERSION, &reg);
  344. if (ret)
  345. goto err_release_lock;
  346. if (reg >= DW_IC_SDA_HOLD_MIN_VERS) {
  347. if (!dev->sda_hold_time) {
  348. /* Keep previous hold time setting if no one set it */
  349. ret = regmap_read(dev->map, DW_IC_SDA_HOLD,
  350. &dev->sda_hold_time);
  351. if (ret)
  352. goto err_release_lock;
  353. }
  354. /*
  355. * Workaround for avoiding TX arbitration lost in case I2C
  356. * slave pulls SDA down "too quickly" after falling edge of
  357. * SCL by enabling non-zero SDA RX hold. Specification says it
  358. * extends incoming SDA low to high transition while SCL is
  359. * high but it appears to help also above issue.
  360. */
  361. if (!(dev->sda_hold_time & DW_IC_SDA_HOLD_RX_MASK))
  362. dev->sda_hold_time |= 1 << DW_IC_SDA_HOLD_RX_SHIFT;
  363. dev_dbg(dev->dev, "SDA Hold Time TX:RX = %d:%d\n",
  364. dev->sda_hold_time & ~(u32)DW_IC_SDA_HOLD_RX_MASK,
  365. dev->sda_hold_time >> DW_IC_SDA_HOLD_RX_SHIFT);
  366. } else if (dev->set_sda_hold_time) {
  367. dev->set_sda_hold_time(dev);
  368. } else if (dev->sda_hold_time) {
  369. dev_warn(dev->dev,
  370. "Hardware too old to adjust SDA hold time.\n");
  371. dev->sda_hold_time = 0;
  372. }
  373. err_release_lock:
  374. i2c_dw_release_lock(dev);
  375. return ret;
  376. }
  377. void __i2c_dw_disable(struct dw_i2c_dev *dev)
  378. {
  379. int timeout = 100;
  380. u32 status;
  381. do {
  382. __i2c_dw_disable_nowait(dev);
  383. /*
  384. * The enable status register may be unimplemented, but
  385. * in that case this test reads zero and exits the loop.
  386. */
  387. regmap_read(dev->map, DW_IC_ENABLE_STATUS, &status);
  388. if ((status & 1) == 0)
  389. return;
  390. /*
  391. * Wait 10 times the signaling period of the highest I2C
  392. * transfer supported by the driver (for 400KHz this is
  393. * 25us) as described in the DesignWare I2C databook.
  394. */
  395. usleep_range(25, 250);
  396. } while (timeout--);
  397. dev_warn(dev->dev, "timeout in disabling adapter\n");
  398. }
  399. u32 i2c_dw_clk_rate(struct dw_i2c_dev *dev)
  400. {
  401. /*
  402. * Clock is not necessary if we got LCNT/HCNT values directly from
  403. * the platform code.
  404. */
  405. if (WARN_ON_ONCE(!dev->get_clk_rate_khz))
  406. return 0;
  407. return dev->get_clk_rate_khz(dev);
  408. }
  409. int i2c_dw_prepare_clk(struct dw_i2c_dev *dev, bool prepare)
  410. {
  411. int ret;
  412. if (prepare) {
  413. /* Optional interface clock */
  414. ret = clk_prepare_enable(dev->pclk);
  415. if (ret)
  416. return ret;
  417. ret = clk_prepare_enable(dev->clk);
  418. if (ret)
  419. clk_disable_unprepare(dev->pclk);
  420. return ret;
  421. }
  422. clk_disable_unprepare(dev->clk);
  423. clk_disable_unprepare(dev->pclk);
  424. return 0;
  425. }
  426. EXPORT_SYMBOL_GPL(i2c_dw_prepare_clk);
  427. int i2c_dw_acquire_lock(struct dw_i2c_dev *dev)
  428. {
  429. int ret;
  430. if (!dev->acquire_lock)
  431. return 0;
  432. ret = dev->acquire_lock();
  433. if (!ret)
  434. return 0;
  435. dev_err(dev->dev, "couldn't acquire bus ownership\n");
  436. return ret;
  437. }
  438. void i2c_dw_release_lock(struct dw_i2c_dev *dev)
  439. {
  440. if (dev->release_lock)
  441. dev->release_lock();
  442. }
  443. /*
  444. * Waiting for bus not busy
  445. */
  446. int i2c_dw_wait_bus_not_busy(struct dw_i2c_dev *dev)
  447. {
  448. u32 status;
  449. int ret;
  450. ret = regmap_read_poll_timeout(dev->map, DW_IC_STATUS, status,
  451. !(status & DW_IC_STATUS_ACTIVITY),
  452. 1100, 20000);
  453. if (ret) {
  454. dev_warn(dev->dev, "timeout waiting for bus ready\n");
  455. i2c_recover_bus(&dev->adapter);
  456. regmap_read(dev->map, DW_IC_STATUS, &status);
  457. if (!(status & DW_IC_STATUS_ACTIVITY))
  458. ret = 0;
  459. }
  460. return ret;
  461. }
  462. int i2c_dw_handle_tx_abort(struct dw_i2c_dev *dev)
  463. {
  464. unsigned long abort_source = dev->abort_source;
  465. int i;
  466. if (abort_source & DW_IC_TX_ABRT_NOACK) {
  467. for_each_set_bit(i, &abort_source, ARRAY_SIZE(abort_sources))
  468. dev_dbg(dev->dev,
  469. "%s: %s\n", __func__, abort_sources[i]);
  470. return -EREMOTEIO;
  471. }
  472. for_each_set_bit(i, &abort_source, ARRAY_SIZE(abort_sources))
  473. dev_err(dev->dev, "%s: %s\n", __func__, abort_sources[i]);
  474. if (abort_source & DW_IC_TX_ARB_LOST)
  475. return -EAGAIN;
  476. else if (abort_source & DW_IC_TX_ABRT_GCALL_READ)
  477. return -EINVAL; /* wrong msgs[] data */
  478. else
  479. return -EIO;
  480. }
  481. int i2c_dw_set_fifo_size(struct dw_i2c_dev *dev)
  482. {
  483. u32 param, tx_fifo_depth, rx_fifo_depth;
  484. int ret;
  485. /*
  486. * Try to detect the FIFO depth if not set by interface driver,
  487. * the depth could be from 2 to 256 from HW spec.
  488. */
  489. ret = i2c_dw_acquire_lock(dev);
  490. if (ret)
  491. return ret;
  492. ret = regmap_read(dev->map, DW_IC_COMP_PARAM_1, &param);
  493. i2c_dw_release_lock(dev);
  494. if (ret)
  495. return ret;
  496. tx_fifo_depth = ((param >> 16) & 0xff) + 1;
  497. rx_fifo_depth = ((param >> 8) & 0xff) + 1;
  498. if (!dev->tx_fifo_depth) {
  499. dev->tx_fifo_depth = tx_fifo_depth;
  500. dev->rx_fifo_depth = rx_fifo_depth;
  501. } else if (tx_fifo_depth >= 2) {
  502. dev->tx_fifo_depth = min_t(u32, dev->tx_fifo_depth,
  503. tx_fifo_depth);
  504. dev->rx_fifo_depth = min_t(u32, dev->rx_fifo_depth,
  505. rx_fifo_depth);
  506. }
  507. return 0;
  508. }
  509. u32 i2c_dw_func(struct i2c_adapter *adap)
  510. {
  511. struct dw_i2c_dev *dev = i2c_get_adapdata(adap);
  512. return dev->functionality;
  513. }
  514. void i2c_dw_disable(struct dw_i2c_dev *dev)
  515. {
  516. u32 dummy;
  517. int ret;
  518. ret = i2c_dw_acquire_lock(dev);
  519. if (ret)
  520. return;
  521. /* Disable controller */
  522. __i2c_dw_disable(dev);
  523. /* Disable all interrupts */
  524. regmap_write(dev->map, DW_IC_INTR_MASK, 0);
  525. regmap_read(dev->map, DW_IC_CLR_INTR, &dummy);
  526. i2c_dw_release_lock(dev);
  527. }
  528. void i2c_dw_disable_int(struct dw_i2c_dev *dev)
  529. {
  530. regmap_write(dev->map, DW_IC_INTR_MASK, 0);
  531. }
  532. MODULE_DESCRIPTION("Synopsys DesignWare I2C bus adapter core");
  533. MODULE_LICENSE("GPL");