Skip to content

Commit bbe05e5

Browse files
committed
Merge branch 'i2c/for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux
Pull more i2c updates from Wolfram Sang: "I2C has two more new drivers: Altera FPGA and STM32F7" * 'i2c/for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: i2c: i2c-stm32f7: add driver i2c: i2c-stm32f4: use generic definition of speed enum dt-bindings: i2c-stm32: Document the STM32F7 I2C bindings i2c: altera: Add Altera I2C Controller driver dt-bindings: i2c: Add Altera I2C Controller
2 parents 9db5959 + aeb068c commit bbe05e5

File tree

9 files changed

+1602
-14
lines changed

9 files changed

+1602
-14
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
* Altera I2C Controller
2+
* This is Altera's synthesizable logic block I2C Controller for use
3+
* in Altera's FPGAs.
4+
5+
Required properties :
6+
- compatible : should be "altr,softip-i2c-v1.0"
7+
- reg : Offset and length of the register set for the device
8+
- interrupts : <IRQ> where IRQ is the interrupt number.
9+
- clocks : phandle to input clock.
10+
- #address-cells = <1>;
11+
- #size-cells = <0>;
12+
13+
Recommended properties :
14+
- clock-frequency : desired I2C bus clock frequency in Hz.
15+
16+
Optional properties :
17+
- fifo-size : Size of the RX and TX FIFOs in bytes.
18+
- Child nodes conforming to i2c bus binding
19+
20+
Example :
21+
22+
i2c@100080000 {
23+
compatible = "altr,softip-i2c-v1.0";
24+
reg = <0x00000001 0x00080000 0x00000040>;
25+
interrupt-parent = <&intc>;
26+
interrupts = <0 43 4>;
27+
clocks = <&clk_0>;
28+
clock-frequency = <100000>;
29+
#address-cells = <1>;
30+
#size-cells = <0>;
31+
fifo-size = <4>;
32+
33+
eeprom@51 {
34+
compatible = "atmel,24c32";
35+
reg = <0x51>;
36+
pagesize = <32>;
37+
};
38+
};
39+

Documentation/devicetree/bindings/i2c/i2c-stm32.txt

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
* I2C controller embedded in STMicroelectronics STM32 I2C platform
22

33
Required properties :
4-
- compatible : Must be "st,stm32f4-i2c"
4+
- compatible : Must be one of the following
5+
- "st,stm32f4-i2c"
6+
- "st,stm32f7-i2c"
57
- reg : Offset and length of the register set for the device
68
- interrupts : Must contain the interrupt id for I2C event and then the
79
interrupt id for I2C error.
@@ -14,8 +16,16 @@ Required properties :
1416

1517
Optional properties :
1618
- clock-frequency : Desired I2C bus clock frequency in Hz. If not specified,
17-
the default 100 kHz frequency will be used. As only Normal and Fast modes
18-
are supported, possible values are 100000 and 400000.
19+
the default 100 kHz frequency will be used.
20+
For STM32F4 SoC Standard-mode and Fast-mode are supported, possible values are
21+
100000 and 400000.
22+
For STM32F7 SoC, Standard-mode, Fast-mode and Fast-mode Plus are supported,
23+
possible values are 100000, 400000 and 1000000.
24+
- i2c-scl-rising-time-ns : Only for STM32F7, I2C SCL Rising time for the board
25+
(default: 25)
26+
- i2c-scl-falling-time-ns : Only for STM32F7, I2C SCL Falling time for the board
27+
(default: 10)
28+
I2C Timings are derived from these 2 values
1929

2030
Example :
2131

