Skip to content

Commit 529766e

Browse files
SyniurgeWolfram Sang
authored andcommitted
i2c: Add drivers for the AMD PCIe MP2 I2C controller
MP2 controllers have two separate busses, so may accommodate up to two I2C adapters. Those adapters are listed in the ACPI namespace with the "AMDI0011" HID, and probed by a platform driver. Communication with the MP2 takes place through MMIO registers, or through DMA for more than 32 bytes transfers. This is major rework of the patch submitted by Nehal-bakulchandra Shah from AMD (https://patchwork.kernel.org/patch/10597369/). Most of the event handling of v3 was rewritten to make it work with more than one bus (e.g on Ryzen-based Lenovo Yoga 530), and this version contains many other improvements. Signed-off-by: Elie Morisse <syniurge@gmail.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
1 parent 36ea73c commit 529766e

File tree

7 files changed

+1111
-0
lines changed

7 files changed

+1111
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
Kernel driver i2c-amd-mp2
2+
3+
Supported adapters:
4+
* AMD MP2 PCIe interface
5+
6+
Datasheet: not publicly available.
7+
8+
Authors:
9+
Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
10+
Nehal Shah <nehal-bakulchandra.shah@amd.com>
11+
Elie Morisse <syniurge@gmail.com>
12+
13+
Description
14+
-----------
15+
16+
The MP2 is an ARM processor programmed as an I2C controller and communicating
17+
with the x86 host through PCI.
18+
19+
If you see something like this:
20+
21+
03:00.7 MP2 I2C controller: Advanced Micro Devices, Inc. [AMD] Device 15e6
22+
23+
in your 'lspci -v', then this driver is for your device.

MAINTAINERS

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -816,6 +816,14 @@ F: drivers/gpu/drm/amd/include/vi_structs.h
816816
F: drivers/gpu/drm/amd/include/v9_structs.h
817817
F: include/uapi/linux/kfd_ioctl.h
818818

819+
AMD MP2 I2C DRIVER
820+
M: Elie Morisse <syniurge@gmail.com>
821+
M: Nehal Shah <nehal-bakulchandra.shah@amd.com>
822+
M: Shyam Sundar S K <shyam-sundar.s-k@amd.com>
823+
L: linux-i2c@vger.kernel.org
824+
S: Maintained
825+
F: drivers/i2c/busses/i2c-amd-mp2*
826+
819827
AMD POWERPLAY
820828
M: Rex Zhu <rex.zhu@amd.com>
821829
M: Evan Quan <evan.quan@amd.com>

drivers/i2c/busses/Kconfig

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,16 @@ config I2C_AMD8111
7777
This driver can also be built as a module. If so, the module
7878
will be called i2c-amd8111.
7979

80+
config I2C_AMD_MP2
81+
tristate "AMD MP2 PCIe"
82+
depends on PCI && ACPI
83+
help
84+
If you say yes to this option, support will be included for the AMD
85+
MP2 PCIe I2C adapter.
86+
87+
This driver can also be built as modules. If so, the modules will
88+
be called i2c-amd-mp2-pci and i2c-amd-mp2-plat.
89+
8090
config I2C_HIX5HD2
8191
tristate "Hix5hd2 high-speed I2C driver"
8292
depends on ARCH_HISI || ARCH_HIX5HD2 || COMPILE_TEST

drivers/i2c/busses/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ obj-$(CONFIG_I2C_POWERMAC) += i2c-powermac.o
3333

3434
# Embedded system I2C/SMBus host controller drivers
3535
obj-$(CONFIG_I2C_ALTERA) += i2c-altera.o
36+
obj-$(CONFIG_I2C_AMD_MP2) += i2c-amd-mp2-pci.o i2c-amd-mp2-plat.o
3637
obj-$(CONFIG_I2C_ASPEED) += i2c-aspeed.o
3738
obj-$(CONFIG_I2C_AT91) += i2c-at91.o
3839
i2c-at91-objs := i2c-at91-core.o i2c-at91-master.o

0 commit comments

Comments
 (0)