Skip to content

Commit

Permalink
mtd: spear_smi: clear status register on init
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Shiraz Hashim authored and David Woodhouse committed Jul 6, 2012
1 parent 770daa4 commit 4dc48c3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/mtd/devices/spear_smi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 4dc48c3

Please sign in to comment.