Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions drivers/gpu/drm/vc4/vc4_hdmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -2167,8 +2167,17 @@ static int vc4_hdmi_audio_cpu_dai_probe(struct snd_soc_dai *dai)
return 0;
}

static int vc4_hdmi_audio_cpu_dai_startup(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai)
{
/* hdmi-codec has no channel allocation for odd channel counts */
return snd_pcm_hw_constraint_step(substream->runtime, 0,
SNDRV_PCM_HW_PARAM_CHANNELS, 2);
}

static const struct snd_soc_dai_ops vc4_snd_dai_ops = {
.probe = vc4_hdmi_audio_cpu_dai_probe,
.startup = vc4_hdmi_audio_cpu_dai_startup,
};

static struct snd_soc_dai_driver vc4_hdmi_audio_cpu_dai_drv = {
Expand Down
4 changes: 4 additions & 0 deletions sound/soc/codecs/hdmi-codec.c
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,10 @@ static int hdmi_codec_get_ch_alloc_table_idx(struct hdmi_codec_priv *hcp,
unsigned long spk_mask;
const struct hdmi_codec_cea_spk_alloc *cap = hdmi_codec_channel_alloc;

/* Index 0 is CA 0x00, which is valid for any sink */
if (channels <= 2)
return 0;

spk_alloc = drm_eld_get_spk_alloc(hcp->eld);
spk_mask = hdmi_codec_spk_mask_from_alloc(spk_alloc);

Expand Down
Loading