driver/spi: spi driver suspend changes

Port the spi changes from bq-6125.
- Do not force suspend for all spi bus.
This will not cause power issue, and can fix clock is closed when SPI
sync message.
- SPI driver missed to check spi runtime status in device suspend.
This may cause spi clocks not closed before device enter deep sleep
So check this status in spi suspend function, if bus not suspened,
break device suspend.
(pick from https://gerrit.mot.com/#/c/1498807/)

Change-Id: Id31492702506361a4ae5e2ccb9c5d381d321e143
Signed-off-by: wengjun1 <wengjun1@motorola.com>
Reviewed-on: https://gerrit.mot.com/1654409
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Huosheng Liao <liaohs@motorola.com>
Submit-Approved: Jira Key
This commit is contained in:
weiweij authored and Gilberto Gambugge committed 2023-06-01 00:47:12 -03:00
1 parent d97f64bdbe
commit c3682b0adb
1 file changed
+5
+5
View File
@@ -1898,6 +1898,7 @@ static int spi_geni_resume(struct device *dev)
static int spi_geni_suspend(struct device *dev)
{
int ret = 0;
#if 0
struct spi_master *spi = get_spi_master(dev);
struct spi_geni_master *geni_mas = spi_master_get_devdata(spi);
@@ -1909,6 +1910,10 @@ static int spi_geni_suspend(struct device *dev)
}
GENI_SE_ERR(geni_mas->ipc, true, dev, ":%s: End\n", __func__);
#else
if (!pm_runtime_status_suspended(dev))
ret = -EBUSY;
#endif
return ret;
}
#else