Skip to content

Commit 0e9ee7d

Browse files
author
Wolfram Sang
committed
Merge tag 'i2c-host-6.10' of git://git.kernel.org/pub/scm/linux/kernel/git/andi.shyti/linux into i2c/for-mergewindow
Code cleanup: A substantial code cleanup from Wolfram affects many drivers: - Removed dev_err() in case of timeout during i2c transfers, as timeouts are not considered errors and should not be treated as such. - For the same reason, 'timeout' variables have been renamed to 'time_left'. Other cleanups: - The viperboard driver now omits the "owner = THIS_MODULE" assignment. - Finally, we have eliminated the last remnants of I2C_CLASS_SPD: support for class-based devices has been completely removed from the mux-gpio driver. - In the ocore devices, a more standard use of ioport_map() for 8-bit I/O read/write operations has been implemented. - The mpc driver will be among the first i2c drivers and one of the first in the kernel to use the __free auto cleanup routine. - The designware driver now uses MODULE_DEVICE_TABLE() instead of MODULE_ALIAS() for better consistency with the ID table. - Added prefixes to the octeon register macros. - Fixed some checkpatch errors in the newly created i2c-viai2c-common.c file. Code refactoring: - The riic driver has refactored read/write operations to more flexibly support new platforms, laying the foundation for new SoC peculiarities. - In the i801 driver, a notifier callback has been created for muxed child segments. - The lpi2c driver now sets a clock rate during probe instead of continuously calling clk_get_rate(). - Improvements in the clock divisor logic to accommodate other clock frequencies. - Combined some common functionalities during initialization for the wmt driver and separated others that can be independently used by different drivers. Now, all the common functionalities are grouped in the i2c-viai2c-common.c file. - Improved the clock stretching mechanism in the newly created i2c-viai2c-common.c file, inherited from the previous i2c-wmt.c. Features added: - The octeon driver now includes watchdog timeout handling. - Added high-speed support for the octeon driver. Added support for: - R9A09G057 SoC in the riic driver. - Rapids-D I2C controller in the designware driver. - Cadence driver now also supports RISC-V architectures. - Added support to the WMT device as a separate driver using the newly created i2c-viai2c-common.c functionalities. - Added support for the Zhaoxin I2C controller. Some improvements in the bindings: - The pnx driver is converted to dtschema. - Added documentation for the Qualcomm SC8280XP.
2 parents 10316dc + 61e05ba commit 0e9ee7d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+1295
-733
lines changed

Documentation/devicetree/bindings/i2c/i2c-pnx.txt

Lines changed: 0 additions & 34 deletions
This file was deleted.
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/i2c/nxp,pnx-i2c.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: NXP PNX I2C Controller
8+
9+
maintainers:
10+
- Animesh Agarwal <[email protected]>
11+
12+
allOf:
13+
- $ref: /schemas/i2c/i2c-controller.yaml#
14+
15+
properties:
16+
compatible:
17+
const: nxp,pnx-i2c
18+
19+
reg:
20+
maxItems: 1
21+
22+
interrupts:
23+
maxItems: 1
24+
25+
clock-frequency:
26+
default: 100000
27+
28+
required:
29+
- compatible
30+
- reg
31+
- interrupts
32+
- "#address-cells"
33+
- "#size-cells"
34+
35+
unevaluatedProperties: false
36+
37+
examples:
38+
- |
39+
i2c@400a0000 {
40+
compatible = "nxp,pnx-i2c";
41+
reg = <0x400a0000 0x100>;
42+
interrupt-parent = <&mic>;
43+
interrupts = <51 0>;
44+
#address-cells = <1>;
45+
#size-cells = <0>;
46+
};

Documentation/devicetree/bindings/i2c/qcom,i2c-cci.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ properties:
2626
- items:
2727
- enum:
2828
- qcom,sc7280-cci
29+
- qcom,sc8280xp-cci
2930
- qcom,sdm845-cci
3031
- qcom,sm6350-cci
3132
- qcom,sm8250-cci
@@ -176,6 +177,24 @@ allOf:
176177
- const: cci
177178
- const: cci_src
178179

180+
- if:
181+
properties:
182+
compatible:
183+
contains:
184+
enum:
185+
- qcom,sc8280xp-cci
186+
then:
187+
properties:
188+
clocks:
189+
minItems: 4
190+
maxItems: 4
191+
clock-names:
192+
items:
193+
- const: camnoc_axi
194+
- const: slow_ahb_src
195+
- const: cpas_ahb
196+
- const: cci
197+
179198
additionalProperties: false
180199

181200
examples:

