aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafał Miłecki <zajec5@gmail.com>2010-05-24 15:50:24 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-06-03 14:10:44 -0400
commitfd515941cfaf949b55086a36943afe085d7268e6 (patch)
treefeaabc312579a5588d0c28ae2dc949ef26bed911
parentc35deb4e70d52ed564c58569fe059dd7ca5f4eec (diff)
ssb: fast powerup delay calculation for PMU capable devices
Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Acked-by: Gábor Stefanik <netrolller.3d@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/ssb/driver_chipcommon.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/drivers/ssb/driver_chipcommon.c b/drivers/ssb/driver_chipcommon.c
index 59ae76bace14..bda851427780 100644
--- a/drivers/ssb/driver_chipcommon.c
+++ b/drivers/ssb/driver_chipcommon.c
@@ -209,6 +209,24 @@ static void chipco_powercontrol_init(struct ssb_chipcommon *cc)
209 } 209 }
210} 210}
211 211
212/* http://bcm-v4.sipsolutions.net/802.11/PmuFastPwrupDelay */
213static u16 pmu_fast_powerup_delay(struct ssb_chipcommon *cc)
214{
215 struct ssb_bus *bus = cc->dev->bus;
216
217 switch (bus->chip_id) {
218 case 0x4312:
219 case 0x4322:
220 case 0x4328:
221 return 7000;
222 case 0x4325:
223 /* TODO: */
224 default:
225 return 15000;
226 }
227}
228
229/* http://bcm-v4.sipsolutions.net/802.11/ClkctlFastPwrupDelay */
212static void calc_fast_powerup_delay(struct ssb_chipcommon *cc) 230static void calc_fast_powerup_delay(struct ssb_chipcommon *cc)
213{ 231{
214 struct ssb_bus *bus = cc->dev->bus; 232 struct ssb_bus *bus = cc->dev->bus;
@@ -218,6 +236,12 @@ static void calc_fast_powerup_delay(struct ssb_chipcommon *cc)
218 236
219 if (bus->bustype != SSB_BUSTYPE_PCI) 237 if (bus->bustype != SSB_BUSTYPE_PCI)
220 return; 238 return;
239
240 if (cc->capabilities & SSB_CHIPCO_CAP_PMU) {
241 cc->fast_pwrup_delay = pmu_fast_powerup_delay(cc);
242 return;
243 }
244
221 if (!(cc->capabilities & SSB_CHIPCO_CAP_PCTL)) 245 if (!(cc->capabilities & SSB_CHIPCO_CAP_PCTL))
222 return; 246 return;
223 247