drivers: spi: Support PM busy state where relevant in DW

Need to set device busy when enter into transceive function
in SPI DW driver.
In current SPI DW driver the transceive function don't set busy state,
but that is important for PM busy state.
This will lead to unexpected behaviors when system calls this
function and enter into idle state.

Signed-off-by: Maksim Masalski <maksim.masalski@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This commit is contained in:
Maksim Masalski 2019-12-25 14:13:36 +08:00 committed by Anas Nashif
commit 33336e78f6

View file

@ -342,6 +342,12 @@ static int transceive(struct device *dev,
spi_context_lock(&spi->ctx, asynchronous, signal);
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
if (device_busy_check(dev) != (-EBUSY)) {
device_busy_set(dev);
}
#endif /* CONFIG_DEVICE_POWER_MANAGEMENT */
/* Configure */
ret = spi_dw_configure(info, spi, config);
if (ret) {
@ -427,6 +433,8 @@ static int transceive(struct device *dev,
out:
spi_context_release(&spi->ctx, ret);
device_busy_clear(dev);
return ret;
}