Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3497dfc2 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "i2c:i2c-msm-geni: Updating last mark busy failure case"

parents 77caecb9 2578117a
Loading
Loading
Loading
Loading
+14 −1
Original line number Diff line number Diff line
@@ -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,9 +1065,12 @@ 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,
		"n:%d addr:0x%x\n", num, msgs[0].addr);
@@ -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;