[alsa-devel] [PATCH] ASoC: Intel: skl: extract common function

Tzung-Bi Shih tzungbi at google.com
Tue Jun 18 10:36:30 CEST 2019


On Tue, Jun 18, 2019 at 3:46 PM Pierre-Louis Bossart
<pierre-louis.bossart at linux.intel.com> wrote:
>
> HDMI support is a mess for sure, but I am not sure this is the right way
> to refactor the code. See e.g. bxt_da7219_max98357a, a single init
> callback was used. you can use dai->id to manage the right offset,
>
> pcm->device = SKL_DPCM_AUDIO_HDMI1_PB + dai->id; or
> pcm->device = dai->id;
>
> instead of hard-coding the values in a parameter.
>
Yeah, I noticed that and I am very confused.

But after following the call sequence, _late_probe() ->
hdac_hdmi_jack_init() -> hdac_hdmi_get_pcm_from_id(), it seems the ID
is merely a unique key to perform linear search in
hdac_hdmi_get_pcm_from_id().  It looks like the follower
snd_hdac_add_chmap_ctls() does not use the ID too seriously.

TBH, I am not very sure either.  But if either way is fine, simpler is
better (i.e. pcm->device = dai->id;).


More information about the Alsa-devel mailing list