Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1412286 > unrolled thread

[PATCH v2 0/5] Add support for the STM32F4 I2C

Started byM'boumba Cedric Madianga <cedric.madianga@gmail.com>
First post2016-06-02 16:30 +0200
Last post2016-06-02 16:30 +0200
Articles 5 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH v2 0/5] Add support for the STM32F4 I2C M'boumba Cedric Madianga <cedric.madianga@gmail.com> - 2016-06-02 16:30 +0200
    [PATCH v2 3/5] ARM: dts: Add I2C1 support for STM32F429 SoC M'boumba Cedric Madianga <cedric.madianga@gmail.com> - 2016-06-02 16:30 +0200
      Re: [PATCH v2 3/5] ARM: dts: Add I2C1 support for STM32F429 SoC Maxime Coquelin <mcoquelin.stm32@gmail.com> - 2016-06-02 18:20 +0200
        Re: [PATCH v2 3/5] ARM: dts: Add I2C1 support for STM32F429 SoC "M'boumba Cedric Madianga" <cedric.madianga@gmail.com> - 2016-06-03 10:00 +0200
    [PATCH v2 5/5] ARM: configs: Add I2C support for STM32 defconfig M'boumba Cedric Madianga <cedric.madianga@gmail.com> - 2016-06-02 16:30 +0200

#1412286 — [PATCH v2 0/5] Add support for the STM32F4 I2C

FromM'boumba Cedric Madianga <cedric.madianga@gmail.com>
Date2016-06-02 16:30 +0200
Subject[PATCH v2 0/5] Add support for the STM32F4 I2C
Message-ID<rFBNf-71V-7@gated-at.bofh.it>
This patchset adds support for the I2C controller embedded in STM32F4xx SoC.
It enables I2C transfer in interrupt mode with Standard-mode and Fast-mode bus
speed.

Changes since v1:
- use compatible st,stm32f4-i2c instead of st,i2c-stm32f4 (Rob)
- fix typo s/enmpty/empty (Maxime)
- use one function to handle TX fifo empty and byte xfer finished IT (Maxime)
- set duty cycle in timing struct in Fast mode
- Rework clock management (call prepare/unprepare at probe and remove, call
  clk_enable/clk_disable for each I2C transfer)

M'boumba Cedric Madianga (5):
  dt-bindings: Document the STM32 I2C bindings
  i2c: Add STM32F4 I2C driver
  ARM: dts: Add I2C1 support for STM32F429 SoC
  ARM: dts: Add I2C1 support for STM32429 eval board
  ARM: configs: Add I2C support for STM32 defconfig

 .../devicetree/bindings/i2c/i2c-stm32.txt          |  33 +
 arch/arm/boot/dts/stm32429i-eval.dts               |   6 +
 arch/arm/boot/dts/stm32f429.dtsi                   |  24 +
 arch/arm/configs/stm32_defconfig                   |   3 +
 drivers/i2c/busses/Kconfig                         |  10 +
 drivers/i2c/busses/Makefile                        |   1 +
 drivers/i2c/busses/i2c-stm32f4.c                   | 867 +++++++++++++++++++++
 7 files changed, 944 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/i2c/i2c-stm32.txt
 create mode 100644 drivers/i2c/busses/i2c-stm32f4.c

-- 
1.9.1

[toc] | [next] | [standalone]


#1412287 — [PATCH v2 3/5] ARM: dts: Add I2C1 support for STM32F429 SoC

FromM'boumba Cedric Madianga <cedric.madianga@gmail.com>
Date2016-06-02 16:30 +0200
Subject[PATCH v2 3/5] ARM: dts: Add I2C1 support for STM32F429 SoC
Message-ID<rFBNg-71V-31@gated-at.bofh.it>
In reply to#1412286
Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Signed-off-by: M'boumba Cedric Madianga <cedric.madianga@gmail.com>
---
 arch/arm/boot/dts/stm32f429.dtsi | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/arch/arm/boot/dts/stm32f429.dtsi b/arch/arm/boot/dts/stm32f429.dtsi
index 434d4b9..d5857eb 100644
--- a/arch/arm/boot/dts/stm32f429.dtsi
+++ b/arch/arm/boot/dts/stm32f429.dtsi
@@ -323,6 +323,18 @@
 					slew-rate = <2>;
 				};
 			};
+
+			i2c1_sda_pin: i2c1_sda@0 {
+				pins {
+					pinmux = <STM32F429_PB9_FUNC_I2C1_SDA>;
+					drive-open-drain;
+				};
+			};
+			i2c1_scl_pin: i2c1_scl@0 {
+				pins {
+					pinmux = <STM32F429_PB6_FUNC_I2C1_SCL>;
+				};
+			};
 		};
 
 		rcc: rcc@40023800 {
@@ -395,6 +407,18 @@
 			interrupts = <80>;
 			clocks = <&rcc 0 38>;
 		};
+
+		i2c1: i2c@40005400 {
+			compatible = "st,stm32f4-i2c";
+			reg = <0x40005400 0x400>;
+			interrupts = <31>,
+				     <32>;
+			resets = <&rcc 277>;
+			clocks = <&rcc 0 149>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+			status = "disabled";
+		};
 	};
 };
 
-- 
1.9.1

[toc] | [prev] | [next] | [standalone]


#1412408 — Re: [PATCH v2 3/5] ARM: dts: Add I2C1 support for STM32F429 SoC

FromMaxime Coquelin <mcoquelin.stm32@gmail.com>
Date2016-06-02 18:20 +0200
SubjectRe: [PATCH v2 3/5] ARM: dts: Add I2C1 support for STM32F429 SoC
Message-ID<rFDvI-87Q-5@gated-at.bofh.it>
In reply to#1412287
2016-06-02 16:26 GMT+02:00 M'boumba Cedric Madianga <cedric.madianga@gmail.com>:
> Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
> Signed-off-by: M'boumba Cedric Madianga <cedric.madianga@gmail.com>
> ---
>  arch/arm/boot/dts/stm32f429.dtsi | 24 ++++++++++++++++++++++++
>  1 file changed, 24 insertions(+)
>
> diff --git a/arch/arm/boot/dts/stm32f429.dtsi b/arch/arm/boot/dts/stm32f429.dtsi
> index 434d4b9..d5857eb 100644
> --- a/arch/arm/boot/dts/stm32f429.dtsi
> +++ b/arch/arm/boot/dts/stm32f429.dtsi
> @@ -323,6 +323,18 @@
>                                         slew-rate = <2>;
>                                 };
>                         };
> +
> +                       i2c1_sda_pin: i2c1_sda@0 {
> +                               pins {
> +                                       pinmux = <STM32F429_PB9_FUNC_I2C1_SDA>;
> +                                       drive-open-drain;
> +                               };
> +                       };
> +                       i2c1_scl_pin: i2c1_scl@0 {
> +                               pins {
> +                                       pinmux = <STM32F429_PB6_FUNC_I2C1_SCL>;
> +                               };
> +                       };
>                 };
Shouldn't be preferrable to group the two functions in a single one,
as done for usart config in this file?:

            usart1_pins_a: usart1@0 {
                pins1 {
                    pinmux = <STM32F429_PA9_FUNC_USART1_TX>;
                    bias-disable;
                    drive-push-pull;
                    slew-rate = <0>;
                };
                pins2 {
                    pinmux = <STM32F429_PA10_FUNC_USART1_RX>;
                    bias-disable;
                };
            };

Also, I would prefer the phandle to be suffixed with the port number,
as multiple muxing options are available, for example "i2c1_pins_b".

Thanks,
Maxime

[toc] | [prev] | [next] | [standalone]


#1412880 — Re: [PATCH v2 3/5] ARM: dts: Add I2C1 support for STM32F429 SoC

From"M'boumba Cedric Madianga" <cedric.madianga@gmail.com>
Date2016-06-03 10:00 +0200
SubjectRe: [PATCH v2 3/5] ARM: dts: Add I2C1 support for STM32F429 SoC
Message-ID<rFSbo-od-21@gated-at.bofh.it>
In reply to#1412408
2016-06-02 18:07 GMT+02:00 Maxime Coquelin <mcoquelin.stm32@gmail.com>:
> 2016-06-02 16:26 GMT+02:00 M'boumba Cedric Madianga <cedric.madianga@gmail.com>:
>> Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
>> Signed-off-by: M'boumba Cedric Madianga <cedric.madianga@gmail.com>
>> ---
>>  arch/arm/boot/dts/stm32f429.dtsi | 24 ++++++++++++++++++++++++
>>  1 file changed, 24 insertions(+)
>>
>> diff --git a/arch/arm/boot/dts/stm32f429.dtsi b/arch/arm/boot/dts/stm32f429.dtsi
>> index 434d4b9..d5857eb 100644
>> --- a/arch/arm/boot/dts/stm32f429.dtsi
>> +++ b/arch/arm/boot/dts/stm32f429.dtsi
>> @@ -323,6 +323,18 @@
>>                                         slew-rate = <2>;
>>                                 };
>>                         };
>> +
>> +                       i2c1_sda_pin: i2c1_sda@0 {
>> +                               pins {
>> +                                       pinmux = <STM32F429_PB9_FUNC_I2C1_SDA>;
>> +                                       drive-open-drain;
>> +                               };
>> +                       };
>> +                       i2c1_scl_pin: i2c1_scl@0 {
>> +                               pins {
>> +                                       pinmux = <STM32F429_PB6_FUNC_I2C1_SCL>;
>> +                               };
>> +                       };
>>                 };
> Shouldn't be preferrable to group the two functions in a single one,
I agree. It is better.
>
>             usart1_pins_a: usart1@0 {
>                 pins1 {
>                     pinmux = <STM32F429_PA9_FUNC_USART1_TX>;
>                     bias-disable;
>                     drive-push-pull;
>                     slew-rate = <0>;
>                 };
>                 pins2 {
>                     pinmux = <STM32F429_PA10_FUNC_USART1_RX>;
>                     bias-disable;
>                 };
>             };
>
> Also, I would prefer the phandle to be suffixed with the port number,
> as multiple muxing options are available, for example "i2c1_pins_b".
Ok understood. I will fix that in the V3.
Thanks
>
> Thanks,
> Maxime

[toc] | [prev] | [next] | [standalone]


#1412295 — [PATCH v2 5/5] ARM: configs: Add I2C support for STM32 defconfig

FromM'boumba Cedric Madianga <cedric.madianga@gmail.com>
Date2016-06-02 16:30 +0200
Subject[PATCH v2 5/5] ARM: configs: Add I2C support for STM32 defconfig
Message-ID<rFBNg-71V-45@gated-at.bofh.it>
In reply to#1412286
Signed-off-by: M'boumba Cedric Madianga <cedric.madianga@gmail.com>
---
 arch/arm/configs/stm32_defconfig | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/arm/configs/stm32_defconfig b/arch/arm/configs/stm32_defconfig
index 709e606..411eb0a 100644
--- a/arch/arm/configs/stm32_defconfig
+++ b/arch/arm/configs/stm32_defconfig
@@ -49,6 +49,9 @@ CONFIG_SERIAL_NONSTANDARD=y
 CONFIG_SERIAL_STM32=y
 CONFIG_SERIAL_STM32_CONSOLE=y
 # CONFIG_HW_RANDOM is not set
+CONFIG_I2C=y
+CONFIG_I2C_CHARDEV=y
+CONFIG_I2C_STM32F4=y
 # CONFIG_HWMON is not set
 # CONFIG_USB_SUPPORT is not set
 CONFIG_NEW_LEDS=y
-- 
1.9.1

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web