hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/drivers/dma/of-dma.c
....@@ -1,13 +1,10 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Device tree helpers for DMA request / controller
34 *
45 * Based on of_gpio.c
56 *
67 * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/
7
- *
8
- * This program is free software; you can redistribute it and/or modify
9
- * it under the terms of the GNU General Public License version 2 as
10
- * published by the Free Software Foundation.
118 */
129
1310 #include <linux/device.h>
....@@ -17,6 +14,8 @@
1714 #include <linux/slab.h>
1815 #include <linux/of.h>
1916 #include <linux/of_dma.h>
17
+
18
+#include "dmaengine.h"
2019
2120 static LIST_HEAD(of_dma_list);
2221 static DEFINE_MUTEX(of_dma_lock);
....@@ -47,7 +46,7 @@
4746 /**
4847 * of_dma_router_xlate - translation function for router devices
4948 * @dma_spec: pointer to DMA specifier as found in the device tree
50
- * @of_dma: pointer to DMA controller data (router information)
49
+ * @ofdma: pointer to DMA controller data (router information)
5150 *
5251 * The function creates new dma_spec to be passed to the router driver's
5352 * of_dma_route_allocate() function to prepare a dma_spec which will be used
....@@ -98,7 +97,7 @@
9897 * @np: device node of DMA controller
9998 * @of_dma_xlate: translation function which converts a phandle
10099 * arguments list into a dma_chan structure
101
- * @data pointer to controller specific data to be used by
100
+ * @data: pointer to controller specific data to be used by
102101 * translation function
103102 *
104103 * Returns 0 on success or appropriate errno value on error.
....@@ -301,7 +300,7 @@
301300 /**
302301 * of_dma_simple_xlate - Simple DMA engine translation function
303302 * @dma_spec: pointer to DMA specifier as found in the device tree
304
- * @of_dma: pointer to DMA controller data
303
+ * @ofdma: pointer to DMA controller data
305304 *
306305 * A simple translation function for devices that use a 32-bit value for the
307306 * filter_param when calling the DMA engine dma_request_channel() function.
....@@ -321,15 +320,15 @@
321320 if (count != 1)
322321 return NULL;
323322
324
- return dma_request_channel(info->dma_cap, info->filter_fn,
325
- &dma_spec->args[0]);
323
+ return __dma_request_channel(&info->dma_cap, info->filter_fn,
324
+ &dma_spec->args[0], dma_spec->np);
326325 }
327326 EXPORT_SYMBOL_GPL(of_dma_simple_xlate);
328327
329328 /**
330329 * of_dma_xlate_by_chan_id - Translate dt property to DMA channel by channel id
331330 * @dma_spec: pointer to DMA specifier as found in the device tree
332
- * @of_dma: pointer to DMA controller data
331
+ * @ofdma: pointer to DMA controller data
333332 *
334333 * This function can be used as the of xlate callback for DMA driver which wants
335334 * to match the channel based on the channel id. When using this xlate function