Skip to contentSkip to conversation

i2c: buses: add i2c bus driver for NVIDIA GPU

PATCH Superseded Ajay Gupta 1 participant 1 message Aug 24, 2018

Subsystems (3)

v2 of 15 Superseded Latest is v15 →

lore
Share & tools
lore

Ajay Gupta

author
#0 lore raw

PATCH v2 1/2 i2c: buses: add i2c bus driver for NVIDIA GPU

Latest NVIDIA GPU card has USB Type-C interface. There is a Type-C controller which can be accessed over I2C.

This driver add I2C bus driver to communicate with Type-C controller. I2C client driver will be part of USB Type-C UCSI driver.

---
Changes from v1 -> v2: None

 Documentation/i2c/busses/i2c-gpu |  18 ++
 MAINTAINERS                      |   7 +
 drivers/i2c/busses/Kconfig       |   9 +
 drivers/i2c/busses/Makefile      |   1 +
 drivers/i2c/busses/i2c-gpu.c     | 493 +++++++++++++++++++++++++++++++++++++++
 5 files changed, 528 insertions(+)
 create mode 100644 Documentation/i2c/busses/i2c-gpu
 create mode 100644 drivers/i2c/busses/i2c-gpu.c
Documentation/i2c/busses/i2c-gpu new file +18 -0
new file mode 100644
index 0000000..873ba34
@@ -0,0 +1,18 @@
+Kernel driver i2c-gpu
+
+Datasheet: not publicly available.
+
+Authors:
+	Ajay Gupta <[email protected]>
+
+Description
+-----------
+
+i2c-gpu is a driver for I2C controller included in NVIDIA Turing and later
+GPUs and it is used to communicate with Type-C controller on GPUs.
+
+If your 'lspci -v' listing shows something like the following,
+
+01:00.3 Serial bus controller [0c80]: NVIDIA Corporation Device 1ad9 (rev a1)
+
+then this driver should support the I2C controller of your GPU.
MAINTAINERS +7 -0
index b2fcd1c..e99f8a2 100644
@@ -6796,6 +6796,13 @@ L:	[email protected]
 S:	Maintained
 F:	drivers/i2c/i2c-core-acpi.c
 
+I2C CONTROLLER DRIVER FOR NVIDIA GPU
+M:	Ajay Gupta <[email protected]>
+L:	[email protected]
+S:	Maintained
+F:	Documentation/i2c/busses/i2c-gpu
+F:	drivers/i2c/busses/i2c-gpu.c
+
 I2C MUXES
 M:	Peter Rosin <[email protected]>
 L:	[email protected]
drivers/i2c/busses/Kconfig +9 -0
index 451d4ae..ff8b2d4 100644
@@ -224,6 +224,15 @@ config I2C_NFORCE2_S4985
 	  This driver can also be built as a module.  If so, the module
 	  will be called i2c-nforce2-s4985.
 
+config I2C_GPU
+	tristate "NVIDIA GPU I2C controller"
+	depends on PCI
+	help
+	  If you say yes to this option, support will be included for the
+	  NVIDIA GPU I2C controller which is used to communicate with the GPU's
+	  Type-C controller. This driver can also be built as a module called
+	  i2c-gpu.ko.
+
 config I2C_SIS5595
 	tristate "SiS 5595"
 	depends on PCI
drivers/i2c/busses/Makefile +1 -0
index 18b26af..15d2894 100644
@@ -140,5 +140,6 @@ obj-$(CONFIG_I2C_SIBYTE)	+= i2c-sibyte.o
 obj-$(CONFIG_I2C_XGENE_SLIMPRO) += i2c-xgene-slimpro.o
 obj-$(CONFIG_SCx200_ACB)	+= scx200_acb.o
 obj-$(CONFIG_I2C_FSI)		+= i2c-fsi.o
+obj-$(CONFIG_I2C_GPU)          += i2c-gpu.o
 
 ccflags-$(CONFIG_I2C_DEBUG_BUS) := -DDEBUG
drivers/i2c/busses/i2c-gpu.c new file +493 -0

493 lines not on this page · raw message