Skip to content

Commit dab334c

Browse files
committed
Merge branch 'i2c/for-mergewindow' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux
Pull i2c updates from Wolfram Sang: - big refactoring of the PASEMI driver to support the Apple M1 - huge improvements to the XIIC in terms of locking and SMP safety - refactoring and clean ups for the i801 driver ... and the usual bunch of small driver updates * 'i2c/for-mergewindow' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: (43 commits) i2c: amd-mp2-plat: ACPI: Use ACPI_COMPANION() directly i2c: i801: Add support for Intel Ice Lake PCH-N i2c: virtio: update the maintainer to Conghui i2c: xlr: Fix a resource leak in the error handling path of 'xlr_i2c_probe()' i2c: qup: move to use request_irq by IRQF_NO_AUTOEN flag i2c: qup: fix a trivial typo i2c: tegra: Ensure that device is suspended before driver is removed i2c: i801: Fix incorrect and needless software PEC disabling i2c: mediatek: Dump i2c/dma register when a timeout occurs i2c: mediatek: Reset the handshake signal between i2c and dma i2c: mlxcpld: Allow flexible polling time setting for I2C transactions i2c: pasemi: Set enable bit for Apple variant i2c: pasemi: Add Apple platform driver i2c: pasemi: Refactor _probe to use devm_* i2c: pasemi: Allow to configure bus frequency i2c: pasemi: Move common reset code to own function i2c: pasemi: Split pci driver to its own file i2c: pasemi: Split off common probing code i2c: pasemi: Remove usage of pci_dev i2c: pasemi: Use dev_name instead of port number ...
2 parents 206825f + c6f49ac commit dab334c

23 files changed

+558
-261
lines changed

Documentation/devicetree/bindings/eeprom/at24.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,12 @@ properties:
9797
- items:
9898
- const: nxp,se97b
9999
- const: atmel,24c02
100+
- items:
101+
- const: onnn,cat24c04
102+
- const: atmel,24c04
103+
- items:
104+
- const: onnn,cat24c05
105+
- const: atmel,24c04
100106
- items:
101107
- const: renesas,r1ex24002
102108
- const: atmel,24c02
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: "http://devicetree.org/schemas/i2c/apple,i2c.yaml#"
5+
$schema: "http://devicetree.org/meta-schemas/core.yaml#"
6+
7+
title: Apple/PASemi I2C controller
8+
9+
maintainers:
10+
- Sven Peter <[email protected]>
11+
12+
description: |
13+
Apple SoCs such as the M1 come with a I2C controller based on the one found
14+
in machines with P. A. Semi's PWRficient processors.
15+
The bus is used to communicate with e.g. USB PD chips or the speaker
16+
amp.
17+
18+
allOf:
19+
- $ref: /schemas/i2c/i2c-controller.yaml#
20+
21+
properties:
22+
compatible:
23+
enum:
24+
- apple,t8103-i2c
25+
- apple,i2c
26+
27+
reg:
28+
maxItems: 1
29+
30+
clocks:
31+
items:
32+
- description: I2C bus reference clock
33+
34+
interrupts:
35+
maxItems: 1
36+
37+
clock-frequency:
38+
description: |
39+
Desired I2C bus clock frequency in Hz. If not specified, 100 kHz will be
40+
used. This frequency is generated by dividing the reference clock.
41+
Allowed values are between ref_clk/(16*4) and ref_clk/(16*255).
42+
43+
required:
44+
- compatible
45+
- reg
46+
- clocks
47+
- interrupts
48+
49+
unevaluatedProperties: false
50+
51+
examples:
52+
- |
53+
i2c@35010000 {
54+
compatible = "apple,t8103-i2c";
55+
reg = <0x35010000 0x4000>;
56+
interrupt-parent = <&aic>;
57+
interrupts = <0 627 4>;
58+
clocks = <&ref_clk>;
59+
#address-cells = <1>;
60+
#size-cells = <0>;
61+
};

MAINTAINERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20189,7 +20189,7 @@ F: include/uapi/linux/virtio_snd.h
2018920189
F: sound/virtio/*
2019020190

2019120191
VIRTIO I2C DRIVER
20192-
M: Jie Deng <jie.deng@intel.com>
20192+
M: Conghui Chen <conghui.chen@intel.com>
2019320193
M: Viresh Kumar <[email protected]>
2019420194
2019520195

drivers/i2c/busses/Kconfig

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -615,7 +615,10 @@ config I2C_EXYNOS5
615615
depends on ARCH_EXYNOS || COMPILE_TEST
616616
default y if ARCH_EXYNOS
617617
help
618-
High-speed I2C controller on Exynos5 and newer Samsung SoCs.
618+
High-speed I2C controller on Samsung Exynos5 and newer Samsung SoCs:
619+
Exynos5250, Exynos5260, Exynos5410, Exynos542x, Exynos5800,
620+
Exynos5433 and Exynos7.
621+
Choose Y here only if you build for such Samsung SoC.
619622

620623
config I2C_GPIO
621624
tristate "GPIO-based bitbanging I2C"
@@ -856,6 +859,17 @@ config I2C_PASEMI
856859
help
857860
Supports the PA Semi PWRficient on-chip SMBus interfaces.
858861

862+
config I2C_APPLE
863+
tristate "Apple SMBus platform driver"
864+
depends on ARCH_APPLE || COMPILE_TEST
865+
default ARCH_APPLE
866+
help
867+
Say Y here if you want to use the I2C controller present on Apple
868+
Silicon chips such as the M1.
869+
870+
This driver can also be built as a module. If so, the module
871+
will be called i2c-apple.
872+
859873
config I2C_PCA_PLATFORM
860874
tristate "PCA9564/PCA9665 as platform device"
861875
select I2C_ALGOPCA

drivers/i2c/busses/Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,10 @@ obj-$(CONFIG_I2C_NPCM7XX) += i2c-npcm7xx.o
8484
obj-$(CONFIG_I2C_OCORES) += i2c-ocores.o
8585
obj-$(CONFIG_I2C_OMAP) += i2c-omap.o
8686
obj-$(CONFIG_I2C_OWL) += i2c-owl.o
87+
i2c-pasemi-objs := i2c-pasemi-core.o i2c-pasemi-pci.o
8788
obj-$(CONFIG_I2C_PASEMI) += i2c-pasemi.o
89+
i2c-apple-objs := i2c-pasemi-core.o i2c-pasemi-platform.o
90+
obj-$(CONFIG_I2C_APPLE) += i2c-apple.o
8891
obj-$(CONFIG_I2C_PCA_PLATFORM) += i2c-pca-platform.o
8992
obj-$(CONFIG_I2C_PNX) += i2c-pnx.o
9093
obj-$(CONFIG_I2C_PXA) += i2c-pxa.o

drivers/i2c/busses/i2c-amd-mp2-pci.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -307,9 +307,9 @@ static int amd_mp2_pci_init(struct amd_mp2_dev *privdata,
307307

308308
pci_set_master(pci_dev);
309309

310-
rc = pci_set_dma_mask(pci_dev, DMA_BIT_MASK(64));
310+
rc = dma_set_mask(&pci_dev->dev, DMA_BIT_MASK(64));
311311
if (rc) {
312-
rc = pci_set_dma_mask(pci_dev, DMA_BIT_MASK(32));
312+
rc = dma_set_mask(&pci_dev->dev, DMA_BIT_MASK(32));
313313
if (rc)
314314
goto err_dma_mask;
315315
}

drivers/i2c/busses/i2c-amd-mp2-plat.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -246,12 +246,11 @@ static int i2c_amd_probe(struct platform_device *pdev)
246246
{
247247
int ret;
248248
struct amd_i2c_dev *i2c_dev;
249-
acpi_handle handle = ACPI_HANDLE(&pdev->dev);
250-
struct acpi_device *adev;
249+
struct acpi_device *adev = ACPI_COMPANION(&pdev->dev);
251250
struct amd_mp2_dev *mp2_dev;
252251
const char *uid;
253252

254-
if (acpi_bus_get_device(handle, &adev))
253+
if (!adev)
255254
return -ENODEV;
256255

257256
/* The ACPI namespace doesn't contain information about which MP2 PCI

drivers/i2c/busses/i2c-bcm-kona.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -763,7 +763,7 @@ static int bcm_kona_i2c_probe(struct platform_device *pdev)
763763
/* Map hardware registers */
764764
dev->base = devm_platform_ioremap_resource(pdev, 0);
765765
if (IS_ERR(dev->base))
766-
return -ENOMEM;
766+
return PTR_ERR(dev->base);
767767

768768
/* Get and enable external clock */
769769
dev->external_clk = devm_clk_get(dev->device, NULL);

0 commit comments

Comments
 (0)