Skip to contentSkip to conversation

Add I2C driver for ZTE ZX2967 family SoCs

PATCH New Shawn Guo 2 participants 5 messages Jun 22, 2017 – Jun 23, 2017

Subsystems (2)
lore
Share & tools
lore

Shawn Guo

author
#0 lore raw

v2 cover Add I2C driver for ZTE ZX2967 family SoCs

From: Shawn Guo <[email protected]>

It's the second posting of the patches adding I2C driver for ZTE ZX2967 family SoCs. Thanks a lot for Wolfram's review comments on v1 patch, which helps identify issues with NACK handling.

Changes for v2:
- Add COMPILE_TEST for Kconfig option dependency.
- Drop warning message for unsupported SMBus transfer, since the driver will fall back to emulate them via I2C anyway.
- Kill ZX2967_I2C_FUNCS define by returning I2C_FUNC_XXX directly.
- Drop error message for i2c_add_numbered_adapter() check, since the core will do the reporting.
- Drop the error checking from zx2967_i2c_reset_hardware() which is useless now, and add it into irq handler for proper NACK handling.

Baoyou Xie (2):
dt: bindings: add documentation for zx2967 family i2c controller
i2c: zx2967: add i2c controller driver for ZTE's zx2967 family

 .../devicetree/bindings/i2c/i2c-zx2967.txt         |  22 +
 drivers/i2c/busses/Kconfig                         |   9 +
 drivers/i2c/busses/Makefile                        |   1 +
 drivers/i2c/busses/i2c-zx2967.c                    | 609 +++++++++++++++++++++
 4 files changed, 641 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/i2c/i2c-zx2967.txt
 create mode 100644 drivers/i2c/busses/i2c-zx2967.c
Signature · 1 line
1.9.1
author
#1 lore raw

PATCH v2 1/2 dt: bindings: add documentation for zx2967 family i2c controller

From: Baoyou Xie <[email protected]>

This patch adds dt-binding documentation for zx2967 family i2c controller.

---
 .../devicetree/bindings/i2c/i2c-zx2967.txt         | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/i2c/i2c-zx2967.txt
Documentation/devicetree/bindings/i2c/i2c-zx2967.txt new file +22 -0
new file mode 100644
index 000000000000..cb806d1ae4c9
@@ -0,0 +1,22 @@
+ZTE zx2967 I2C controller
+
+Required properties:
+ - compatible: must be "zte,zx296718-i2c"
+ - reg: physical address and length of the device registers
+ - interrupts: a single interrupt specifier
+ - clocks: clock for the device
+ - #address-cells: should be <1>
+ - #size-cells: should be <0>
+ - clock-frequency: the desired I2C bus clock frequency.
+
+Examples:
+
+	i2c at 112000 {
+		compatible = "zte,zx296718-i2c";
+		reg = <0x00112000 0x1000>;
+		interrupts = <GIC_SPI 112 IRQ_TYPE_LEVEL_HIGH>;
+		clocks = <&osc24m>;
+		#address-cells = <1>
+		#size-cells = <0>;
+		clock-frequency = <1600000>;
+	};
Signature · 1 line
1.9.1
Applied
#2 lore raw

PATCH v2 1/2 dt: bindings: add documentation for zx2967 family i2c controller

Quoted 8 lines · Shawn Guo

From: Baoyou Xie <[email protected]>

This patch adds dt-binding documentation for zx2967 family i2c controller.

Applied to for-next, thanks!

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20170623/a3277ca2/attachment.sig>

author
#3 lore raw

PATCH v2 2/2 i2c: zx2967: add i2c controller driver for ZTE's zx2967 family

In reply to Shawn Guo

From: Baoyou Xie <[email protected]>

This patch adds i2c controller driver for ZTE's zx2967 family.

---
 drivers/i2c/busses/Kconfig      |   9 +
 drivers/i2c/busses/Makefile     |   1 +
 drivers/i2c/busses/i2c-zx2967.c | 609 ++++++++++++++++++++++++++++++++++++++++
 3 files changed, 619 insertions(+)
 create mode 100644 drivers/i2c/busses/i2c-zx2967.c
drivers/i2c/busses/Kconfig +9 -0
index ed7106e48ba4..ec1f305294a6 100644
@@ -1260,4 +1260,13 @@ config I2C_OPAL
 	  This driver can also be built as a module. If so, the module will be
 	  called as i2c-opal.
 
+config I2C_ZX2967
+	tristate "ZTE ZX2967 I2C support"
+	depends on ARCH_ZX || COMPILE_TEST
+	default y
+	help
+	  Selecting this option will add ZX2967 I2C driver.
+	  This driver can also be built as a module. If so, the module will be
+	  called i2c-zx2967.
+
 endmenu
drivers/i2c/busses/Makefile +1 -0
index c89a4314c563..cdc65d8c3790 100644
@@ -103,6 +103,7 @@ obj-$(CONFIG_I2C_XILINX)	+= i2c-xiic.o
 obj-$(CONFIG_I2C_XLR)		+= i2c-xlr.o
 obj-$(CONFIG_I2C_XLP9XX)	+= i2c-xlp9xx.o
 obj-$(CONFIG_I2C_RCAR)		+= i2c-rcar.o
+obj-$(CONFIG_I2C_ZX2967)	+= i2c-zx2967.o
 
 # External I2C/SMBus adapter drivers
 obj-$(CONFIG_I2C_DIOLAN_U2C)	+= i2c-diolan-u2c.o
drivers/i2c/busses/i2c-zx2967.c new file +609 -0

609 lines not on this page · raw message

Signature · 1 line
1.9.1
Applied
#4 lore raw

PATCH v2 2/2 i2c: zx2967: add i2c controller driver for ZTE's zx2967 family

Quoted 8 lines · Shawn Guo

From: Baoyou Xie <[email protected]>

This patch adds i2c controller driver for ZTE's zx2967 family.

Applied to for-next, thanks!

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20170623/dc9e2f32/attachment.sig>