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


Groups > linux.kernel > #1603335

Re: [PATCH 3/5] i2c: i2c-stm32f7: add driver

From "M'boumba Cedric Madianga" <cedric.madianga@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH 3/5] i2c: i2c-stm32f7: add driver
Date 2017-03-17 15:00 +0100
Message-ID <tm0Aa-7ex-27@gated-at.bofh.it> (permalink)
References <tlWPU-4pa-31@gated-at.bofh.it> <tlWZA-4Iy-43@gated-at.bofh.it> <tlXCi-535-17@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Hi,


>> +static int stm32f7_i2c_hw_config(struct stm32f7_i2c_dev *i2c_dev)
>> +{
>> +     struct device_node *of_node = i2c_dev->dev->of_node;
>> +     u32 timing;
>> +     int ret;
>> +
>> +     ret = of_property_read_u32(of_node, "st,i2c-timing", &timing);
>> +     if (ret) {
>> +             dev_err(i2c_dev->dev, "Error: missing i2c timing property\n");
>> +             return ret;
>> +     }
>> +
>> +     /* Timing settings */
>> +     writel_relaxed(timing, i2c_dev->base + STM32F7_I2C_TIMINGR);
>
> Hi,
>
> Using a register value in DT is quite ugly since the requirement to calculate the timings
> is quite easy, and well documented.
>
> I wrote it for Zephyr, you can find it here :
> https://github.com/zephyrproject-rtos/zephyr/blob/master/drivers/i2c/i2c_stm32lx.c#L31

Thanks for this code. It is very interesting.
With our formula, I just notice that we don't use any i2c rise time or
fall time but they have some impacts in i2c timing computation.
So, the user could not be able to select these values for him use case. Right ?


>
> Another point, maybe you should find a better name for the driver, since this I2C IP is share
> with the STM32Lx also and is not tied to STM32F7.

As far as I know, we don't have any STM32Lx SoC integrated in the
linux kernel mainline.
I choose i2c-stm32f7 name as it is the first Soc integrated in the
linux kernel mainline where this IP could be used.

BR,
Cedric

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/5] Add support for the STM32F7 I2C M'boumba Cedric Madianga <cedric.madianga@gmail.com> - 2017-03-17 11:10 +0100
  [PATCH 1/5] dt-bindings: i2c-stm32: Document the STM32F7 I2C bindings M'boumba Cedric Madianga <cedric.madianga@gmail.com> - 2017-03-17 11:10 +0100
    Re: [PATCH 1/5] dt-bindings: i2c-stm32: Document the STM32F7 I2C  bindings Rob Herring <robh@kernel.org> - 2017-03-24 14:50 +0100
  [PATCH 3/5] i2c: i2c-stm32f7: add driver M'boumba Cedric Madianga <cedric.madianga@gmail.com> - 2017-03-17 11:10 +0100
    Re: [PATCH 3/5] i2c: i2c-stm32f7: add driver Neil Armstrong <narmstrong@baylibre.com> - 2017-03-17 11:50 +0100
      Re: [PATCH 3/5] i2c: i2c-stm32f7: add driver "M'boumba Cedric Madianga" <cedric.madianga@gmail.com> - 2017-03-17 15:00 +0100
        Re: [PATCH 3/5] i2c: i2c-stm32f7: add driver Neil Armstrong <narmstrong@baylibre.com> - 2017-03-17 16:00 +0100
          Re: [PATCH 3/5] i2c: i2c-stm32f7: add driver "M'boumba Cedric Madianga" <cedric.madianga@gmail.com> - 2017-03-17 16:40 +0100
            Re: [PATCH 3/5] i2c: i2c-stm32f7: add driver Neil Armstrong <narmstrong@baylibre.com> - 2017-03-17 17:00 +0100
              Re: [PATCH 3/5] i2c: i2c-stm32f7: add driver "M'boumba Cedric Madianga" <cedric.madianga@gmail.com> - 2017-03-17 23:50 +0100
    Re: [PATCH 3/5] i2c: i2c-stm32f7: add driver Wolfram Sang <wsa@the-dreams.de> - 2017-03-23 21:20 +0100
      Re: [PATCH 3/5] i2c: i2c-stm32f7: add driver "M'boumba Cedric Madianga" <cedric.madianga@gmail.com> - 2017-03-23 21:50 +0100
        Re: [PATCH 3/5] i2c: i2c-stm32f7: add driver Wolfram Sang <wsa@the-dreams.de> - 2017-03-23 21:50 +0100

csiph-web