[PATCH 2/3] ssb: Add weak DMA-mask API

From: Michael Buesch
Date: Thu May 01 2008 - 10:46:35 EST


This adds a "weak" variant of ssb_dma_set_mask().

Signed-off-by: Michael Buesch <mb@xxxxxxxxx>


Index: linux-2.6/drivers/ssb/main.c
===================================================================
--- linux-2.6.orig/drivers/ssb/main.c 2008-05-01 13:19:53.000000000 +0200
+++ linux-2.6/drivers/ssb/main.c 2008-05-01 13:47:29.000000000 +0200
@@ -1165,6 +1165,12 @@ u32 ssb_dma_translation(struct ssb_devic
}
EXPORT_SYMBOL(ssb_dma_translation);

+static void do_set_dma_mask(struct device *dma_dev, u64 mask)
+{
+ dma_dev->coherent_dma_mask = mask;
+ dma_dev->dma_mask = &dma_dev->coherent_dma_mask;
+}
+
int ssb_dma_set_mask(struct ssb_device *ssb_dev, u64 mask)
{
struct device *dma_dev = ssb_dev->dma_dev;
@@ -1173,13 +1179,26 @@ int ssb_dma_set_mask(struct ssb_device *
if (ssb_dev->bus->bustype == SSB_BUSTYPE_PCI)
return dma_set_mask(dma_dev, mask);
#endif
- dma_dev->coherent_dma_mask = mask;
- dma_dev->dma_mask = &dma_dev->coherent_dma_mask;
+ do_set_dma_mask(dma_dev, mask);

return 0;
}
EXPORT_SYMBOL(ssb_dma_set_mask);

+int ssb_dma_set_mask_weak(struct ssb_device *ssb_dev, u64 *mask)
+{
+ struct device *dma_dev = ssb_dev->dma_dev;
+
+#ifdef CONFIG_SSB_PCIHOST
+ if (ssb_dev->bus->bustype == SSB_BUSTYPE_PCI)
+ return dma_set_mask_weak(dma_dev, mask);
+#endif
+ do_set_dma_mask(dma_dev, *mask);
+
+ return 0;
+}
+EXPORT_SYMBOL(ssb_dma_set_mask_weak);
+
int ssb_bus_may_powerdown(struct ssb_bus *bus)
{
struct ssb_chipcommon *cc;
Index: linux-2.6/include/linux/ssb/ssb.h
===================================================================
--- linux-2.6.orig/include/linux/ssb/ssb.h 2008-05-01 13:19:59.000000000 +0200
+++ linux-2.6/include/linux/ssb/ssb.h 2008-05-01 13:43:17.000000000 +0200
@@ -406,6 +406,7 @@ extern u32 ssb_dma_translation(struct ss
#define SSB_DMA_TRANSLATION_SHIFT 30

extern int ssb_dma_set_mask(struct ssb_device *ssb_dev, u64 mask);
+extern int ssb_dma_set_mask_weak(struct ssb_device *ssb_dev, u64 *mask);


#ifdef CONFIG_SSB_PCIHOST

--
Greetings Michael.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/