diff --git a/drivers/i2c/busses/i2c-msm-geni.c b/drivers/i2c/busses/i2c-msm-geni.c index 2b7434f359c9..bc99dae5a635 100644 --- a/drivers/i2c/busses/i2c-msm-geni.c +++ b/drivers/i2c/busses/i2c-msm-geni.c @@ -135,6 +135,7 @@ struct geni_i2c_dev { bool gpi_reset; bool disable_dma_mode; bool prev_cancel_pending; //Halt cancel till IOS in good state + bool is_i2c_rtl_based; /* doing pending cancel only for rtl based SE's */ }; static struct geni_i2c_dev *gi2c_dev_dbg[MAX_SE]; @@ -247,6 +248,10 @@ static int do_pending_cancel(struct geni_i2c_dev *gi2c) int timeout = 0; u32 geni_ios = 0; + /* doing pending cancel only rtl based SE's */ + if (!gi2c->is_i2c_rtl_based) + return 0; + geni_ios = geni_read_reg_nolog(gi2c->base, SE_GENI_IOS); if ((geni_ios & 0x3) != 0x3) { /* Try to restore IOS with FORCE_DEFAULT */ @@ -1060,8 +1065,11 @@ static int geni_i2c_xfer(struct i2c_adapter *adap, // WAR : Complete previous pending cancel cmd if (gi2c->prev_cancel_pending) { ret = do_pending_cancel(gi2c); - if (ret) + if (ret) { + pm_runtime_mark_last_busy(gi2c->dev); + pm_runtime_put_autosuspend(gi2c->dev); return ret; //Don't perform xfer is cancel failed + } } GENI_SE_DBG(gi2c->ipcl, false, gi2c->dev, @@ -1324,6 +1332,11 @@ static int geni_i2c_probe(struct platform_device *pdev) if (of_property_read_bool(pdev->dev.of_node, "qcom,leica-used-i2c")) gi2c->i2c_rsc.skip_bw_vote = true; + if (of_property_read_bool(pdev->dev.of_node, "qcom,rtl_se")) { + gi2c->is_i2c_rtl_based = true; + dev_info(&pdev->dev, "%s: RTL based SE\n", __func__); + } + gi2c->i2c_rsc.wrapper_dev = &wrapper_pdev->dev; gi2c->i2c_rsc.ctrl_dev = gi2c->dev;