From: Zhu Yingjiang Date: Wed, 12 Jun 2019 17:01:45 +0000 (-0500) Subject: ASoC: SOF: topology: add min/max step for volume_table X-Git-Tag: v5.4-rc1~52^2~39^2~225 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=aa66fd80e0813fab0146e001b8bef8c4ffe0ba3a;p=platform%2Fkernel%2Flinux-rpi.git ASoC: SOF: topology: add min/max step for volume_table add two units min_volume_step and max_volume_step to the snd_sof_control struct, for the min and max step of the volume_table. Signed-off-by: Zhu Yingjiang Signed-off-by: Pierre-Louis Bossart Signed-off-by: Mark Brown --- diff --git a/sound/soc/sof/sof-priv.h b/sound/soc/sof/sof-priv.h index 17f3d2a..8760a46 100644 --- a/sound/soc/sof/sof-priv.h +++ b/sound/soc/sof/sof-priv.h @@ -297,6 +297,8 @@ struct snd_sof_pcm { struct snd_sof_control { struct snd_sof_dev *sdev; int comp_id; + int min_volume_step; /* min volume step for volume_table */ + int max_volume_step; /* max volume step for volume_table */ int num_channels; u32 readback_offset; /* offset to mmaped data if used */ struct sof_ipc_ctrl_data *control_data; diff --git a/sound/soc/sof/topology.c b/sound/soc/sof/topology.c index a13233a..1c661de 100644 --- a/sound/soc/sof/topology.c +++ b/sound/soc/sof/topology.c @@ -451,6 +451,8 @@ static int sof_control_load_volume(struct snd_soc_component *scomp, return -ENOMEM; scontrol->comp_id = sdev->next_comp_id; + scontrol->min_volume_step = le32_to_cpu(mc->min); + scontrol->max_volume_step = le32_to_cpu(mc->max); scontrol->num_channels = le32_to_cpu(mc->num_channels); /* set cmd for mixer control */