Files
linux-apfs/include/linux/of_dma.h
T

76 lines
1.9 KiB
C
Raw Normal View History

2012-09-14 17:41:56 -05:00
/*
* OF helpers for DMA request / controller
*
* Based on of_gpio.h
*
* Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
#ifndef __LINUX_OF_DMA_H
#define __LINUX_OF_DMA_H
#include <linux/of.h>
#include <linux/dmaengine.h>
struct device_node;
struct of_dma {
struct list_head of_dma_controllers;
struct device_node *of_node;
struct dma_chan *(*of_dma_xlate)
(struct of_phandle_args *, struct of_dma *);
void *of_dma_data;
};
struct of_dma_filter_info {
dma_cap_mask_t dma_cap;
dma_filter_fn filter_fn;
};
2012-09-25 09:57:36 +05:30
#ifdef CONFIG_OF
2012-09-14 17:41:56 -05:00
extern int of_dma_controller_register(struct device_node *np,
struct dma_chan *(*of_dma_xlate)
(struct of_phandle_args *, struct of_dma *),
void *data);
extern void of_dma_controller_free(struct device_node *np);
2012-09-14 17:41:56 -05:00
extern struct dma_chan *of_dma_request_slave_channel(struct device_node *np,
2013-02-24 16:36:09 +01:00
const char *name);
2012-09-14 17:41:56 -05:00
extern struct dma_chan *of_dma_simple_xlate(struct of_phandle_args *dma_spec,
struct of_dma *ofdma);
extern struct dma_chan *of_dma_xlate_by_chan_id(struct of_phandle_args *dma_spec,
struct of_dma *ofdma);
2012-09-25 09:57:36 +05:30
#else
2012-11-29 12:17:22 +05:30
static inline int of_dma_controller_register(struct device_node *np,
2012-09-25 09:57:36 +05:30
struct dma_chan *(*of_dma_xlate)
(struct of_phandle_args *, struct of_dma *),
void *data)
{
return -ENODEV;
}
static inline void of_dma_controller_free(struct device_node *np)
2012-09-25 09:57:36 +05:30
{
}
2012-11-29 12:17:22 +05:30
static inline struct dma_chan *of_dma_request_slave_channel(struct device_node *np,
2013-02-24 16:36:09 +01:00
const char *name)
2012-09-25 09:57:36 +05:30
{
return NULL;
}
2012-11-29 12:17:22 +05:30
static inline struct dma_chan *of_dma_simple_xlate(struct of_phandle_args *dma_spec,
2012-09-25 09:57:36 +05:30
struct of_dma *ofdma)
{
return NULL;
}
#define of_dma_xlate_by_chan_id NULL
2012-09-25 09:57:36 +05:30
#endif
2012-09-14 17:41:56 -05:00
#endif /* __LINUX_OF_DMA_H */