ASoC: SOF: topology: add min/max step for volume_table
authorZhu Yingjiang <yingjiang.zhu@linux.intel.com>
Wed, 12 Jun 2019 17:01:45 +0000 (12:01 -0500)
committerMark Brown <broonie@kernel.org>
Thu, 13 Jun 2019 18:54:59 +0000 (19:54 +0100)
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 <yingjiang.zhu@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/sof/sof-priv.h
sound/soc/sof/topology.c

index 17f3d2a5a7019c5ba1a6f2235aed67d2e8be3f14..8760a4694d8f866ce9ba7c8018c1a105d57d8e7a 100644 (file)
@@ -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;
index a13233ae6d0e7807ff0753360bfc3c624aa09e9e..1c661dec8dd4eb3cd5a9eeae0e3b0e9e15c027e8 100644 (file)
@@ -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 */