• Takashi Iwai's avatar
    ALSA: hda/hdmi: Don't use standard hda_jack for generic HDMI jacks · db845402
    Takashi Iwai authored
    The current HDMI codec driver code manages the jack detection in two
    different ways: for Intel codecs with audio component, the driver
    creates snd_jack objects by itself while the standard hda_jack stuff
    is used for the rest.  This was basically because the audio component
    doesn't need the pin sense reading and the unsol event handling, hence
    it just needs to report the corresponding jacks directly.
    
    It was a bit messy but not too messy until the driver got DP-MST
    support for Nvidia that re-uses the part of dyn_pcm_assign feature
    while keeping the pin sense and the unsol event handling.  Now, for
    DP-MST, we use hda_jack for pin sensing and unsol events but use the
    own snd_jack objects.  Meanwhile for non-DP-MST, hda_jack is used for
    pin sense and unsol events, and the jacks are bound on hda_jack.
    
    Moreover, there is a polling mode support where the unsol event isn't
    used.  For those, we also have special handling.
    
    For simplifying those messes, this patch unifies the snd_jack handling
    over all generic HDMI codes.  The driver creates snd_jack objects just
    like Intel codecs did in the past but now for all devices.  For the
    system without audio component binding, we still need the pin sense
    and the unsol event handling, and those are still done with the
    hda_jack table as before.  But hda_jack is no longer used for the
    actual snd_jack handling.
    
    Since the hda_jack is no longer used for jack reporting, we removed
    snd_hda_jack_report_sync() calls, which also allowed to simplify the
    return type of hda_present_sense() and co.  pin_idx_to_pcm_jack() was
    simplified as well because it behaves same for all cases now.
    
    Note that the hda_jack is still used for the simple HDMI codecs; they
    are really simple enough, so no big reason to change intrusively.
    Reviewed-by: default avatarNikhil Mahale <nmahale@nvidia.com>
    Link: https://lore.kernel.org/r/20200206162804.4734-3-tiwai@suse.deSigned-off-by: default avatarTakashi Iwai <tiwai@suse.de>
    db845402
patch_hdmi.c 112 KB