linux/sound/soc/intel/atom/sst-atom-controls.h

/* SPDX-License-Identifier: GPL-2.0-only */
/*
 *  sst-atom-controls.h - Intel MID Platform driver header file
 *
 *  Copyright (C) 2013-14 Intel Corp
 *  Author: Ramesh Babu <[email protected]>
 *  	Omair M Abdullah <[email protected]>
 *  	Samreen Nilofer <[email protected]>
 *  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 *
 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 */

#ifndef __SST_ATOM_CONTROLS_H__
#define __SST_ATOM_CONTROLS_H__

#include <sound/soc.h>
#include <sound/tlv.h>

enum {};

/* define a bit for each mixer input */
#define SST_MIX_IP(x)

#define SST_IP_MODEM
#define SST_IP_BT
#define SST_IP_CODEC0
#define SST_IP_CODEC1
#define SST_IP_LOOP0
#define SST_IP_LOOP1
#define SST_IP_LOOP2
#define SST_IP_PROBE
#define SST_IP_VOIP
#define SST_IP_PCM0
#define SST_IP_PCM1
#define SST_IP_MEDIA0
#define SST_IP_MEDIA1
#define SST_IP_MEDIA2
#define SST_IP_MEDIA3

#define SST_IP_LAST

#define SST_SWM_INPUT_COUNT
#define SST_CMD_SWM_MAX_INPUTS

#define SST_PATH_ID_SHIFT
#define SST_DEFAULT_LOCATION_ID
#define SST_DEFAULT_CELL_NBR
#define SST_DEFAULT_MODULE_ID

/*
 * Audio DSP Path Ids. Specified by the audio DSP FW
 */
enum sst_path_index {};

/*
 * path IDs
 */
enum sst_swm_inputs {};

/*
 * path IDs
 */
enum sst_swm_outputs {};

enum sst_ipc_msg {};

enum sst_cmd_type {};

enum sst_task {};

enum sst_type {};

enum sst_flag {};

/*
 * Enumeration for indexing the gain cells in VB_SET_GAIN DSP command
 */
enum sst_gain_index {};

/*
 * Audio DSP module IDs specified by FW spec
 * TODO: Update with all modules
 */
enum sst_module_id {};

enum sst_cmd {};

enum sst_dsp_switch {};

enum sst_path_switch {};

enum sst_swm_state {};

#define SST_FILL_LOCATION_IDS(dst, cell_idx, pipe_id)
#define SST_FILL_LOCATION_ID(dst, loc_id)
#define SST_FILL_MODULE_ID(dst, mod_id)

#define SST_FILL_DESTINATION1(dst, id)
#define SST_FILL_DESTINATION2(dst, loc_id, mod_id)
#define SST_FILL_DESTINATION3(dst, cell_idx, path_id, mod_id)

#define SST_FILL_DESTINATION(level, dst, ...)
#define SST_FILL_DEFAULT_DESTINATION(dst)

struct sst_destination_id {} __packed;
struct sst_dsp_header {} __packed;

/*
 *
 * Common Commands
 *
 */
struct sst_cmd_generic {} __packed;

struct swm_input_ids {} __packed;

struct sst_cmd_set_swm {} __packed;

struct sst_cmd_set_media_path {} __packed;

struct pcm_cfg {} __packed;

struct sst_cmd_set_speech_path {} __packed;

struct gain_cell {} __packed;

#define NUM_GAIN_CELLS
struct sst_cmd_set_gain_dual {} __packed;
struct sst_cmd_set_params {} __packed;


struct sst_cmd_sba_vb_start {} __packed;

sba_media_loop_params __packed;

struct sst_cmd_sba_set_media_loop_map {} __packed;

struct sst_cmd_tone_stop {} __packed;

enum sst_ssp_mode {};

enum sst_ssp_pcm_mode {};

enum sst_ssp_duplex {};

enum sst_ssp_fs_frequency {};

enum sst_ssp_fs_polarity {};

enum sst_ssp_protocol {};

enum sst_ssp_port_id {};

struct sst_cmd_sba_hw_set_ssp {} __packed;

#define SST_MAX_TDM_SLOTS

struct sst_param_sba_ssp_slot_map {} __packed;

enum {};

/**** widget defines *****/

#define SST_MODULE_GAIN
#define SST_MODULE_ALGO

#define SST_FMT_MONO
#define SST_FMT_STEREO

/* physical SSP numbers */
enum {};

#define SST_NUM_SSPS
#define SST_MAX_SSP_MUX
#define SST_MAX_SSP_DOMAINS

struct sst_module {};

struct sst_ssp_config {};

struct sst_ssp_cfg {};

struct sst_ids {};


#define SST_AIF_IN(wname, wevent)

#define SST_AIF_OUT(wname, wevent)

#define SST_INPUT(wname, wevent)

