struct hdmi_ops ops;
 
        bool dyn_pin_out;
+       bool static_pcm_mapping;
        /* hdmi interrupt trigger control flag for Nvidia codec */
        bool hdmi_intr_trig_ctrl;
        bool nv_dp_workaround; /* workaround DP audio infoframe for Nvidia */
         */
        pcm_jack = pin_idx_to_pcm_jack(codec, per_pin);
 
-       if (eld->eld_valid) {
-               hdmi_attach_hda_pcm(spec, per_pin);
-               hdmi_pcm_setup_pin(spec, per_pin);
-       } else {
-               hdmi_pcm_reset_pin(spec, per_pin);
-               hdmi_detach_hda_pcm(spec, per_pin);
+       if (!spec->static_pcm_mapping) {
+               if (eld->eld_valid) {
+                       hdmi_attach_hda_pcm(spec, per_pin);
+                       hdmi_pcm_setup_pin(spec, per_pin);
+               } else {
+                       hdmi_pcm_reset_pin(spec, per_pin);
+                       hdmi_detach_hda_pcm(spec, per_pin);
+               }
        }
+
        /* if pcm_idx == -1, it means this is in monitor connection event
         * we can get the correct pcm_idx now.
         */
        struct hdmi_spec *spec = codec->spec;
        int idx, pcm_num;
 
-       /* limit the PCM devices to the codec converters */
-       pcm_num = spec->num_cvts;
+       /* limit the PCM devices to the codec converters or available PINs */
+       pcm_num = min(spec->num_cvts, spec->num_pins);
        codec_dbg(codec, "hdmi: pcm_num set to %d\n", pcm_num);
 
        for (idx = 0; idx < pcm_num; idx++) {
                struct hdmi_spec_per_pin *per_pin = get_pin(spec, pin_idx);
                struct hdmi_eld *pin_eld = &per_pin->sink_eld;
 
+               if (spec->static_pcm_mapping) {
+                       hdmi_attach_hda_pcm(spec, per_pin);
+                       hdmi_pcm_setup_pin(spec, per_pin);
+               }
+
                pin_eld->eld_valid = false;
                hdmi_present_sense(per_pin, 0);
        }
 
        spec = codec->spec;
 
+       spec->static_pcm_mapping = true;
+
        spec->ops.pin_get_eld = atihdmi_pin_get_eld;
        spec->ops.pin_setup_infoframe = atihdmi_pin_setup_infoframe;
        spec->ops.pin_hbr_setup = atihdmi_pin_hbr_setup;