aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ssb/main.c
diff options
context:
space:
mode:
authorRafał Miłecki <zajec5@gmail.com>2011-05-10 20:10:58 -0400
committerJohn W. Linville <linville@tuxdriver.com>2011-05-11 14:50:41 -0400
commit8576f815d5c8beb8b10f96abe31831b90af3d352 (patch)
tree5c600a151f8a508434e20d8ade1579c0c4cec696 /drivers/ssb/main.c
parent1073e4ee595265086a592a056d903bf4fcc8885a (diff)
ssb: move ssb_commit_settings and export it
Commiting settings is possible on devices without PCI core (but with CC core). Export it for usage in drivers supporting other cores. Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/ssb/main.c')
-rw-r--r--drivers/ssb/main.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/drivers/ssb/main.c b/drivers/ssb/main.c
index ad3da93a428c..ee2937c41424 100644
--- a/drivers/ssb/main.c
+++ b/drivers/ssb/main.c
@@ -1329,6 +1329,31 @@ error:
1329} 1329}
1330EXPORT_SYMBOL(ssb_bus_powerup); 1330EXPORT_SYMBOL(ssb_bus_powerup);
1331 1331
1332static void ssb_broadcast_value(struct ssb_device *dev,
1333 u32 address, u32 data)
1334{
1335 /* This is used for both, PCI and ChipCommon core, so be careful. */
1336 BUILD_BUG_ON(SSB_PCICORE_BCAST_ADDR != SSB_CHIPCO_BCAST_ADDR);
1337 BUILD_BUG_ON(SSB_PCICORE_BCAST_DATA != SSB_CHIPCO_BCAST_DATA);
1338
1339 ssb_write32(dev, SSB_PCICORE_BCAST_ADDR, address);
1340 ssb_read32(dev, SSB_PCICORE_BCAST_ADDR); /* flush */
1341 ssb_write32(dev, SSB_PCICORE_BCAST_DATA, data);
1342 ssb_read32(dev, SSB_PCICORE_BCAST_DATA); /* flush */
1343}
1344
1345void ssb_commit_settings(struct ssb_bus *bus)
1346{
1347 struct ssb_device *dev;
1348
1349 dev = bus->chipco.dev ? bus->chipco.dev : bus->pcicore.dev;
1350 if (WARN_ON(!dev))
1351 return;
1352 /* This forces an update of the cached registers. */
1353 ssb_broadcast_value(dev, 0xFD8, 0);
1354}
1355EXPORT_SYMBOL(ssb_commit_settings);
1356
1332u32 ssb_admatch_base(u32 adm) 1357u32 ssb_admatch_base(u32 adm)
1333{ 1358{
1334 u32 base = 0; 1359 u32 base = 0;