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:
"Another bunch of fixes for I2C.

Jean's i801 patch is a cleanup on top of Volker's i801 patch, but it
will make dependency handling much easier if those two go together"

* 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux:
i2c: mxs: use MXS_DMA_CTRL_WAIT4END instead of DMA_CTRL_ACK
i2c: mediatek: Send i2c master code at more than 1MHz
i2c: mediatek: Fix generic definitions for bus frequency
i2c: core: Call i2c_acpi_install_space_handler() before i2c_acpi_register_devices()
i2c: i801: Simplify the suspend callback
i2c: i801: Fix resume bug
i2c: aspeed: Mask IRQ status to relevant bits

+29 -17
+2
drivers/i2c/busses/i2c-aspeed.c
··· 69 69 * These share bit definitions, so use the same values for the enable & 70 70 * status bits. 71 71 */ 72 + #define ASPEED_I2CD_INTR_RECV_MASK 0xf000ffff 72 73 #define ASPEED_I2CD_INTR_SDA_DL_TIMEOUT BIT(14) 73 74 #define ASPEED_I2CD_INTR_BUS_RECOVER_DONE BIT(13) 74 75 #define ASPEED_I2CD_INTR_SLAVE_MATCH BIT(7) ··· 605 604 writel(irq_received & ~ASPEED_I2CD_INTR_RX_DONE, 606 605 bus->base + ASPEED_I2C_INTR_STS_REG); 607 606 readl(bus->base + ASPEED_I2C_INTR_STS_REG); 607 + irq_received &= ASPEED_I2CD_INTR_RECV_MASK; 608 608 irq_remaining = irq_received; 609 609 610 610 #if IS_ENABLED(CONFIG_I2C_SLAVE)
+16 -10
drivers/i2c/busses/i2c-i801.c
··· 1709 1709 static inline void i801_acpi_remove(struct i801_priv *priv) { } 1710 1710 #endif 1711 1711 1712 + static unsigned char i801_setup_hstcfg(struct i801_priv *priv) 1713 + { 1714 + unsigned char hstcfg = priv->original_hstcfg; 1715 + 1716 + hstcfg &= ~SMBHSTCFG_I2C_EN; /* SMBus timing */ 1717 + hstcfg |= SMBHSTCFG_HST_EN; 1718 + pci_write_config_byte(priv->pci_dev, SMBHSTCFG, hstcfg); 1719 + return hstcfg; 1720 + } 1721 + 1712 1722 static int i801_probe(struct pci_dev *dev, const struct pci_device_id *id) 1713 1723 { 1714 1724 unsigned char temp; ··· 1840 1830 return err; 1841 1831 } 1842 1832 1843 - pci_read_config_byte(priv->pci_dev, SMBHSTCFG, &temp); 1844 - priv->original_hstcfg = temp; 1845 - temp &= ~SMBHSTCFG_I2C_EN; /* SMBus timing */ 1846 - if (!(temp & SMBHSTCFG_HST_EN)) { 1833 + pci_read_config_byte(priv->pci_dev, SMBHSTCFG, &priv->original_hstcfg); 1834 + temp = i801_setup_hstcfg(priv); 1835 + if (!(priv->original_hstcfg & SMBHSTCFG_HST_EN)) 1847 1836 dev_info(&dev->dev, "Enabling SMBus device\n"); 1848 - temp |= SMBHSTCFG_HST_EN; 1849 - } 1850 - pci_write_config_byte(priv->pci_dev, SMBHSTCFG, temp); 1851 1837 1852 1838 if (temp & SMBHSTCFG_SMB_SMI_EN) { 1853 1839 dev_dbg(&dev->dev, "SMBus using interrupt SMI#\n"); ··· 1958 1952 #ifdef CONFIG_PM_SLEEP 1959 1953 static int i801_suspend(struct device *dev) 1960 1954 { 1961 - struct pci_dev *pci_dev = to_pci_dev(dev); 1962 - struct i801_priv *priv = pci_get_drvdata(pci_dev); 1955 + struct i801_priv *priv = dev_get_drvdata(dev); 1963 1956 1964 - pci_write_config_byte(pci_dev, SMBHSTCFG, priv->original_hstcfg); 1957 + pci_write_config_byte(priv->pci_dev, SMBHSTCFG, priv->original_hstcfg); 1965 1958 return 0; 1966 1959 } 1967 1960 ··· 1968 1963 { 1969 1964 struct i801_priv *priv = dev_get_drvdata(dev); 1970 1965 1966 + i801_setup_hstcfg(priv); 1971 1967 i801_enable_host_notify(&priv->adapter); 1972 1968 1973 1969 return 0;
+3 -3
drivers/i2c/busses/i2c-mt65xx.c
··· 681 681 unsigned int cnt_mul; 682 682 int ret = -EINVAL; 683 683 684 - if (target_speed > I2C_MAX_FAST_MODE_PLUS_FREQ) 685 - target_speed = I2C_MAX_FAST_MODE_PLUS_FREQ; 684 + if (target_speed > I2C_MAX_HIGH_SPEED_MODE_FREQ) 685 + target_speed = I2C_MAX_HIGH_SPEED_MODE_FREQ; 686 686 687 687 max_step_cnt = mtk_i2c_max_step_cnt(target_speed); 688 688 base_step_cnt = max_step_cnt; ··· 759 759 for (clk_div = 1; clk_div <= max_clk_div; clk_div++) { 760 760 clk_src = parent_clk / clk_div; 761 761 762 - if (target_speed > I2C_MAX_FAST_MODE_FREQ) { 762 + if (target_speed > I2C_MAX_FAST_MODE_PLUS_FREQ) { 763 763 /* Set master code speed register */ 764 764 ret = mtk_i2c_calculate_speed(i2c, clk_src, 765 765 I2C_MAX_FAST_MODE_FREQ,
+7 -3
drivers/i2c/busses/i2c-mxs.c
··· 25 25 #include <linux/of_device.h> 26 26 #include <linux/dma-mapping.h> 27 27 #include <linux/dmaengine.h> 28 + #include <linux/dma/mxs-dma.h> 28 29 29 30 #define DRIVER_NAME "mxs-i2c" 30 31 ··· 201 200 dma_map_sg(i2c->dev, &i2c->sg_io[0], 1, DMA_TO_DEVICE); 202 201 desc = dmaengine_prep_slave_sg(i2c->dmach, &i2c->sg_io[0], 1, 203 202 DMA_MEM_TO_DEV, 204 - DMA_PREP_INTERRUPT | DMA_CTRL_ACK); 203 + DMA_PREP_INTERRUPT | 204 + MXS_DMA_CTRL_WAIT4END); 205 205 if (!desc) { 206 206 dev_err(i2c->dev, 207 207 "Failed to get DMA data write descriptor.\n"); ··· 230 228 dma_map_sg(i2c->dev, &i2c->sg_io[1], 1, DMA_FROM_DEVICE); 231 229 desc = dmaengine_prep_slave_sg(i2c->dmach, &i2c->sg_io[1], 1, 232 230 DMA_DEV_TO_MEM, 233 - DMA_PREP_INTERRUPT | DMA_CTRL_ACK); 231 + DMA_PREP_INTERRUPT | 232 + MXS_DMA_CTRL_WAIT4END); 234 233 if (!desc) { 235 234 dev_err(i2c->dev, 236 235 "Failed to get DMA data write descriptor.\n"); ··· 263 260 dma_map_sg(i2c->dev, i2c->sg_io, 2, DMA_TO_DEVICE); 264 261 desc = dmaengine_prep_slave_sg(i2c->dmach, i2c->sg_io, 2, 265 262 DMA_MEM_TO_DEV, 266 - DMA_PREP_INTERRUPT | DMA_CTRL_ACK); 263 + DMA_PREP_INTERRUPT | 264 + MXS_DMA_CTRL_WAIT4END); 267 265 if (!desc) { 268 266 dev_err(i2c->dev, 269 267 "Failed to get DMA data write descriptor.\n");
+1 -1
drivers/i2c/i2c-core-base.c
··· 1464 1464 1465 1465 /* create pre-declared device nodes */ 1466 1466 of_i2c_register_devices(adap); 1467 - i2c_acpi_register_devices(adap); 1468 1467 i2c_acpi_install_space_handler(adap); 1468 + i2c_acpi_register_devices(adap); 1469 1469 1470 1470 if (adap->nr < __i2c_first_dynamic_bus_num) 1471 1471 i2c_scan_static_board_info(adap);