Skip to content

Commit dfba48a

Browse files
committed
Merge tag 'i2c-for-6.16-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux
Pull i2c fixes from Wolfram Sang: - imx: fix SMBus protocol compliance during block read - omap: fix error handling path in probe - robotfuzz, tiny-usb: prevent zero-length reads - x86, designware, amdisp: fix build error when modules are disabled (agreed to go in via i2c) - scx200_acb: fix build error because of missing HAS_IOPORT * tag 'i2c-for-6.16-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: i2c: scx200_acb: depends on HAS_IOPORT i2c: omap: Fix an error handling path in omap_i2c_probe() platform/x86: Use i2c adapter name to fix build errors i2c: amd-isp: Initialize unique adapter name i2c: designware: Initialize adapter name only when not set i2c: tiny-usb: disable zero-length read messages i2c: robotfuzz-osif: disable zero-length read messages i2c: imx: fix emulated smbus block read
2 parents ded7790 + f40213c commit dfba48a

File tree

10 files changed

+40
-7
lines changed

10 files changed

+40
-7
lines changed

MAINTAINERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24099,6 +24099,7 @@ M: Bin Du <[email protected]>
2409924099
2410024100
S: Maintained
2410124101
F: drivers/i2c/busses/i2c-designware-amdisp.c
24102+
F: include/linux/soc/amd/isp4_misc.h
2410224103

2410324104
SYNOPSYS DESIGNWARE MMC/SD/SDIO DRIVER
2410424105
M: Jaehoon Chung <[email protected]>

drivers/i2c/busses/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1530,7 +1530,7 @@ config I2C_XGENE_SLIMPRO
15301530

15311531
config SCx200_ACB
15321532
tristate "Geode ACCESS.bus support"
1533-
depends on X86_32 && PCI
1533+
depends on X86_32 && PCI && HAS_IOPORT
15341534
help
15351535
Enable the use of the ACCESS.bus controllers on the Geode SCx200 and
15361536
SC1100 processors and the CS5535 and CS5536 Geode companion devices.

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include <linux/module.h>
99
#include <linux/platform_device.h>
1010
#include <linux/pm_runtime.h>
11+
#include <linux/soc/amd/isp4_misc.h>
1112

1213
#include "i2c-designware-core.h"
1314

@@ -62,6 +63,7 @@ static int amd_isp_dw_i2c_plat_probe(struct platform_device *pdev)
6263

6364
adap = &isp_i2c_dev->adapter;
6465
adap->owner = THIS_MODULE;
66+
scnprintf(adap->name, sizeof(adap->name), AMDISP_I2C_ADAP_NAME);
6567
ACPI_COMPANION_SET(&adap->dev, ACPI_COMPANION(&pdev->dev));
6668
adap->dev.of_node = pdev->dev.of_node;
6769
/* use dynamically allocated adapter id */

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1042,8 +1042,9 @@ int i2c_dw_probe_master(struct dw_i2c_dev *dev)
10421042
if (ret)
10431043
return ret;
10441044

1045-
snprintf(adap->name, sizeof(adap->name),
1046-
"Synopsys DesignWare I2C adapter");
1045+
if (!adap->name[0])
1046+
scnprintf(adap->name, sizeof(adap->name),
1047+
"Synopsys DesignWare I2C adapter");
10471048
adap->retries = 3;
10481049
adap->algo = &i2c_dw_algo;
10491050
adap->quirks = &i2c_dw_quirks;

drivers/i2c/busses/i2c-imx.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1008,7 +1008,7 @@ static inline int i2c_imx_isr_read(struct imx_i2c_struct *i2c_imx)
10081008
/* setup bus to read data */
10091009
temp = imx_i2c_read_reg(i2c_imx, IMX_I2C_I2CR);
10101010
temp &= ~I2CR_MTX;
1011-
if (i2c_imx->msg->len - 1)
1011+
if ((i2c_imx->msg->len - 1) || (i2c_imx->msg->flags & I2C_M_RECV_LEN))
10121012
temp &= ~I2CR_TXAK;
10131013

10141014
imx_i2c_write_reg(temp, i2c_imx, IMX_I2C_I2CR);
@@ -1063,6 +1063,7 @@ static inline void i2c_imx_isr_read_block_data_len(struct imx_i2c_struct *i2c_im
10631063
wake_up(&i2c_imx->queue);
10641064
}
10651065
i2c_imx->msg->len += len;
1066+
i2c_imx->msg->buf[i2c_imx->msg_buf_idx++] = len;
10661067
}
10671068

10681069
static irqreturn_t i2c_imx_master_isr(struct imx_i2c_struct *i2c_imx, unsigned int status)

