linux/sound/soc/intel/skylake/skl-topology.h

/* SPDX-License-Identifier: GPL-2.0-only */
/*
 *  skl_topology.h - Intel HDA Platform topology header file
 *
 *  Copyright (C) 2014-15 Intel Corp
 *  Author: Jeeja KP <[email protected]>
 *  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 *
 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 */

#ifndef __SKL_TOPOLOGY_H__
#define __SKL_TOPOLOGY_H__

#include <linux/types.h>

#include <sound/hdaudio_ext.h>
#include <sound/soc.h>
#include <uapi/sound/skl-tplg-interface.h>
#include "skl.h"

#define BITS_PER_BYTE
#define MAX_TS_GROUPS
#define MAX_DMIC_TS_GROUPS
#define MAX_FIXED_DMIC_PARAMS_SIZE

/* Maximum number of coefficients up down mixer module */
#define UP_DOWN_MIXER_MAX_COEFF

#define MODULE_MAX_IN_PINS
#define MODULE_MAX_OUT_PINS

#define SKL_MIC_CH_SUPPORT
#define SKL_MIC_MAX_CH_SUPPORT
#define SKL_DEFAULT_MIC_SEL_GAIN
#define SKL_MIC_SEL_SWITCH

#define SKL_OUTPUT_PIN
#define SKL_INPUT_PIN
#define SKL_MAX_PATH_CONFIGS
#define SKL_MAX_MODULES_IN_PIPE
#define SKL_MAX_MODULE_FORMATS
#define SKL_MAX_MODULE_RESOURCES

enum skl_channel_index {};

enum skl_bitdepth {};


enum skl_s_freq {};

#define SKL_MAX_PARAMS_TYPES

enum skl_widget_type {};

struct skl_audio_data_format {} __packed;

struct skl_base_cfg {};

struct skl_cpr_gtw_cfg {} __packed;

struct skl_dma_control {} __packed;

struct skl_cpr_cfg {} __packed;

struct skl_cpr_pin_fmt {} __packed;

struct skl_src_module_cfg {} __packed;

struct skl_up_down_mixer_cfg {} __packed;

struct skl_pin_format {} __packed;

struct skl_base_cfg_ext {} __packed;

struct skl_algo_cfg {} __packed;

struct skl_base_outfmt_cfg {} __packed;

enum skl_dma_type {};

skl_ssp_dma_node;

skl_connector_node_id;

struct skl_module_fmt {};

struct skl_module_cfg;

struct skl_mod_inst_map {};

struct skl_uuid_inst_map {} __packed;

struct skl_kpb_params {};

struct skl_module_inst_id {};

enum skl_module_pin_state {};

struct skl_module_pin {};

struct skl_specific_cfg {};

enum skl_pipe_state {};

struct skl_pipe_module {};

struct skl_pipe_params {};

struct skl_pipe_fmt {};

struct skl_pipe_mcfg {};

struct skl_path_config {};

struct skl_pipe {};

enum skl_module_state {};

enum d0i3_capability {};

struct skl_module_pin_fmt {};

struct skl_module_iface {};

struct skl_module_pin_resources {};

struct skl_module_res {};

struct skl_module {};

struct skl_module_cfg {};

struct skl_algo_data {};

struct skl_pipeline {};

struct skl_module_deferred_bind {};

struct skl_mic_sel_config {} __packed;

enum skl_channel {};

static inline struct skl_dev *get_skl_ctx(struct device *dev)
{}

int skl_tplg_be_update_params(struct snd_soc_dai *dai,
	struct skl_pipe_params *params);
int skl_dsp_set_dma_control(struct skl_dev *skl, u32 *caps,
			u32 caps_size, u32 node_id);
void skl_tplg_set_be_dmic_config(struct snd_soc_dai *dai,
	struct skl_pipe_params *params, int stream);
int skl_tplg_init(struct snd_soc_component *component,
				struct hdac_bus *bus);
void skl_tplg_exit(struct snd_soc_component *component,
				struct hdac_bus *bus);
struct skl_module_cfg *skl_tplg_fe_get_cpr_module(
		struct snd_soc_dai *dai, int stream);
int skl_tplg_update_pipe_params(struct device *dev,
		struct skl_module_cfg *mconfig, struct skl_pipe_params *params);

void skl_tplg_d0i3_get(struct skl_dev *skl, enum d0i3_capability caps);
void skl_tplg_d0i3_put(struct skl_dev *skl, enum d0i3_capability caps);

int skl_create_pipeline(struct skl_dev *skl, struct skl_pipe *pipe);

int skl_run_pipe(struct skl_dev *skl, struct skl_pipe *pipe);

int skl_pause_pipe(struct skl_dev *skl, struct skl_pipe *pipe);

int skl_delete_pipe(struct skl_dev *skl, struct skl_pipe *pipe);

int skl_stop_pipe(struct skl_dev *skl, struct skl_pipe *pipe);

int skl_reset_pipe(struct skl_dev *skl, struct skl_pipe *pipe);

int skl_init_module(struct skl_dev *skl, struct skl_module_cfg *mconfig);

int skl_bind_modules(struct skl_dev *skl, struct skl_module_cfg
	*src_mcfg, struct skl_module_cfg *dst_mcfg);

int skl_unbind_modules(struct skl_dev *skl, struct skl_module_cfg
	*src_mcfg, struct skl_module_cfg *dst_mcfg);

int skl_set_module_params(struct skl_dev *skl, u32 *params, int size,
			u32 param_id, struct skl_module_cfg *mcfg);
int skl_get_module_params(struct skl_dev *skl, u32 *params, int size,
			  u32 param_id, struct skl_module_cfg *mcfg);

struct skl_module_cfg *skl_tplg_be_get_cpr_module(struct snd_soc_dai *dai,
								int stream);
enum skl_bitdepth skl_get_bit_depth(int params);
int skl_pcm_host_dma_prepare(struct device *dev,
			struct skl_pipe_params *params);
int skl_pcm_link_dma_prepare(struct device *dev,
			struct skl_pipe_params *params);

int skl_dai_load(struct snd_soc_component *cmp, int index,
		struct snd_soc_dai_driver *dai_drv,
		struct snd_soc_tplg_pcm *pcm, struct snd_soc_dai *dai);
void skl_tplg_add_moduleid_in_bind_params(struct skl_dev *skl,
				struct snd_soc_dapm_widget *w);
#endif