Documentation/devicetree/bindings/i2c/renesas,riic.yaml

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,17 @@ allOf:
1515

1616
properties:
1717
compatible:
18-
items:
19-
- enum:
20-
- renesas,riic-r7s72100 # RZ/A1H
21-
- renesas,riic-r7s9210 # RZ/A2M
22-
- renesas,riic-r9a07g043 # RZ/G2UL and RZ/Five
23-
- renesas,riic-r9a07g044 # RZ/G2{L,LC}
24-
- renesas,riic-r9a07g054 # RZ/V2L
25-
- const: renesas,riic-rz # RZ/A or RZ/G2L
18+
oneOf:
19+
- items:
20+
- enum:
21+
- renesas,riic-r7s72100 # RZ/A1H
22+
- renesas,riic-r7s9210 # RZ/A2M
23+
- renesas,riic-r9a07g043 # RZ/G2UL and RZ/Five
24+
- renesas,riic-r9a07g044 # RZ/G2{L,LC}
25+
- renesas,riic-r9a07g054 # RZ/V2L
26+
- const: renesas,riic-rz # RZ/A or RZ/G2L
27+
28+
- const: renesas,riic-r9a09g057 # RZ/V2H(P)
2629

2730
reg:
2831
maxItems: 1

MAINTAINERS

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2320,7 +2320,7 @@ M: Vladimir Zapolskiy <[email protected]>
23202320
L: [email protected] (moderated for non-subscribers)
23212321
S: Maintained
23222322
T: git git://github.com/vzapolskiy/linux-lpc32xx.git
2323-
F: Documentation/devicetree/bindings/i2c/i2c-pnx.txt
2323+
F: Documentation/devicetree/bindings/i2c/nxp,pnx-i2c.yaml
23242324
F: arch/arm/boot/dts/nxp/lpc/lpc32*
23252325
F: arch/arm/mach-lpc32xx/
23262326
F: drivers/i2c/busses/i2c-pnx.c
@@ -3017,7 +3017,7 @@ S: Orphan
30173017
F: Documentation/devicetree/bindings/i2c/i2c-wmt.txt
30183018
F: arch/arm/mach-vt8500/
30193019
F: drivers/clocksource/timer-vt8500.c
3020-
F: drivers/i2c/busses/i2c-wmt.c
3020+
F: drivers/i2c/busses/i2c-viai2c-wmt.c
30213021
F: drivers/mmc/host/wmt-sdmmc.c
30223022
F: drivers/pwm/pwm-vt8500.c
30233023
F: drivers/rtc/rtc-vt8500.c
@@ -10258,6 +10258,14 @@ L: [email protected]
1025810258
F: Documentation/i2c/busses/i2c-ismt.rst
1025910259
F: drivers/i2c/busses/i2c-ismt.c
1026010260

10261+
I2C/SMBUS ZHAOXIN DRIVER
10262+
M: Hans Hu <[email protected]>
10263+
10264+
S: Maintained
10265+
W: https://www.zhaoxin.com
10266+
F: drivers/i2c/busses/i2c-viai2c-common.c
10267+
F: drivers/i2c/busses/i2c-viai2c-zhaoxin.c
10268+
1026110269
I2C/SMBUS STUB DRIVER
1026210270
M: Jean Delvare <[email protected]>
1026310271

drivers/i2c/busses/Kconfig

Lines changed: 34 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ config I2C_CCGX_UCSI
1818

1919
config I2C_ALI1535
2020
tristate "ALI 1535"
21-
depends on PCI
21+
depends on PCI && HAS_IOPORT
2222
help
2323
If you say yes to this option, support will be included for the SMB
2424
Host controller on Acer Labs Inc. (ALI) M1535 South Bridges. The SMB
@@ -30,7 +30,7 @@ config I2C_ALI1535
3030

3131
config I2C_ALI1563
3232
tristate "ALI 1563"
33-
depends on PCI
33+
depends on PCI && HAS_IOPORT
3434
help
3535
If you say yes to this option, support will be included for the SMB
3636
Host controller on Acer Labs Inc. (ALI) M1563 South Bridges. The SMB
@@ -42,7 +42,7 @@ config I2C_ALI1563
4242

4343
config I2C_ALI15X3
4444
tristate "ALI 15x3"
45-
depends on PCI
45+
depends on PCI && HAS_IOPORT
4646
help
4747
If you say yes to this option, support will be included for the
4848
Acer Labs Inc. (ALI) M1514 and M1543 motherboard I2C interfaces.
@@ -52,7 +52,7 @@ config I2C_ALI15X3
5252

