Skip to contentSkip to conversation

i2c: buses: add i2c bus driver for NVIDIA GPU

PATCH Superseded Ajay Gupta 1 participant 1 message Oct 25, 2018

Subsystems (4)

v14 of 15 Superseded Latest is v15 →

lore
Share & tools
lore

Ajay Gupta

author maintainer
#0 lore raw

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

From: Ajay Gupta <[email protected]>

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

This driver adds 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
Changes from v2 -> v3

	Fixed review comments from Andy and Thierry
	Rename i2c-gpu.c -> i2c-nvidia-gpu.c

Changes from v3 -> v4
Fixed review comments from Andy
Changes from v4 -> v5
Fixed review comments from Andy
Changes from v5 -> v6
None
Changes from v6 -> v7 -> v8
Fixed review comments from Peter
- Add implicit STOP for last write message
- Add i2c_adapter_quirks with max_read_len and I2C_AQ_COMB flags
Changes from v8 -> v9
Fixed review comments from Peter
- Drop do_start flag
- Use i2c_8bit_addr_from_msg()
Changes from v9 -> v10
Fixed review comments from Peter
- Dropped I2C_FUNC_SMBUS_EMUL
- Dropped local mutex
Changes from v10 -> v11
Fixed review comments from Peter
- Moved stop in master_xfer at end of message
- Change i2c_read without STOP
- Dropped I2C_AC_COMB* flags
Changes from v11 -> v12
Fixed review comments from Peter
- Removed clearing of empty bits
- Fix master_xfer for correct stop use
Changes from v12 -> v13
Fixed review comments from Peter
- Added comments on 4 byte read limitation
- Added I2C_AC_COMB* flags
Changes from v13 -> v14
None

 Documentation/i2c/busses/i2c-nvidia-gpu |  18 ++
 MAINTAINERS                             |   7 +
 drivers/i2c/busses/Kconfig              |   9 +
 drivers/i2c/busses/Makefile             |   1 +
 drivers/i2c/busses/i2c-nvidia-gpu.c     | 368 ++++++++++++++++++++++++
 5 files changed, 403 insertions(+)
 create mode 100644 Documentation/i2c/busses/i2c-nvidia-gpu
 create mode 100644 drivers/i2c/busses/i2c-nvidia-gpu.c
Documentation/i2c/busses/i2c-nvidia-gpu new file +18 -0
new file mode 100644
index 000000000000..31884d2b2eb5
@@ -0,0 +1,18 @@
+Kernel driver i2c-nvidia-gpu
+
+Datasheet: not publicly available.
+
+Authors:
+	Ajay Gupta <[email protected]>
+
+Description
+-----------
+
+i2c-nvidia-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 d63705445bf8..83df14ca45b4 100644
@@ -6800,6 +6800,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-nvidia-gpu
+F:	drivers/i2c/busses/i2c-nvidia-gpu.c
+
 I2C MUXES
 M:	Peter Rosin <[email protected]>
 L:	[email protected]
drivers/i2c/busses/Kconfig +9 -0
index 451d4ae50e66..eed827b44068 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_NVIDIA_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-nvidia-gpu.
+
 config I2C_SIS5595
 	tristate "SiS 5595"
 	depends on PCI
drivers/i2c/busses/Makefile +1 -0
index 18b26af82b1c..d499813df038 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_NVIDIA_GPU)	+= i2c-nvidia-gpu.o
 
 ccflags-$(CONFIG_I2C_DEBUG_BUS) := -DDEBUG
drivers/i2c/busses/i2c-nvidia-gpu.c new file +368 -0

368 lines not on this page · raw message