Commit 6a6b5727 authored by Ranjani Sridharan's avatar Ranjani Sridharan Committed by Mark Brown

ASoC: SOF: topology: Drop the size parameter from struct sof_topology_token

It is always 0 and never used while parsing.
Signed-off-by: default avatarRanjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: default avatarBard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: default avatarPéter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20220307181111.49392-8-ranjani.sridharan@linux.intel.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 9911ce06
...@@ -473,12 +473,11 @@ static enum sof_comp_type find_process_comp_type(enum sof_ipc_process_type type) ...@@ -473,12 +473,11 @@ static enum sof_comp_type find_process_comp_type(enum sof_ipc_process_type type)
struct sof_topology_token { struct sof_topology_token {
u32 token; u32 token;
u32 type; u32 type;
int (*get_token)(void *elem, void *object, u32 offset, u32 size); int (*get_token)(void *elem, void *object, u32 offset);
u32 offset; u32 offset;
u32 size;
}; };
static int get_token_u32(void *elem, void *object, u32 offset, u32 size) static int get_token_u32(void *elem, void *object, u32 offset)
{ {
struct snd_soc_tplg_vendor_value_elem *velem = elem; struct snd_soc_tplg_vendor_value_elem *velem = elem;
u32 *val = (u32 *)((u8 *)object + offset); u32 *val = (u32 *)((u8 *)object + offset);
...@@ -487,7 +486,7 @@ static int get_token_u32(void *elem, void *object, u32 offset, u32 size) ...@@ -487,7 +486,7 @@ static int get_token_u32(void *elem, void *object, u32 offset, u32 size)
return 0; return 0;
} }
static int get_token_u16(void *elem, void *object, u32 offset, u32 size) static int get_token_u16(void *elem, void *object, u32 offset)
{ {
struct snd_soc_tplg_vendor_value_elem *velem = elem; struct snd_soc_tplg_vendor_value_elem *velem = elem;
u16 *val = (u16 *)((u8 *)object + offset); u16 *val = (u16 *)((u8 *)object + offset);
...@@ -496,7 +495,7 @@ static int get_token_u16(void *elem, void *object, u32 offset, u32 size) ...@@ -496,7 +495,7 @@ static int get_token_u16(void *elem, void *object, u32 offset, u32 size)
return 0; return 0;
} }
static int get_token_uuid(void *elem, void *object, u32 offset, u32 size) static int get_token_uuid(void *elem, void *object, u32 offset)
{ {
struct snd_soc_tplg_vendor_uuid_elem *velem = elem; struct snd_soc_tplg_vendor_uuid_elem *velem = elem;
u8 *dst = (u8 *)object + offset; u8 *dst = (u8 *)object + offset;
...@@ -506,7 +505,7 @@ static int get_token_uuid(void *elem, void *object, u32 offset, u32 size) ...@@ -506,7 +505,7 @@ static int get_token_uuid(void *elem, void *object, u32 offset, u32 size)
return 0; return 0;
} }
static int get_token_comp_format(void *elem, void *object, u32 offset, u32 size) static int get_token_comp_format(void *elem, void *object, u32 offset)
{ {
struct snd_soc_tplg_vendor_string_elem *velem = elem; struct snd_soc_tplg_vendor_string_elem *velem = elem;
u32 *val = (u32 *)((u8 *)object + offset); u32 *val = (u32 *)((u8 *)object + offset);
...@@ -515,7 +514,7 @@ static int get_token_comp_format(void *elem, void *object, u32 offset, u32 size) ...@@ -515,7 +514,7 @@ static int get_token_comp_format(void *elem, void *object, u32 offset, u32 size)
return 0; return 0;
} }
static int get_token_dai_type(void *elem, void *object, u32 offset, u32 size) static int get_token_dai_type(void *elem, void *object, u32 offset)
{ {
struct snd_soc_tplg_vendor_string_elem *velem = elem; struct snd_soc_tplg_vendor_string_elem *velem = elem;
u32 *val = (u32 *)((u8 *)object + offset); u32 *val = (u32 *)((u8 *)object + offset);
...@@ -524,8 +523,7 @@ static int get_token_dai_type(void *elem, void *object, u32 offset, u32 size) ...@@ -524,8 +523,7 @@ static int get_token_dai_type(void *elem, void *object, u32 offset, u32 size)
return 0; return 0;
} }
static int get_token_process_type(void *elem, void *object, u32 offset, static int get_token_process_type(void *elem, void *object, u32 offset)
u32 size)
{ {
struct snd_soc_tplg_vendor_string_elem *velem = elem; struct snd_soc_tplg_vendor_string_elem *velem = elem;
u32 *val = (u32 *)((u8 *)object + offset); u32 *val = (u32 *)((u8 *)object + offset);
...@@ -537,80 +535,80 @@ static int get_token_process_type(void *elem, void *object, u32 offset, ...@@ -537,80 +535,80 @@ static int get_token_process_type(void *elem, void *object, u32 offset,
/* Buffers */ /* Buffers */
static const struct sof_topology_token buffer_tokens[] = { static const struct sof_topology_token buffer_tokens[] = {
{SOF_TKN_BUF_SIZE, SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32, {SOF_TKN_BUF_SIZE, SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32,
offsetof(struct sof_ipc_buffer, size), 0}, offsetof(struct sof_ipc_buffer, size)},
{SOF_TKN_BUF_CAPS, SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32, {SOF_TKN_BUF_CAPS, SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32,
offsetof(struct sof_ipc_buffer, caps), 0}, offsetof(struct sof_ipc_buffer, caps)},
}; };
/* DAI */ /* DAI */
static const struct sof_topology_token dai_tokens[] = { static const struct sof_topology_token dai_tokens[] = {
{SOF_TKN_DAI_TYPE, SND_SOC_TPLG_TUPLE_TYPE_STRING, get_token_dai_type, {SOF_TKN_DAI_TYPE, SND_SOC_TPLG_TUPLE_TYPE_STRING, get_token_dai_type,
offsetof(struct sof_ipc_comp_dai, type), 0}, offsetof(struct sof_ipc_comp_dai, type)},
{SOF_TKN_DAI_INDEX, SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32, {SOF_TKN_DAI_INDEX, SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32,
offsetof(struct sof_ipc_comp_dai, dai_index), 0}, offsetof(struct sof_ipc_comp_dai, dai_index)},
{SOF_TKN_DAI_DIRECTION, SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32, {SOF_TKN_DAI_DIRECTION, SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32,
offsetof(struct sof_ipc_comp_dai, direction), 0}, offsetof(struct sof_ipc_comp_dai, direction)},
}; };
/* BE DAI link */ /* BE DAI link */
static const struct sof_topology_token dai_link_tokens[] = { static const struct sof_topology_token dai_link_tokens[] = {
{SOF_TKN_DAI_TYPE, SND_SOC_TPLG_TUPLE_TYPE_STRING, get_token_dai_type, {SOF_TKN_DAI_TYPE, SND_SOC_TPLG_TUPLE_TYPE_STRING, get_token_dai_type,
offsetof(struct sof_ipc_dai_config, type), 0}, offsetof(struct sof_ipc_dai_config, type)},
{SOF_TKN_DAI_INDEX, SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32, {SOF_TKN_DAI_INDEX, SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32,
offsetof(struct sof_ipc_dai_config, dai_index), 0}, offsetof(struct sof_ipc_dai_config, dai_index)},
}; };
/* scheduling */ /* scheduling */
static const struct sof_topology_token sched_tokens[] = { static const struct sof_topology_token sched_tokens[] = {
{SOF_TKN_SCHED_PERIOD, SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32, {SOF_TKN_SCHED_PERIOD, SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32,
offsetof(struct sof_ipc_pipe_new, period), 0}, offsetof(struct sof_ipc_pipe_new, period)},
{SOF_TKN_SCHED_PRIORITY, SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32, {SOF_TKN_SCHED_PRIORITY, SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32,
offsetof(struct sof_ipc_pipe_new, priority), 0}, offsetof(struct sof_ipc_pipe_new, priority)},
{SOF_TKN_SCHED_MIPS, SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32, {SOF_TKN_SCHED_MIPS, SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32,
offsetof(struct sof_ipc_pipe_new, period_mips), 0}, offsetof(struct sof_ipc_pipe_new, period_mips)},
{SOF_TKN_SCHED_CORE, SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32, {SOF_TKN_SCHED_CORE, SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32,
offsetof(struct sof_ipc_pipe_new, core), 0}, offsetof(struct sof_ipc_pipe_new, core)},
{SOF_TKN_SCHED_FRAMES, SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32, {SOF_TKN_SCHED_FRAMES, SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32,
offsetof(struct sof_ipc_pipe_new, frames_per_sched), 0}, offsetof(struct sof_ipc_pipe_new, frames_per_sched)},
{SOF_TKN_SCHED_TIME_DOMAIN, SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32, {SOF_TKN_SCHED_TIME_DOMAIN, SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32,
offsetof(struct sof_ipc_pipe_new, time_domain), 0}, offsetof(struct sof_ipc_pipe_new, time_domain)},
}; };
static const struct sof_topology_token pipeline_tokens[] = { static const struct sof_topology_token pipeline_tokens[] = {
{SOF_TKN_SCHED_DYNAMIC_PIPELINE, SND_SOC_TPLG_TUPLE_TYPE_BOOL, get_token_u16, {SOF_TKN_SCHED_DYNAMIC_PIPELINE, SND_SOC_TPLG_TUPLE_TYPE_BOOL, get_token_u16,
offsetof(struct snd_sof_widget, dynamic_pipeline_widget), 0}, offsetof(struct snd_sof_widget, dynamic_pipeline_widget)},
}; };
/* volume */ /* volume */
static const struct sof_topology_token volume_tokens[] = { static const struct sof_topology_token volume_tokens[] = {
{SOF_TKN_VOLUME_RAMP_STEP_TYPE, SND_SOC_TPLG_TUPLE_TYPE_WORD, {SOF_TKN_VOLUME_RAMP_STEP_TYPE, SND_SOC_TPLG_TUPLE_TYPE_WORD,
get_token_u32, offsetof(struct sof_ipc_comp_volume, ramp), 0}, get_token_u32, offsetof(struct sof_ipc_comp_volume, ramp)},
{SOF_TKN_VOLUME_RAMP_STEP_MS, {SOF_TKN_VOLUME_RAMP_STEP_MS,
SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32, SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32,
offsetof(struct sof_ipc_comp_volume, initial_ramp), 0}, offsetof(struct sof_ipc_comp_volume, initial_ramp)},
}; };
/* SRC */ /* SRC */
static const struct sof_topology_token src_tokens[] = { static const struct sof_topology_token src_tokens[] = {
{SOF_TKN_SRC_RATE_IN, SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32, {SOF_TKN_SRC_RATE_IN, SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32,
offsetof(struct sof_ipc_comp_src, source_rate), 0}, offsetof(struct sof_ipc_comp_src, source_rate)},
{SOF_TKN_SRC_RATE_OUT, SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32, {SOF_TKN_SRC_RATE_OUT, SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32,
offsetof(struct sof_ipc_comp_src, sink_rate), 0}, offsetof(struct sof_ipc_comp_src, sink_rate)},
}; };
/* ASRC */ /* ASRC */
static const struct sof_topology_token asrc_tokens[] = { static const struct sof_topology_token asrc_tokens[] = {
{SOF_TKN_ASRC_RATE_IN, SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32, {SOF_TKN_ASRC_RATE_IN, SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32,
offsetof(struct sof_ipc_comp_asrc, source_rate), 0}, offsetof(struct sof_ipc_comp_asrc, source_rate)},
{SOF_TKN_ASRC_RATE_OUT, SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32, {SOF_TKN_ASRC_RATE_OUT, SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32,
offsetof(struct sof_ipc_comp_asrc, sink_rate), 0}, offsetof(struct sof_ipc_comp_asrc, sink_rate)},
{SOF_TKN_ASRC_ASYNCHRONOUS_MODE, SND_SOC_TPLG_TUPLE_TYPE_WORD, {SOF_TKN_ASRC_ASYNCHRONOUS_MODE, SND_SOC_TPLG_TUPLE_TYPE_WORD,
get_token_u32, get_token_u32,
offsetof(struct sof_ipc_comp_asrc, asynchronous_mode), 0}, offsetof(struct sof_ipc_comp_asrc, asynchronous_mode)},
{SOF_TKN_ASRC_OPERATION_MODE, SND_SOC_TPLG_TUPLE_TYPE_WORD, {SOF_TKN_ASRC_OPERATION_MODE, SND_SOC_TPLG_TUPLE_TYPE_WORD,
get_token_u32, get_token_u32,
offsetof(struct sof_ipc_comp_asrc, operation_mode), 0}, offsetof(struct sof_ipc_comp_asrc, operation_mode)},
}; };
/* Tone */ /* Tone */
...@@ -621,62 +619,62 @@ static const struct sof_topology_token tone_tokens[] = { ...@@ -621,62 +619,62 @@ static const struct sof_topology_token tone_tokens[] = {
static const struct sof_topology_token process_tokens[] = { static const struct sof_topology_token process_tokens[] = {
{SOF_TKN_PROCESS_TYPE, SND_SOC_TPLG_TUPLE_TYPE_STRING, {SOF_TKN_PROCESS_TYPE, SND_SOC_TPLG_TUPLE_TYPE_STRING,
get_token_process_type, get_token_process_type,
offsetof(struct sof_ipc_comp_process, type), 0}, offsetof(struct sof_ipc_comp_process, type)},
}; };
/* PCM */ /* PCM */
static const struct sof_topology_token pcm_tokens[] = { static const struct sof_topology_token pcm_tokens[] = {
{SOF_TKN_PCM_DMAC_CONFIG, SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32, {SOF_TKN_PCM_DMAC_CONFIG, SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32,
offsetof(struct sof_ipc_comp_host, dmac_config), 0}, offsetof(struct sof_ipc_comp_host, dmac_config)},
}; };
/* PCM */ /* PCM */
static const struct sof_topology_token stream_tokens[] = { static const struct sof_topology_token stream_tokens[] = {
{SOF_TKN_STREAM_PLAYBACK_COMPATIBLE_D0I3, {SOF_TKN_STREAM_PLAYBACK_COMPATIBLE_D0I3,
SND_SOC_TPLG_TUPLE_TYPE_BOOL, get_token_u16, SND_SOC_TPLG_TUPLE_TYPE_BOOL, get_token_u16,
offsetof(struct snd_sof_pcm, stream[0].d0i3_compatible), 0}, offsetof(struct snd_sof_pcm, stream[0].d0i3_compatible)},
{SOF_TKN_STREAM_CAPTURE_COMPATIBLE_D0I3, {SOF_TKN_STREAM_CAPTURE_COMPATIBLE_D0I3,
SND_SOC_TPLG_TUPLE_TYPE_BOOL, get_token_u16, SND_SOC_TPLG_TUPLE_TYPE_BOOL, get_token_u16,
offsetof(struct snd_sof_pcm, stream[1].d0i3_compatible), 0}, offsetof(struct snd_sof_pcm, stream[1].d0i3_compatible)},
}; };
/* Generic components */ /* Generic components */
static const struct sof_topology_token comp_tokens[] = { static const struct sof_topology_token comp_tokens[] = {
{SOF_TKN_COMP_PERIOD_SINK_COUNT, {SOF_TKN_COMP_PERIOD_SINK_COUNT,
SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32, SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32,
offsetof(struct sof_ipc_comp_config, periods_sink), 0}, offsetof(struct sof_ipc_comp_config, periods_sink)},
{SOF_TKN_COMP_PERIOD_SOURCE_COUNT, {SOF_TKN_COMP_PERIOD_SOURCE_COUNT,
SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32, SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32,
offsetof(struct sof_ipc_comp_config, periods_source), 0}, offsetof(struct sof_ipc_comp_config, periods_source)},
{SOF_TKN_COMP_FORMAT, {SOF_TKN_COMP_FORMAT,
SND_SOC_TPLG_TUPLE_TYPE_STRING, get_token_comp_format, SND_SOC_TPLG_TUPLE_TYPE_STRING, get_token_comp_format,
offsetof(struct sof_ipc_comp_config, frame_fmt), 0}, offsetof(struct sof_ipc_comp_config, frame_fmt)},
}; };
/* SSP */ /* SSP */
static const struct sof_topology_token ssp_tokens[] = { static const struct sof_topology_token ssp_tokens[] = {
{SOF_TKN_INTEL_SSP_CLKS_CONTROL, {SOF_TKN_INTEL_SSP_CLKS_CONTROL,
SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32, SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32,
offsetof(struct sof_ipc_dai_ssp_params, clks_control), 0}, offsetof(struct sof_ipc_dai_ssp_params, clks_control)},
{SOF_TKN_INTEL_SSP_MCLK_ID, {SOF_TKN_INTEL_SSP_MCLK_ID,
SND_SOC_TPLG_TUPLE_TYPE_SHORT, get_token_u16, SND_SOC_TPLG_TUPLE_TYPE_SHORT, get_token_u16,
offsetof(struct sof_ipc_dai_ssp_params, mclk_id), 0}, offsetof(struct sof_ipc_dai_ssp_params, mclk_id)},
{SOF_TKN_INTEL_SSP_SAMPLE_BITS, SND_SOC_TPLG_TUPLE_TYPE_WORD, {SOF_TKN_INTEL_SSP_SAMPLE_BITS, SND_SOC_TPLG_TUPLE_TYPE_WORD,
get_token_u32, get_token_u32,
offsetof(struct sof_ipc_dai_ssp_params, sample_valid_bits), 0}, offsetof(struct sof_ipc_dai_ssp_params, sample_valid_bits)},
{SOF_TKN_INTEL_SSP_FRAME_PULSE_WIDTH, SND_SOC_TPLG_TUPLE_TYPE_SHORT, {SOF_TKN_INTEL_SSP_FRAME_PULSE_WIDTH, SND_SOC_TPLG_TUPLE_TYPE_SHORT,
get_token_u16, get_token_u16,
offsetof(struct sof_ipc_dai_ssp_params, frame_pulse_width), 0}, offsetof(struct sof_ipc_dai_ssp_params, frame_pulse_width)},
{SOF_TKN_INTEL_SSP_QUIRKS, SND_SOC_TPLG_TUPLE_TYPE_WORD, {SOF_TKN_INTEL_SSP_QUIRKS, SND_SOC_TPLG_TUPLE_TYPE_WORD,
get_token_u32, get_token_u32,
offsetof(struct sof_ipc_dai_ssp_params, quirks), 0}, offsetof(struct sof_ipc_dai_ssp_params, quirks)},
{SOF_TKN_INTEL_SSP_TDM_PADDING_PER_SLOT, SND_SOC_TPLG_TUPLE_TYPE_BOOL, {SOF_TKN_INTEL_SSP_TDM_PADDING_PER_SLOT, SND_SOC_TPLG_TUPLE_TYPE_BOOL,
get_token_u16, get_token_u16,
offsetof(struct sof_ipc_dai_ssp_params, offsetof(struct sof_ipc_dai_ssp_params,
tdm_per_slot_padding_flag), 0}, tdm_per_slot_padding_flag)},
{SOF_TKN_INTEL_SSP_BCLK_DELAY, SND_SOC_TPLG_TUPLE_TYPE_WORD, {SOF_TKN_INTEL_SSP_BCLK_DELAY, SND_SOC_TPLG_TUPLE_TYPE_WORD,
get_token_u32, get_token_u32,
offsetof(struct sof_ipc_dai_ssp_params, bclk_delay), 0}, offsetof(struct sof_ipc_dai_ssp_params, bclk_delay)},
}; };
...@@ -684,43 +682,42 @@ static const struct sof_topology_token ssp_tokens[] = { ...@@ -684,43 +682,42 @@ static const struct sof_topology_token ssp_tokens[] = {
static const struct sof_topology_token alh_tokens[] = { static const struct sof_topology_token alh_tokens[] = {
{SOF_TKN_INTEL_ALH_RATE, {SOF_TKN_INTEL_ALH_RATE,
SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32, SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32,
offsetof(struct sof_ipc_dai_alh_params, rate), 0}, offsetof(struct sof_ipc_dai_alh_params, rate)},
{SOF_TKN_INTEL_ALH_CH, {SOF_TKN_INTEL_ALH_CH,
SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32, SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32,
offsetof(struct sof_ipc_dai_alh_params, channels), 0}, offsetof(struct sof_ipc_dai_alh_params, channels)},
}; };
/* DMIC */ /* DMIC */
static const struct sof_topology_token dmic_tokens[] = { static const struct sof_topology_token dmic_tokens[] = {
{SOF_TKN_INTEL_DMIC_DRIVER_VERSION, {SOF_TKN_INTEL_DMIC_DRIVER_VERSION,
SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32, SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32,
offsetof(struct sof_ipc_dai_dmic_params, driver_ipc_version), offsetof(struct sof_ipc_dai_dmic_params, driver_ipc_version)},
0},
{SOF_TKN_INTEL_DMIC_CLK_MIN, {SOF_TKN_INTEL_DMIC_CLK_MIN,
SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32, SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32,
offsetof(struct sof_ipc_dai_dmic_params, pdmclk_min), 0}, offsetof(struct sof_ipc_dai_dmic_params, pdmclk_min)},
{SOF_TKN_INTEL_DMIC_CLK_MAX, {SOF_TKN_INTEL_DMIC_CLK_MAX,
SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32, SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32,
offsetof(struct sof_ipc_dai_dmic_params, pdmclk_max), 0}, offsetof(struct sof_ipc_dai_dmic_params, pdmclk_max)},
{SOF_TKN_INTEL_DMIC_SAMPLE_RATE, {SOF_TKN_INTEL_DMIC_SAMPLE_RATE,
SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32, SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32,
offsetof(struct sof_ipc_dai_dmic_params, fifo_fs), 0}, offsetof(struct sof_ipc_dai_dmic_params, fifo_fs)},
{SOF_TKN_INTEL_DMIC_DUTY_MIN, {SOF_TKN_INTEL_DMIC_DUTY_MIN,
SND_SOC_TPLG_TUPLE_TYPE_SHORT, get_token_u16, SND_SOC_TPLG_TUPLE_TYPE_SHORT, get_token_u16,
offsetof(struct sof_ipc_dai_dmic_params, duty_min), 0}, offsetof(struct sof_ipc_dai_dmic_params, duty_min)},
{SOF_TKN_INTEL_DMIC_DUTY_MAX, {SOF_TKN_INTEL_DMIC_DUTY_MAX,
SND_SOC_TPLG_TUPLE_TYPE_SHORT, get_token_u16, SND_SOC_TPLG_TUPLE_TYPE_SHORT, get_token_u16,
offsetof(struct sof_ipc_dai_dmic_params, duty_max), 0}, offsetof(struct sof_ipc_dai_dmic_params, duty_max)},
{SOF_TKN_INTEL_DMIC_NUM_PDM_ACTIVE, {SOF_TKN_INTEL_DMIC_NUM_PDM_ACTIVE,
SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32, SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32,
offsetof(struct sof_ipc_dai_dmic_params, offsetof(struct sof_ipc_dai_dmic_params,
num_pdm_active), 0}, num_pdm_active)},
{SOF_TKN_INTEL_DMIC_FIFO_WORD_LENGTH, {SOF_TKN_INTEL_DMIC_FIFO_WORD_LENGTH,
SND_SOC_TPLG_TUPLE_TYPE_SHORT, get_token_u16, SND_SOC_TPLG_TUPLE_TYPE_SHORT, get_token_u16,
offsetof(struct sof_ipc_dai_dmic_params, fifo_bits), 0}, offsetof(struct sof_ipc_dai_dmic_params, fifo_bits)},
{SOF_TKN_INTEL_DMIC_UNMUTE_RAMP_TIME_MS, {SOF_TKN_INTEL_DMIC_UNMUTE_RAMP_TIME_MS,
SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32, SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32,
offsetof(struct sof_ipc_dai_dmic_params, unmute_ramp_time), 0}, offsetof(struct sof_ipc_dai_dmic_params, unmute_ramp_time)},
}; };
...@@ -728,28 +725,28 @@ static const struct sof_topology_token dmic_tokens[] = { ...@@ -728,28 +725,28 @@ static const struct sof_topology_token dmic_tokens[] = {
static const struct sof_topology_token esai_tokens[] = { static const struct sof_topology_token esai_tokens[] = {
{SOF_TKN_IMX_ESAI_MCLK_ID, {SOF_TKN_IMX_ESAI_MCLK_ID,
SND_SOC_TPLG_TUPLE_TYPE_SHORT, get_token_u16, SND_SOC_TPLG_TUPLE_TYPE_SHORT, get_token_u16,
offsetof(struct sof_ipc_dai_esai_params, mclk_id), 0}, offsetof(struct sof_ipc_dai_esai_params, mclk_id)},
}; };
/* SAI */ /* SAI */
static const struct sof_topology_token sai_tokens[] = { static const struct sof_topology_token sai_tokens[] = {
{SOF_TKN_IMX_SAI_MCLK_ID, {SOF_TKN_IMX_SAI_MCLK_ID,
SND_SOC_TPLG_TUPLE_TYPE_SHORT, get_token_u16, SND_SOC_TPLG_TUPLE_TYPE_SHORT, get_token_u16,
offsetof(struct sof_ipc_dai_sai_params, mclk_id), 0}, offsetof(struct sof_ipc_dai_sai_params, mclk_id)},
}; };
/* Core tokens */ /* Core tokens */
static const struct sof_topology_token core_tokens[] = { static const struct sof_topology_token core_tokens[] = {
{SOF_TKN_COMP_CORE_ID, {SOF_TKN_COMP_CORE_ID,
SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32, SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32,
offsetof(struct sof_ipc_comp, core), 0}, offsetof(struct sof_ipc_comp, core)},
}; };
/* Component extended tokens */ /* Component extended tokens */
static const struct sof_topology_token comp_ext_tokens[] = { static const struct sof_topology_token comp_ext_tokens[] = {
{SOF_TKN_COMP_UUID, {SOF_TKN_COMP_UUID,
SND_SOC_TPLG_TUPLE_TYPE_UUID, get_token_uuid, SND_SOC_TPLG_TUPLE_TYPE_UUID, get_token_uuid,
offsetof(struct sof_ipc_comp_ext, uuid), 0}, offsetof(struct sof_ipc_comp_ext, uuid)},
}; };
/* /*
...@@ -761,63 +758,56 @@ static const struct sof_topology_token comp_ext_tokens[] = { ...@@ -761,63 +758,56 @@ static const struct sof_topology_token comp_ext_tokens[] = {
static const struct sof_topology_token dmic_pdm_tokens[] = { static const struct sof_topology_token dmic_pdm_tokens[] = {
{SOF_TKN_INTEL_DMIC_PDM_CTRL_ID, {SOF_TKN_INTEL_DMIC_PDM_CTRL_ID,
SND_SOC_TPLG_TUPLE_TYPE_SHORT, get_token_u16, SND_SOC_TPLG_TUPLE_TYPE_SHORT, get_token_u16,
offsetof(struct sof_ipc_dai_dmic_pdm_ctrl, id), offsetof(struct sof_ipc_dai_dmic_pdm_ctrl, id),},
0},
{SOF_TKN_INTEL_DMIC_PDM_MIC_A_Enable, {SOF_TKN_INTEL_DMIC_PDM_MIC_A_Enable,
SND_SOC_TPLG_TUPLE_TYPE_SHORT, get_token_u16, SND_SOC_TPLG_TUPLE_TYPE_SHORT, get_token_u16,
offsetof(struct sof_ipc_dai_dmic_pdm_ctrl, enable_mic_a), offsetof(struct sof_ipc_dai_dmic_pdm_ctrl, enable_mic_a)},
0},
{SOF_TKN_INTEL_DMIC_PDM_MIC_B_Enable, {SOF_TKN_INTEL_DMIC_PDM_MIC_B_Enable,
SND_SOC_TPLG_TUPLE_TYPE_SHORT, get_token_u16, SND_SOC_TPLG_TUPLE_TYPE_SHORT, get_token_u16,
offsetof(struct sof_ipc_dai_dmic_pdm_ctrl, enable_mic_b), offsetof(struct sof_ipc_dai_dmic_pdm_ctrl, enable_mic_b)},
0},
{SOF_TKN_INTEL_DMIC_PDM_POLARITY_A, {SOF_TKN_INTEL_DMIC_PDM_POLARITY_A,
SND_SOC_TPLG_TUPLE_TYPE_SHORT, get_token_u16, SND_SOC_TPLG_TUPLE_TYPE_SHORT, get_token_u16,
offsetof(struct sof_ipc_dai_dmic_pdm_ctrl, polarity_mic_a), offsetof(struct sof_ipc_dai_dmic_pdm_ctrl, polarity_mic_a)},
0},
{SOF_TKN_INTEL_DMIC_PDM_POLARITY_B, {SOF_TKN_INTEL_DMIC_PDM_POLARITY_B,
SND_SOC_TPLG_TUPLE_TYPE_SHORT, get_token_u16, SND_SOC_TPLG_TUPLE_TYPE_SHORT, get_token_u16,
offsetof(struct sof_ipc_dai_dmic_pdm_ctrl, polarity_mic_b), offsetof(struct sof_ipc_dai_dmic_pdm_ctrl, polarity_mic_b)},
0},
{SOF_TKN_INTEL_DMIC_PDM_CLK_EDGE, {SOF_TKN_INTEL_DMIC_PDM_CLK_EDGE,
SND_SOC_TPLG_TUPLE_TYPE_SHORT, get_token_u16, SND_SOC_TPLG_TUPLE_TYPE_SHORT, get_token_u16,
offsetof(struct sof_ipc_dai_dmic_pdm_ctrl, clk_edge), offsetof(struct sof_ipc_dai_dmic_pdm_ctrl, clk_edge)},
0},
{SOF_TKN_INTEL_DMIC_PDM_SKEW, {SOF_TKN_INTEL_DMIC_PDM_SKEW,
SND_SOC_TPLG_TUPLE_TYPE_SHORT, get_token_u16, SND_SOC_TPLG_TUPLE_TYPE_SHORT, get_token_u16,
offsetof(struct sof_ipc_dai_dmic_pdm_ctrl, skew), offsetof(struct sof_ipc_dai_dmic_pdm_ctrl, skew)},
0},
}; };
/* HDA */ /* HDA */
static const struct sof_topology_token hda_tokens[] = { static const struct sof_topology_token hda_tokens[] = {
{SOF_TKN_INTEL_HDA_RATE, {SOF_TKN_INTEL_HDA_RATE,
SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32, SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32,
offsetof(struct sof_ipc_dai_hda_params, rate), 0}, offsetof(struct sof_ipc_dai_hda_params, rate)},
{SOF_TKN_INTEL_HDA_CH, {SOF_TKN_INTEL_HDA_CH,
SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32, SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32,
offsetof(struct sof_ipc_dai_hda_params, channels), 0}, offsetof(struct sof_ipc_dai_hda_params, channels)},
}; };
/* Leds */ /* Leds */
static const struct sof_topology_token led_tokens[] = { static const struct sof_topology_token led_tokens[] = {
{SOF_TKN_MUTE_LED_USE, SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32, {SOF_TKN_MUTE_LED_USE, SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32,
offsetof(struct snd_sof_led_control, use_led), 0}, offsetof(struct snd_sof_led_control, use_led)},
{SOF_TKN_MUTE_LED_DIRECTION, SND_SOC_TPLG_TUPLE_TYPE_WORD, {SOF_TKN_MUTE_LED_DIRECTION, SND_SOC_TPLG_TUPLE_TYPE_WORD,
get_token_u32, offsetof(struct snd_sof_led_control, direction), 0}, get_token_u32, offsetof(struct snd_sof_led_control, direction)},
}; };
/* AFE */ /* AFE */
static const struct sof_topology_token afe_tokens[] = { static const struct sof_topology_token afe_tokens[] = {
{SOF_TKN_MEDIATEK_AFE_RATE, {SOF_TKN_MEDIATEK_AFE_RATE,
SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32, SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32,
offsetof(struct sof_ipc_dai_mtk_afe_params, rate), 0}, offsetof(struct sof_ipc_dai_mtk_afe_params, rate)},
{SOF_TKN_MEDIATEK_AFE_CH, {SOF_TKN_MEDIATEK_AFE_CH,
SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32, SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32,
offsetof(struct sof_ipc_dai_mtk_afe_params, channels), 0}, offsetof(struct sof_ipc_dai_mtk_afe_params, channels)},
{SOF_TKN_MEDIATEK_AFE_FORMAT, {SOF_TKN_MEDIATEK_AFE_FORMAT,
SND_SOC_TPLG_TUPLE_TYPE_STRING, get_token_comp_format, SND_SOC_TPLG_TUPLE_TYPE_STRING, get_token_comp_format,
offsetof(struct sof_ipc_dai_mtk_afe_params, format), 0}, offsetof(struct sof_ipc_dai_mtk_afe_params, format)},
}; };
static int sof_parse_uuid_tokens(struct snd_soc_component *scomp, static int sof_parse_uuid_tokens(struct snd_soc_component *scomp,
...@@ -847,8 +837,7 @@ static int sof_parse_uuid_tokens(struct snd_soc_component *scomp, ...@@ -847,8 +837,7 @@ static int sof_parse_uuid_tokens(struct snd_soc_component *scomp,
/* matched - now load token */ /* matched - now load token */
tokens[j].get_token(elem, object, tokens[j].get_token(elem, object,
offset + tokens[j].offset, offset + tokens[j].offset);
tokens[j].size);
found++; found++;
} }
...@@ -884,8 +873,7 @@ static int sof_parse_string_tokens(struct snd_soc_component *scomp, ...@@ -884,8 +873,7 @@ static int sof_parse_string_tokens(struct snd_soc_component *scomp,
/* matched - now load token */ /* matched - now load token */
tokens[j].get_token(elem, object, tokens[j].get_token(elem, object,
offset + tokens[j].offset, offset + tokens[j].offset);
tokens[j].size);
found++; found++;
} }
...@@ -924,8 +912,7 @@ static int sof_parse_word_tokens(struct snd_soc_component *scomp, ...@@ -924,8 +912,7 @@ static int sof_parse_word_tokens(struct snd_soc_component *scomp,
/* load token */ /* load token */
tokens[j].get_token(elem, object, tokens[j].get_token(elem, object,
offset + tokens[j].offset, offset + tokens[j].offset);
tokens[j].size);
found++; found++;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment