Merge "i2c: i2c-msm-geni: disable auto suspend timer for levm"

This commit is contained in:
qctecmdr 2023-07-17 07:36:51 -07:00 committed by Gerrit - the friendly Code Review server
commit acff8403df
2 changed files with 17 additions and 7 deletions

View File

@ -1917,8 +1917,11 @@ static int geni_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[],
if (gi2c->prev_cancel_pending) {
ret = do_pending_cancel(gi2c);
if (ret) {
pm_runtime_mark_last_busy(gi2c->dev);
pm_runtime_put_autosuspend(gi2c->dev);
/* for levm skip auto suspend timer */
if (!gi2c->is_le_vm) {
pm_runtime_mark_last_busy(gi2c->dev);
pm_runtime_put_autosuspend(gi2c->dev);
}
atomic_set(&gi2c->is_xfer_in_progress, 0);
return ret; //Don't perform xfer is cancel failed
}
@ -1928,8 +1931,11 @@ static int geni_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[],
if ((geni_ios & 0x3) != 0x3) { //SCL:b'1, SDA:b'0
I2C_LOG_ERR(gi2c->ipcl, false, gi2c->dev,
"IO lines in bad state, Power the slave\n");
pm_runtime_mark_last_busy(gi2c->dev);
pm_runtime_put_autosuspend(gi2c->dev);
/* for levm skip auto suspend timer */
if (!gi2c->is_le_vm) {
pm_runtime_mark_last_busy(gi2c->dev);
pm_runtime_put_autosuspend(gi2c->dev);
}
atomic_set(&gi2c->is_xfer_in_progress, 0);
return -ENXIO;
}
@ -2235,8 +2241,11 @@ static int geni_i2c_probe(struct platform_device *pdev)
strscpy(gi2c->adap.name, "Geni-I2C", sizeof(gi2c->adap.name));
pm_runtime_set_suspended(gi2c->dev);
pm_runtime_set_autosuspend_delay(gi2c->dev, I2C_AUTO_SUSPEND_DELAY);
pm_runtime_use_autosuspend(gi2c->dev);
/* for levm skip auto suspend timer */
if (!gi2c->is_le_vm) {
pm_runtime_set_autosuspend_delay(gi2c->dev, I2C_AUTO_SUSPEND_DELAY);
pm_runtime_use_autosuspend(gi2c->dev);
}
pm_runtime_enable(gi2c->dev);
ret = i2c_add_adapter(&gi2c->adap);
if (ret) {

View File

@ -2344,7 +2344,8 @@ static int spi_geni_probe(struct platform_device *pdev)
init_completion(&geni_mas->tx_cb);
init_completion(&geni_mas->rx_cb);
pm_runtime_set_suspended(&pdev->dev);
if (!geni_mas->dis_autosuspend) {
/* for levm skip auto suspend timer */
if (!geni_mas->is_le_vm && !geni_mas->dis_autosuspend) {
pm_runtime_set_autosuspend_delay(&pdev->dev,
SPI_AUTO_SUSPEND_DELAY);
pm_runtime_use_autosuspend(&pdev->dev);