public inbox for linux-i2c@vger.kernel.org
 help / color / mirror / Atom feed
From: Shah Nehal-Bakulchandra <Nehal-Bakulchandra.Shah@amd.com>
To: jarkko.nikula@linux.intel.com, andriy.shevchenko@linux.intel.com,
	mika.westerberg@linux.intel.com
Cc: lucas.demarchi@intel.com, wsa@the-dreams.de,
	linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org,
	Shyam-sundar.S-k@amd.com,
	Shah Nehal-Bakulchandra <Nehal-Bakulchandra.Shah@amd.com>,
	Shah Nehal-Bakulchandra <Nehal-bakulchandra.Shah@amd.com>,
	Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
Subject: [PATCH] i2c: designware: Fix regression when dynamic TAR update is disabled
Date: Fri, 10 Feb 2017 01:20:51 +0530	[thread overview]
Message-ID: <1486669851-25632-1-git-send-email-Nehal-Bakulchandra.Shah@amd.com> (raw)

The following commit causes a regression when dynamic TAR update is
disabled:

     commit 63d0f0a6952a1a02bc4f116b7da7c7887e46efa3 ("i2c: designware:
     detect when dynamic tar update is possible")

In such case, the DW_IC_CON_10BITADDR_MASTER is R/W, and is changed
by the logic that's trying to detect  dynamic TAR update.The original
value of DW_IC_CON_10BITADDR_MASTER bit should be restored.

Signed-off-by: Shah Nehal-Bakulchandra <Nehal-bakulchandra.Shah@amd.com>
Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
---
 drivers/i2c/busses/i2c-designware-core.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/i2c/busses/i2c-designware-core.c b/drivers/i2c/busses/i2c-designware-core.c
index 6d81c56..0c57166 100644
--- a/drivers/i2c/busses/i2c-designware-core.c
+++ b/drivers/i2c/busses/i2c-designware-core.c
@@ -987,6 +987,11 @@ int i2c_dw_probe(struct dw_i2c_dev *dev)
 	    (reg & DW_IC_CON_10BITADDR_MASTER)) {
 		dev->dynamic_tar_update_enabled = true;
 		dev_dbg(dev->dev, "Dynamic TAR update enabled");
+	} else {
+		/* If test is failed then restore the original value */
+		dev->dynamic_tar_update_enabled = false;
+		dev_dbg(dev->dev, "Dynamic TAR update disable restore the value");
+		dw_writel(dev, reg, DW_IC_CON);
 	}
 
 	i2c_dw_release_lock(dev);
-- 
1.9.1

             reply	other threads:[~2017-02-09 19:50 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-09 19:50 Shah Nehal-Bakulchandra [this message]
2017-02-09 20:07 ` [PATCH] i2c: designware: Fix regression when dynamic TAR update is disabled Andy Shevchenko
2017-02-09 21:34   ` De Marchi, Lucas
2017-02-10  6:38     ` Suravee Suthikulpanit
2017-02-10 10:48       ` Jarkko Nikula
2017-02-13  4:15         ` Shah, Nehal-bakulchandra

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1486669851-25632-1-git-send-email-Nehal-Bakulchandra.Shah@amd.com \
    --to=nehal-bakulchandra.shah@amd.com \
    --cc=Shyam-sundar.S-k@amd.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=jarkko.nikula@linux.intel.com \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lucas.demarchi@intel.com \
    --cc=mika.westerberg@linux.intel.com \
    --cc=suravee.suthikulpanit@amd.com \
    --cc=wsa@the-dreams.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox