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:
"The usual driver fixes and documentation updates"

* 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux:
i2c: mlxcpld: check correct size of maximum RECV_LEN packet
i2c: add Kconfig help text for slave mode
i2c: slave-eeprom: update documentation
i2c: eg20t: Load module automatically if ID matches
i2c: designware: platdrv: Set class based on DMI
i2c: algo-pca: Add 0x78 as SCL stuck low status for PCA9665

+43 -9
+17 -5
Documentation/i2c/slave-eeprom-backend.rst
··· 1 1 ============================== 2 - Linux I2C slave eeprom backend 2 + Linux I2C slave EEPROM backend 3 3 ============================== 4 4 5 - by Wolfram Sang <wsa@sang-engineering.com> in 2014-15 5 + by Wolfram Sang <wsa@sang-engineering.com> in 2014-20 6 6 7 - This is a proof-of-concept backend which acts like an EEPROM on the connected 8 - I2C bus. The memory contents can be modified from userspace via this file 9 - located in sysfs:: 7 + This backend simulates an EEPROM on the connected I2C bus. Its memory contents 8 + can be accessed from userspace via this file located in sysfs:: 10 9 11 10 /sys/bus/i2c/devices/<device-directory>/slave-eeprom 11 + 12 + The following types are available: 24c02, 24c32, 24c64, and 24c512. Read-only 13 + variants are also supported. The name needed for instantiating has the form 14 + 'slave-<type>[ro]'. Examples follow: 15 + 16 + 24c02, read/write, address 0x64: 17 + # echo slave-24c02 0x1064 > /sys/bus/i2c/devices/i2c-1/new_device 18 + 19 + 24c512, read-only, address 0x42: 20 + # echo slave-24c512ro 0x1042 > /sys/bus/i2c/devices/i2c-1/new_device 21 + 22 + You can also preload data during boot if a device-property named 23 + 'firmware-name' contains a valid filename (DT or ACPI only). 12 24 13 25 As of 2015, Linux doesn't support poll on binary sysfs files, so there is no 14 26 notification when another master changed the content.
+7
drivers/i2c/Kconfig
··· 113 113 114 114 config I2C_SLAVE 115 115 bool "I2C slave support" 116 + help 117 + This enables Linux to act as an I2C slave device. Note that your I2C 118 + bus master driver also needs to support this functionality. Please 119 + read Documentation/i2c/slave-interface.rst for further details. 116 120 117 121 if I2C_SLAVE 118 122 119 123 config I2C_SLAVE_EEPROM 120 124 tristate "I2C eeprom slave driver" 125 + help 126 + This backend makes Linux behave like an I2C EEPROM. Please read 127 + Documentation/i2c/slave-eeprom-backend.rst for further details. 121 128 122 129 endif 123 130
+2 -1
drivers/i2c/algos/i2c-algo-pca.c
··· 314 314 DEB2("BUS ERROR - SDA Stuck low\n"); 315 315 pca_reset(adap); 316 316 goto out; 317 - case 0x90: /* Bus error - SCL stuck low */ 317 + case 0x78: /* Bus error - SCL stuck low (PCA9665) */ 318 + case 0x90: /* Bus error - SCL stuck low (PCA9564) */ 318 319 DEB2("BUS ERROR - SCL Stuck low\n"); 319 320 pca_reset(adap); 320 321 goto out;
+14 -1
drivers/i2c/busses/i2c-designware-platdrv.c
··· 12 12 #include <linux/clk-provider.h> 13 13 #include <linux/clk.h> 14 14 #include <linux/delay.h> 15 + #include <linux/dmi.h> 15 16 #include <linux/err.h> 16 17 #include <linux/errno.h> 17 18 #include <linux/i2c.h> ··· 192 191 return ret; 193 192 } 194 193 194 + static const struct dmi_system_id dw_i2c_hwmon_class_dmi[] = { 195 + { 196 + .ident = "Qtechnology QT5222", 197 + .matches = { 198 + DMI_MATCH(DMI_SYS_VENDOR, "Qtechnology"), 199 + DMI_MATCH(DMI_PRODUCT_NAME, "QT5222"), 200 + }, 201 + }, 202 + { } /* terminate list */ 203 + }; 204 + 195 205 static int dw_i2c_plat_probe(struct platform_device *pdev) 196 206 { 197 207 struct dw_i2c_platform_data *pdata = dev_get_platdata(&pdev->dev); ··· 279 267 280 268 adap = &dev->adapter; 281 269 adap->owner = THIS_MODULE; 282 - adap->class = I2C_CLASS_DEPRECATED; 270 + adap->class = dmi_check_system(dw_i2c_hwmon_class_dmi) ? 271 + I2C_CLASS_HWMON : I2C_CLASS_DEPRECATED; 283 272 ACPI_COMPANION_SET(&adap->dev, ACPI_COMPANION(&pdev->dev)); 284 273 adap->dev.of_node = pdev->dev.of_node; 285 274 adap->nr = -1;
+1
drivers/i2c/busses/i2c-eg20t.c
··· 180 180 { PCI_VDEVICE(ROHM, PCI_DEVICE_ID_ML7831_I2C), 1, }, 181 181 {0,} 182 182 }; 183 + MODULE_DEVICE_TABLE(pci, pch_pcidev_id); 183 184 184 185 static irqreturn_t pch_i2c_handler(int irq, void *pData); 185 186
+2 -2
drivers/i2c/busses/i2c-mlxcpld.c
··· 337 337 if (priv->smbus_block && (val & MLXCPLD_I2C_SMBUS_BLK_BIT)) { 338 338 mlxcpld_i2c_read_comm(priv, MLXCPLD_LPCI2C_NUM_DAT_REG, 339 339 &datalen, 1); 340 - if (unlikely(datalen > (I2C_SMBUS_BLOCK_MAX + 1))) { 340 + if (unlikely(datalen > I2C_SMBUS_BLOCK_MAX)) { 341 341 dev_err(priv->dev, "Incorrect smbus block read message len\n"); 342 - return -E2BIG; 342 + return -EPROTO; 343 343 } 344 344 } else { 345 345 datalen = priv->xfer.data_len;