dmaengine: dw: platform: provide platform data for Intel
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Tue, 13 Oct 2015 17:09:18 +0000 (20:09 +0300)
committerVinod Koul <vinod.koul@intel.com>
Sat, 31 Oct 2015 02:02:36 +0000 (07:32 +0530)
Provide platform data explicitly for Intel SoCs where dw_dmac is enumerated by
ACPI.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
drivers/dma/dw/platform.c

index b2c3ae07142910a39c90b7ed47f718af35821021..68a4815750b514bcd94a312885607a83db7d99cf 100644 (file)
@@ -155,6 +155,7 @@ static int dw_probe(struct platform_device *pdev)
        struct dw_dma_chip *chip;
        struct device *dev = &pdev->dev;
        struct resource *mem;
+       const struct acpi_device_id *id;
        struct dw_dma_platform_data *pdata;
        int err;
 
@@ -178,6 +179,11 @@ static int dw_probe(struct platform_device *pdev)
        pdata = dev_get_platdata(dev);
        if (!pdata)
                pdata = dw_dma_parse_dt(pdev);
+       if (!pdata && has_acpi_companion(dev)) {
+               id = acpi_match_device(dev->driver->acpi_match_table, dev);
+               if (id)
+                       pdata = (struct dw_dma_platform_data *)id->driver_data;
+       }
 
        chip->dev = dev;
 
@@ -246,8 +252,17 @@ MODULE_DEVICE_TABLE(of, dw_dma_of_id_table);
 #endif
 
 #ifdef CONFIG_ACPI
+static struct dw_dma_platform_data dw_dma_acpi_pdata = {
+       .nr_channels = 8,
+       .is_private = true,
+       .chan_allocation_order = CHAN_ALLOCATION_ASCENDING,
+       .chan_priority = CHAN_PRIORITY_ASCENDING,
+       .block_size = 4095,
+       .nr_masters = 2,
+};
+
 static const struct acpi_device_id dw_dma_acpi_id_table[] = {
-       { "INTL9C60", 0 },
+       { "INTL9C60", (kernel_ulong_t)&dw_dma_acpi_pdata },
        { }
 };
 MODULE_DEVICE_TABLE(acpi, dw_dma_acpi_id_table);