Skip to content

Commit

Permalink
i2c: rk3x: add driver for Rockchip RK3xxx SoC I2C adapter
Browse files Browse the repository at this point in the history
Driver for the native I2C adapter found in Rockchip RK3xxx SoCs.

Configuration is only possible through devicetree. The driver is
interrupt driven and supports the I2C_M_IGNORE_NAK mangling bit.

Signed-off-by: Max Schwarz <max.schwarz@online.de>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
  • Loading branch information
Max Schwarz authored and Wolfram Sang committed Jun 11, 2014
1 parent c31c24b commit c41aa3c
Show file tree
Hide file tree
Showing 4 changed files with 815 additions and 0 deletions.
42 changes: 42 additions & 0 deletions Documentation/devicetree/bindings/i2c/i2c-rk3x.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
* Rockchip RK3xxx I2C controller

This driver interfaces with the native I2C controller present in Rockchip
RK3xxx SoCs.

Required properties :

- reg : Offset and length of the register set for the device
- compatible : should be "rockchip,rk3066-i2c", "rockchip,rk3188-i2c" or
"rockchip,rk3288-i2c".
- interrupts : interrupt number
- clocks : parent clock

Required on RK3066, RK3188 :

- rockchip,grf : the phandle of the syscon node for the general register
file (GRF)
- on those SoCs an alias with the correct I2C bus ID (bit offset in the GRF)
is also required.

Optional properties :

- clock-frequency : SCL frequency to use (in Hz). If omitted, 100kHz is used.

Example:

aliases {
i2c0 = &i2c0;
}

i2c0: i2c@2002d000 {
compatible = "rockchip,rk3188-i2c";
reg = <0x2002d000 0x1000>;
interrupts = <GIC_SPI 40 IRQ_TYPE_LEVEL_HIGH>;
#address-cells = <1>;
#size-cells = <0>;

rockchip,grf = <&grf>;

clock-names = "i2c";
clocks = <&cru PCLK_I2C0>;
};
10 changes: 10 additions & 0 deletions drivers/i2c/busses/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -676,6 +676,16 @@ config I2C_RIIC
This driver can also be built as a module. If so, the module
will be called i2c-riic.

config I2C_RK3X
tristate "Rockchip RK3xxx I2C adapter"
depends on OF
help
Say Y here to include support for the I2C adapter in Rockchip RK3xxx
SoCs.

This driver can also be built as a module. If so, the module will
be called i2c-rk3x.

config HAVE_S3C2410_I2C
bool
help
Expand Down
1 change: 1 addition & 0 deletions drivers/i2c/busses/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ obj-$(CONFIG_I2C_PXA) += i2c-pxa.o
obj-$(CONFIG_I2C_PXA_PCI) += i2c-pxa-pci.o
obj-$(CONFIG_I2C_QUP) += i2c-qup.o
obj-$(CONFIG_I2C_RIIC) += i2c-riic.o
obj-$(CONFIG_I2C_RK3X) += i2c-rk3x.o
obj-$(CONFIG_I2C_S3C2410) += i2c-s3c2410.o
obj-$(CONFIG_I2C_S6000) += i2c-s6000.o
obj-$(CONFIG_I2C_SH7760) += i2c-sh7760.o
Expand Down
Loading

0 comments on commit c41aa3c

Please sign in to comment.