|
@@ -30,11 +30,12 @@ static DEFINE_MUTEX(acpi_dma_lock);
|
|
* @adev: ACPI device to match with
|
|
* @adev: ACPI device to match with
|
|
* @adma: struct acpi_dma of the given DMA controller
|
|
* @adma: struct acpi_dma of the given DMA controller
|
|
*
|
|
*
|
|
- * Returns 1 on success, 0 when no information is available, or appropriate
|
|
|
|
- * errno value on error.
|
|
|
|
- *
|
|
|
|
* In order to match a device from DSDT table to the corresponding CSRT device
|
|
* In order to match a device from DSDT table to the corresponding CSRT device
|
|
* we use MMIO address and IRQ.
|
|
* we use MMIO address and IRQ.
|
|
|
|
+ *
|
|
|
|
+ * Return:
|
|
|
|
+ * 1 on success, 0 when no information is available, or appropriate errno value
|
|
|
|
+ * on error.
|
|
*/
|
|
*/
|
|
static int acpi_dma_parse_resource_group(const struct acpi_csrt_group *grp,
|
|
static int acpi_dma_parse_resource_group(const struct acpi_csrt_group *grp,
|
|
struct acpi_device *adev, struct acpi_dma *adma)
|
|
struct acpi_device *adev, struct acpi_dma *adma)
|
|
@@ -101,7 +102,6 @@ static int acpi_dma_parse_resource_group(const struct acpi_csrt_group *grp,
|
|
*
|
|
*
|
|
* We are using this table to get the request line range of the specific DMA
|
|
* We are using this table to get the request line range of the specific DMA
|
|
* controller to be used later.
|
|
* controller to be used later.
|
|
- *
|
|
|
|
*/
|
|
*/
|
|
static void acpi_dma_parse_csrt(struct acpi_device *adev, struct acpi_dma *adma)
|
|
static void acpi_dma_parse_csrt(struct acpi_device *adev, struct acpi_dma *adma)
|
|
{
|
|
{
|
|
@@ -141,10 +141,11 @@ static void acpi_dma_parse_csrt(struct acpi_device *adev, struct acpi_dma *adma)
|
|
* @data pointer to controller specific data to be used by
|
|
* @data pointer to controller specific data to be used by
|
|
* translation function
|
|
* translation function
|
|
*
|
|
*
|
|
- * Returns 0 on success or appropriate errno value on error.
|
|
|
|
- *
|
|
|
|
* Allocated memory should be freed with appropriate acpi_dma_controller_free()
|
|
* Allocated memory should be freed with appropriate acpi_dma_controller_free()
|
|
* call.
|
|
* call.
|
|
|
|
+ *
|
|
|
|
+ * Return:
|
|
|
|
+ * 0 on success or appropriate errno value on error.
|
|
*/
|
|
*/
|
|
int acpi_dma_controller_register(struct device *dev,
|
|
int acpi_dma_controller_register(struct device *dev,
|
|
struct dma_chan *(*acpi_dma_xlate)
|
|
struct dma_chan *(*acpi_dma_xlate)
|
|
@@ -188,6 +189,9 @@ EXPORT_SYMBOL_GPL(acpi_dma_controller_register);
|
|
* @dev: struct device of DMA controller
|
|
* @dev: struct device of DMA controller
|
|
*
|
|
*
|
|
* Memory allocated by acpi_dma_controller_register() is freed here.
|
|
* Memory allocated by acpi_dma_controller_register() is freed here.
|
|
|
|
+ *
|
|
|
|
+ * Return:
|
|
|
|
+ * 0 on success or appropriate errno value on error.
|
|
*/
|
|
*/
|
|
int acpi_dma_controller_free(struct device *dev)
|
|
int acpi_dma_controller_free(struct device *dev)
|
|
{
|
|
{
|
|
@@ -225,6 +229,9 @@ static void devm_acpi_dma_release(struct device *dev, void *res)
|
|
* Managed acpi_dma_controller_register(). DMA controller registered by this
|
|
* Managed acpi_dma_controller_register(). DMA controller registered by this
|
|
* function are automatically freed on driver detach. See
|
|
* function are automatically freed on driver detach. See
|
|
* acpi_dma_controller_register() for more information.
|
|
* acpi_dma_controller_register() for more information.
|
|
|
|
+ *
|
|
|
|
+ * Return:
|
|
|
|
+ * 0 on success or appropriate errno value on error.
|
|
*/
|
|
*/
|
|
int devm_acpi_dma_controller_register(struct device *dev,
|
|
int devm_acpi_dma_controller_register(struct device *dev,
|
|
struct dma_chan *(*acpi_dma_xlate)
|
|
struct dma_chan *(*acpi_dma_xlate)
|
|
@@ -267,8 +274,6 @@ EXPORT_SYMBOL_GPL(devm_acpi_dma_controller_free);
|
|
* @adma: struct acpi_dma of DMA controller
|
|
* @adma: struct acpi_dma of DMA controller
|
|
* @dma_spec: dma specifier to update
|
|
* @dma_spec: dma specifier to update
|
|
*
|
|
*
|
|
- * Returns 0, if no information is avaiable, -1 on mismatch, and 1 otherwise.
|
|
|
|
- *
|
|
|
|
* Accordingly to ACPI 5.0 Specification Table 6-170 "Fixed DMA Resource
|
|
* Accordingly to ACPI 5.0 Specification Table 6-170 "Fixed DMA Resource
|
|
* Descriptor":
|
|
* Descriptor":
|
|
* DMA Request Line bits is a platform-relative number uniquely
|
|
* DMA Request Line bits is a platform-relative number uniquely
|
|
@@ -276,6 +281,9 @@ EXPORT_SYMBOL_GPL(devm_acpi_dma_controller_free);
|
|
* mapping is done in a controller-specific OS driver.
|
|
* mapping is done in a controller-specific OS driver.
|
|
* That's why we can safely adjust slave_id when the appropriate controller is
|
|
* That's why we can safely adjust slave_id when the appropriate controller is
|
|
* found.
|
|
* found.
|
|
|
|
+ *
|
|
|
|
+ * Return:
|
|
|
|
+ * 0, if no information is avaiable, -1 on mismatch, and 1 otherwise.
|
|
*/
|
|
*/
|
|
static int acpi_dma_update_dma_spec(struct acpi_dma *adma,
|
|
static int acpi_dma_update_dma_spec(struct acpi_dma *adma,
|
|
struct acpi_dma_spec *dma_spec)
|
|
struct acpi_dma_spec *dma_spec)
|
|
@@ -334,7 +342,8 @@ static int acpi_dma_parse_fixed_dma(struct acpi_resource *res, void *data)
|
|
* @dev: struct device to get DMA request from
|
|
* @dev: struct device to get DMA request from
|
|
* @index: index of FixedDMA descriptor for @dev
|
|
* @index: index of FixedDMA descriptor for @dev
|
|
*
|
|
*
|
|
- * Returns pointer to appropriate dma channel on success or NULL on error.
|
|
|
|
|
|
+ * Return:
|
|
|
|
+ * Pointer to appropriate dma channel on success or NULL on error.
|
|
*/
|
|
*/
|
|
struct dma_chan *acpi_dma_request_slave_chan_by_index(struct device *dev,
|
|
struct dma_chan *acpi_dma_request_slave_chan_by_index(struct device *dev,
|
|
size_t index)
|
|
size_t index)
|
|
@@ -403,7 +412,8 @@ EXPORT_SYMBOL_GPL(acpi_dma_request_slave_chan_by_index);
|
|
* translate the names "tx" and "rx" here based on the most common case where
|
|
* translate the names "tx" and "rx" here based on the most common case where
|
|
* the first FixedDMA descriptor is TX and second is RX.
|
|
* the first FixedDMA descriptor is TX and second is RX.
|
|
*
|
|
*
|
|
- * Returns pointer to appropriate dma channel on success or NULL on error.
|
|
|
|
|
|
+ * Return:
|
|
|
|
+ * Pointer to appropriate dma channel on success or NULL on error.
|
|
*/
|
|
*/
|
|
struct dma_chan *acpi_dma_request_slave_chan_by_name(struct device *dev,
|
|
struct dma_chan *acpi_dma_request_slave_chan_by_name(struct device *dev,
|
|
const char *name)
|
|
const char *name)
|
|
@@ -427,8 +437,10 @@ EXPORT_SYMBOL_GPL(acpi_dma_request_slave_chan_by_name);
|
|
* @adma: pointer to ACPI DMA controller data
|
|
* @adma: pointer to ACPI DMA controller data
|
|
*
|
|
*
|
|
* A simple translation function for ACPI based devices. Passes &struct
|
|
* A simple translation function for ACPI based devices. Passes &struct
|
|
- * dma_spec to the DMA controller driver provided filter function. Returns
|
|
|
|
- * pointer to the channel if found or %NULL otherwise.
|
|
|
|
|
|
+ * dma_spec to the DMA controller driver provided filter function.
|
|
|
|
+ *
|
|
|
|
+ * Return:
|
|
|
|
+ * Pointer to the channel if found or %NULL otherwise.
|
|
*/
|
|
*/
|
|
struct dma_chan *acpi_dma_simple_xlate(struct acpi_dma_spec *dma_spec,
|
|
struct dma_chan *acpi_dma_simple_xlate(struct acpi_dma_spec *dma_spec,
|
|
struct acpi_dma *adma)
|
|
struct acpi_dma *adma)
|