#define SST_OUTPUT(wname, wevent)

#define SST_DAPM_OUTPUT(wname, wloc_id, wtask_id, wformat, wevent)

#define SST_PATH(wname, wtask, wloc_id, wevent, wflags)

#define SST_LINKED_PATH(wname, wtask, wloc_id, linked_wname, wevent, wflags)

#define SST_PATH_MEDIA_LOOP(wname, wtask, wloc_id, wformat, wevent, wflags)

/* output is triggered before input */
#define SST_PATH_INPUT(name, task_id, loc_id, event)

#define SST_PATH_LINKED_INPUT(name, task_id, loc_id, linked_wname, event)

#define SST_PATH_OUTPUT(name, task_id, loc_id, event)

#define SST_PATH_LINKED_OUTPUT(name, task_id, loc_id, linked_wname, event)

#define SST_PATH_MEDIA_LOOP_OUTPUT(name, task_id, loc_id, format, event)


#define SST_SWM_MIXER(wname, wreg, wtask, wloc_id, wcontrols, wevent)

enum sst_gain_kcontrol_type {};

struct sst_gain_mixer_control {};

struct sst_gain_value {};
#define SST_GAIN_VOLUME_DEFAULT
#define SST_GAIN_RAMP_DURATION_DEFAULT
#define SST_GAIN_MUTE_DEFAULT

#define SST_GAIN_KCONTROL_TLV(xname, xhandler_get, xhandler_put, \
			      xmod, xpipe, xinstance, xtask, tlv_array, xgain_val, \
			      xmin, xmax, xpname)

#define SST_GAIN_KCONTROL_INT(xname, xhandler_get, xhandler_put, \
			      xmod, xpipe, xinstance, xtask, xtype, xgain_val, \
			      xmin, xmax, xpname)

#define SST_GAIN_KCONTROL_BOOL(xname, xhandler_get, xhandler_put,\
			       xmod, xpipe, xinstance, xtask, xgain_val, xpname)
#define SST_CONTROL_NAME(xpname, xmname, xinstance, xtype)

#define SST_COMBO_CONTROL_NAME(xpname, xmname, xinstance, xtype, xsubmodule)

/*
 * 3 Controls for each Gain module
 * e.g.	- pcm0_in Gain 0 Volume
 *	- pcm0_in Gain 0 Ramp Delay
 *	- pcm0_in Gain 0 Switch
 */
#define SST_GAIN_KCONTROLS(xpname, xmname, xmin_gain, xmax_gain, xmin_tc, xmax_tc, \
			   xhandler_get, xhandler_put, \
			   xmod, xpipe, xinstance, xtask, tlv_array, xgain_val)

#define SST_GAIN_TC_MIN
#define SST_GAIN_TC_MAX
#define SST_GAIN_MIN_VALUE
#define SST_GAIN_MAX_VALUE

enum sst_algo_kcontrol_type {};

struct sst_algo_control {};

/* size of the control = size of params + size of length field */
#define SST_ALGO_CTL_VALUE(xcount, xtype, xpipe, xmod, xtask, xcmd)

#define SST_ALGO_KCONTROL(xname, xcount, xmod, xpipe,					\
			  xtask, xcmd, xtype, xinfo, xget, xput)

#define SST_ALGO_KCONTROL_BYTES(xpname, xmname, xcount, xmod,				\
				xpipe, xinstance, xtask, xcmd)

#define SST_ALGO_KCONTROL_BOOL(xpname, xmname, xmod, xpipe, xinstance, xtask)

#define SST_ALGO_BYPASS_PARAMS(xpname, xmname, xcount, xmod, xpipe,			\
				xinstance, xtask, xcmd)

#define SST_COMBO_ALGO_KCONTROL_BYTES(xpname, xmname, xsubmod, xcount, xmod,		\
				      xpipe, xinstance, xtask, xcmd)


struct sst_enum {};

/* only 4 slots/channels supported atm */
#define SST_SSP_SLOT_ENUM(s_ch_no, is_tx, xtexts)

#define SST_SLOT_CTL_NAME(xpname, xmname, s_ch_name)

#define SST_SSP_SLOT_CTL(xpname, xmname, s_ch_name, s_ch_no, is_tx, xtexts, xget, xput)

#define SST_MUX_CTL_NAME(xpname, xinstance)

#define SST_SSP_MUX_ENUM(xreg, xshift, xtexts)

#define SST_SSP_MUX_CTL(xpname, xinstance, xreg, xshift, xtexts)

int sst_fill_ssp_slot(struct snd_soc_dai *dai, unsigned int tx_mask,
				unsigned int rx_mask, int slots, int slot_width);
int sst_fill_ssp_config(struct snd_soc_dai *dai, unsigned int fmt);
void sst_fill_ssp_defaults(struct snd_soc_dai *dai);

#endif