Skip to contentSkip to conversation

i2c: hix5hd2: add i2c controller driver

PATCH Superseded Zhangfei Gao 2 participants 8 messages Sep 30, 2014 – Oct 4, 2014

Subsystems (2)

v3 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

v3 cover i2c: hix5hd2: add i2c controller driver

v3:
Add COMPILE_TEST as dependence to enable compile test Remove specific mach info in dts binding to solve the confusion.

v2:
Modify according to Wolfram's comments
including change vector name, coding style, return value etc.

Wei Yan (2):
i2c: hix5hd2: add devicetree documentation
i2c: hix5hd2: add i2c controller driver

Zhangfei Gao (1):
ARM: dts: hix5hd2: add i2c node

 .../devicetree/bindings/i2c/i2c-hix5hd2.txt        |   25 +
 arch/arm/boot/dts/hisi-x5hd2.dtsi                  |   60 +++
 drivers/i2c/busses/Kconfig                         |   10 +
 drivers/i2c/busses/Makefile                        |    1 +
 drivers/i2c/busses/i2c-hix5hd2.c                   |  554 ++++++++++++++++++++
 5 files changed, 650 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/i2c/i2c-hix5hd2.txt
 create mode 100644 drivers/i2c/busses/i2c-hix5hd2.c
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH v3 1/3 i2c: hix5hd2: add devicetree documentation

From: Wei Yan <[email protected]>

---
 .../devicetree/bindings/i2c/i2c-hix5hd2.txt        |   25 ++++++++++++++++++++
 1 file changed, 25 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/i2c/i2c-hix5hd2.txt
Documentation/devicetree/bindings/i2c/i2c-hix5hd2.txt new file +25 -0
new file mode 100644
index 0000000..660b7ba
@@ -0,0 +1,25 @@
+I2C for Hisilicon hix5hd2 chipset platform
+
+Required properties:
+- compatible: Must be "hisilicon,hix5hd2-i2c"
+- reg: physical base address of the controller and length of memory mapped
+     region.
+- interrupts: interrupt number to the cpu.
+- #address-cells = <1>;
+- #size-cells = <0>;
+- clocks: phandles to input clocks.
+
+Optional properties:
+- clock-frequency: Desired I2C bus frequency in Hz, otherwise defaults to 100000
+- Child nodes conforming to i2c bus binding
+
+Examples:
+I2C0 at f8b10000 {
+	compatible = "hisilicon,hix5hd2-i2c";
+	reg = <0xf8b10000 0x1000>;
+	interrupts = <0 38 4>;
+	clocks = <&clock HIX5HD2_I2C0_RST>;
+	#address-cells = <1>;
+	#size-cells = <0>;
+	status = "disabled";
+}
Signature · 1 line
1.7.9.5
#2 lore raw

PATCH v3 2/3 i2c: hix5hd2: add i2c controller driver

In reply to Zhangfei Gao

From: Wei Yan <[email protected]>

I2C drivers for hix5hd2 soc series, including following chipset Hi3716CV200, Hi3719CV100, Hi3718CV100, Hi3719MV100, Hi3718MV100.

---
 drivers/i2c/busses/Kconfig       |   10 +
 drivers/i2c/busses/Makefile      |    1 +
 drivers/i2c/busses/i2c-hix5hd2.c |  554 ++++++++++++++++++++++++++++++++++++++
 3 files changed, 565 insertions(+)
 create mode 100644 drivers/i2c/busses/i2c-hix5hd2.c
drivers/i2c/busses/Kconfig +10 -0
index 2ac87fa..2ef671f 100644
@@ -77,6 +77,16 @@ config I2C_AMD8111
 	  This driver can also be built as a module.  If so, the module
 	  will be called i2c-amd8111.
 
+config I2C_HIX5HD2
+	tristate "Hix5hd2 high-speed I2C driver"
+	depends on ARCH_HIX5HD2 || COMPILE_TEST
+	help
+	  Say Y here to include support for high-speed I2C controller in the
+	  Hisilicon based hix5hd2 SoCs.
+
+	  This driver can also be built as a module.  If so, the module
+	  will be called i2c-hix5hd2.
+
 config I2C_I801
 	tristate "Intel 82801 (ICH/PCH)"
 	depends on PCI
drivers/i2c/busses/Makefile +1 -0
index 49bf07e..9739938 100644
@@ -47,6 +47,7 @@ obj-$(CONFIG_I2C_EG20T)		+= i2c-eg20t.o
 obj-$(CONFIG_I2C_EXYNOS5)	+= i2c-exynos5.o
 obj-$(CONFIG_I2C_GPIO)		+= i2c-gpio.o
 obj-$(CONFIG_I2C_HIGHLANDER)	+= i2c-highlander.o
+obj-$(CONFIG_I2C_HIX5HD2)	+= i2c-hix5hd2.o
 obj-$(CONFIG_I2C_IBM_IIC)	+= i2c-ibm_iic.o
 obj-$(CONFIG_I2C_IMX)		+= i2c-imx.o
 obj-$(CONFIG_I2C_IOP3XX)	+= i2c-iop3xx.o
