summaryrefslogtreecommitdiffstats
path: root/drivers/mtd/devices
diff options
context:
space:
mode:
authorShiraz Hashim2012-07-02 07:58:46 +0200
committerDavid Woodhouse2012-07-06 19:27:38 +0200
commit4dc48c37d1ce968b5ade7d1646927199ee536129 (patch)
treed03ec4c8c7c14c66ba10860df690101e1ce56fab /drivers/mtd/devices
parentmtd: spear_smi: Move suspend/resume to follow dev_pm_ops (diff)
downloadkernel-qcow2-linux-4dc48c37d1ce968b5ade7d1646927199ee536129.tar.gz
kernel-qcow2-linux-4dc48c37d1ce968b5ade7d1646927199ee536129.tar.xz
kernel-qcow2-linux-4dc48c37d1ce968b5ade7d1646927199ee536129.zip
mtd: spear_smi: clear status register on init
It was observed that sometimes smi returned errors while resume from suspend. For safety reasons clear status register for any errors during init. In absence of it smi can return failures during command transmissions. Signed-off-by: Shiraz Hashim <shiraz.hashim@st.com> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers/mtd/devices')
-rw-r--r--drivers/mtd/devices/spear_smi.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/mtd/devices/spear_smi.c b/drivers/mtd/devices/spear_smi.c
index cffd36a916d0..aec941e74e67 100644
--- a/drivers/mtd/devices/spear_smi.c
+++ b/drivers/mtd/devices/spear_smi.c
@@ -336,6 +336,9 @@ static void spear_smi_hw_init(struct spear_smi *dev)
val = HOLD1 | BANK_EN | DSEL_TIME | (prescale << 8);
mutex_lock(&dev->lock);
+ /* clear all interrupt conditions */
+ writel(0, dev->io_base + SMI_SR);
+
writel(val, dev->io_base + SMI_CR1);
mutex_unlock(&dev->lock);
}