linux/drivers/dma/mmp_tdma.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * Driver For Marvell Two-channel DMA Engine
 *
 * Copyright: Marvell International Ltd.
 */

#include <linux/err.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/types.h>
#include <linux/interrupt.h>
#include <linux/dma-mapping.h>
#include <linux/slab.h>
#include <linux/dmaengine.h>
#include <linux/platform_device.h>
#include <linux/property.h>
#include <linux/device.h>
#include <linux/genalloc.h>
#include <linux/of_dma.h>

#include "dmaengine.h"

/*
 * Two-Channel DMA registers
 */
#define TDBCR
#define TDSAR
#define TDDAR
#define TDNDPR
#define TDCR
#define TDCP
#define TDCDPR
#define TDIMR
#define TDISR

/* Two-Channel DMA Control Register */
#define TDCR_SSZ_8_BITS
#define TDCR_SSZ_12_BITS
#define TDCR_SSZ_16_BITS
#define TDCR_SSZ_20_BITS
#define TDCR_SSZ_24_BITS
#define TDCR_SSZ_32_BITS
#define TDCR_SSZ_SHIFT
#define TDCR_SSZ_MASK
#define TDCR_SSPMOD
#define TDCR_ABR
#define TDCR_CDE
#define TDCR_PACKMOD
#define TDCR_CHANACT
#define TDCR_FETCHND
#define TDCR_CHANEN
#define TDCR_INTMODE
#define TDCR_CHAINMOD
#define TDCR_BURSTSZ_MSK
#define TDCR_BURSTSZ_4B
#define TDCR_BURSTSZ_8B
#define TDCR_BURSTSZ_16B
#define TDCR_BURSTSZ_32B
#define TDCR_BURSTSZ_64B
#define TDCR_BURSTSZ_SQU_1B
#define TDCR_BURSTSZ_SQU_2B
#define TDCR_BURSTSZ_SQU_4B
#define TDCR_BURSTSZ_SQU_8B
#define TDCR_BURSTSZ_SQU_16B
#define TDCR_BURSTSZ_SQU_32B
#define TDCR_BURSTSZ_128B
#define TDCR_DSTDIR_MSK
#define TDCR_DSTDIR_ADDR_HOLD
#define TDCR_DSTDIR_ADDR_INC
#define TDCR_SRCDIR_MSK
#define TDCR_SRCDIR_ADDR_HOLD
#define TDCR_SRCDIR_ADDR_INC
#define TDCR_DSTDESCCONT
#define TDCR_SRCDESTCONT

/* Two-Channel DMA Int Mask Register */
#define TDIMR_COMP

/* Two-Channel DMA Int Status Register */
#define TDISR_COMP

/*
 * Two-Channel DMA Descriptor Struct
 * NOTE: desc's buf must be aligned to 16 bytes.
 */
struct mmp_tdma_desc {};

enum mmp_tdma_type {};

#define TDMA_MAX_XFER_BYTES

struct mmp_tdma_chan {};

#define TDMA_CHANNEL_NUM
struct mmp_tdma_device {};

#define to_mmp_tdma_chan(dchan)

static int mmp_tdma_config_write(struct dma_chan *chan,
				 enum dma_transfer_direction dir,
				 struct dma_slave_config *dmaengine_cfg);

static void mmp_tdma_chan_set_desc(struct mmp_tdma_chan *tdmac, dma_addr_t phys)
{}

static void mmp_tdma_enable_irq(struct mmp_tdma_chan *tdmac, bool enable)
{}

static void mmp_tdma_enable_chan(struct mmp_tdma_chan *tdmac)
{}

static int mmp_tdma_disable_chan(struct dma_chan *chan)
{}

static int mmp_tdma_resume_chan(struct dma_chan *chan)
{}

static int mmp_tdma_pause_chan(struct dma_chan *chan)
{}

static int mmp_tdma_config_chan(struct dma_chan *chan)
{}

static int mmp_tdma_clear_chan_irq(struct mmp_tdma_chan *tdmac)
{}

static size_t mmp_tdma_get_pos(struct mmp_tdma_chan *tdmac)
{}

static irqreturn_t mmp_tdma_chan_handler(int irq, void *dev_id)
{}

static irqreturn_t mmp_tdma_int_handler(int irq, void *dev_id)
{}

static void dma_do_tasklet(struct tasklet_struct *t)
{}

static void mmp_tdma_free_descriptor(struct mmp_tdma_chan *tdmac)
{}

static dma_cookie_t mmp_tdma_tx_submit(struct dma_async_tx_descriptor *tx)
{}

static int mmp_tdma_alloc_chan_resources(struct dma_chan *chan)
{}

static void mmp_tdma_free_chan_resources(struct dma_chan *chan)
{}

static struct mmp_tdma_desc *mmp_tdma_alloc_descriptor(struct mmp_tdma_chan *tdmac)
{}

static struct dma_async_tx_descriptor *mmp_tdma_prep_dma_cyclic(
		struct dma_chan *chan, dma_addr_t dma_addr, size_t buf_len,
		size_t period_len, enum dma_transfer_direction direction,
		unsigned long flags)
{}

static int mmp_tdma_terminate_all(struct dma_chan *chan)
{}

static int mmp_tdma_config(struct dma_chan *chan,
			   struct dma_slave_config *dmaengine_cfg)
{}

static int mmp_tdma_config_write(struct dma_chan *chan,
				 enum dma_transfer_direction dir,
				 struct dma_slave_config *dmaengine_cfg)
{}

static enum dma_status mmp_tdma_tx_status(struct dma_chan *chan,
			dma_cookie_t cookie, struct dma_tx_state *txstate)
{}

static void mmp_tdma_issue_pending(struct dma_chan *chan)
{}

static void mmp_tdma_remove(struct platform_device *pdev)
{}

static int mmp_tdma_chan_init(struct mmp_tdma_device *tdev,
					int idx, int irq,
					int type, struct gen_pool *pool)
{}

struct mmp_tdma_filter_param {};

static bool mmp_tdma_filter_fn(struct dma_chan *chan, void *fn_param)
{}

static struct dma_chan *mmp_tdma_xlate(struct of_phandle_args *dma_spec,
			       struct of_dma *ofdma)
{}

static const struct of_device_id mmp_tdma_dt_ids[] =;
MODULE_DEVICE_TABLE(of, mmp_tdma_dt_ids);

static int mmp_tdma_probe(struct platform_device *pdev)
{}

static struct platform_driver mmp_tdma_driver =;

module_platform_driver();

MODULE_LICENSE();
MODULE_DESCRIPTION();
MODULE_ALIAS();
MODULE_AUTHOR();
MODULE_AUTHOR();