]> git.dujemihanovic.xyz Git - u-boot.git/commit
i2c: stm32f7: move driver data of each instance in a privdata
authorPatrick Delaunay <patrick.delaunay@foss.st.com>
Tue, 3 Aug 2021 10:05:09 +0000 (12:05 +0200)
committerPatrice Chotard <patrice.chotard@foss.st.com>
Fri, 8 Oct 2021 06:42:40 +0000 (08:42 +0200)
commit1fd9eb68d64845bf3db41cba6519741872fadd8e
tree250f5375f29f72094a3266fe17e65bdba3766be3
parent81b2445af4005cad6f1edef8b30ff1bb82ff8f80
i2c: stm32f7: move driver data of each instance in a privdata

Today all the I2C instance point on the same global
variable stm32_i2c_setup according the compatible: i2c_priv->setup =
pointer to the same driver data.

This patch changes this driver data (stm32f7_setup and stm32mp15_setup)
to a const struct and move the timing struct 'setup' as element of i2c
privdata, initialized in stm32_ofdata_to_platdata() with the driver
configuration data.

This patch solves issues when several I2C instance have not the same
clock source or not the same configuration: each timing setup is saved
is the I2C privdata.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
drivers/i2c/stm32f7_i2c.c