[PATCH v4 4/4] i2c: stm32: fix usage of rise/fall device tree properties

Patrick DELAUNAY patrick.delaunay at foss.st.com
Mon Sep 12 14:04:23 CEST 2022


Hi,

On 9/12/22 10:42, Alain Volmat wrote:
> From: Jorge Ramirez-Ortiz <jorge at foundries.io>
>
> 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 at foundries.io>
> Reviewed-by: Alain Volmat <alain.volmat at foss.st.com>
> ---
>   drivers/i2c/stm32f7_i2c.c | 11 ++++++-----
>   1 file changed, 6 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/i2c/stm32f7_i2c.c b/drivers/i2c/stm32f7_i2c.c
> index 2db7f44d44..1d2dd8e25d 100644
> --- a/drivers/i2c/stm32f7_i2c.c
> +++ b/drivers/i2c/stm32f7_i2c.c
> @@ -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"))



Reviewed-by: Patrick Delaunay <patrick.delaunay at foss.st.com>

Thanks
Patrick



Reviewed-by: Patrick Delaunay <patrick.delaunay at foss.st.com>
Tested-by: Patrick Delaunay <patrick.delaunay at foss.st.com> 
[stm32mp157c-dk2]

No regression detection on ST Microelectonics board.

- No error trace on boot

- I2C probe command is OK

   STM32MP> i2c probe
   Valid chip addresses: 28 33

- And other tests done with the 2 I2C devices STPMIC1 & STUSB1600 are ok:
   regulalor command

   pmic status command

   USB type C connection/deconnection


@Jorge: can you test also for your use-case, thanks


Thanks
Patrick



More information about the U-Boot mailing list