Skip to content

Commit 6d16db0

Browse files
committed
Merge branch 'i2c/for-current-fixed' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux
Pull i2c fixes from Wolfram Sang: "A bunch of driver bugfixes and a MAINTAINERS addition" * 'i2c/for-current-fixed' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: MAINTAINERS: add entry for STM32 I2C driver i2c: viperboard: return message count on master_xfer success i2c: pmcmsp: fix error return from master_xfer i2c: pmcmsp: return message count on master_xfer success i2c: designware: fix poll-after-enable regression eeprom: at24: fix retrieving the at24_chip_data structure i2c: core: ACPI: Log device not acking errors at dbg loglevel i2c: core: ACPI: Improve OpRegion read errors
2 parents 2c71d33 + 22aac3e commit 6d16db0

6 files changed

Lines changed: 24 additions & 8 deletions

File tree

‎MAINTAINERS‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13264,6 +13264,12 @@ M: Jan-Benedict Glaw <jbglaw@lug-owl.de>
1326413264
S: Maintained
1326513265
F: arch/alpha/kernel/srm_env.c
1326613266

13267+
ST STM32 I2C/SMBUS DRIVER
13268+
M: Pierre-Yves MORDRET <pierre-yves.mordret@st.com>
13269+
L: linux-i2c@vger.kernel.org
13270+
S: Maintained
13271+
F: drivers/i2c/busses/i2c-stm32*
13272+
1326713273
STABLE BRANCH
1326813274
M: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1326913275
L: stable@vger.kernel.org

‎drivers/i2c/busses/i2c-designware-master.c‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,10 @@ static void i2c_dw_xfer_init(struct dw_i2c_dev *dev)
209209
i2c_dw_disable_int(dev);
210210

211211
/* Enable the adapter */
212-
__i2c_dw_enable_and_wait(dev, true);
212+
__i2c_dw_enable(dev, true);
213+
214+
/* Dummy read to avoid the register getting stuck on Bay Trail */
215+
dw_readl(dev, DW_IC_ENABLE_STATUS);
213216

214217
/* Clear and enable interrupts */
215218
dw_readl(dev, DW_IC_CLR_INTR);

‎drivers/i2c/busses/i2c-pmcmsp.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -564,10 +564,10 @@ static int pmcmsptwi_master_xfer(struct i2c_adapter *adap,
564564
* TODO: We could potentially loop and retry in the case
565565
* of MSP_TWI_XFER_TIMEOUT.
566566
*/
567-
return -1;
567+
return -EIO;
568568
}
569569

570-
return 0;
570+
return num;
571571
}
572572

573573
static u32 pmcmsptwi_i2c_func(struct i2c_adapter *adapter)

‎drivers/i2c/busses/i2c-viperboard.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ static int vprbrd_i2c_xfer(struct i2c_adapter *i2c, struct i2c_msg *msgs,
337337
}
338338
mutex_unlock(&vb->lock);
339339
}
340-
return 0;
340+
return num;
341341
error:
342342
mutex_unlock(&vb->lock);
343343
return error;

‎drivers/i2c/i2c-core-acpi.c‎

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -445,10 +445,17 @@ static int acpi_gsb_i2c_read_bytes(struct i2c_client *client,
445445
msgs[1].buf = buffer;
446446

447447
ret = i2c_transfer(client->adapter, msgs, ARRAY_SIZE(msgs));
448-
if (ret < 0)
449-
dev_err(&client->adapter->dev, "i2c read failed\n");
450-
else
448+
if (ret < 0) {
449+
/* Getting a NACK is unfortunately normal with some DSTDs */
450+
if (ret == -EREMOTEIO)
451+
dev_dbg(&client->adapter->dev, "i2c read %d bytes from client@%#x starting at reg %#x failed, error: %d\n",
452+
data_len, client->addr, cmd, ret);
453+
else
454+
dev_err(&client->adapter->dev, "i2c read %d bytes from client@%#x starting at reg %#x failed, error: %d\n",
455+
data_len, client->addr, cmd, ret);
456+
} else {
451457
memcpy(data, buffer, data_len);
458+
}
452459

453460
kfree(buffer);
454461
return ret;

‎drivers/misc/eeprom/at24.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,7 @@ static int at24_get_pdata(struct device *dev, struct at24_platform_data *pdata)
518518
if (of_node && of_match_device(at24_of_match, dev))
519519
cdata = of_device_get_match_data(dev);
520520
else if (id)
521-
cdata = (void *)&id->driver_data;
521+
cdata = (void *)id->driver_data;
522522
else
523523
cdata = acpi_device_get_match_data(dev);
524524

0 commit comments

Comments
 (0)