1. 29 Jan, 2016 4 commits
    • Libin Yang's avatar
      ALSA: hda - hdmi dynamically bind PCM to pin when monitor hotplug · a76056f2
      Libin Yang authored
      Dynamically bind/unbind the PCM to pin when HDMI/DP monitor hotplug.
      
      When monitor is connected, find a proper PCM for the monitor.
      When monitor is disconnected, unbind the PCM from the pin.
      
      The binding policy (use Intel platform as example) is:
      1. Try to use the legacy pin-pcm mapping for the device entry 0
         of the pin.
      2. If step 1 fails, try to bind pin to the backup PCMs. For example,
         on Intel platform, if DP MST is enabled, 5 PCMs will be created.
         PCM 3, PCM 7, PCM 8 are supposed to be used by device entry 0 of
         pin 5, pin 6 and pin 7. PCM 9 and PCM 10 are the backup PCMs.
      3. If step 2 fails, try to find any PCM to bind to the pin.
      Signed-off-by: default avatarLibin Yang <libin.yang@linux.intel.com>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      a76056f2
    • Libin Yang's avatar
      ALSA: hda - hdmi operate spdif based on pcm · 2bf3c85a
      Libin Yang authored
      Currently, the driver operates the spdif based on pin.
      This is ok for the current driver as pcm is statically
      bound to the pin.
      
      However, if the driver uses dynamically pcm assignment,
      this will cause confusion for user space.
      
      The patch changes spdif operation from pin based to pcm based.
      Signed-off-by: default avatarLibin Yang <libin.yang@linux.intel.com>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      2bf3c85a
    • Libin Yang's avatar
      ALSA: hda - hdmi playback without monitor in dynamic pcm bind mode · 42b29870
      Libin Yang authored
      Pulseaudio requires open pcm successfully when probing.
      
      This patch handles playback without monitor in dynamic pcm assignment
      mode. It tries to open/prepare/close pcm successfully even there is
      no pin bound to the PCM. On the meantime, it will try to find a proper
      converter for the PCM.
      
      As pcm is This patch introduces a pcm_lock in struct hdmi_spec.
      This lock is used to protect:
      1. the variables in struct hdmi_spec;
      2. other variables shared for dynamic pcm assignment mode
      3. device entry selection. As each device entry is represented by
         a separate struct struct hdmi_spec_per_pin, the lock in per_pin
         is not enough. Please see details below.
      
      MST audio device entry operation:
      1. select device entry on the pin
      2. operate on the pin nid
      Signed-off-by: default avatarLibin Yang <libin.yang@linux.intel.com>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      42b29870
    • Libin Yang's avatar
      ALSA: hda - hdmi begin to support dynamic PCM assignment · 6590faab
      Libin Yang authored
      Begin to support dynamic PCM assignment to pin in
      hdmi audio driver.
      
      This means PCM will not be statically bound with pin.
      When there is a monitor connected, the corresponding pin
      will try to find a proper PCM to bind. When the monitor
      is disconnected, the corresponding pin will unbind
      the PCM. This helps to reduce the PCM number when there
      are many pins (device entries in DP MST mode) and only
      a few of them work at the same time.
      
      This patch adds the pcm member in struct hdmi_spec_per_pin.
      When PCM is dynamically bound to the pin, the member pcm
      will pointer to the corresponding pcm_rec[] in hdmi_spec,
      which means the hda_pcm is bound to the pin.
      Signed-off-by: default avatarLibin Yang <libin.yang@linux.intel.com>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      6590faab
  2. 24 Jan, 2016 36 commits