Skip to contentSkip to conversation

i2c: hibvt: add Hisilicon BVT I2C controller driver

PATCH Superseded Pan Wen 2 participants 2 messages Aug 1, 2016

Subsystems (2)

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore

Pan Wen

author
#0 lore raw

PATCH v3 1/1 i2c: hibvt: add Hisilicon BVT I2C controller driver

add Hisilicon BVT I2C controller driver support.

---
change log
v3:
Add a SoC specific compatible string.
v2:
1)Fixed a compile error.
2)Dropped the clock-names property.

 .../devicetree/bindings/i2c/i2c-hibvt.txt          |  24 +
 drivers/i2c/busses/Kconfig                         |  10 +
 drivers/i2c/busses/Makefile                        |   1 +
 drivers/i2c/busses/i2c-hibvt.c                     | 737 +++++++++++++++++++++
 4 files changed, 772 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/i2c/i2c-hibvt.txt
 create mode 100644 drivers/i2c/busses/i2c-hibvt.c
Documentation/devicetree/bindings/i2c/i2c-hibvt.txt new file +24 -0
new file mode 100644
index 0000000..db3d2e2
@@ -0,0 +1,24 @@
+Hisilicon BVT I2C master controller
+
+Required properties:
+- compatible: should be "hisilicon,hibvt-i2c" and one of the following:
+	"hisilicon,hi3516cv300-i2c"
+- reg: physical base address of the controller and length of memory mapped.
+     region.
+- interrupts: interrupt number to the cpu.
+- clocks: phandles to input clocks.
+
+Optional properties:
+- clock-frequency: Desired I2C bus frequency in Hz, otherwise defaults to 100000.
+
+Other properties:
+see Documentation/devicetree/bindings/i2c/i2c.txt.
+
+Examples:
+i2c_bus0: i2c@12110000 {
+	compatible = "hisilicon,hi3516cv300-i2c", "hisilicon,hibvt-i2c";
+	reg = <0x12110000 0x100>;
+	interrupts = <20>;
+	clocks = <&crg_ctrl HI3516CV300_APB_CLK>;
+	clock-frequency = <100000>;
+};
drivers/i2c/busses/Kconfig +10 -0
index f167021..6c5d24a 100644
@@ -552,6 +552,16 @@ config I2C_GPIO
 	  This is a very simple bitbanging I2C driver utilizing the
 	  arch-neutral GPIO API to control the SCL and SDA lines.
 
+config I2C_HIBVT
+	tristate "Hisilicon BVT I2C Controller"
+	depends on ARCH_HISI
+	help
+	  Say Y here to include support for Hisilicon BVT I2C controller in the
+	  Hisilicon BVT SoCs.
+
+	  This driver can also be built as a module.  If so, the module
+	  will be called i2c-hibvt.
+
 config I2C_HIGHLANDER
 	tristate "Highlander FPGA SMBus interface"
 	depends on SH_HIGHLANDER
drivers/i2c/busses/Makefile +1 -0
index 37f2819..42ef2e0 100644
@@ -51,6 +51,7 @@ obj-$(CONFIG_I2C_EG20T)		+= i2c-eg20t.o
 obj-$(CONFIG_I2C_EMEV2)		+= i2c-emev2.o
 obj-$(CONFIG_I2C_EXYNOS5)	+= i2c-exynos5.o
 obj-$(CONFIG_I2C_GPIO)		+= i2c-gpio.o
+obj-$(CONFIG_I2C_HIBVT)		+= i2c-hibvt.o
 obj-$(CONFIG_I2C_HIGHLANDER)	+= i2c-highlander.o
 obj-$(CONFIG_I2C_HIX5HD2)	+= i2c-hix5hd2.o
 obj-$(CONFIG_I2C_IBM_IIC)	+= i2c-ibm_iic.o
drivers/i2c/busses/i2c-hibvt.c new file +737 -0

737 lines not on this page · raw message

Signature · 1 line
2.3.7
maintainer Acked-by on v3 1/1
#1 lore raw
Quoted 11 lines · Pan Wen

add Hisilicon BVT I2C controller driver support.

---
change log
v3:
Add a SoC specific compatible string.
v2:
1)Fixed a compile error.
2)Dropped the clock-names property.

 .../devicetree/bindings/i2c/i2c-hibvt.txt          |  24 +
Quoted 6 lines
 drivers/i2c/busses/Kconfig                         |  10 +
 drivers/i2c/busses/Makefile                        |   1 +
 drivers/i2c/busses/i2c-hibvt.c                     | 737 +++++++++++++++++++++
 4 files changed, 772 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/i2c/i2c-hibvt.txt
 create mode 100644 drivers/i2c/busses/i2c-hibvt.c