diff options
author | Subhransu S. Prusty <subhransu.s.prusty@intel.com> | 2016-04-14 00:37:36 -0400 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2016-04-28 13:49:24 -0400 |
commit | ea5a137d0fe263854ae6267a0fa208c544d83452 (patch) | |
tree | e87d13d214b7ad55e08bb06d3791587f90180d06 | |
parent | 7e12dc87ac59963cf1765fb8272412db19004987 (diff) |
ASoC: Intel: Skylake: Update channel map based on runtime params
Default channel map is set for 2 channels. Fix the channel map
based on runtime params to support multichannel.
Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r-- | sound/soc/intel/skylake/skl-topology.c | 21 |
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 | ||
157 | static 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 | |||
157 | static void skl_tplg_update_params(struct skl_module_fmt *fmt, | 174 | static 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 | ||