@@ -31,3 +41,16 @@ Example :
3141
pinctrl-0 = <&i2c1_sda_pin>, <&i2c1_scl_pin>;
3242
pinctrl-names = "default";
3343
};
44+
45+
i2c@40005400 {
46+
compatible = "st,stm32f7-i2c";
47+
#address-cells = <1>;
48+
#size-cells = <0>;
49+
reg = <0x40005400 0x400>;
50+
interrupts = <31>,
51+
<32>;
52+
resets = <&rcc STM32F7_APB1_RESET(I2C1)>;
53+
clocks = <&rcc 1 CLK_I2C1>;
54+
pinctrl-0 = <&i2c1_sda_pin>, <&i2c1_scl_pin>;
55+
pinctrl-names = "default";
56+
};

MAINTAINERS

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -644,6 +644,11 @@ ALPS PS/2 TOUCHPAD DRIVER
644644
R: Pali Rohár <[email protected]>
645645
F: drivers/input/mouse/alps.*
646646

647+
ALTERA I2C CONTROLLER DRIVER
648+
M: Thor Thayer <[email protected]>
649+
S: Maintained
650+
F: drivers/i2c/busses/i2c-altera.c
651+
647652
ALTERA MAILBOX DRIVER
648653
M: Ley Foon Tan <[email protected]>
649654
L: [email protected] (moderated for non-subscribers)

drivers/i2c/busses/Kconfig

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,16 @@ config I2C_POWERMAC
336336

337337
comment "I2C system bus drivers (mostly embedded / system-on-chip)"
338338

339+
config I2C_ALTERA
340+
tristate "Altera Soft IP I2C"
341+
depends on (ARCH_SOCFPGA || NIOS2) && OF
342+
help
343+
If you say yes to this option, support will be included for the
344+
Altera Soft IP I2C interfaces on SoCFPGA and Nios2 architectures.
345+
346+
This driver can also be built as a module. If so, the module
347+
will be called i2c-altera.
348+
339349
config I2C_ASPEED
340350
tristate "Aspeed I2C Controller"
341351
depends on ARCH_ASPEED || COMPILE_TEST
@@ -935,6 +945,16 @@ config I2C_STM32F4
935945
This driver can also be built as module. If so, the module
936946
will be called i2c-stm32f4.
937947

948+
config I2C_STM32F7
949+
tristate "STMicroelectronics STM32F7 I2C support"
950+
depends on ARCH_STM32 || COMPILE_TEST
951+
help
952+
Enable this option to add support for STM32 I2C controller embedded
953+
in STM32F7 SoCs.
954+
955+
This driver can also be built as module. If so, the module
956+
will be called i2c-stm32f7.
957+
938958
config I2C_STU300
939959
tristate "ST Microelectronics DDC I2C interface"
940960
depends on MACH_U300

drivers/i2c/busses/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ obj-$(CONFIG_I2C_HYDRA) += i2c-hydra.o
3030
obj-$(CONFIG_I2C_POWERMAC) += i2c-powermac.o
3131

3232
# Embedded system I2C/SMBus host controller drivers
33+
obj-$(CONFIG_I2C_ALTERA) += i2c-altera.o
3334
obj-$(CONFIG_I2C_ASPEED) += i2c-aspeed.o
3435
obj-$(CONFIG_I2C_AT91) += i2c-at91.o
3536
obj-$(CONFIG_I2C_AU1550) += i2c-au1550.o
@@ -93,6 +94,7 @@ obj-$(CONFIG_I2C_SIRF) += i2c-sirf.o
9394
obj-$(CONFIG_I2C_SPRD) += i2c-sprd.o
9495
obj-$(CONFIG_I2C_ST) += i2c-st.o
9596
obj-$(CONFIG_I2C_STM32F4) += i2c-stm32f4.o
97+
obj-$(CONFIG_I2C_STM32F7) += i2c-stm32f7.o
9698
obj-$(CONFIG_I2C_STU300) += i2c-stu300.o
9799
obj-$(CONFIG_I2C_SUN6I_P2WI) += i2c-sun6i-p2wi.o
98100
obj-$(CONFIG_I2C_TEGRA) += i2c-tegra.o

0 commit comments

Comments
 (0)