drivers/i2c/busses/i2c-hix5hd2.c new file +554 -0

554 lines not on this page · raw message

Signature · 1 line
1.7.9.5
#3 lore raw

PATCH v3 2/3 i2c: hix5hd2: add i2c controller driver

Hi,

Quoted 7 lines · Zhangfei Gao

From: Wei Yan <[email protected]>

I2C drivers for hix5hd2 soc series, including following chipset Hi3716CV200, Hi3719CV100, Hi3718CV100, Hi3719MV100, Hi3718MV100.

Looks good to me. You probably want to have a look at this patch
http://patchwork.ozlabs.org/patch/394648/

an do something similar here, I guess.

BTW what tests have you performed?

Thanks,

Wolfram

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20141003/08e9a616/attachment-0001.sig>

author
#4 lore raw

PATCH v3 2/3 i2c: hix5hd2: add i2c controller driver

Quoted 11 lines · Wolfram Sang

Hi,

Quoted 7 lines · Zhangfei Gao

From: Wei Yan <[email protected]>

I2C drivers for hix5hd2 soc series, including following chipset Hi3716CV200, Hi3719CV100, Hi3718CV100, Hi3719MV100, Hi3718MV100.

Quoted 7 lines

Looks good to me. You probably want to have a look at this patch
http://patchwork.ozlabs.org/patch/394648/

an do something similar here, I guess.

BTW what tests have you performed?

Thanks Wolfram for the info, will update accordingly.

Currently Wei help do the test via I2C device interface, on a specific board with i2c device.
We do the test after the board is up, also no i2c activity during probe.

Thanks

#5 lore raw

PATCH v3 2/3 i2c: hix5hd2: add i2c controller driver

Quoted 3 lines

Currently Wei help do the test via I2C device interface, on a specific board with i2c device.
We do the test after the board is up, also no i2c activity during probe.

Huh, so the driver has not been tested with a real i2c slave so far? Or am I misunderstanding something?

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20141003/ff37924e/attachment.sig>

author
#6 lore raw

PATCH v3 2/3 i2c: hix5hd2: add i2c controller driver

Quoted 6 lines · Wolfram Sang
Quoted 3 lines

Currently Wei help do the test via I2C device interface, on a specific board with i2c device.
We do the test after the board is up, also no i2c activity during probe.

Huh, so the driver has not been tested with a real i2c slave so far? Or am I misunderstanding something?

Sorry for the confusion

It is tested via e2prom,
Write group of data then read back to check whether they are same or not. We use I2C device interface, and only run the test application when board is up.

Thanks

#7 lore raw

PATCH v3 3/3 ARM: dts: hix5hd2: add i2c node

In reply to Zhangfei Gao
---
 arch/arm/boot/dts/hisi-x5hd2.dtsi |   60 +++++++++++++++++++++++++++++++++++++
 1 file changed, 60 insertions(+)
arch/arm/boot/dts/hisi-x5hd2.dtsi +60 -0
index d3d99fb..17d0637 100644
@@ -476,5 +476,65 @@
                         interrupts = <0 70 4>;
                         clocks = <&clock HIX5HD2_SATA_CLK>;
 		};
+
+		i2c0: i2c at b10000 {
+			compatible = "hisilicon,hix5hd2-i2c";
+			reg = <0xb10000 0x1000>;
+			interrupts = <0 38 4>;
+			clocks = <&clock HIX5HD2_I2C0_RST>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+			status = "disabled";
+		};
+
+		i2c1: i2c at b11000 {
+			compatible = "hisilicon,hix5hd2-i2c";
+			reg = <0xb11000 0x1000>;
+			interrupts = <0 39 4>;
+			clocks = <&clock HIX5HD2_I2C1_RST>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+			status = "disabled";
+		};
+
+		i2c2: i2c at b12000 {
+			compatible = "hisilicon,hix5hd2-i2c";
+			reg = <0xb12000 0x1000>;
+			interrupts = <0 40 4>;
+			clocks = <&clock HIX5HD2_I2C2_RST>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+			status = "disabled";
+		};
+
+		i2c3: i2c at b13000 {
+			compatible = "hisilicon,hix5hd2-i2c";
+			reg = <0xb13000 0x1000>;
+			interrupts = <0 41 4>;
+			clocks = <&clock HIX5HD2_I2C3_RST>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+			status = "disabled";
+		};
+
+		i2c4: i2c at b16000 {
+			compatible = "hisilicon,hix5hd2-i2c";
+			reg = <0xb16000 0x1000>;
+			interrupts = <0 43 4>;
+			clocks = <&clock HIX5HD2_I2C4_RST>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+			status = "disabled";
+		};
+
+		i2c5: i2c at b17000 {
+			compatible = "hisilicon,hix5hd2-i2c";
+			reg = <0xb17000 0x1000>;
+			interrupts = <0 44 4>;
+			clocks = <&clock HIX5HD2_I2C5_RST>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+			status = "disabled";
+		};
 	};
 };
Signature · 1 line
1.7.9.5