Skip to content

Commit 3f9c37a

Browse files
manabianWolfram Sang
authored andcommitted
i2c: lpc2k: add driver
Add support for the I2C controller found on several NXP devices including LPC2xxx, LPC178x/7x and LPC18xx/43xx. The controller is implemented as a state machine and the driver act upon the state changes when the bus is accessed. The I2C controller supports master/slave operation, bus arbitration, programmable clock rate, and speeds up to 1 Mbit/s. Signed-off-by: Joachim Eastwood <manabian@gmail.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
1 parent b3fdd32 commit 3f9c37a

File tree

4 files changed

+557
-0
lines changed

4 files changed

+557
-0
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
NXP I2C controller for LPC2xxx/178x/18xx/43xx
2+
3+
Required properties:
4+
- compatible: must be "nxp,lpc1788-i2c"
5+
- reg: physical address and length of the device registers
6+
- interrupts: a single interrupt specifier
7+
- clocks: clock for the device
8+
- #address-cells: should be <1>
9+
- #size-cells: should be <0>
10+
11+
Optional properties:
12+
- clock-frequency: the desired I2C bus clock frequency in Hz; in
13+
absence of this property the default value is used (100 kHz).
14+
15+
Example:
16+
i2c0: i2c@400a1000 {
17+
compatible = "nxp,lpc1788-i2c";
18+
reg = <0x400a1000 0x1000>;
19+
interrupts = <18>;
20+
clocks = <&ccu1 CLK_APB1_I2C0>;
21+
#address-cells = <1>;
22+
#size-cells = <0>;
23+
};
24+
25+
&i2c0 {
26+
clock-frequency = <400000>;
27+
28+
lm75@48 {
29+
compatible = "nxp,lm75";
30+
reg = <0x48>;
31+
};
32+
};
33+

drivers/i2c/busses/Kconfig

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -619,6 +619,16 @@ config I2C_KEMPLD
619619
This driver can also be built as a module. If so, the module
620620
will be called i2c-kempld.
621621

622+
config I2C_LPC2K
623+
tristate "I2C bus support for NXP LPC2K/LPC178x/18xx/43xx"
624+
depends on OF && (ARCH_LPC18XX || COMPILE_TEST)
625+
help
626+
This driver supports the I2C interface found several NXP
627+
devices including LPC2xxx, LPC178x/7x and LPC18xx/43xx.
628+
629+
This driver can also be built as a module. If so, the module
630+
will be called i2c-lpc2k.
631+
622632
config I2C_MESON
623633
tristate "Amlogic Meson I2C controller"
624634
depends on ARCH_MESON

drivers/i2c/busses/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ obj-$(CONFIG_I2C_IMX) += i2c-imx.o
5959
obj-$(CONFIG_I2C_IOP3XX) += i2c-iop3xx.o
6060
obj-$(CONFIG_I2C_JZ4780) += i2c-jz4780.o
6161
obj-$(CONFIG_I2C_KEMPLD) += i2c-kempld.o
62+
obj-$(CONFIG_I2C_LPC2K) += i2c-lpc2k.o
6263
obj-$(CONFIG_I2C_MESON) += i2c-meson.o
6364
obj-$(CONFIG_I2C_MPC) += i2c-mpc.o
6465
obj-$(CONFIG_I2C_MT65XX) += i2c-mt65xx.o

0 commit comments

Comments
 (0)