aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ssb
diff options
context:
space:
mode:
authorRafał Miłecki <zajec5@gmail.com>2011-02-16 19:50:50 -0500
committerJohn W. Linville <linville@tuxdriver.com>2011-02-18 16:54:54 -0500
commitb1a1bcf714c4d79f7872a34138d100941ebb0a0b (patch)
tree3e93caf667a9f342c5ff6d9af48e38c1b2ffa035 /drivers/ssb
parent0d4171e2153b70957fe67867420a1a24d5e4cd82 (diff)
ssb: when needed, reject IM input while disabling device
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.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/drivers/ssb/main.c b/drivers/ssb/main.c
index 775c579817b..06c0b6d5250 100644
--- a/drivers/ssb/main.c
+++ b/drivers/ssb/main.c
@@ -1220,7 +1220,7 @@ static int ssb_wait_bits(struct ssb_device *dev, u16 reg, u32 bitmask,
1220 1220
1221void ssb_device_disable(struct ssb_device *dev, u32 core_specific_flags) 1221void ssb_device_disable(struct ssb_device *dev, u32 core_specific_flags)
1222{ 1222{
1223 u32 reject; 1223 u32 reject, val;
1224 1224
1225 if (ssb_read32(dev, SSB_TMSLOW) & SSB_TMSLOW_RESET) 1225 if (ssb_read32(dev, SSB_TMSLOW) & SSB_TMSLOW_RESET)
1226 return; 1226 return;
@@ -1229,12 +1229,26 @@ void ssb_device_disable(struct ssb_device *dev, u32 core_specific_flags)
1229 ssb_write32(dev, SSB_TMSLOW, reject | SSB_TMSLOW_CLOCK); 1229 ssb_write32(dev, SSB_TMSLOW, reject | SSB_TMSLOW_CLOCK);
1230 ssb_wait_bits(dev, SSB_TMSLOW, reject, 1000, 1); 1230 ssb_wait_bits(dev, SSB_TMSLOW, reject, 1000, 1);
1231 ssb_wait_bits(dev, SSB_TMSHIGH, SSB_TMSHIGH_BUSY, 1000, 0); 1231 ssb_wait_bits(dev, SSB_TMSHIGH, SSB_TMSHIGH_BUSY, 1000, 0);
1232
1233 if (ssb_read32(dev, SSB_IDLOW) & SSB_IDLOW_INITIATOR) {
1234 val = ssb_read32(dev, SSB_IMSTATE);
1235 val |= SSB_IMSTATE_REJECT;
1236 ssb_write32(dev, SSB_IMSTATE, val);
1237 ssb_wait_bits(dev, SSB_IMSTATE, SSB_IMSTATE_BUSY, 1000, 0);
1238 }
1239
1232 ssb_write32(dev, SSB_TMSLOW, 1240 ssb_write32(dev, SSB_TMSLOW,
1233 SSB_TMSLOW_FGC | SSB_TMSLOW_CLOCK | 1241 SSB_TMSLOW_FGC | SSB_TMSLOW_CLOCK |
1234 reject | SSB_TMSLOW_RESET | 1242 reject | SSB_TMSLOW_RESET |
1235 core_specific_flags); 1243 core_specific_flags);
1236 ssb_flush_tmslow(dev); 1244 ssb_flush_tmslow(dev);
1237 1245
1246 if (ssb_read32(dev, SSB_IDLOW) & SSB_IDLOW_INITIATOR) {
1247 val = ssb_read32(dev, SSB_IMSTATE);
1248 val &= ~SSB_IMSTATE_REJECT;
1249 ssb_write32(dev, SSB_IMSTATE, val);
1250 }
1251
1238 ssb_write32(dev, SSB_TMSLOW, 1252 ssb_write32(dev, SSB_TMSLOW,
1239 reject | SSB_TMSLOW_RESET | 1253 reject | SSB_TMSLOW_RESET |
1240 core_specific_flags); 1254 core_specific_flags);