]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
i2c: stm32: fix usage of rise/fall device tree properties
authorJorge Ramirez-Ortiz <jorge@foundries.io>
Mon, 12 Sep 2022 08:42:01 +0000 (10:42 +0200)
committerPatrick Delaunay <patrick.delaunay@foss.st.com>
Thu, 15 Sep 2022 12:59:29 +0000 (14:59 +0200)
These two device tree properties were not being applied.

Fixes: 1fd9eb68d6 ("i2c: stm32f7: move driver data of each instance in a privdata")
Signed-off-by: Jorge Ramirez-Ortiz <jorge@foundries.io>
Reviewed-by: Alain Volmat <alain.volmat@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Tested-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
drivers/i2c/stm32f7_i2c.c

index 80bd3c4cafd022a5539c4c36d863521321fbd6c9..836148e4c1a02b02f29cbb79d97a394bbd136c09 100644 (file)
@@ -914,18 +914,19 @@ static int stm32_of_to_plat(struct udevice *dev)
 {
        const struct stm32_i2c_data *data;
        struct stm32_i2c_priv *i2c_priv = dev_get_priv(dev);
-       u32 rise_time, fall_time;
        int ret;
 
        data = (const struct stm32_i2c_data *)dev_get_driver_data(dev);
        if (!data)
                return -EINVAL;
 
-       rise_time = dev_read_u32_default(dev, "i2c-scl-rising-time-ns",
-                                        STM32_I2C_RISE_TIME_DEFAULT);
+       i2c_priv->setup.rise_time = dev_read_u32_default(dev,
+                                                        "i2c-scl-rising-time-ns",
+                                                        STM32_I2C_RISE_TIME_DEFAULT);
 
-       fall_time = dev_read_u32_default(dev, "i2c-scl-falling-time-ns",
-                                        STM32_I2C_FALL_TIME_DEFAULT);
+       i2c_priv->setup.fall_time = dev_read_u32_default(dev,
+                                                        "i2c-scl-falling-time-ns",
+                                                        STM32_I2C_FALL_TIME_DEFAULT);
 
        i2c_priv->dnf_dt = dev_read_u32_default(dev, "i2c-digital-filter-width-ns", 0);
        if (!dev_read_bool(dev, "i2c-digital-filter"))