Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux

Pull i2c fixes from Wolfram Sang:
"Some I2C driver bugfixes for 5.18. Nothing spectacular but worth
fixing"

* 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux:
drivers: i2c: thunderx: Allow driver to work with ACPI defined TWSI controllers
i2c: ismt: Provide a DMA buffer for Interrupt Cause Logging
i2c: mt7621: fix missing clk_disable_unprepare() on error in mtk_i2c_probe()

+23 -2
+14
drivers/i2c/busses/i2c-ismt.c
··· 82 82 83 83 #define ISMT_DESC_ENTRIES 2 /* number of descriptor entries */ 84 84 #define ISMT_MAX_RETRIES 3 /* number of SMBus retries to attempt */ 85 + #define ISMT_LOG_ENTRIES 3 /* number of interrupt cause log entries */ 85 86 86 87 /* Hardware Descriptor Constants - Control Field */ 87 88 #define ISMT_DESC_CWRL 0x01 /* Command/Write Length */ ··· 176 175 u8 head; /* ring buffer head pointer */ 177 176 struct completion cmp; /* interrupt completion */ 178 177 u8 buffer[I2C_SMBUS_BLOCK_MAX + 16]; /* temp R/W data buffer */ 178 + dma_addr_t log_dma; 179 + u32 *log; 179 180 }; 180 181 181 182 static const struct pci_device_id ismt_ids[] = { ··· 413 410 /* Initialize the descriptor */ 414 411 memset(desc, 0, sizeof(struct ismt_desc)); 415 412 desc->tgtaddr_rw = ISMT_DESC_ADDR_RW(addr, read_write); 413 + 414 + /* Always clear the log entries */ 415 + memset(priv->log, 0, ISMT_LOG_ENTRIES * sizeof(u32)); 416 416 417 417 /* Initialize common control bits */ 418 418 if (likely(pci_dev_msi_enabled(priv->pci_dev))) ··· 714 708 /* initialize the Master Descriptor Base Address (MDBA) */ 715 709 writeq(priv->io_rng_dma, priv->smba + ISMT_MSTR_MDBA); 716 710 711 + writeq(priv->log_dma, priv->smba + ISMT_GR_SMTICL); 712 + 717 713 /* initialize the Master Control Register (MCTRL) */ 718 714 writel(ISMT_MCTRL_MEIE, priv->smba + ISMT_MSTR_MCTRL); 719 715 ··· 802 794 803 795 priv->head = 0; 804 796 init_completion(&priv->cmp); 797 + 798 + priv->log = dmam_alloc_coherent(&priv->pci_dev->dev, 799 + ISMT_LOG_ENTRIES * sizeof(u32), 800 + &priv->log_dma, GFP_KERNEL); 801 + if (!priv->log) 802 + return -ENOMEM; 805 803 806 804 return 0; 807 805 }
+8 -2
drivers/i2c/busses/i2c-mt7621.c
··· 304 304 305 305 if (i2c->bus_freq == 0) { 306 306 dev_warn(i2c->dev, "clock-frequency 0 not supported\n"); 307 - return -EINVAL; 307 + ret = -EINVAL; 308 + goto err_disable_clk; 308 309 } 309 310 310 311 adap = &i2c->adap; ··· 323 322 324 323 ret = i2c_add_adapter(adap); 325 324 if (ret < 0) 326 - return ret; 325 + goto err_disable_clk; 327 326 328 327 dev_info(&pdev->dev, "clock %u kHz\n", i2c->bus_freq / 1000); 328 + 329 + return 0; 330 + 331 + err_disable_clk: 332 + clk_disable_unprepare(i2c->clk); 329 333 330 334 return ret; 331 335 }
+1
drivers/i2c/busses/i2c-thunderx-pcidrv.c
··· 213 213 i2c->adap.bus_recovery_info = &octeon_i2c_recovery_info; 214 214 i2c->adap.dev.parent = dev; 215 215 i2c->adap.dev.of_node = pdev->dev.of_node; 216 + i2c->adap.dev.fwnode = dev->fwnode; 216 217 snprintf(i2c->adap.name, sizeof(i2c->adap.name), 217 218 "Cavium ThunderX i2c adapter at %s", dev_name(dev)); 218 219 i2c_set_adapdata(&i2c->adap, i2c);