#include <linux/delay.h>
#include <linux/shdma-base.h>
#include <linux/dmaengine.h>
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/module.h>
#include <linux/pm_runtime.h>
#include <linux/slab.h>
#include <linux/spinlock.h>
#include "../dmaengine.h"
enum shdma_desc_status { … };
#define NR_DESCS_PER_CHANNEL …
#define to_shdma_chan(c) …
#define to_shdma_dev(d) …
static unsigned int slave_num = …;
module_param(slave_num, uint, 0444);
static unsigned long *shdma_slave_used;
static void shdma_chan_xfer_ld_queue(struct shdma_chan *schan)
{ … }
static dma_cookie_t shdma_tx_submit(struct dma_async_tx_descriptor *tx)
{ … }
static struct shdma_desc *shdma_get_desc(struct shdma_chan *schan)
{ … }
static int shdma_setup_slave(struct shdma_chan *schan, dma_addr_t slave_addr)
{ … }
static int shdma_alloc_chan_resources(struct dma_chan *chan)
{ … }
bool shdma_chan_filter(struct dma_chan *chan, void *arg)
{ … }
EXPORT_SYMBOL(…);
static dma_async_tx_callback __ld_cleanup(struct shdma_chan *schan, bool all)
{ … }
static void shdma_chan_ld_cleanup(struct shdma_chan *schan, bool all)
{ … }
static void shdma_free_chan_resources(struct dma_chan *chan)
{ … }
static struct shdma_desc *shdma_add_desc(struct shdma_chan *schan,
unsigned long flags, dma_addr_t *dst, dma_addr_t *src, size_t *len,
struct shdma_desc **first, enum dma_transfer_direction direction)
{ … }
static struct dma_async_tx_descriptor *shdma_prep_sg(struct shdma_chan *schan,
struct scatterlist *sgl, unsigned int sg_len, dma_addr_t *addr,
enum dma_transfer_direction direction, unsigned long flags, bool cyclic)
{ … }
static struct dma_async_tx_descriptor *shdma_prep_memcpy(
struct dma_chan *chan, dma_addr_t dma_dest, dma_addr_t dma_src,
size_t len, unsigned long flags)
{ … }
static struct dma_async_tx_descriptor *shdma_prep_slave_sg(
struct dma_chan *chan, struct scatterlist *sgl, unsigned int sg_len,
enum dma_transfer_direction direction, unsigned long flags, void *context)
{ … }
#define SHDMA_MAX_SG_LEN …
static struct dma_async_tx_descriptor *shdma_prep_dma_cyclic(
struct dma_chan *chan, dma_addr_t buf_addr, size_t buf_len,
size_t period_len, enum dma_transfer_direction direction,
unsigned long flags)
{ … }
static int shdma_terminate_all(struct dma_chan *chan)
{ … }
static int shdma_config(struct dma_chan *chan,
struct dma_slave_config *config)
{ … }
static void shdma_issue_pending(struct dma_chan *chan)
{ … }
static enum dma_status shdma_tx_status(struct dma_chan *chan,
dma_cookie_t cookie,
struct dma_tx_state *txstate)
{ … }
bool shdma_reset(struct shdma_dev *sdev)
{ … }
EXPORT_SYMBOL(…);
static irqreturn_t chan_irq(int irq, void *dev)
{ … }
static irqreturn_t chan_irqt(int irq, void *dev)
{ … }
int shdma_request_irq(struct shdma_chan *schan, int irq,
unsigned long flags, const char *name)
{ … }
EXPORT_SYMBOL(…);
void shdma_chan_probe(struct shdma_dev *sdev,
struct shdma_chan *schan, int id)
{ … }
EXPORT_SYMBOL(…);
void shdma_chan_remove(struct shdma_chan *schan)
{ … }
EXPORT_SYMBOL(…);
int shdma_init(struct device *dev, struct shdma_dev *sdev,
int chan_num)
{ … }
EXPORT_SYMBOL(…);
void shdma_cleanup(struct shdma_dev *sdev)
{ … }
EXPORT_SYMBOL(…);
static int __init shdma_enter(void)
{ … }
module_init(…) …;
static void __exit shdma_exit(void)
{ … }
module_exit(shdma_exit);
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;