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-next' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux

Pull more i2c updates from Wolfram Sang:

- make Lenovo Yoga C630 boot now that the dependencies are merged

- restore BlockProcessCall for i801, accidently removed in this merge
window

- a bugfix for the riic driver

- an improvement to the slave-eeprom driver which should have been in
the first pull request but sadly got lost in the process

* 'i2c/for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux:
i2c: slave-eeprom: Add read only mode
i2c: i801: Bring back Block Process Call support for certain platforms
i2c: riic: Clear NACK in tend isr
i2c: qcom-geni: Disable DMA processing on the Lenovo Yoga C630

+21 -7
+1
drivers/i2c/busses/i2c-i801.c
··· 1736 1736 case PCI_DEVICE_ID_INTEL_LEWISBURG_SSKU_SMBUS: 1737 1737 case PCI_DEVICE_ID_INTEL_DNV_SMBUS: 1738 1738 case PCI_DEVICE_ID_INTEL_KABYLAKE_PCH_H_SMBUS: 1739 + priv->features |= FEATURE_BLOCK_PROC; 1739 1740 priv->features |= FEATURE_I2C_BLOCK_READ; 1740 1741 priv->features |= FEATURE_IRQ; 1741 1742 priv->features |= FEATURE_SMBUS_PEC;
+8 -4
drivers/i2c/busses/i2c-qcom-geni.c
··· 355 355 { 356 356 dma_addr_t rx_dma; 357 357 unsigned long time_left; 358 - void *dma_buf; 358 + void *dma_buf = NULL; 359 359 struct geni_se *se = &gi2c->se; 360 360 size_t len = msg->len; 361 361 362 - dma_buf = i2c_get_dma_safe_msg_buf(msg, 32); 362 + if (!of_machine_is_compatible("lenovo,yoga-c630")) 363 + dma_buf = i2c_get_dma_safe_msg_buf(msg, 32); 364 + 363 365 if (dma_buf) 364 366 geni_se_select_mode(se, GENI_SE_DMA); 365 367 else ··· 396 394 { 397 395 dma_addr_t tx_dma; 398 396 unsigned long time_left; 399 - void *dma_buf; 397 + void *dma_buf = NULL; 400 398 struct geni_se *se = &gi2c->se; 401 399 size_t len = msg->len; 402 400 403 - dma_buf = i2c_get_dma_safe_msg_buf(msg, 32); 401 + if (!of_machine_is_compatible("lenovo,yoga-c630")) 402 + dma_buf = i2c_get_dma_safe_msg_buf(msg, 32); 403 + 404 404 if (dma_buf) 405 405 geni_se_select_mode(se, GENI_SE_DMA); 406 406 else
+1
drivers/i2c/busses/i2c-riic.c
··· 202 202 if (readb(riic->base + RIIC_ICSR2) & ICSR2_NACKF) { 203 203 /* We got a NACKIE */ 204 204 readb(riic->base + RIIC_ICDRR); /* dummy read */ 205 + riic_clear_set_bit(riic, ICSR2_NACKF, 0, RIIC_ICSR2); 205 206 riic->err = -ENXIO; 206 207 } else if (riic->bytes_left) { 207 208 return IRQ_NONE;
+11 -3
drivers/i2c/i2c-slave-eeprom.c
··· 33 33 u16 address_mask; 34 34 u8 num_address_bytes; 35 35 u8 idx_write_cnt; 36 + bool read_only; 36 37 u8 buffer[]; 37 38 }; 38 39 39 40 #define I2C_SLAVE_BYTELEN GENMASK(15, 0) 40 41 #define I2C_SLAVE_FLAG_ADDR16 BIT(16) 42 + #define I2C_SLAVE_FLAG_RO BIT(17) 41 43 #define I2C_SLAVE_DEVICE_MAGIC(_len, _flags) ((_flags) | (_len)) 42 44 43 45 static int i2c_slave_eeprom_slave_cb(struct i2c_client *client, ··· 55 53 eeprom->buffer_idx = *val | (eeprom->buffer_idx << 8); 56 54 eeprom->idx_write_cnt++; 57 55 } else { 58 - spin_lock(&eeprom->buffer_lock); 59 - eeprom->buffer[eeprom->buffer_idx++ & eeprom->address_mask] = *val; 60 - spin_unlock(&eeprom->buffer_lock); 56 + if (!eeprom->read_only) { 57 + spin_lock(&eeprom->buffer_lock); 58 + eeprom->buffer[eeprom->buffer_idx++ & eeprom->address_mask] = *val; 59 + spin_unlock(&eeprom->buffer_lock); 60 + } 61 61 } 62 62 break; 63 63 ··· 134 130 eeprom->idx_write_cnt = 0; 135 131 eeprom->num_address_bytes = flag_addr16 ? 2 : 1; 136 132 eeprom->address_mask = size - 1; 133 + eeprom->read_only = FIELD_GET(I2C_SLAVE_FLAG_RO, id->driver_data); 137 134 spin_lock_init(&eeprom->buffer_lock); 138 135 i2c_set_clientdata(client, eeprom); 139 136 ··· 170 165 171 166 static const struct i2c_device_id i2c_slave_eeprom_id[] = { 172 167 { "slave-24c02", I2C_SLAVE_DEVICE_MAGIC(2048 / 8, 0) }, 168 + { "slave-24c02ro", I2C_SLAVE_DEVICE_MAGIC(2048 / 8, I2C_SLAVE_FLAG_RO) }, 173 169 { "slave-24c32", I2C_SLAVE_DEVICE_MAGIC(32768 / 8, I2C_SLAVE_FLAG_ADDR16) }, 170 + { "slave-24c32ro", I2C_SLAVE_DEVICE_MAGIC(32768 / 8, I2C_SLAVE_FLAG_ADDR16 | I2C_SLAVE_FLAG_RO) }, 174 171 { "slave-24c64", I2C_SLAVE_DEVICE_MAGIC(65536 / 8, I2C_SLAVE_FLAG_ADDR16) }, 172 + { "slave-24c64ro", I2C_SLAVE_DEVICE_MAGIC(65536 / 8, I2C_SLAVE_FLAG_ADDR16 | I2C_SLAVE_FLAG_RO) }, 175 173 { } 176 174 }; 177 175 MODULE_DEVICE_TABLE(i2c, i2c_slave_eeprom_id);