#include <linux/delay.h>
#include <linux/of_dma.h>
#include <sound/dmaengine_pcm.h>
#include "rsnd.h"
#define PDMASAR …
#define PDMADAR …
#define PDMACHCR …
#define PDMACHCR_DE …
struct rsnd_dmaen { … };
struct rsnd_dmapp { … };
struct rsnd_dma { … };
struct rsnd_dma_ctrl { … };
#define rsnd_priv_to_dmac(p) …
#define rsnd_mod_to_dma(_mod) …
#define rsnd_dma_to_dmaen(dma) …
#define rsnd_dma_to_dmapp(dma) …
static struct rsnd_mod_ops mem_ops = …;
static struct rsnd_mod mem = …;
static struct dma_chan *rsnd_dmaen_request_channel(struct rsnd_dai_stream *io,
struct rsnd_mod *mod_from,
struct rsnd_mod *mod_to)
{ … }
static int rsnd_dmaen_stop(struct rsnd_mod *mod,
struct rsnd_dai_stream *io,
struct rsnd_priv *priv)
{ … }
static int rsnd_dmaen_cleanup(struct rsnd_mod *mod,
struct rsnd_dai_stream *io,
struct rsnd_priv *priv)
{ … }
static int rsnd_dmaen_prepare(struct rsnd_mod *mod,
struct rsnd_dai_stream *io,
struct rsnd_priv *priv)
{ … }
static int rsnd_dmaen_start(struct rsnd_mod *mod,
struct rsnd_dai_stream *io,
struct rsnd_priv *priv)
{ … }
struct dma_chan *rsnd_dma_request_channel(struct device_node *of_node, char *name,
struct rsnd_mod *mod, char *x)
{ … }
static int rsnd_dmaen_attach(struct rsnd_dai_stream *io,
struct rsnd_dma *dma,
struct rsnd_mod *mod_from, struct rsnd_mod *mod_to)
{ … }
static int rsnd_dmaen_pointer(struct rsnd_mod *mod,
struct rsnd_dai_stream *io,
snd_pcm_uframes_t *pointer)
{ … }
static struct rsnd_mod_ops rsnd_dmaen_ops = …;
static const u8 gen2_id_table_ssiu[] = …;
static const u8 gen2_id_table_scu[] = …;
static const u8 gen2_id_table_cmd[] = …;
static u32 rsnd_dmapp_get_id(struct rsnd_dai_stream *io,
struct rsnd_mod *mod)
{ … }
static u32 rsnd_dmapp_get_chcr(struct rsnd_dai_stream *io,
struct rsnd_mod *mod_from,
struct rsnd_mod *mod_to)
{ … }
#define rsnd_dmapp_addr(dmac, dma, reg) …
static void rsnd_dmapp_write(struct rsnd_dma *dma, u32 data, u32 reg)
{ … }
static u32 rsnd_dmapp_read(struct rsnd_dma *dma, u32 reg)
{ … }
static void rsnd_dmapp_bset(struct rsnd_dma *dma, u32 data, u32 mask, u32 reg)
{ … }
static int rsnd_dmapp_stop(struct rsnd_mod *mod,
struct rsnd_dai_stream *io,
struct rsnd_priv *priv)
{ … }
static int rsnd_dmapp_start(struct rsnd_mod *mod,
struct rsnd_dai_stream *io,
struct rsnd_priv *priv)
{ … }
static int rsnd_dmapp_attach(struct rsnd_dai_stream *io,
struct rsnd_dma *dma,
struct rsnd_mod *mod_from, struct rsnd_mod *mod_to)
{ … }
#ifdef CONFIG_DEBUG_FS
static void rsnd_dmapp_debug_info(struct seq_file *m,
struct rsnd_dai_stream *io,
struct rsnd_mod *mod)
{ … }
#define DEBUG_INFO …
#else
#define DEBUG_INFO
#endif
static struct rsnd_mod_ops rsnd_dmapp_ops = …;
#define RDMA_SSI_I_N(addr, i) …
#define RDMA_SSI_O_N(addr, i) …
#define RDMA_SSIU_I_N(addr, i, j) …
#define RDMA_SSIU_O_N(addr, i, j) …
#define RDMA_SSIU_I_P(addr, i, j) …
#define RDMA_SSIU_O_P(addr, i, j) …
#define RDMA_SRC_I_N(addr, i) …
#define RDMA_SRC_O_N(addr, i) …
#define RDMA_SRC_I_P(addr, i) …
#define RDMA_SRC_O_P(addr, i) …
#define RDMA_CMD_O_N(addr, i) …
#define RDMA_CMD_O_P(addr, i) …
static dma_addr_t
rsnd_gen2_dma_addr(struct rsnd_dai_stream *io,
struct rsnd_mod *mod,
int is_play, int is_from)
{ … }
#define RDMA_SSI_SDMC(addr, i) …
static dma_addr_t
rsnd_gen4_dma_addr(struct rsnd_dai_stream *io, struct rsnd_mod *mod,
int is_play, int is_from)
{ … }
static dma_addr_t rsnd_dma_addr(struct rsnd_dai_stream *io,
struct rsnd_mod *mod,
int is_play, int is_from)
{ … }
#define MOD_MAX …
static void rsnd_dma_of_path(struct rsnd_mod *this,
struct rsnd_dai_stream *io,
int is_play,
struct rsnd_mod **mod_from,
struct rsnd_mod **mod_to)
{ … }
static int rsnd_dma_alloc(struct rsnd_dai_stream *io, struct rsnd_mod *mod,
struct rsnd_mod **dma_mod)
{ … }
int rsnd_dma_attach(struct rsnd_dai_stream *io, struct rsnd_mod *mod,
struct rsnd_mod **dma_mod)
{ … }
int rsnd_dma_probe(struct rsnd_priv *priv)
{ … }