xref: /linux/Documentation/sound/hd-audio/dp-mst.rst (revision 0337966d121ebebf73a1c346123e8112796e684e)
176ab4e15STakashi Iwai=======================
276ab4e15STakashi IwaiHD-Audio DP-MST Support
376ab4e15STakashi Iwai=======================
476ab4e15STakashi Iwai
576ab4e15STakashi IwaiTo support DP MST audio, HD Audio hdmi codec driver introduces virtual pin
676ab4e15STakashi Iwaiand dynamic pcm assignment.
776ab4e15STakashi Iwai
876ab4e15STakashi IwaiVirtual pin is an extension of per_pin. The most difference of DP MST
976ab4e15STakashi Iwaifrom legacy is that DP MST introduces device entry. Each pin can contain
1076ab4e15STakashi Iwaiseveral device entries. Each device entry behaves as a pin.
1176ab4e15STakashi Iwai
1276ab4e15STakashi IwaiAs each pin may contain several device entries and each codec may contain
1376ab4e15STakashi Iwaiseveral pins, if we use one pcm per per_pin, there will be many PCMs.
1476ab4e15STakashi IwaiThe new solution is to create a few PCMs and to dynamically bind pcm to
1576ab4e15STakashi Iwaiper_pin. Driver uses spec->dyn_pcm_assign flag to indicate whether to use
1676ab4e15STakashi Iwaithe new solution.
1776ab4e15STakashi Iwai
1876ab4e15STakashi IwaiPCM
1976ab4e15STakashi Iwai===
2076ab4e15STakashi IwaiTo be added
2176ab4e15STakashi Iwai
22*dd48e8edSLibin YangPin Initialization
23*dd48e8edSLibin Yang==================
24*dd48e8edSLibin YangEach pin may have several device entries (virtual pins). On Intel platform,
25*dd48e8edSLibin Yangthe device entries number is dynamically changed. If DP MST hub is connected,
26*dd48e8edSLibin Yangit is in DP MST mode, and the device entries number is 3. Otherwise, the
27*dd48e8edSLibin Yangdevice entries number is 1.
28*dd48e8edSLibin Yang
29*dd48e8edSLibin YangTo simplify the implementation, all the device entries will be initialized
30*dd48e8edSLibin Yangwhen bootup no matter whether it is in DP MST mode or not.
31*dd48e8edSLibin Yang
32*dd48e8edSLibin YangConnection list
33*dd48e8edSLibin Yang===============
34*dd48e8edSLibin YangDP MST reuses connection list code. The code can be reused because
35*dd48e8edSLibin Yangdevice entries on the same pin have the same connection list.
36*dd48e8edSLibin Yang
37*dd48e8edSLibin YangThis means DP MST gets the device entry connection list without the
38*dd48e8edSLibin Yangdevice entry setting.
3976ab4e15STakashi Iwai
4076ab4e15STakashi IwaiJack
4176ab4e15STakashi Iwai====
4276ab4e15STakashi Iwai
4376ab4e15STakashi IwaiPresume:
4476ab4e15STakashi Iwai - MST must be dyn_pcm_assign, and it is acomp (for Intel scenario);
4576ab4e15STakashi Iwai - NON-MST may or may not be dyn_pcm_assign, it can be acomp or !acomp;
4676ab4e15STakashi Iwai
4776ab4e15STakashi IwaiSo there are the following scenarios:
4876ab4e15STakashi Iwai a. MST (&& dyn_pcm_assign && acomp)
4976ab4e15STakashi Iwai b. NON-MST && dyn_pcm_assign && acomp
5076ab4e15STakashi Iwai c. NON-MST && !dyn_pcm_assign && !acomp
5176ab4e15STakashi Iwai
5276ab4e15STakashi IwaiBelow discussion will ignore MST and NON-MST difference as it doesn't
5376ab4e15STakashi Iwaiimpact on jack handling too much.
5476ab4e15STakashi Iwai
5576ab4e15STakashi IwaiDriver uses struct hdmi_pcm pcm[] array in hdmi_spec and snd_jack is
5676ab4e15STakashi Iwaia member of hdmi_pcm. Each pin has one struct hdmi_pcm * pcm pointer.
5776ab4e15STakashi Iwai
5876ab4e15STakashi IwaiFor !dyn_pcm_assign, per_pin->pcm will assigned to spec->pcm[n] statically.
5976ab4e15STakashi Iwai
6076ab4e15STakashi IwaiFor dyn_pcm_assign, per_pin->pcm will assigned to spec->pcm[n]
6176ab4e15STakashi Iwaiwhen monitor is hotplugged.
6276ab4e15STakashi Iwai
6376ab4e15STakashi Iwai
6476ab4e15STakashi IwaiBuild Jack
6576ab4e15STakashi Iwai----------
6676ab4e15STakashi Iwai
6776ab4e15STakashi Iwai- dyn_pcm_assign
6876ab4e15STakashi Iwai
6976ab4e15STakashi Iwai  Will not use hda_jack but use snd_jack in spec->pcm_rec[pcm_idx].jack directly.
7076ab4e15STakashi Iwai
7176ab4e15STakashi Iwai- !dyn_pcm_assign
7276ab4e15STakashi Iwai
7376ab4e15STakashi Iwai  Use hda_jack and assign spec->pcm_rec[pcm_idx].jack = jack->jack statically.
7476ab4e15STakashi Iwai
7576ab4e15STakashi Iwai
7676ab4e15STakashi IwaiUnsolicited Event Enabling
7776ab4e15STakashi Iwai--------------------------
7876ab4e15STakashi IwaiEnable unsolicited event if !acomp.
7976ab4e15STakashi Iwai
8076ab4e15STakashi Iwai
8176ab4e15STakashi IwaiMonitor Hotplug Event Handling
8276ab4e15STakashi Iwai------------------------------
8376ab4e15STakashi Iwai- acomp
8476ab4e15STakashi Iwai
8576ab4e15STakashi Iwai  pin_eld_notify() -> check_presence_and_report() -> hdmi_present_sense() ->
8676ab4e15STakashi Iwai  sync_eld_via_acomp().
8776ab4e15STakashi Iwai
8876ab4e15STakashi Iwai  Use directly snd_jack_report() on spec->pcm_rec[pcm_idx].jack for
8976ab4e15STakashi Iwai  both dyn_pcm_assign and !dyn_pcm_assign
9076ab4e15STakashi Iwai
9176ab4e15STakashi Iwai- !acomp
9276ab4e15STakashi Iwai
9376ab4e15STakashi Iwai  hdmi_unsol_event() -> hdmi_intrinsic_event() -> check_presence_and_report() ->
9476ab4e15STakashi Iwai  hdmi_present_sense() -> hdmi_prepsent_sense_via_verbs()
9576ab4e15STakashi Iwai
9676ab4e15STakashi Iwai  Use directly snd_jack_report() on spec->pcm_rec[pcm_idx].jack for dyn_pcm_assign.
9776ab4e15STakashi Iwai  Use hda_jack mechanism to handle jack events.
9876ab4e15STakashi Iwai
9976ab4e15STakashi Iwai
10076ab4e15STakashi IwaiOthers to be added later
10176ab4e15STakashi Iwai========================
102