5353
config I2C_AMD756
5454
tristate "AMD 756/766/768/8111 and nVidia nForce"
55-
depends on PCI
55+
depends on PCI && HAS_IOPORT
5656
help
5757
If you say yes to this option, support will be included for the AMD
5858
756/766/768 mainboard I2C interfaces. The driver also includes
@@ -77,7 +77,7 @@ config I2C_AMD756_S4882
7777

7878
config I2C_AMD8111
7979
tristate "AMD 8111"
80-
depends on PCI
80+
depends on PCI && HAS_IOPORT
8181
help
8282
If you say yes to this option, support will be included for the
8383
second (SMBus 2.0) AMD 8111 mainboard I2C interface.
@@ -107,7 +107,7 @@ config I2C_HIX5HD2
107107

108108
config I2C_I801
109109
tristate "Intel 82801 (ICH/PCH)"
110-
depends on PCI
110+
depends on PCI && HAS_IOPORT
111111
select P2SB if X86
112112
select CHECK_SIGNATURE if X86 && DMI
113113
select I2C_SMBUS
@@ -163,9 +163,17 @@ config I2C_I801
163163
This driver can also be built as a module. If so, the module
164164
will be called i2c-i801.
165165

166+
config I2C_I801_MUX
167+
def_bool I2C_I801
168+
depends on DMI && I2C_MUX_GPIO
169+
depends on !(I2C_I801=y && I2C_MUX=m)
170+
help
171+
Optional support for multiplexed SMBUS on certain systems with
172+
more than 8 memory slots.
173+
166174
config I2C_ISCH
167175
tristate "Intel SCH SMBus 1.0"
168-
depends on PCI
176+
depends on PCI && HAS_IOPORT
169177
select LPC_SCH
170178
help
171179
Say Y here if you want to use SMBus controller on the Intel SCH
@@ -186,7 +194,7 @@ config I2C_ISMT
186194

187195
config I2C_PIIX4
188196
tristate "Intel PIIX4 and compatible (ATI/AMD/Serverworks/Broadcom/SMSC)"
189-
depends on PCI
197+
depends on PCI && HAS_IOPORT
190198
help
191199
If you say yes to this option, support will be included for the Intel
192200
PIIX4 family of mainboard I2C interfaces. Specifically, the following
@@ -232,7 +240,7 @@ config I2C_CHT_WC
232240

233241
config I2C_NFORCE2
234242
tristate "Nvidia nForce2, nForce3 and nForce4"
235-
depends on PCI
243+
depends on PCI && HAS_IOPORT
236244
help
237245
If you say yes to this option, support will be included for the Nvidia
238246
nForce2, nForce3 and nForce4 families of mainboard I2C interfaces.
@@ -265,7 +273,7 @@ config I2C_NVIDIA_GPU
265273

266274
config I2C_SIS5595
267275
tristate "SiS 5595"
268-
depends on PCI
276+
depends on PCI && HAS_IOPORT
269277
help
270278
If you say yes to this option, support will be included for the
271279
SiS5595 SMBus (a subset of I2C) interface.
@@ -275,7 +283,7 @@ config I2C_SIS5595
275283

276284
config I2C_SIS630
277285
tristate "SiS 630/730/964"
278-
depends on PCI
286+
depends on PCI && HAS_IOPORT
279287
help
280288
If you say yes to this option, support will be included for the
281289
SiS630, SiS730 and SiS964 SMBus (a subset of I2C) interface.
@@ -285,7 +293,7 @@ config I2C_SIS630
285293

286294
config I2C_SIS96X
287295
tristate "SiS 96x"
288-
depends on PCI
296+
depends on PCI && HAS_IOPORT
289297
help
290298
If you say yes to this option, support will be included for the SiS
291299
96x SMBus (a subset of I2C) interfaces. Specifically, the following
@@ -303,7 +311,7 @@ config I2C_SIS96X
303311

304312
config I2C_VIA
305313
tristate "VIA VT82C586B"
306-
depends on PCI
314+
depends on PCI && HAS_IOPORT
307315
select I2C_ALGOBIT
308316
help
309317
If you say yes to this option, support will be included for the VIA
@@ -314,7 +322,7 @@ config I2C_VIA
314322

315323
config I2C_VIAPRO
316324
tristate "VIA VT82C596/82C686/82xx and CX700/VX8xx/VX900"
317-
depends on PCI
325+
depends on PCI && HAS_IOPORT
318326
help
319327
If you say yes to this option, support will be included for the VIA
320328
VT82C596 and later SMBus interface. Specifically, the following
@@ -336,6 +344,16 @@ config I2C_VIAPRO
336344

337345
if ACPI
338346

