aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ssb
diff options
context:
space:
mode:
authorRafał Miłecki <zajec5@gmail.com>2011-02-16 19:50:51 -0500
committerJohn W. Linville <linville@tuxdriver.com>2011-02-18 16:54:55 -0500
commit011d18350f525dfdb1ccbd52019e8c04cadcc222 (patch)
treebceefcd1c6e65bdaba3ff5346ae05c87ccdb88f4 /drivers/ssb
parentb1a1bcf714c4d79f7872a34138d100941ebb0a0b (diff)
ssb: reset device only if it was enabled
Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/ssb')
-rw-r--r--drivers/ssb/main.c40
1 files changed, 22 insertions, 18 deletions
diff --git a/drivers/ssb/main.c b/drivers/ssb/main.c
index 06c0b6d5250d..e05ba6eefc7e 100644
--- a/drivers/ssb/main.c
+++ b/drivers/ssb/main.c
@@ -1226,27 +1226,31 @@ void ssb_device_disable(struct ssb_device *dev, u32 core_specific_flags)
1226 return; 1226 return;
1227 1227
1228 reject = ssb_tmslow_reject_bitmask(dev); 1228 reject = ssb_tmslow_reject_bitmask(dev);
1229 ssb_write32(dev, SSB_TMSLOW, reject | SSB_TMSLOW_CLOCK);
1230 ssb_wait_bits(dev, SSB_TMSLOW, reject, 1000, 1);
1231 ssb_wait_bits(dev, SSB_TMSHIGH, SSB_TMSHIGH_BUSY, 1000, 0);
1232 1229
1233 if (ssb_read32(dev, SSB_IDLOW) & SSB_IDLOW_INITIATOR) { 1230 if (ssb_read32(dev, SSB_TMSLOW) & SSB_TMSLOW_CLOCK) {
1234 val = ssb_read32(dev, SSB_IMSTATE); 1231 ssb_write32(dev, SSB_TMSLOW, reject | SSB_TMSLOW_CLOCK);
1235 val |= SSB_IMSTATE_REJECT; 1232 ssb_wait_bits(dev, SSB_TMSLOW, reject, 1000, 1);
1236 ssb_write32(dev, SSB_IMSTATE, val); 1233 ssb_wait_bits(dev, SSB_TMSHIGH, SSB_TMSHIGH_BUSY, 1000, 0);
1237 ssb_wait_bits(dev, SSB_IMSTATE, SSB_IMSTATE_BUSY, 1000, 0); 1234
1238 } 1235 if (ssb_read32(dev, SSB_IDLOW) & SSB_IDLOW_INITIATOR) {
1236 val = ssb_read32(dev, SSB_IMSTATE);
1237 val |= SSB_IMSTATE_REJECT;
1238 ssb_write32(dev, SSB_IMSTATE, val);
1239 ssb_wait_bits(dev, SSB_IMSTATE, SSB_IMSTATE_BUSY, 1000,
1240 0);
1241 }
1239 1242
1240 ssb_write32(dev, SSB_TMSLOW, 1243 ssb_write32(dev, SSB_TMSLOW,
1241 SSB_TMSLOW_FGC | SSB_TMSLOW_CLOCK | 1244 SSB_TMSLOW_FGC | SSB_TMSLOW_CLOCK |
1242 reject | SSB_TMSLOW_RESET | 1245 reject | SSB_TMSLOW_RESET |
1243 core_specific_flags); 1246 core_specific_flags);
1244 ssb_flush_tmslow(dev); 1247 ssb_flush_tmslow(dev);
1245 1248
1246 if (ssb_read32(dev, SSB_IDLOW) & SSB_IDLOW_INITIATOR) { 1249 if (ssb_read32(dev, SSB_IDLOW) & SSB_IDLOW_INITIATOR) {
1247 val = ssb_read32(dev, SSB_IMSTATE); 1250 val = ssb_read32(dev, SSB_IMSTATE);
1248 val &= ~SSB_IMSTATE_REJECT; 1251 val &= ~SSB_IMSTATE_REJECT;
1249 ssb_write32(dev, SSB_IMSTATE, val); 1252 ssb_write32(dev, SSB_IMSTATE, val);
1253 }
1250 } 1254 }
1251 1255
1252 ssb_write32(dev, SSB_TMSLOW, 1256 ssb_write32(dev, SSB_TMSLOW,