aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sound/soc/intel/skylake/skl-topology.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/sound/soc/intel/skylake/skl-topology.c b/sound/soc/intel/skylake/skl-topology.c
index 545b4e77b8aa..8fceb7a04147 100644
--- a/sound/soc/intel/skylake/skl-topology.c
+++ b/sound/soc/intel/skylake/skl-topology.c
@@ -154,13 +154,32 @@ static void skl_dump_mconfig(struct skl_sst *ctx,
154 dev_dbg(ctx->dev, "ch_cfg = %d\n", mcfg->out_fmt[0].ch_cfg); 154 dev_dbg(ctx->dev, "ch_cfg = %d\n", mcfg->out_fmt[0].ch_cfg);
155} 155}
156 156
157static void skl_tplg_update_chmap(struct skl_module_fmt *fmt, int chs)
158{
159 int slot_map = 0xFFFFFFFF;
160 int start_slot = 0;
161 int i;
162
163 for (i = 0; i < chs; i++) {
164 /*
165 * For 2 channels with starting slot as 0, slot map will
166 * look like 0xFFFFFF10.
167 */
168 slot_map &= (~(0xF << (4 * i)) | (start_slot << (4 * i)));
169 start_slot++;
170 }
171 fmt->ch_map = slot_map;
172}
173
157static void skl_tplg_update_params(struct skl_module_fmt *fmt, 174static void skl_tplg_update_params(struct skl_module_fmt *fmt,
158 struct skl_pipe_params *params, int fixup) 175 struct skl_pipe_params *params, int fixup)
159{ 176{
160 if (fixup & SKL_RATE_FIXUP_MASK) 177 if (fixup & SKL_RATE_FIXUP_MASK)
161 fmt->s_freq = params->s_freq; 178 fmt->s_freq = params->s_freq;
162 if (fixup & SKL_CH_FIXUP_MASK) 179 if (fixup & SKL_CH_FIXUP_MASK) {
163 fmt->channels = params->ch; 180 fmt->channels = params->ch;
181 skl_tplg_update_chmap(fmt, fmt->channels);
182 }
164 if (fixup & SKL_FMT_FIXUP_MASK) { 183 if (fixup & SKL_FMT_FIXUP_MASK) {
165 fmt->valid_bit_depth = skl_get_bit_depth(params->s_fmt); 184 fmt->valid_bit_depth = skl_get_bit_depth(params->s_fmt);
166 185