Skip to contentSkip to conversation

Amlogic Meson I2C driver

PATCH Superseded Beniamino Galvani 1 participant 3 messages Sep 16, 2014

Subsystems (3)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

cover Amlogic Meson I2C driver

Hi,

this series adds a driver for the I2C controller found on Amlogic Meson SoCs. It has been tested on a Tronsmart Vega S89 TV Box, which is based on a Meson8 core, but should work also on Meson6 devices.

A patchset adding support for these SoCs was submitted some days ago and can be found here:

http://thread.gmane.org/gmane.linux.ports.arm.kernel/356685

Beniamino Galvani (2):
i2c: add support for Amlogic Meson I2C controller
i2c: meson: add device tree bindings documentation

 .../devicetree/bindings/i2c/i2c-meson.txt          |  24 +
 drivers/i2c/busses/Kconfig                         |   7 +
 drivers/i2c/busses/Makefile                        |   1 +
 drivers/i2c/busses/i2c-meson.c                     | 500 +++++++++++++++++++++
 4 files changed, 532 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/i2c/i2c-meson.txt
 create mode 100644 drivers/i2c/busses/i2c-meson.c
Signature · 1 line
1.9.1
#1 lore raw

PATCH 1/2 i2c: add support for Amlogic Meson I2C controller

This adds a driver for the I2C controller found in Meson6 and Meson8 SoCs from Amlogic.

---
 drivers/i2c/busses/Kconfig     |   7 +
 drivers/i2c/busses/Makefile    |   1 +
 drivers/i2c/busses/i2c-meson.c | 500 +++++++++++++++++++++++++++++++++++++++++
 3 files changed, 508 insertions(+)
 create mode 100644 drivers/i2c/busses/i2c-meson.c
drivers/i2c/busses/Kconfig +7 -0
index 9f7d585..e79e95b 100644
@@ -529,6 +529,13 @@ config I2C_KEMPLD
 	  This driver can also be built as a module. If so, the module
 	  will be called i2c-kempld.
 
+config I2C_MESON
+	tristate "Amlogic Meson I2C controller"
+	depends on ARCH_MESON
+	help
+	  If you say yes to this option, support will be included for the
+	  I2C interface on the Amlogic Meson family of SoCs.
+
 config I2C_MPC
 	tristate "MPC107/824x/85xx/512x/52xx/83xx/86xx"
 	depends on PPC
drivers/i2c/busses/Makefile +1 -0
index dd9a7f8..10c2a13 100644
@@ -51,6 +51,7 @@ obj-$(CONFIG_I2C_IBM_IIC)	+= i2c-ibm_iic.o
 obj-$(CONFIG_I2C_IMX)		+= i2c-imx.o
 obj-$(CONFIG_I2C_IOP3XX)	+= i2c-iop3xx.o
 obj-$(CONFIG_I2C_KEMPLD)	+= i2c-kempld.o
+obj-$(CONFIG_I2C_MESON)		+= i2c-meson.o
 obj-$(CONFIG_I2C_MPC)		+= i2c-mpc.o
 obj-$(CONFIG_I2C_MV64XXX)	+= i2c-mv64xxx.o
 obj-$(CONFIG_I2C_MXS)		+= i2c-mxs.o
drivers/i2c/busses/i2c-meson.c new file +500 -0

500 lines not on this page · raw message

Signature · 1 line
1.9.1
#2 lore raw

PATCH 2/2 i2c: meson: add device tree bindings documentation

In reply to Beniamino Galvani

Add device tree bindings documentation for the I2C controller found in Amlogic Meson SoCs.

---
 .../devicetree/bindings/i2c/i2c-meson.txt          | 24 ++++++++++++++++++++++
 1 file changed, 24 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/i2c/i2c-meson.txt
Documentation/devicetree/bindings/i2c/i2c-meson.txt new file +24 -0
new file mode 100644
index 0000000..54a6c2c
@@ -0,0 +1,24 @@
+* Amlogic Meson I2C controller
+
+Required properties:
+ - compatible: must be "amlogic,meson6-i2c"
+ - reg: physical address and length of the device register set
+ - interrupts: a single interrupt specifier
+ - clocks: clock for the device
+ - #address-cells: should be <1>
+ - #size-cells: should be <0>
+
+Optional properties:
+- clock-frequency: the desired I2C bus clock frequency in Hz; in
+  absence of this property the default value is used (100 kHz).
+
+Example:
+
+	i2c at c1108500 {
+		compatible = "amlogic,meson6-i2c";
+		reg = <0xc1108500 0x20>;
+		interrupts = <0 21 1>;
+		clocks = <&clk81>;
+		#address-cells = <1>;
+		#size-cells = <0>;
+	};
Signature · 1 line
1.9.1