~ubuntu-audio-dev/alsa-driver/tiwai-trunk2

« back to all changes in this revision

Viewing changes to soc/intel/skylake/skl-topology.c

  • Committer: Canonistack server
  • Date: 2016-05-16 13:04:41 UTC
  • Revision ID: david.henningsson@canonical.com-20160516130441-xmcvo5v7n0mupdei
Test run of 623 machines: 3 failing with 3 errors and 0 warnings.

Show diffs side-by-side

added added

removed removed

Lines of Context:
154
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
174
static void skl_tplg_update_params(struct skl_module_fmt *fmt,
158
175
                        struct skl_pipe_params *params, int fixup)
159
176
{
160
177
        if (fixup & SKL_RATE_FIXUP_MASK)
161
178
                fmt->s_freq = params->s_freq;
162
 
        if (fixup & SKL_CH_FIXUP_MASK)
 
179
        if (fixup & SKL_CH_FIXUP_MASK) {
163
180
                fmt->channels = params->ch;
 
181
                skl_tplg_update_chmap(fmt, fmt->channels);
 
182
        }
164
183
        if (fixup & SKL_FMT_FIXUP_MASK) {
165
184
                fmt->valid_bit_depth = skl_get_bit_depth(params->s_fmt);
166
185
 
1564
1583
                return -ENOMEM;
1565
1584
 
1566
1585
        w->priv = mconfig;
 
1586
        memcpy(&mconfig->guid, &dfw_config->uuid, 16);
 
1587
 
1567
1588
        mconfig->id.module_id = dfw_config->module_id;
1568
1589
        mconfig->id.instance_id = dfw_config->instance_id;
1569
1590
        mconfig->mcps = dfw_config->max_mcps;
1593
1614
        mconfig->time_slot = dfw_config->time_slot;
1594
1615
        mconfig->formats_config.caps_size = dfw_config->caps.caps_size;
1595
1616
 
1596
 
        if (dfw_config->is_loadable)
1597
 
                memcpy(mconfig->guid, dfw_config->uuid,
1598
 
                                        ARRAY_SIZE(dfw_config->uuid));
1599
 
 
1600
1617
        mconfig->m_in_pin = devm_kzalloc(bus->dev, (mconfig->max_in_queue) *
1601
1618
                                                sizeof(*mconfig->m_in_pin),
1602
1619
                                                GFP_KERNEL);