[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1400164644-3222-2-git-send-email-mika.westerberg@linux.intel.com>
Date: Thu, 15 May 2014 17:37:21 +0300
From: Mika Westerberg <mika.westerberg@...ux.intel.com>
To: Wolfram Sang <wsa@...-dreams.de>
Cc: Yao Jin <yao.jin@...el.com>, Aubrey Li <aubrey.li@...el.com>,
Mika Westerberg <mika.westerberg@...ux.intel.com>,
linux-i2c@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH 1/4] i2c: designware: No need to disable already disabled controller
If the controller is already in desired state (enabled/disabled) there is
no point in setting its state again.
Signed-off-by: Mika Westerberg <mika.westerberg@...ux.intel.com>
---
drivers/i2c/busses/i2c-designware-core.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/i2c/busses/i2c-designware-core.c b/drivers/i2c/busses/i2c-designware-core.c
index b58ecf19e767..b0792675b970 100644
--- a/drivers/i2c/busses/i2c-designware-core.c
+++ b/drivers/i2c/busses/i2c-designware-core.c
@@ -258,6 +258,10 @@ static void __i2c_dw_enable(struct dw_i2c_dev *dev, bool enable)
{
int timeout = 100;
+ /* In case the controller is already in desired state */
+ if ((dw_readl(dev, DW_IC_ENABLE_STATUS) & 1) == enable)
+ return;
+
do {
dw_writel(dev, enable, DW_IC_ENABLE);
if ((dw_readl(dev, DW_IC_ENABLE_STATUS) & 1) == enable)
--
2.0.0.rc2
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists