[POWERPC] Add celleb_dma_dev_setup()
authorMichael Ellerman <michael@ellerman.id.au>
Mon, 21 Jan 2008 05:42:42 +0000 (16:42 +1100)
committerPaul Mackerras <paulus@samba.org>
Fri, 25 Jan 2008 11:52:54 +0000 (22:52 +1100)
Celleb always uses dma_direct_ops, and sets dma_direct_offset, so it
too should set dma_data to dma_direct_offset.

Currently there's no pci_dma_dev_setup() routine for Celleb so add one.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
arch/powerpc/platforms/celleb/iommu.c

index 41e1e6f8e05915fa14b558886ab9a4d2b58b6637..843a66f422bb767f1aa7871af91f122a1b345829 100644 (file)
@@ -72,6 +72,17 @@ static void __init celleb_init_direct_mapping(void)
        dma_direct_offset = dma_base;
 }
 
+static void celleb_dma_dev_setup(struct device *dev)
+{
+       dev->archdata.dma_ops = get_pci_dma_ops();
+       dev->archdata.dma_data = (void *)dma_direct_offset;
+}
+
+static void celleb_pci_dma_dev_setup(struct pci_dev *pdev)
+{
+       celleb_dma_dev_setup(&pdev->dev);
+}
+
 static int celleb_of_bus_notify(struct notifier_block *nb,
                                unsigned long action, void *data)
 {
@@ -81,7 +92,7 @@ static int celleb_of_bus_notify(struct notifier_block *nb,
        if (action != BUS_NOTIFY_ADD_DEVICE)
                return 0;
 
-       dev->archdata.dma_ops = get_pci_dma_ops();
+       celleb_dma_dev_setup(dev);
 
        return 0;
 }
@@ -94,6 +105,7 @@ static int __init celleb_init_iommu(void)
 {
        celleb_init_direct_mapping();
        set_pci_dma_ops(&dma_direct_ops);
+       ppc_md.pci_dma_dev_setup = celleb_pci_dma_dev_setup;
        bus_register_notifier(&of_platform_bus_type, &celleb_of_bus_notifier);
 
        return 0;