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

// SPDX-License-Identifier: GPL-2.0
//
// Renesas R-Car SRU/SCU/SSIU/SSI support
//
// Copyright (C) 2013 Renesas Solutions Corp.
// Kuninori Morimoto <[email protected]>
//
// Based on fsi.c
// Kuninori Morimoto <[email protected]>

/*
 * Renesas R-Car sound device structure
 *
 * Gen1
 *
 * SRU		: Sound Routing Unit
 *  - SRC	: Sampling Rate Converter
 *  - CMD
 *    - CTU	: Channel Count Conversion Unit
 *    - MIX	: Mixer
 *    - DVC	: Digital Volume and Mute Function
 *  - SSI	: Serial Sound Interface
 *
 * Gen2
 *
 * SCU		: Sampling Rate Converter Unit
 *  - SRC	: Sampling Rate Converter
 *  - CMD
 *   - CTU	: Channel Count Conversion Unit
 *   - MIX	: Mixer
 *   - DVC	: Digital Volume and Mute Function
 * SSIU		: Serial Sound Interface Unit
 *  - SSI	: Serial Sound Interface
 */

/*
 *	driver data Image
 *
 * rsnd_priv
 *   |
 *   | ** this depends on Gen1/Gen2
 *   |
 *   +- gen
 *   |
 *   | ** these depend on data path
 *   | ** gen and platform data control it
 *   |
 *   +- rdai[0]
 *   |   |		 sru     ssiu      ssi
 *   |   +- playback -> [mod] -> [mod] -> [mod] -> ...
 *   |   |
 *   |   |		 sru     ssiu      ssi
 *   |   +- capture  -> [mod] -> [mod] -> [mod] -> ...
 *   |
 *   +- rdai[1]
 *   |   |		 sru     ssiu      ssi
 *   |   +- playback -> [mod] -> [mod] -> [mod] -> ...
 *   |   |
 *   |   |		 sru     ssiu      ssi
 *   |   +- capture  -> [mod] -> [mod] -> [mod] -> ...
 *   ...
 *   |
 *   | ** these control ssi
 *   |
 *   +- ssi
 *   |  |
 *   |  +- ssi[0]
 *   |  +- ssi[1]
 *   |  +- ssi[2]
 *   |  ...
 *   |
 *   | ** these control src
 *   |
 *   +- src
 *      |
 *      +- src[0]
 *      +- src[1]
 *      +- src[2]
 *      ...
 *
 *
 * for_each_rsnd_dai(xx, priv, xx)
 *  rdai[0] => rdai[1] => rdai[2] => ...
 *
 * for_each_rsnd_mod(xx, rdai, xx)
 *  [mod] => [mod] => [mod] => ...
 *
 * rsnd_dai_call(xxx, fn )
 *  [mod]->fn() -> [mod]->fn() -> [mod]->fn()...
 *
 */

#include <linux/pm_runtime.h>
#include <linux/of_graph.h>
#include "rsnd.h"

#define RSND_RATES
#define RSND_FMTS

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

/*
 *	rsnd_mod functions
 */
void rsnd_mod_make_sure(struct rsnd_mod *mod, enum rsnd_mod_type type)
{}

struct dma_chan *rsnd_mod_dma_req(struct rsnd_dai_stream *io,
				  struct rsnd_mod *mod)
{}

#define MOD_NAME_NUM
#define MOD_NAME_SIZE
char *rsnd_mod_name(struct rsnd_mod *mod)
{}

u32 *rsnd_mod_get_status(struct rsnd_mod *mod,
			 struct rsnd_dai_stream *io,
			 enum rsnd_mod_type type)
{}

int rsnd_mod_id_raw(struct rsnd_mod *mod)
{}

int rsnd_mod_id(struct rsnd_mod *mod)
{}

int rsnd_mod_id_sub(struct rsnd_mod *mod)
{}

int rsnd_mod_init(struct rsnd_priv *priv,
		  struct rsnd_mod *mod,
		  struct rsnd_mod_ops *ops,
		  struct clk *clk,
		  enum rsnd_mod_type type,
		  int id)
{}

void rsnd_mod_quit(struct rsnd_mod *mod)
{}

void rsnd_mod_interrupt(struct rsnd_mod *mod,
			void (*callback)(struct rsnd_mod *mod,
					 struct rsnd_dai_stream *io))
{}

int rsnd_io_is_working(struct rsnd_dai_stream *io)
{}

int rsnd_runtime_channel_original_with_params(struct rsnd_dai_stream *io,
					      struct snd_pcm_hw_params *params)
{}

int rsnd_runtime_channel_after_ctu_with_params(struct rsnd_dai_stream *io,
					       struct snd_pcm_hw_params *params)
{}

int rsnd_channel_normalization(int chan)
{}

int rsnd_runtime_channel_for_ssi_with_params(struct rsnd_dai_stream *io,
					     struct snd_pcm_hw_params *params)
{}

int rsnd_runtime_is_multi_ssi(struct rsnd_dai_stream *io)
{}

int rsnd_runtime_is_tdm(struct rsnd_dai_stream *io)
{}

int rsnd_runtime_is_tdm_split(struct rsnd_dai_stream *io)
{}

/*
 *	ADINR function
 */
u32 rsnd_get_adinr_bit(struct rsnd_mod *mod, struct rsnd_dai_stream *io)
{}

/*
 *	DALIGN function
 */
u32 rsnd_get_dalign(struct rsnd_mod *mod, struct rsnd_dai_stream *io)
{}

u32 rsnd_get_busif_shift(struct rsnd_dai_stream *io, struct rsnd_mod *mod)
{}

/*
 *	rsnd_dai functions
 */
struct rsnd_mod *rsnd_mod_next(int *iterator,
			       struct rsnd_dai_stream *io,
			       enum rsnd_mod_type *array,
			       int array_size)
{}

static enum rsnd_mod_type rsnd_mod_sequence[][RSND_MOD_MAX] =;

static int rsnd_status_update(struct rsnd_dai_stream *io,
			      struct rsnd_mod *mod, enum rsnd_mod_type type,
			      int shift, int add, int timing)
{}

#define rsnd_dai_call(fn, io, param...)

int rsnd_dai_connect(struct rsnd_mod *mod,
		     struct rsnd_dai_stream *io,
		     enum rsnd_mod_type type)
{}

static void rsnd_dai_disconnect(struct rsnd_mod *mod,
				struct rsnd_dai_stream *io,
				enum rsnd_mod_type type)
{}

int rsnd_rdai_channels_ctrl(struct rsnd_dai *rdai,
			    int max_channels)
{}

int rsnd_rdai_ssi_lane_ctrl(struct rsnd_dai *rdai,
			    int ssi_lane)
{}

int rsnd_rdai_width_ctrl(struct rsnd_dai *rdai, int width)
{}

struct rsnd_dai *rsnd_rdai_get(struct rsnd_priv *priv, int id)
{}

static struct snd_soc_dai_driver
*rsnd_daidrv_get(struct rsnd_priv *priv, int id)
{}

#define rsnd_dai_to_priv(dai)
static struct rsnd_dai *rsnd_dai_to_rdai(struct snd_soc_dai *dai)
{}

/*
 *	rsnd_soc_dai functions
 */
void rsnd_dai_period_elapsed(struct rsnd_dai_stream *io)
{}

static void rsnd_dai_stream_init(struct rsnd_dai_stream *io,
				struct snd_pcm_substream *substream)
{}

static void rsnd_dai_stream_quit(struct rsnd_dai_stream *io)
{}

static
struct snd_soc_dai *rsnd_substream_to_dai(struct snd_pcm_substream *substream)
{}

static
struct rsnd_dai_stream *rsnd_rdai_to_io(struct rsnd_dai *rdai,
					struct snd_pcm_substream *substream)
{}

static int rsnd_soc_dai_trigger(struct snd_pcm_substream *substream, int cmd,
			    struct snd_soc_dai *dai)
{}

static int rsnd_soc_dai_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
{}

static int rsnd_soc_set_dai_tdm_slot(struct snd_soc_dai *dai,
				     u32 tx_mask, u32 rx_mask,
				     int slots, int slot_width)
{}

static unsigned int rsnd_soc_hw_channels_list[] =;

static unsigned int rsnd_soc_hw_rate_list[] =;

static int rsnd_soc_hw_rule(struct rsnd_dai *rdai,
			    unsigned int *list, int list_num,
			    struct snd_interval *baseline, struct snd_interval *iv,
			    struct rsnd_dai_stream *io, char *unit)
{}

static int rsnd_soc_hw_rule_rate(struct snd_pcm_hw_params *params,
				 struct snd_pcm_hw_rule *rule)
{}

static int rsnd_soc_hw_rule_channels(struct snd_pcm_hw_params *params,
				     struct snd_pcm_hw_rule *rule)
{}

static const struct snd_pcm_hardware rsnd_pcm_hardware =;

static int rsnd_soc_dai_startup(struct snd_pcm_substream *substream,
				struct snd_soc_dai *dai)
{}

static void rsnd_soc_dai_shutdown(struct snd_pcm_substream *substream,
				  struct snd_soc_dai *dai)
{}

static int rsnd_soc_dai_prepare(struct snd_pcm_substream *substream,
				struct snd_soc_dai *dai)
{}

static const u64 rsnd_soc_dai_formats[] =;

static void rsnd_parse_tdm_split_mode(struct rsnd_priv *priv,
				      struct rsnd_dai_stream *io,
				      struct device_node *dai_np)
{}

static void rsnd_parse_connect_simple(struct rsnd_priv *priv,
				      struct rsnd_dai_stream *io,
				      struct device_node *dai_np)
{}

static void rsnd_parse_connect_graph(struct rsnd_priv *priv,
				     struct rsnd_dai_stream *io,
				     struct device_node *endpoint)
{}

void rsnd_parse_connect_common(struct rsnd_dai *rdai, char *name,
		struct rsnd_mod* (*mod_get)(struct rsnd_priv *priv, int id),
		struct device_node *node,
		struct device_node *playback,
		struct device_node *capture)
{}

int rsnd_node_fixed_index(struct device *dev, struct device_node *node, char *name, int idx)
{}

int rsnd_node_count(struct rsnd_priv *priv, struct device_node *node, char *name)
{}

static int rsnd_dai_of_node(struct rsnd_priv *priv, int *is_graph)
{}


#define PREALLOC_BUFFER
#define PREALLOC_BUFFER_MAX

static int rsnd_preallocate_pages(struct snd_soc_pcm_runtime *rtd,
				  struct rsnd_dai_stream *io,
				  int stream)
{}

static int rsnd_soc_dai_pcm_new(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai)
{}

static const struct snd_soc_dai_ops rsnd_soc_dai_ops =;

static void __rsnd_dai_probe(struct rsnd_priv *priv,
			     struct device_node *dai_np,
			     struct device_node *node_np,
			     uint32_t node_arg,
			     int dai_i)
{}

static int rsnd_dai_probe(struct rsnd_priv *priv)
{}

/*
 *		pcm ops
 */
static int rsnd_hw_update(struct snd_pcm_substream *substream,
			  struct snd_pcm_hw_params *hw_params)
{}

static int rsnd_hw_params(struct snd_soc_component *component,
			  struct snd_pcm_substream *substream,
			  struct snd_pcm_hw_params *hw_params)
{}

static int rsnd_hw_free(struct snd_soc_component *component,
			struct snd_pcm_substream *substream)
{}

static snd_pcm_uframes_t rsnd_pointer(struct snd_soc_component *component,
				      struct snd_pcm_substream *substream)
{}

/*
 *		snd_kcontrol
 */
static int rsnd_kctrl_info(struct snd_kcontrol *kctrl,
			   struct snd_ctl_elem_info *uinfo)
{}

static int rsnd_kctrl_get(struct snd_kcontrol *kctrl,
			  struct snd_ctl_elem_value *uc)
{}

static int rsnd_kctrl_put(struct snd_kcontrol *kctrl,
			  struct snd_ctl_elem_value *uc)
{}

int rsnd_kctrl_accept_anytime(struct rsnd_dai_stream *io)
{}

int rsnd_kctrl_accept_runtime(struct rsnd_dai_stream *io)
{}

struct rsnd_kctrl_cfg *rsnd_kctrl_init_m(struct rsnd_kctrl_cfg_m *cfg)
{}

struct rsnd_kctrl_cfg *rsnd_kctrl_init_s(struct rsnd_kctrl_cfg_s *cfg)
{}

const char * const volume_ramp_rate[] =;

int rsnd_kctrl_new(struct rsnd_mod *mod,
		   struct rsnd_dai_stream *io,
		   struct snd_soc_pcm_runtime *rtd,
		   const unsigned char *name,
		   int (*accept)(struct rsnd_dai_stream *io),
		   void (*update)(struct rsnd_dai_stream *io,
				  struct rsnd_mod *mod),
		   struct rsnd_kctrl_cfg *cfg,
		   const char * const *texts,
		   int size,
		   u32 max)
{}

/*
 *		snd_soc_component
 */
static const struct snd_soc_component_driver rsnd_soc_component =;

static int rsnd_rdai_continuance_probe(struct rsnd_priv *priv,
				       struct rsnd_dai_stream *io)
{}

/*
 *	rsnd probe
 */
static int rsnd_probe(struct platform_device *pdev)
{}

static void rsnd_remove(struct platform_device *pdev)
{}

static int __maybe_unused rsnd_suspend(struct device *dev)
{}

static int __maybe_unused rsnd_resume(struct device *dev)
{}

static const struct dev_pm_ops rsnd_pm_ops =;

static struct platform_driver rsnd_driver =;
module_platform_driver();

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