Skip to contentSkip to conversation

i2c: microchip: pci1xxxx: Add driver for I2C host controller in multifunction endpoint of pci1xxxx switch

PATCH Applied Tharun Kumar P 2 participants 2 messages Sep 27, 2022 – Sep 28, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v6 1/1 i2c: microchip: pci1xxxx: Add driver for I2C host controller in multifunction endpoint of pci1xxxx switch

Microchip pci1xxxx is an unmanaged PCIe3.1a Switch for Consumer, Industrial and Automotive applications. This switch has multiple downstream ports. In one of the Switch's Downstream port, there is a multifunction endpoint for peripherals which includes an I2C host controller. The I2C function in the endpoint operates at 100KHz, 400KHz and 1 MHz and has buffer depth of 128 bytes.
This patch provides the I2C controller driver for the I2C function of the switch.

---
V5 -> V6:
1. Added Signed-Off-by and Reviewed-by tags
---
V4 -> V5:
1. Removed autoprobe
2. Added quirk flag
---
V3 -> V4:
1. Removed typecasting for fields of min_t
2. Replaced TRUE with true
---
V2 -> V3:
1. Replaced SIMPLE_DEV_PM_OPS with DEFINE_SIMPLE_DEV_PM_OPS
2. Used devm_add_action API to avoid mixing devm and non-devm APIs
---
RFC -> V2:
1. Removed pci_free_irq_vectors API in code since pcim_enable_device is used
2. Added pci1xxxx_i2c_shutdown API in failure case of pci_alloc_irq_vectors and devm_request_irq
3. Used devm variant of i2c_add_adapter
4. Resolved name collision and fixed styling issues in comments

---
 MAINTAINERS                            |    8 +
 drivers/i2c/busses/Kconfig             |   10 +
 drivers/i2c/busses/Makefile            |    1 +
 drivers/i2c/busses/i2c-mchp-pci1xxxx.c | 1210 ++++++++++++++++++++++++
 4 files changed, 1229 insertions(+)
 create mode 100644 drivers/i2c/busses/i2c-mchp-pci1xxxx.c
MAINTAINERS +8 -0
index 3cf9842d9233..204885ab5200 100644
@@ -13110,6 +13110,14 @@ S:	Supported
 F:	Documentation/devicetree/bindings/mtd/atmel-nand.txt
 F:	drivers/mtd/nand/raw/atmel/*
 
+MICROCHIP PCI1XXXX I2C DRIVER
+M:	Tharun Kumar P <[email protected]>
+M:	Kumaravel Thiagarajan <[email protected]>
+M:	Microchip Linux Driver Support <[email protected]>
+L:	[email protected]
+S:	Maintained
+F:	drivers/i2c/busses/i2c-mchp-pci1xxxx.c
+
 MICROCHIP PWM DRIVER
 M:	Claudiu Beznea <[email protected]>
 L:	[email protected] (moderated for non-subscribers)
drivers/i2c/busses/Kconfig +10 -0
index a1bae59208e3..7e967d87dc04 100644
@@ -1244,6 +1244,16 @@ config I2C_PARPORT
 	  This support is also available as a module.  If so, the module
 	  will be called i2c-parport.
 
+config I2C_PCI1XXXX
+	tristate "PCI1XXXX I2C Host Adapter"
+	depends on PCI
+	help
+	  If you say yes to this option, support will be included for
+	  Microchip PCI1XXXX's I2C interface.
+
+	  This driver can also be built as a module. If so, the module will
+	  be called i2c-mchp-pci1xxxx.
+
 config I2C_ROBOTFUZZ_OSIF
 	tristate "RobotFuzz Open Source InterFace USB adapter"
 	depends on USB
drivers/i2c/busses/Makefile +1 -0
index 479f60e4ee3d..2372ed91e7ad 100644
@@ -131,6 +131,7 @@ obj-$(CONFIG_I2C_DIOLAN_U2C)	+= i2c-diolan-u2c.o
 obj-$(CONFIG_I2C_DLN2)		+= i2c-dln2.o
 obj-$(CONFIG_I2C_CP2615) += i2c-cp2615.o
 obj-$(CONFIG_I2C_PARPORT)	+= i2c-parport.o
+obj-$(CONFIG_I2C_PCI1XXXX)	+= i2c-mchp-pci1xxxx.o
 obj-$(CONFIG_I2C_ROBOTFUZZ_OSIF)	+= i2c-robotfuzz-osif.o
 obj-$(CONFIG_I2C_TAOS_EVM)	+= i2c-taos-evm.o
 obj-$(CONFIG_I2C_TINY_USB)	+= i2c-tiny-usb.o
drivers/i2c/busses/i2c-mchp-pci1xxxx.c new file +1210 -0

1,210 lines not on this page · raw message

Signature · 1 line
2.25.1
Applied
#1 lore raw
Quoted 11 lines · Tharun Kumar P

Microchip pci1xxxx is an unmanaged PCIe3.1a Switch for Consumer, Industrial and Automotive applications. This switch has multiple downstream ports. In one of the Switch's Downstream port, there is a multifunction endpoint for peripherals which includes an I2C host controller. The I2C function in the endpoint operates at 100KHz, 400KHz and 1 MHz and has buffer depth of 128 bytes.
This patch provides the I2C controller driver for the I2C function of the switch.

Applied to for-next, thanks!