linux/sound/soc/sh/rcar/dma.c

// SPDX-License-Identifier: GPL-2.0
//
// Renesas R-Car Audio DMAC support
//
// Copyright (C) 2015 Renesas Electronics Corp.
// Copyright (c) 2015 Kuninori Morimoto <[email protected]>

#include <linux/delay.h>
#include <linux/of_dma.h>
#include <sound/dmaengine_pcm.h>
#include "rsnd.h"

/*
 * Audio DMAC peri peri register
 */
#define PDMASAR
#define PDMADAR
#define PDMACHCR

/* 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)

/* for DEBUG */
static struct rsnd_mod_ops mem_ops =;

static struct rsnd_mod mem =;

/*
 *		Audio DMAC
 */
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 =;

/*
 *		Audio DMAC peri peri
 */
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 =;

/*
 *		Common DMAC Interface
 */

/*
 *	DMA read/write register offset
 *
 *	RSND_xxx_I_N	for Audio DMAC input
 *	RSND_xxx_O_N	for Audio DMAC output
 *	RSND_xxx_I_P	for Audio DMAC peri peri input
 *	RSND_xxx_O_P	for Audio DMAC peri peri output
 *
 *	ex) R-Car H2 case
 *	      mod        / DMAC in    / DMAC out   / DMAC PP in / DMAC pp out
 *	SSI : 0xec541000 / 0xec241008 / 0xec24100c
 *	SSIU: 0xec541000 / 0xec100000 / 0xec100000 / 0xec400000 / 0xec400000
 *	SCU : 0xec500000 / 0xec000000 / 0xec004000 / 0xec300000 / 0xec304000
 *	CMD : 0xec500000 /            / 0xec008000                0xec308000
 */
#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)
{}

/*
 *	Gen4 DMA read/write register offset
 *
 *	ex) R-Car V4H case
 *		  mod		/ SYS-DMAC in	/ SYS-DMAC out
 *	SSI_SDMC: 0xec400000	/ 0xec400000	/ 0xec400000
 */
#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)
{}