@@ -804,7 +804,7 @@ static int stm32_ospi_get_resources(struct platform_device *pdev)
return ret;
}
- ospi->rstc = devm_reset_control_array_get_optional_exclusive(dev);
+ ospi->rstc = devm_reset_control_array_get_exclusive_released(dev);
if (IS_ERR(ospi->rstc))
return dev_err_probe(dev, PTR_ERR(ospi->rstc),
"Can't get reset\n");
@@ -937,9 +937,11 @@ static int stm32_ospi_probe(struct platform_device *pdev)
goto err_pm_enable;
if (ospi->rstc) {
+ reset_control_acquire(ospi->rstc);
reset_control_assert(ospi->rstc);
udelay(2);
reset_control_deassert(ospi->rstc);
+ reset_control_release(ospi->rstc);
}
ret = spi_register_controller(ctrl);
As ospi reset is consumed by both OMM and OSPI drivers, use the reset acquire/release mechanism which ensure exclusive reset usage. This avoid to call reset_control_get/put() in OMM driver each time we need to reset OSPI children and guarantee the reset line stays deasserted. Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com> --- drivers/spi/spi-stm32-ospi.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)