Commit 011d1835 authored by Rafał Miłecki's avatar Rafał Miłecki Committed by John W. Linville

ssb: reset device only if it was enabled

Signed-off-by: default avatarRafał Miłecki <zajec5@gmail.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent b1a1bcf7
......@@ -1226,6 +1226,8 @@ void ssb_device_disable(struct ssb_device *dev, u32 core_specific_flags)
return;
reject = ssb_tmslow_reject_bitmask(dev);
if (ssb_read32(dev, SSB_TMSLOW) & SSB_TMSLOW_CLOCK) {
ssb_write32(dev, SSB_TMSLOW, reject | SSB_TMSLOW_CLOCK);
ssb_wait_bits(dev, SSB_TMSLOW, reject, 1000, 1);
ssb_wait_bits(dev, SSB_TMSHIGH, SSB_TMSHIGH_BUSY, 1000, 0);
......@@ -1234,7 +1236,8 @@ void ssb_device_disable(struct ssb_device *dev, u32 core_specific_flags)
val = ssb_read32(dev, SSB_IMSTATE);
val |= SSB_IMSTATE_REJECT;
ssb_write32(dev, SSB_IMSTATE, val);
ssb_wait_bits(dev, SSB_IMSTATE, SSB_IMSTATE_BUSY, 1000, 0);
ssb_wait_bits(dev, SSB_IMSTATE, SSB_IMSTATE_BUSY, 1000,
0);
}
ssb_write32(dev, SSB_TMSLOW,
......@@ -1248,6 +1251,7 @@ void ssb_device_disable(struct ssb_device *dev, u32 core_specific_flags)
val &= ~SSB_IMSTATE_REJECT;
ssb_write32(dev, SSB_IMSTATE, val);
}
}
ssb_write32(dev, SSB_TMSLOW,
reject | SSB_TMSLOW_RESET |
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment