| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Device tree helpers for DMA request / controller |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * Based on of_gpio.c |
|---|
| 5 | 6 | * |
|---|
| 6 | 7 | * 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. |
|---|
| 11 | 8 | */ |
|---|
| 12 | 9 | |
|---|
| 13 | 10 | #include <linux/device.h> |
|---|
| .. | .. |
|---|
| 17 | 14 | #include <linux/slab.h> |
|---|
| 18 | 15 | #include <linux/of.h> |
|---|
| 19 | 16 | #include <linux/of_dma.h> |
|---|
| 17 | + |
|---|
| 18 | +#include "dmaengine.h" |
|---|
| 20 | 19 | |
|---|
| 21 | 20 | static LIST_HEAD(of_dma_list); |
|---|
| 22 | 21 | static DEFINE_MUTEX(of_dma_lock); |
|---|
| .. | .. |
|---|
| 47 | 46 | /** |
|---|
| 48 | 47 | * of_dma_router_xlate - translation function for router devices |
|---|
| 49 | 48 | * @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) |
|---|
| 51 | 50 | * |
|---|
| 52 | 51 | * The function creates new dma_spec to be passed to the router driver's |
|---|
| 53 | 52 | * of_dma_route_allocate() function to prepare a dma_spec which will be used |
|---|
| .. | .. |
|---|
| 98 | 97 | * @np: device node of DMA controller |
|---|
| 99 | 98 | * @of_dma_xlate: translation function which converts a phandle |
|---|
| 100 | 99 | * 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 |
|---|
| 102 | 101 | * translation function |
|---|
| 103 | 102 | * |
|---|
| 104 | 103 | * Returns 0 on success or appropriate errno value on error. |
|---|
| .. | .. |
|---|
| 301 | 300 | /** |
|---|
| 302 | 301 | * of_dma_simple_xlate - Simple DMA engine translation function |
|---|
| 303 | 302 | * @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 |
|---|
| 305 | 304 | * |
|---|
| 306 | 305 | * A simple translation function for devices that use a 32-bit value for the |
|---|
| 307 | 306 | * filter_param when calling the DMA engine dma_request_channel() function. |
|---|
| .. | .. |
|---|
| 321 | 320 | if (count != 1) |
|---|
| 322 | 321 | return NULL; |
|---|
| 323 | 322 | |
|---|
| 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); |
|---|
| 326 | 325 | } |
|---|
| 327 | 326 | EXPORT_SYMBOL_GPL(of_dma_simple_xlate); |
|---|
| 328 | 327 | |
|---|
| 329 | 328 | /** |
|---|
| 330 | 329 | * of_dma_xlate_by_chan_id - Translate dt property to DMA channel by channel id |
|---|
| 331 | 330 | * @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 |
|---|
| 333 | 332 | * |
|---|
| 334 | 333 | * This function can be used as the of xlate callback for DMA driver which wants |
|---|
| 335 | 334 | * to match the channel based on the channel id. When using this xlate function |
|---|