347+
config I2C_ZHAOXIN
348+
tristate "Zhaoxin I2C Interface"
349+
depends on PCI || COMPILE_TEST
350+
help
351+
If you say yes to this option, support will be included for the
352+
ZHAOXIN I2C interface
353+
354+
This driver can also be built as a module. If so, the module
355+
will be called i2c-zhaoxin.
356+
339357
comment "ACPI drivers"
340358

341359
config I2C_SCMI
@@ -500,7 +518,7 @@ config I2C_BRCMSTB
500518

501519
config I2C_CADENCE
502520
tristate "Cadence I2C Controller"
503-
depends on ARCH_ZYNQ || ARM64 || XTENSA || COMPILE_TEST
521+
depends on ARCH_ZYNQ || ARM64 || XTENSA || RISCV || COMPILE_TEST
504522
help
505523
Say yes here to select Cadence I2C Host Controller. This controller is
506524
e.g. used by Xilinx Zynq.
@@ -1397,6 +1415,7 @@ config I2C_ICY
13971415
config I2C_MLXCPLD
13981416
tristate "Mellanox I2C driver"
13991417
depends on X86_64 || (ARM64 && ACPI) || COMPILE_TEST
1418+
depends on HAS_IOPORT
14001419
help
14011420
This exposes the Mellanox platform I2C busses to the linux I2C layer
14021421
for X86 and ARM64/ACPI based systems.

drivers/i2c/busses/Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ obj-$(CONFIG_I2C_SIS630) += i2c-sis630.o
2929
obj-$(CONFIG_I2C_SIS96X) += i2c-sis96x.o
3030
obj-$(CONFIG_I2C_VIA) += i2c-via.o
3131
obj-$(CONFIG_I2C_VIAPRO) += i2c-viapro.o
32+
i2c-zhaoxin-objs := i2c-viai2c-zhaoxin.o i2c-viai2c-common.o
33+
obj-$(CONFIG_I2C_ZHAOXIN) += i2c-zhaoxin.o
3234

3335
# Mac SMBus host controller drivers
3436
obj-$(CONFIG_I2C_HYDRA) += i2c-hydra.o
@@ -118,6 +120,7 @@ obj-$(CONFIG_I2C_TEGRA_BPMP) += i2c-tegra-bpmp.o
118120
obj-$(CONFIG_I2C_UNIPHIER) += i2c-uniphier.o
119121
obj-$(CONFIG_I2C_UNIPHIER_F) += i2c-uniphier-f.o
120122
obj-$(CONFIG_I2C_VERSATILE) += i2c-versatile.o
123+
i2c-wmt-objs := i2c-viai2c-wmt.o i2c-viai2c-common.o
121124
obj-$(CONFIG_I2C_WMT) += i2c-wmt.o
122125
i2c-octeon-objs := i2c-octeon-core.o i2c-octeon-platdrv.o
123126
obj-$(CONFIG_I2C_OCTEON) += i2c-octeon.o

drivers/i2c/busses/i2c-ali1535.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -285,10 +285,8 @@ static int ali1535_transaction(struct i2c_adapter *adap)
285285
&& (timeout++ < MAX_TIMEOUT));
286286

287287
/* If the SMBus is still busy, we give up */
288-
if (timeout > MAX_TIMEOUT) {
288+
if (timeout > MAX_TIMEOUT)
289289
result = -ETIMEDOUT;
290-
dev_err(&adap->dev, "SMBus Timeout!\n");
291-
}
292290

293291
if (temp & ALI1535_STS_FAIL) {
294292
result = -EIO;
@@ -313,10 +311,8 @@ static int ali1535_transaction(struct i2c_adapter *adap)
313311
}
314312

315313
/* check to see if the "command complete" indication is set */
316-
if (!(temp & ALI1535_STS_DONE)) {
314+
if (!(temp & ALI1535_STS_DONE))
317315
result = -ETIMEDOUT;
318-
dev_err(&adap->dev, "Error: command never completed\n");
319-
}
320316

321317
dev_dbg(&adap->dev, "Transaction (post): STS=%02x, TYP=%02x, "
322318
"CMD=%02x, ADD=%02x, DAT0=%02x, DAT1=%02x\n",

drivers/i2c/busses/i2c-ali1563.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@ static int ali1563_transaction(struct i2c_adapter *a, int size)
9999
return 0;
100100

101101
if (!timeout) {
102-
dev_err(&a->dev, "Timeout - Trying to KILL transaction!\n");
103102
/* Issue 'kill' to host controller */
104103
outb_p(HST_CNTL2_KILL, SMB_HST_CNTL2);
105104
data = inb_p(SMB_HST_STS);

0 commit comments

Comments
 (0)