Skip to content

Commit d7e67a9

Browse files
committed
Merge tag 'i2c-for-6.12-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux
Pull i2c fixes from Wolfram Sang: "i2c-host fixes for v6.12-rc7 (from Andi): - Fix designware incorrect behavior when concluding a transmission - Fix Mule multiplexer error value evaluation" * tag 'i2c-for-6.12-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: i2c: designware: do not hold SCL low when I2C_DYNAMIC_TAR_UPDATE is not set i2c: muxes: Fix return value check in mule_i2c_mux_probe()
2 parents ace149e + 547aad9 commit d7e67a9

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

drivers/i2c/busses/i2c-designware-common.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -524,17 +524,19 @@ int i2c_dw_set_sda_hold(struct dw_i2c_dev *dev)
524524
void __i2c_dw_disable(struct dw_i2c_dev *dev)
525525
{
526526
struct i2c_timings *t = &dev->timings;
527-
unsigned int raw_intr_stats;
527+
unsigned int raw_intr_stats, ic_stats;
528528
unsigned int enable;
529529
int timeout = 100;
530530
bool abort_needed;
531531
unsigned int status;
532532
int ret;
533533

534534
regmap_read(dev->map, DW_IC_RAW_INTR_STAT, &raw_intr_stats);
535+
regmap_read(dev->map, DW_IC_STATUS, &ic_stats);
535536
regmap_read(dev->map, DW_IC_ENABLE, &enable);
536537

537-
abort_needed = raw_intr_stats & DW_IC_INTR_MST_ON_HOLD;
538+
abort_needed = (raw_intr_stats & DW_IC_INTR_MST_ON_HOLD) ||
539+
(ic_stats & DW_IC_STATUS_MASTER_HOLD_TX_FIFO_EMPTY);
538540
if (abort_needed) {
539541
if (!(enable & DW_IC_ENABLE_ENABLE)) {
540542
regmap_write(dev->map, DW_IC_ENABLE, DW_IC_ENABLE_ENABLE);

drivers/i2c/busses/i2c-designware-core.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@
116116
#define DW_IC_STATUS_RFNE BIT(3)
117117
#define DW_IC_STATUS_MASTER_ACTIVITY BIT(5)
118118
#define DW_IC_STATUS_SLAVE_ACTIVITY BIT(6)
119+
#define DW_IC_STATUS_MASTER_HOLD_TX_FIFO_EMPTY BIT(7)
119120

120121
#define DW_IC_SDA_HOLD_RX_SHIFT 16
121122
#define DW_IC_SDA_HOLD_RX_MASK GENMASK(23, 16)

drivers/i2c/muxes/i2c-mux-mule.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ static int mule_i2c_mux_probe(struct platform_device *pdev)
6666
priv = i2c_mux_priv(muxc);
6767

6868
priv->regmap = dev_get_regmap(mux_dev->parent, NULL);
69-
if (IS_ERR(priv->regmap))
70-
return dev_err_probe(mux_dev, PTR_ERR(priv->regmap),
69+
if (!priv->regmap)
70+
return dev_err_probe(mux_dev, -ENODEV,
7171
"No parent i2c register map\n");
7272

7373
platform_set_drvdata(pdev, muxc);

0 commit comments

Comments
 (0)