On Tue, Jun 18, 2019 at 3:46 PM Pierre-Louis Bossart <pierre-louis.bossart@xxxxxxxxxxxxxxx> 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;). _______________________________________________ Alsa-devel mailing list Alsa-devel@xxxxxxxxxxxxxxxx https://mailman.alsa-project.org/mailman/listinfo/alsa-devel