mirror of
https://github.com/apache/nuttx.git
synced 2026-10-10 07:40:27 +00:00
[UPSTREAM] arch/arm/imxrt: Improve imxrt_lpi2c_reset
Re-initialize the bus even in the case the bus cannot be re-covered. The client still has a reference to the bus, and may try to access it again. If the bus is not initialized or the root clock is off, the access may cause a crash. Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
This commit is contained in:
parent
2c736d0860
commit
70e453c2c4
1 changed files with 4 additions and 3 deletions
|
|
@ -2387,6 +2387,10 @@ static int imxrt_lpi2c_reset(struct i2c_master_s *dev)
|
|||
imxrt_config_gpio(sda_gpio);
|
||||
imxrt_config_gpio(scl_gpio);
|
||||
|
||||
ret = OK;
|
||||
|
||||
out:
|
||||
|
||||
/* Re-init the port */
|
||||
|
||||
imxrt_lpi2c_init(priv);
|
||||
|
|
@ -2394,9 +2398,6 @@ static int imxrt_lpi2c_reset(struct i2c_master_s *dev)
|
|||
/* Restore the frequency */
|
||||
|
||||
imxrt_lpi2c_setclock(priv, frequency);
|
||||
ret = OK;
|
||||
|
||||
out:
|
||||
|
||||
/* Release the port for reuse by other clients */
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue