aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ssb
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ssb')
-rw-r--r--drivers/ssb/main.c74
1 files changed, 0 insertions, 74 deletions
diff --git a/drivers/ssb/main.c b/drivers/ssb/main.c
index a732b396e602..7cee7f4eb60b 100644
--- a/drivers/ssb/main.c
+++ b/drivers/ssb/main.c
@@ -1228,80 +1228,6 @@ u32 ssb_dma_translation(struct ssb_device *dev)
1228} 1228}
1229EXPORT_SYMBOL(ssb_dma_translation); 1229EXPORT_SYMBOL(ssb_dma_translation);
1230 1230
1231int ssb_dma_set_mask(struct ssb_device *dev, u64 mask)
1232{
1233#ifdef CONFIG_SSB_PCIHOST
1234 int err;
1235#endif
1236
1237 switch (dev->bus->bustype) {
1238 case SSB_BUSTYPE_PCI:
1239#ifdef CONFIG_SSB_PCIHOST
1240 err = pci_set_dma_mask(dev->bus->host_pci, mask);
1241 if (err)
1242 return err;
1243 err = pci_set_consistent_dma_mask(dev->bus->host_pci, mask);
1244 return err;
1245#endif
1246 case SSB_BUSTYPE_SSB:
1247 return dma_set_mask(dev->dev, mask);
1248 default:
1249 __ssb_dma_not_implemented(dev);
1250 }
1251 return -ENOSYS;
1252}
1253EXPORT_SYMBOL(ssb_dma_set_mask);
1254
1255void * ssb_dma_alloc_consistent(struct ssb_device *dev, size_t size,
1256 dma_addr_t *dma_handle, gfp_t gfp_flags)
1257{
1258 switch (dev->bus->bustype) {
1259 case SSB_BUSTYPE_PCI:
1260#ifdef CONFIG_SSB_PCIHOST
1261 if (gfp_flags & GFP_DMA) {
1262 /* Workaround: The PCI API does not support passing
1263 * a GFP flag. */
1264 return dma_alloc_coherent(&dev->bus->host_pci->dev,
1265 size, dma_handle, gfp_flags);
1266 }
1267 return pci_alloc_consistent(dev->bus->host_pci, size, dma_handle);
1268#endif
1269 case SSB_BUSTYPE_SSB:
1270 return dma_alloc_coherent(dev->dev, size, dma_handle, gfp_flags);
1271 default:
1272 __ssb_dma_not_implemented(dev);
1273 }
1274 return NULL;
1275}
1276EXPORT_SYMBOL(ssb_dma_alloc_consistent);
1277
1278void ssb_dma_free_consistent(struct ssb_device *dev, size_t size,
1279 void *vaddr, dma_addr_t dma_handle,
1280 gfp_t gfp_flags)
1281{
1282 switch (dev->bus->bustype) {
1283 case SSB_BUSTYPE_PCI:
1284#ifdef CONFIG_SSB_PCIHOST
1285 if (gfp_flags & GFP_DMA) {
1286 /* Workaround: The PCI API does not support passing
1287 * a GFP flag. */
1288 dma_free_coherent(&dev->bus->host_pci->dev,
1289 size, vaddr, dma_handle);
1290 return;
1291 }
1292 pci_free_consistent(dev->bus->host_pci, size,
1293 vaddr, dma_handle);
1294 return;
1295#endif
1296 case SSB_BUSTYPE_SSB:
1297 dma_free_coherent(dev->dev, size, vaddr, dma_handle);
1298 return;
1299 default:
1300 __ssb_dma_not_implemented(dev);
1301 }
1302}
1303EXPORT_SYMBOL(ssb_dma_free_consistent);
1304
1305int ssb_bus_may_powerdown(struct ssb_bus *bus) 1231int ssb_bus_may_powerdown(struct ssb_bus *bus)
1306{ 1232{
1307 struct ssb_chipcommon *cc; 1233 struct ssb_chipcommon *cc;