drivers/i2c/busses/i2c-omap.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1461,13 +1461,13 @@ omap_i2c_probe(struct platform_device *pdev)
14611461
if (IS_ERR(mux_state)) {
14621462
r = PTR_ERR(mux_state);
14631463
dev_dbg(&pdev->dev, "failed to get I2C mux: %d\n", r);
1464-
goto err_disable_pm;
1464+
goto err_put_pm;
14651465
}
14661466
omap->mux_state = mux_state;
14671467
r = mux_state_select(omap->mux_state);
14681468
if (r) {
14691469
dev_err(&pdev->dev, "failed to select I2C mux: %d\n", r);
1470-
goto err_disable_pm;
1470+
goto err_put_pm;
14711471
}
14721472
}
14731473

@@ -1515,6 +1515,9 @@ omap_i2c_probe(struct platform_device *pdev)
15151515

15161516
err_unuse_clocks:
15171517
omap_i2c_write_reg(omap, OMAP_I2C_CON_REG, 0);
1518+
if (omap->mux_state)
1519+
mux_state_deselect(omap->mux_state);
1520+
err_put_pm:
15181521
pm_runtime_dont_use_autosuspend(omap->dev);
15191522
pm_runtime_put_sync(omap->dev);
15201523
err_disable_pm:

drivers/i2c/busses/i2c-robotfuzz-osif.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,11 @@ static u32 osif_func(struct i2c_adapter *adapter)
111111
return I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL;
112112
}
113113

114+
/* prevent invalid 0-length usb_control_msg */
115+
static const struct i2c_adapter_quirks osif_quirks = {
116+
.flags = I2C_AQ_NO_ZERO_LEN_READ,
117+
};
118+
114119
static const struct i2c_algorithm osif_algorithm = {
115120
.xfer = osif_xfer,
116121
.functionality = osif_func,
@@ -143,6 +148,7 @@ static int osif_probe(struct usb_interface *interface,
143148

144149
priv->adapter.owner = THIS_MODULE;
145150
priv->adapter.class = I2C_CLASS_HWMON;
151+
priv->adapter.quirks = &osif_quirks;
146152
priv->adapter.algo = &osif_algorithm;
147153
priv->adapter.algo_data = priv;
148154
snprintf(priv->adapter.name, sizeof(priv->adapter.name),

drivers/i2c/busses/i2c-tiny-usb.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,11 @@ static u32 usb_func(struct i2c_adapter *adapter)
139139
return ret;
140140
}
141141

142+
/* prevent invalid 0-length usb_control_msg */
143+
static const struct i2c_adapter_quirks usb_quirks = {
144+
.flags = I2C_AQ_NO_ZERO_LEN_READ,
145+
};
146+
142147
/* This is the actual algorithm we define */
143148
static const struct i2c_algorithm usb_algorithm = {
144149
.xfer = usb_xfer,
@@ -247,6 +252,7 @@ static int i2c_tiny_usb_probe(struct usb_interface *interface,
247252
/* setup i2c adapter description */
248253
dev->adapter.owner = THIS_MODULE;
249254
dev->adapter.class = I2C_CLASS_HWMON;
255+
dev->adapter.quirks = &usb_quirks;
250256
dev->adapter.algo = &usb_algorithm;
251257
dev->adapter.algo_data = dev;
252258
snprintf(dev->adapter.name, sizeof(dev->adapter.name),

drivers/platform/x86/amd/amd_isp4.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include <linux/mutex.h>
1212
#include <linux/platform_device.h>
1313
#include <linux/property.h>
14+
#include <linux/soc/amd/isp4_misc.h>
1415
#include <linux/string.h>
1516
#include <linux/types.h>
1617
#include <linux/units.h>
@@ -151,7 +152,7 @@ MODULE_DEVICE_TABLE(acpi, amdisp_sensor_ids);
151152

152153
static inline bool is_isp_i2c_adapter(struct i2c_adapter *adap)
153154
{
154-
return !strcmp(adap->owner->name, "i2c_designware_amdisp");
155+
return !strcmp(adap->name, AMDISP_I2C_ADAP_NAME);
155156
}
156157

157158
static void instantiate_isp_i2c_client(struct amdisp_platform *isp4_platform,

include/linux/soc/amd/isp4_misc.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// SPDX-License-Identifier: GPL-2.0+
2+
3+
/*
4+
* Copyright (C) 2025 Advanced Micro Devices, Inc.
5+
*/
6+
7+
#ifndef __SOC_ISP4_MISC_H
8+
#define __SOC_ISP4_MISC_H
9+
10+
#define AMDISP_I2C_ADAP_NAME "AMDISP DesignWare I2C adapter"
11+
12+
#endif

0 commit comments

Comments
 (0)