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:
parent
6f680cffc6
commit
33336e78f6
1 changed files with 8 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue