~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/linux/acpi_dma.h

Version: ~ [ linux-5.4-rc3 ] ~ [ linux-5.3.6 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.79 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.149 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.196 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.196 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.140 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.75 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ linux-3.10.108 ] ~ [ linux-3.9.11 ] ~ [ linux-3.8.13 ] ~ [ linux-3.7.10 ] ~ [ linux-3.6.11 ] ~ [ linux-3.5.7 ] ~ [ linux-3.4.113 ] ~ [ linux-3.3.8 ] ~ [ linux-3.2.102 ] ~ [ linux-3.1.10 ] ~ [ linux-3.0.101 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /*
  2  * ACPI helpers for DMA request / controller
  3  *
  4  * Based on of_dma.h
  5  *
  6  * Copyright (C) 2013, Intel Corporation
  7  * Author: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
  8  *
  9  * This program is free software; you can redistribute it and/or modify
 10  * it under the terms of the GNU General Public License version 2 as
 11  * published by the Free Software Foundation.
 12  */
 13 
 14 #ifndef __LINUX_ACPI_DMA_H
 15 #define __LINUX_ACPI_DMA_H
 16 
 17 #include <linux/list.h>
 18 #include <linux/device.h>
 19 #include <linux/err.h>
 20 #include <linux/dmaengine.h>
 21 
 22 /**
 23  * struct acpi_dma_spec - slave device DMA resources
 24  * @chan_id:    channel unique id
 25  * @slave_id:   request line unique id
 26  * @dev:        struct device of the DMA controller to be used in the filter
 27  *              function
 28  */
 29 struct acpi_dma_spec {
 30         int             chan_id;
 31         int             slave_id;
 32         struct device   *dev;
 33 };
 34 
 35 /**
 36  * struct acpi_dma - representation of the registered DMAC
 37  * @dma_controllers:    linked list node
 38  * @dev:                struct device of this controller
 39  * @acpi_dma_xlate:     callback function to find a suitable channel
 40  * @data:               private data used by a callback function
 41  * @base_request_line:  first supported request line (CSRT)
 42  * @end_request_line:   last supported request line (CSRT)
 43  */
 44 struct acpi_dma {
 45         struct list_head        dma_controllers;
 46         struct device           *dev;
 47         struct dma_chan         *(*acpi_dma_xlate)
 48                                 (struct acpi_dma_spec *, struct acpi_dma *);
 49         void                    *data;
 50         unsigned short          base_request_line;
 51         unsigned short          end_request_line;
 52 };
 53 
 54 /* Used with acpi_dma_simple_xlate() */
 55 struct acpi_dma_filter_info {
 56         dma_cap_mask_t  dma_cap;
 57         dma_filter_fn   filter_fn;
 58 };
 59 
 60 #ifdef CONFIG_DMA_ACPI
 61 
 62 int acpi_dma_controller_register(struct device *dev,
 63                 struct dma_chan *(*acpi_dma_xlate)
 64                 (struct acpi_dma_spec *, struct acpi_dma *),
 65                 void *data);
 66 int acpi_dma_controller_free(struct device *dev);
 67 int devm_acpi_dma_controller_register(struct device *dev,
 68                 struct dma_chan *(*acpi_dma_xlate)
 69                 (struct acpi_dma_spec *, struct acpi_dma *),
 70                 void *data);
 71 void devm_acpi_dma_controller_free(struct device *dev);
 72 
 73 struct dma_chan *acpi_dma_request_slave_chan_by_index(struct device *dev,
 74                                                       size_t index);
 75 struct dma_chan *acpi_dma_request_slave_chan_by_name(struct device *dev,
 76                                                      const char *name);
 77 
 78 struct dma_chan *acpi_dma_simple_xlate(struct acpi_dma_spec *dma_spec,
 79                                        struct acpi_dma *adma);
 80 #else
 81 
 82 static inline int acpi_dma_controller_register(struct device *dev,
 83                 struct dma_chan *(*acpi_dma_xlate)
 84                 (struct acpi_dma_spec *, struct acpi_dma *),
 85                 void *data)
 86 {
 87         return -ENODEV;
 88 }
 89 static inline int acpi_dma_controller_free(struct device *dev)
 90 {
 91         return -ENODEV;
 92 }
 93 static inline int devm_acpi_dma_controller_register(struct device *dev,
 94                 struct dma_chan *(*acpi_dma_xlate)
 95                 (struct acpi_dma_spec *, struct acpi_dma *),
 96                 void *data)
 97 {
 98         return -ENODEV;
 99 }
100 static inline void devm_acpi_dma_controller_free(struct device *dev)
101 {
102 }
103 
104 static inline struct dma_chan *acpi_dma_request_slave_chan_by_index(
105                 struct device *dev, size_t index)
106 {
107         return ERR_PTR(-ENODEV);
108 }
109 static inline struct dma_chan *acpi_dma_request_slave_chan_by_name(
110                 struct device *dev, const char *name)
111 {
112         return ERR_PTR(-ENODEV);
113 }
114 
115 #define acpi_dma_simple_xlate   NULL
116 
117 #endif
118 
119 #define acpi_dma_request_slave_channel  acpi_dma_request_slave_chan_by_index
120 
121 #endif /* __LINUX_ACPI_DMA_H */
122 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp