Skip to contentSkip to conversation

i2c: atmel: add driver for atmel i2c

PATCH Superseded Songjun Wu 2 participants 5 messages May 6, 2016 – May 9, 2016

Subsystems (2)

v1 of 5 Superseded Latest is v5 →

lore
Share & tools
lore

Songjun Wu

author
#0 lore raw

cover i2c: atmel: add driver for atmel i2c

The i2c driver includes two parts.
1) Driver code to implement the i2c function.
2) Device tree binding documentation, it describes how to add the i2c in device tree.

Songjun Wu (2):
i2c: atmel: add i2c driver
i2c: atmel: DT binding for i2c driver

 doc/device-tree-bindings/i2c/i2c-at91.txt |  24 +++
 drivers/i2c/Kconfig                       |  10 ++
 drivers/i2c/Makefile                      |   1 +
 drivers/i2c/at91_i2c.c                    | 290 ++++++++++++++++++++++++++++++
 drivers/i2c/at91_i2c.h                    |  76 ++++++++
 5 files changed, 401 insertions(+)
 create mode 100644 doc/device-tree-bindings/i2c/i2c-at91.txt
 create mode 100644 drivers/i2c/at91_i2c.c
 create mode 100644 drivers/i2c/at91_i2c.h
Signature · 1 line
2.7.4
author
#1 lore raw

PATCH 1/2 i2c: atmel: add i2c driver

Add i2c driver.

---

 drivers/i2c/Kconfig    |  10 ++
 drivers/i2c/Makefile   |   1 +
 drivers/i2c/at91_i2c.c | 290 +++++++++++++++++++++++++++++++++++++++++++++++++
 drivers/i2c/at91_i2c.h |  76 +++++++++++++
 4 files changed, 377 insertions(+)
 create mode 100644 drivers/i2c/at91_i2c.c
 create mode 100644 drivers/i2c/at91_i2c.h
drivers/i2c/Kconfig +10 -0
index 9324c6c..e71fc51 100644
@@ -58,6 +58,16 @@ config DM_I2C_GPIO
 	  bindings are supported.
 	  Binding info: doc/device-tree-bindings/i2c/i2c-gpio.txt
 
+config SYS_I2C_AT91
+	bool "Atmel I2C driver"
+	depends on DM_I2C && ARCH_AT91
+	help
+	  Add support for the Atmel I2C driver. A serious problem is that there
+	  is no documented way to issue repeated START conditions for more than
+	  two messages, as needed to support combined I2C messages. Use the
+	  i2c-gpio driver unless your system can cope with this limitation.
+	  Binding info: doc/device-tree-bindings/i2c/i2c-at91.txt
+
 config SYS_I2C_CADENCE
 	tristate "Cadence I2C Controller"
 	depends on DM_I2C && (ARCH_ZYNQ || ARM64)
drivers/i2c/Makefile +1 -0
index 167424d..c5362a5 100644
@@ -16,6 +16,7 @@ obj-$(CONFIG_PCA9564_I2C) += pca9564_i2c.o
 obj-$(CONFIG_TSI108_I2C) += tsi108_i2c.o
 obj-$(CONFIG_SH_SH7734_I2C) += sh_sh7734_i2c.o
 obj-$(CONFIG_SYS_I2C) += i2c_core.o
+obj-$(CONFIG_SYS_I2C_AT91) += at91_i2c.o
 obj-$(CONFIG_SYS_I2C_CADENCE) += i2c-cdns.o
 obj-$(CONFIG_SYS_I2C_DAVINCI) += davinci_i2c.o
 obj-$(CONFIG_SYS_I2C_DW) += designware_i2c.o
drivers/i2c/at91_i2c.c new file +290 -0

290 lines not on this page · raw message

drivers/i2c/at91_i2c.h new file +76 -0

76 lines not on this page · raw message

Signature · 1 line
2.7.4
#2 lore raw

PATCH 1/2 i2c: atmel: add i2c driver

Hello Songjun Wu,

Am 06.05.2016 um 07:32 schrieb Songjun Wu:

Quoted 5 lines

Add i2c driver.

---

Quoted 7 lines
  drivers/i2c/Kconfig    |  10 ++
  drivers/i2c/Makefile   |   1 +
  drivers/i2c/at91_i2c.c | 290 +++++++++++++++++++++++++++++++++++++++++++++++++
  drivers/i2c/at91_i2c.h |  76 +++++++++++++
  4 files changed, 377 insertions(+)

create mode 100644 drivers/i2c/at91_i2c.c
create mode 100644 drivers/i2c/at91_i2c.h

Thanks!

bye,
Heiko

Signature · 2 lines
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
author
#3 lore raw

PATCH 2/2 i2c: atmel: DT binding for i2c driver

In reply to Songjun Wu

DT binding documentation for atmel i2c driver.

---

 doc/device-tree-bindings/i2c/i2c-at91.txt | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)
 create mode 100644 doc/device-tree-bindings/i2c/i2c-at91.txt
doc/device-tree-bindings/i2c/i2c-at91.txt new file +24 -0
new file mode 100644
index 0000000..3432a13
@@ -0,0 +1,24 @@
+I2C for Atmel platforms
+
+Required properties :
+- compatible : Must be "atmel,at91rm9200-i2c", "atmel,at91sam9261-i2c",
+     "atmel,at91sam9260-i2c", "atmel,at91sam9g20-i2c", "atmel,at91sam9g10-i2c",
+     "atmel,at91sam9x5-i2c", "atmel,sama5d4-i2c" or "atmel,sama5d2-i2c".
+- reg: physical base address of the controller and length of memory mapped
+     region.
+- #address-cells = <1>;
+- #size-cells = <0>;
+
+Optional properties:
+- clock-frequency: Desired I2C bus frequency in Hz, default value is 100000.
+- Child nodes conforming to i2c bus binding.
+
+Examples :
+
+i2c0: i2c at f8028000 {
+	compatible = "atmel,sama5d2-i2c";
+	reg = <0xf8028000 0x100>;
+	#address-cells = <1>;
+	#size-cells = <0>;
+	clock-frequency = <100000>;
+};
Signature · 1 line
2.7.4
#4 lore raw

PATCH 2/2 i2c: atmel: DT binding for i2c driver

Hello Songjun Wu,

Am 06.05.2016 um 07:32 schrieb Songjun Wu:

Quoted 8 lines

DT binding documentation for atmel i2c driver.

---

  doc/device-tree-bindings/i2c/i2c-at91.txt | 24 ++++++++++++++++++++++++
  1 file changed, 24 insertions(+)

create mode 100644 doc/device-tree-bindings/i2c/i2c-at91.txt

Thanks!

bye,
Heiko

Signature · 2 lines
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany