dmaengine: ti: omap-dma: Pass sdma auxdata to driver and use it
authorTony Lindgren <tony@atomide.com>
Mon, 16 Dec 2019 22:41:53 +0000 (14:41 -0800)
committerTony Lindgren <tony@atomide.com>
Mon, 30 Dec 2019 17:46:01 +0000 (09:46 -0800)
We can now start passing sdma auxdata to the dmaengine driver to start
removing the platform based sdma init.

Cc: Aaro Koskinen <aaro.koskinen@iki.fi>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Peter Ujfalusi <peter.ujfalusi@ti.com>
Cc: Russell King <rmk+kernel@armlinux.org.uk>
Cc: Vinod Koul <vkoul@kernel.org>
Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Tested-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Acked-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Tony Lindgren <tony@atomide.com>
arch/arm/mach-omap2/common.h
arch/arm/mach-omap2/dma.c
arch/arm/mach-omap2/pdata-quirks.c
drivers/dma/ti/omap-dma.c

index 223b37c..480387a 100644 (file)
@@ -345,9 +345,12 @@ static inline int dra7xx_pciess_reset(struct omap_hwmod *oh)
 }
 #endif
 
+struct omap_system_dma_plat_info;
+
 void pdata_quirks_init(const struct of_device_id *);
 void omap_auxdata_legacy_init(struct device *dev);
 void omap_pcs_legacy_init(int irq, void (*rearm)(void));
+extern struct omap_system_dma_plat_info dma_plat_info;
 
 struct omap_sdrc_params;
 extern void omap_sdrc_init(struct omap_sdrc_params *sdrc_cs0,
index 9dd4807..d965688 100644 (file)
@@ -217,7 +217,7 @@ static struct omap_dma_dev_attr dma_attr = {
        .lch_count = 32,
 };
 
-static struct omap_system_dma_plat_info dma_plat_info __initdata = {
+struct omap_system_dma_plat_info dma_plat_info = {
        .reg_map        = reg_map,
        .channel_stride = 0x60,
        .dma_attr       = &dma_attr,
index e95c224..922ee10 100644 (file)
@@ -514,6 +514,7 @@ static struct of_dev_auxdata omap_auxdata_lookup[] = {
        /* Common auxdata */
        OF_DEV_AUXDATA("ti,sysc", 0, NULL, &ti_sysc_pdata),
        OF_DEV_AUXDATA("pinctrl-single", 0, NULL, &pcs_pdata),
+       OF_DEV_AUXDATA("ti,omap-sdma", 0, NULL, &dma_plat_info),
        { /* sentinel */ },
 };
 
index 64a6b9f..7e26f0c 100644 (file)
@@ -1585,14 +1585,18 @@ static int omap_dma_probe(struct platform_device *pdev)
                return PTR_ERR(od->base);
 
        conf = of_device_get_match_data(&pdev->dev);
-       if (conf)
+       if (conf) {
                od->cfg = conf;
-       else
+               od->plat = dev_get_platdata(&pdev->dev);
+               if (!od->plat)
+                       dev_warn(&pdev->dev, "no sdma auxdata needed?\n");
+       } else {
                od->cfg = &default_cfg;
 
-       od->plat = omap_get_plat_info();
-       if (!od->plat)
-               return -EPROBE_DEFER;
+               od->plat = omap_get_plat_info();
+               if (!od->plat)
+                       return -EPROBE_DEFER;
+       }
 
        od->reg_map = od->plat->reg_map;