]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - include/asm-powerpc/dma-mapping.h
i2c: Convert the pca9539 driver to a new-style i2c driver
[linux-2.6-omap-h63xx.git] / include / asm-powerpc / dma-mapping.h
index de1395023cb169702979aeb31ad0aea30e760dc2..74c549780987ba8e9feb48a299c9455c32cfce93 100644 (file)
@@ -45,6 +45,15 @@ extern void __dma_sync_page(struct page *page, unsigned long offset,
 #endif /* ! CONFIG_NOT_COHERENT_CACHE */
 
 #ifdef CONFIG_PPC64
+
+static inline unsigned long device_to_mask(struct device *dev)
+{
+       if (dev->dma_mask && *dev->dma_mask)
+               return *dev->dma_mask;
+       /* Assume devices without mask can take 32 bit addresses */
+       return 0xfffffffful;
+}
+
 /*
  * DMA operations are abstracted for G5 vs. i/pSeries, PCI vs. VIO
  */