Skip to content

Commit 462e244

Browse files
committed
Merge tag 'asoc-fix-v6.15-rc7' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus
ASoC: Fixes for v6.15 A couple more small fixes for v6.15, both of which could also easily wait until the merge window.
2 parents f709b78 + 688abe2 commit 462e244

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

sound/soc/apple/mca.c

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -464,6 +464,28 @@ static int mca_configure_serdes(struct mca_cluster *cl, int serdes_unit,
464464
return -EINVAL;
465465
}
466466

467+
static int mca_fe_startup(struct snd_pcm_substream *substream,
468+
struct snd_soc_dai *dai)
469+
{
470+
struct mca_cluster *cl = mca_dai_to_cluster(dai);
471+
unsigned int mask, nchannels;
472+
473+
if (cl->tdm_slots) {
474+
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
475+
mask = cl->tdm_tx_mask;
476+
else
477+
mask = cl->tdm_rx_mask;
478+
479+
nchannels = hweight32(mask);
480+
} else {
481+
nchannels = 2;
482+
}
483+
484+
return snd_pcm_hw_constraint_minmax(substream->runtime,
485+
SNDRV_PCM_HW_PARAM_CHANNELS,
486+
1, nchannels);
487+
}
488+
467489
static int mca_fe_set_tdm_slot(struct snd_soc_dai *dai, unsigned int tx_mask,
468490
unsigned int rx_mask, int slots, int slot_width)
469491
{
@@ -680,6 +702,7 @@ static int mca_fe_hw_params(struct snd_pcm_substream *substream,
680702
}
681703

682704
static const struct snd_soc_dai_ops mca_fe_ops = {
705+
.startup = mca_fe_startup,
683706
.set_fmt = mca_fe_set_fmt,
684707
.set_bclk_ratio = mca_set_bclk_ratio,
685708
.set_tdm_slot = mca_fe_set_tdm_slot,

sound/soc/qcom/sdm845.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,10 @@ static int sdm845_slim_snd_hw_params(struct snd_pcm_substream *substream,
9191
else
9292
ret = snd_soc_dai_set_channel_map(cpu_dai, tx_ch_cnt,
9393
tx_ch, 0, NULL);
94+
if (ret != 0 && ret != -ENOTSUPP) {
95+
dev_err(rtd->dev, "failed to set cpu chan map, err:%d\n", ret);
96+
return ret;
97+
}
9498
}
9599

96100
return 0;

0 commit comments

Comments
 (0)