Lines Matching +full:audio +full:- +full:enable
43 * DOC: High Definition Audio over HDMI and Display Port
45 * The graphics and audio drivers together support High Definition Audio over
46 * HDMI and Display Port. The audio programming sequences are divided into audio
47 * codec and controller enable and disable sequences. The graphics driver
48 * handles the audio codec sequences, while the audio driver handles the audio
52 * port. The enable sequences may only be performed after enabling the
53 * transcoder and port, and after completed link training. Therefore the audio
54 * enable/disable sequences are part of the modeset sequence.
57 * but generally the ELDV/PD change in the codec sequence indicates to the audio
59 * co-operation between the graphics and audio drivers is handled via audio
64 * and audio drivers. The struct &i915_audio_component_ops @ops in it is
65 * defined in graphics driver and called in audio driver. The
144 /* Appendix C - N & CTS values for deep color from HDMI 2.0 spec*/
188 * WA_14020863754: Implement Audio Workaround
189 * Corner case with Min Hblank Fix can cause audio hang
199 struct drm_i915_private *i915 = to_i915(crtc_state->uapi.crtc->dev); in audio_config_hdmi_pixel_clock()
201 &crtc_state->hw.adjusted_mode; in audio_config_hdmi_pixel_clock()
205 if (adjusted_mode->crtc_clock == hdmi_audio_clock[i].clock) in audio_config_hdmi_pixel_clock()
209 if (DISPLAY_VER(i915) < 12 && adjusted_mode->crtc_clock > 148500) in audio_config_hdmi_pixel_clock()
213 drm_dbg_kms(&i915->drm, in audio_config_hdmi_pixel_clock()
214 "HDMI audio pixel clock setting for %d not found, falling back to defaults\n", in audio_config_hdmi_pixel_clock()
215 adjusted_mode->crtc_clock); in audio_config_hdmi_pixel_clock()
219 drm_dbg_kms(&i915->drm, in audio_config_hdmi_pixel_clock()
220 "Configuring HDMI audio for pixel clock %d (0x%08x)\n", in audio_config_hdmi_pixel_clock()
233 if (crtc_state->pipe_bpp == 36) { in audio_config_hdmi_get_n()
236 } else if (crtc_state->pipe_bpp == 30) { in audio_config_hdmi_get_n()
246 crtc_state->port_clock == hdmi_ncts_table[i].clock) { in audio_config_hdmi_get_n()
266 struct drm_i915_private *i915 = to_i915(encoder->base.dev); in g4x_audio_codec_get_config()
267 u32 *eld = (u32 *)crtc_state->eld; in g4x_audio_codec_get_config()
278 len = min_t(int, sizeof(crtc_state->eld) / 4, eld_buffer_size); in g4x_audio_codec_get_config()
288 struct drm_i915_private *i915 = to_i915(encoder->base.dev); in g4x_audio_codec_disable()
289 struct intel_crtc *crtc = to_intel_crtc(old_crtc_state->uapi.crtc); in g4x_audio_codec_disable()
303 struct drm_i915_private *i915 = to_i915(encoder->base.dev); in g4x_audio_codec_enable()
304 struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); in g4x_audio_codec_enable()
305 const u32 *eld = (const u32 *)crtc_state->eld; in g4x_audio_codec_enable()
314 len = min(drm_eld_size(crtc_state->eld) / 4, eld_buffer_size); in g4x_audio_codec_enable()
321 drm_WARN_ON(&i915->drm, in g4x_audio_codec_enable()
332 struct drm_i915_private *i915 = to_i915(encoder->base.dev); in hsw_dp_audio_config_update()
333 enum transcoder cpu_transcoder = crtc_state->cpu_transcoder; in hsw_dp_audio_config_update()
335 /* Enable time stamps. Let HW calculate Maud/Naud values */ in hsw_dp_audio_config_update()
350 struct drm_i915_private *i915 = to_i915(encoder->base.dev); in hsw_hdmi_audio_config_update()
351 struct i915_audio_component *acomp = i915->display.audio.component; in hsw_hdmi_audio_config_update()
352 enum transcoder cpu_transcoder = crtc_state->cpu_transcoder; in hsw_hdmi_audio_config_update()
353 enum port port = encoder->port; in hsw_hdmi_audio_config_update()
357 rate = acomp ? acomp->aud_sample_rate[port] : 0; in hsw_hdmi_audio_config_update()
367 drm_dbg_kms(&i915->drm, "using N %d\n", n); in hsw_hdmi_audio_config_update()
373 drm_dbg_kms(&i915->drm, "using automatic N\n"); in hsw_hdmi_audio_config_update()
379 * Let's disable "Enable CTS or M Prog bit" in hsw_hdmi_audio_config_update()
402 struct drm_i915_private *i915 = to_i915(encoder->base.dev); in hsw_audio_codec_disable()
403 struct intel_crtc *crtc = to_intel_crtc(old_crtc_state->uapi.crtc); in hsw_audio_codec_disable()
404 enum transcoder cpu_transcoder = old_crtc_state->cpu_transcoder; in hsw_audio_codec_disable()
406 mutex_lock(&i915->display.audio.mutex); in hsw_audio_codec_disable()
424 /* Disable audio presence detect */ in hsw_audio_codec_disable()
431 mutex_unlock(&i915->display.audio.mutex); in hsw_audio_codec_disable()
437 struct drm_i915_private *i915 = to_i915(encoder->base.dev); in calc_hblank_early_prog()
445 h_active = crtc_state->hw.adjusted_mode.crtc_hdisplay; in calc_hblank_early_prog()
446 h_total = crtc_state->hw.adjusted_mode.crtc_htotal; in calc_hblank_early_prog()
447 pixel_clk = crtc_state->hw.adjusted_mode.crtc_clock; in calc_hblank_early_prog()
448 vdsc_bppx16 = crtc_state->dsc.compressed_bpp_x16; in calc_hblank_early_prog()
449 cdclk = i915->display.cdclk.hw.cdclk; in calc_hblank_early_prog()
452 link_clk = crtc_state->port_clock; in calc_hblank_early_prog()
453 lanes = crtc_state->lane_count; in calc_hblank_early_prog()
455 drm_dbg_kms(&i915->drm, in calc_hblank_early_prog()
462 link_clks_available = (h_total - h_active) * link_clk / pixel_clk - 28; in calc_hblank_early_prog()
475 link_clks_active = (tu_line - 1) * 64 + tu_data; in calc_hblank_early_prog()
479 return h_active - hblank_rise + hblank_delta; in calc_hblank_early_prog()
487 h_active = crtc_state->hw.adjusted_mode.hdisplay; in calc_samples_room()
488 h_total = crtc_state->hw.adjusted_mode.htotal; in calc_samples_room()
489 pixel_clk = crtc_state->hw.adjusted_mode.clock; in calc_samples_room()
490 link_clk = crtc_state->port_clock; in calc_samples_room()
491 lanes = crtc_state->lane_count; in calc_samples_room()
493 return ((h_total - h_active) * link_clk - 12 * pixel_clk) / in calc_samples_room()
500 struct drm_i915_private *i915 = to_i915(encoder->base.dev); in enable_audio_dsc_wa()
501 enum transcoder cpu_transcoder = crtc_state->cpu_transcoder; in enable_audio_dsc_wa()
515 if (crtc_state->dsc.compression_enable && in enable_audio_dsc_wa()
516 crtc_state->hw.adjusted_mode.hdisplay >= 3840 && in enable_audio_dsc_wa()
517 crtc_state->hw.adjusted_mode.vdisplay >= 2160) { in enable_audio_dsc_wa()
518 /* Get hblank early enable value required */ in enable_audio_dsc_wa()
546 struct drm_i915_private *i915 = to_i915(encoder->base.dev); in hsw_audio_codec_enable()
547 struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); in hsw_audio_codec_enable()
548 enum transcoder cpu_transcoder = crtc_state->cpu_transcoder; in hsw_audio_codec_enable()
550 mutex_lock(&i915->display.audio.mutex); in hsw_audio_codec_enable()
552 /* Enable Audio WA for 4k DSC usecases */ in hsw_audio_codec_enable()
559 /* Enable audio presence detect */ in hsw_audio_codec_enable()
570 * The audio componenent is used to convey the ELD in hsw_audio_codec_enable()
574 /* Enable timestamps */ in hsw_audio_codec_enable()
577 mutex_unlock(&i915->display.audio.mutex); in hsw_audio_codec_enable()
589 regs->hdmiw_hdmiedid = VLV_HDMIW_HDMIEDID(pipe); in ibx_audio_regs_init()
590 regs->aud_config = VLV_AUD_CFG(pipe); in ibx_audio_regs_init()
591 regs->aud_cntl_st = VLV_AUD_CNTL_ST(pipe); in ibx_audio_regs_init()
592 regs->aud_cntrl_st2 = VLV_AUD_CNTL_ST2; in ibx_audio_regs_init()
594 regs->hdmiw_hdmiedid = CPT_HDMIW_HDMIEDID(pipe); in ibx_audio_regs_init()
595 regs->aud_config = CPT_AUD_CFG(pipe); in ibx_audio_regs_init()
596 regs->aud_cntl_st = CPT_AUD_CNTL_ST(pipe); in ibx_audio_regs_init()
597 regs->aud_cntrl_st2 = CPT_AUD_CNTRL_ST2; in ibx_audio_regs_init()
599 regs->hdmiw_hdmiedid = IBX_HDMIW_HDMIEDID(pipe); in ibx_audio_regs_init()
600 regs->aud_config = IBX_AUD_CFG(pipe); in ibx_audio_regs_init()
601 regs->aud_cntl_st = IBX_AUD_CNTL_ST(pipe); in ibx_audio_regs_init()
602 regs->aud_cntrl_st2 = IBX_AUD_CNTL_ST2; in ibx_audio_regs_init()
610 struct drm_i915_private *i915 = to_i915(encoder->base.dev); in ibx_audio_codec_disable()
611 struct intel_crtc *crtc = to_intel_crtc(old_crtc_state->uapi.crtc); in ibx_audio_codec_disable()
612 enum port port = encoder->port; in ibx_audio_codec_disable()
613 enum pipe pipe = crtc->pipe; in ibx_audio_codec_disable()
616 if (drm_WARN_ON(&i915->drm, port == PORT_A)) in ibx_audio_codec_disable()
621 mutex_lock(&i915->display.audio.mutex); in ibx_audio_codec_disable()
636 mutex_unlock(&i915->display.audio.mutex); in ibx_audio_codec_disable()
646 struct drm_i915_private *i915 = to_i915(encoder->base.dev); in ibx_audio_codec_enable()
647 struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); in ibx_audio_codec_enable()
648 enum port port = encoder->port; in ibx_audio_codec_enable()
649 enum pipe pipe = crtc->pipe; in ibx_audio_codec_enable()
652 if (drm_WARN_ON(&i915->drm, port == PORT_A)) in ibx_audio_codec_enable()
659 mutex_lock(&i915->display.audio.mutex); in ibx_audio_codec_enable()
666 * The audio componenent is used to convey the ELD in ibx_audio_codec_enable()
670 /* Enable timestamps */ in ibx_audio_codec_enable()
679 mutex_unlock(&i915->display.audio.mutex); in ibx_audio_codec_enable()
684 struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); in intel_audio_sdp_split_update()
685 struct drm_i915_private *i915 = to_i915(crtc->base.dev); in intel_audio_sdp_split_update()
686 enum transcoder trans = crtc_state->cpu_transcoder; in intel_audio_sdp_split_update()
690 crtc_state->sdp_split_enable ? AUD_ENABLE_SDP_SPLIT : 0); in intel_audio_sdp_split_update()
697 struct drm_i915_private *i915 = to_i915(encoder->base.dev); in intel_audio_compute_config()
698 struct drm_connector *connector = conn_state->connector; in intel_audio_compute_config()
700 &crtc_state->hw.adjusted_mode; in intel_audio_compute_config()
702 if (!connector->eld[0]) { in intel_audio_compute_config()
703 drm_dbg_kms(&i915->drm, in intel_audio_compute_config()
705 connector->base.id, connector->name); in intel_audio_compute_config()
709 BUILD_BUG_ON(sizeof(crtc_state->eld) != sizeof(connector->eld)); in intel_audio_compute_config()
710 memcpy(crtc_state->eld, connector->eld, sizeof(crtc_state->eld)); in intel_audio_compute_config()
712 crtc_state->eld[6] = drm_av_sync_delay(connector, adjusted_mode) / 2; in intel_audio_compute_config()
718 * intel_audio_codec_enable - Enable the audio codec for HD audio
719 * @encoder: encoder on which to enable audio
723 * The enable sequences may only be performed after enabling the transcoder and
730 struct drm_i915_private *i915 = to_i915(encoder->base.dev); in intel_audio_codec_enable()
731 struct i915_audio_component *acomp = i915->display.audio.component; in intel_audio_codec_enable()
732 struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); in intel_audio_codec_enable()
733 struct intel_connector *connector = to_intel_connector(conn_state->connector); in intel_audio_codec_enable()
734 enum transcoder cpu_transcoder = crtc_state->cpu_transcoder; in intel_audio_codec_enable()
736 enum port port = encoder->port; in intel_audio_codec_enable()
738 if (!crtc_state->has_audio) in intel_audio_codec_enable()
741 …drm_dbg_kms(&i915->drm, "[CONNECTOR:%d:%s][ENCODER:%d:%s] Enable audio codec on [CRTC:%d:%s], %u b… in intel_audio_codec_enable()
742 connector->base.base.id, connector->base.name, in intel_audio_codec_enable()
743 encoder->base.base.id, encoder->base.name, in intel_audio_codec_enable()
744 crtc->base.base.id, crtc->base.name, in intel_audio_codec_enable()
745 drm_eld_size(crtc_state->eld)); in intel_audio_codec_enable()
747 if (i915->display.funcs.audio) in intel_audio_codec_enable()
748 i915->display.funcs.audio->audio_codec_enable(encoder, in intel_audio_codec_enable()
752 mutex_lock(&i915->display.audio.mutex); in intel_audio_codec_enable()
754 audio_state = &i915->display.audio.state[cpu_transcoder]; in intel_audio_codec_enable()
756 audio_state->encoder = encoder; in intel_audio_codec_enable()
757 BUILD_BUG_ON(sizeof(audio_state->eld) != sizeof(crtc_state->eld)); in intel_audio_codec_enable()
758 memcpy(audio_state->eld, crtc_state->eld, sizeof(audio_state->eld)); in intel_audio_codec_enable()
760 mutex_unlock(&i915->display.audio.mutex); in intel_audio_codec_enable()
762 if (acomp && acomp->base.audio_ops && in intel_audio_codec_enable()
763 acomp->base.audio_ops->pin_eld_notify) { in intel_audio_codec_enable()
764 /* audio drivers expect cpu_transcoder = -1 to indicate Non-MST cases */ in intel_audio_codec_enable()
766 cpu_transcoder = -1; in intel_audio_codec_enable()
767 acomp->base.audio_ops->pin_eld_notify(acomp->base.audio_ops->audio_ptr, in intel_audio_codec_enable()
771 intel_lpe_audio_notify(i915, cpu_transcoder, port, crtc_state->eld, in intel_audio_codec_enable()
772 crtc_state->port_clock, in intel_audio_codec_enable()
777 * intel_audio_codec_disable - Disable the audio codec for HD audio
778 * @encoder: encoder on which to disable audio
789 struct drm_i915_private *i915 = to_i915(encoder->base.dev); in intel_audio_codec_disable()
790 struct i915_audio_component *acomp = i915->display.audio.component; in intel_audio_codec_disable()
791 struct intel_crtc *crtc = to_intel_crtc(old_crtc_state->uapi.crtc); in intel_audio_codec_disable()
792 struct intel_connector *connector = to_intel_connector(old_conn_state->connector); in intel_audio_codec_disable()
793 enum transcoder cpu_transcoder = old_crtc_state->cpu_transcoder; in intel_audio_codec_disable()
795 enum port port = encoder->port; in intel_audio_codec_disable()
797 if (!old_crtc_state->has_audio) in intel_audio_codec_disable()
800 drm_dbg_kms(&i915->drm, "[CONNECTOR:%d:%s][ENCODER:%d:%s] Disable audio codec on [CRTC:%d:%s]\n", in intel_audio_codec_disable()
801 connector->base.base.id, connector->base.name, in intel_audio_codec_disable()
802 encoder->base.base.id, encoder->base.name, in intel_audio_codec_disable()
803 crtc->base.base.id, crtc->base.name); in intel_audio_codec_disable()
805 if (i915->display.funcs.audio) in intel_audio_codec_disable()
806 i915->display.funcs.audio->audio_codec_disable(encoder, in intel_audio_codec_disable()
810 mutex_lock(&i915->display.audio.mutex); in intel_audio_codec_disable()
812 audio_state = &i915->display.audio.state[cpu_transcoder]; in intel_audio_codec_disable()
814 audio_state->encoder = NULL; in intel_audio_codec_disable()
815 memset(audio_state->eld, 0, sizeof(audio_state->eld)); in intel_audio_codec_disable()
817 mutex_unlock(&i915->display.audio.mutex); in intel_audio_codec_disable()
819 if (acomp && acomp->base.audio_ops && in intel_audio_codec_disable()
820 acomp->base.audio_ops->pin_eld_notify) { in intel_audio_codec_disable()
821 /* audio drivers expect cpu_transcoder = -1 to indicate Non-MST cases */ in intel_audio_codec_disable()
823 cpu_transcoder = -1; in intel_audio_codec_disable()
824 acomp->base.audio_ops->pin_eld_notify(acomp->base.audio_ops->audio_ptr, in intel_audio_codec_disable()
834 struct drm_i915_private *i915 = to_i915(encoder->base.dev); in intel_acomp_get_config()
835 enum transcoder cpu_transcoder = crtc_state->cpu_transcoder; in intel_acomp_get_config()
838 mutex_lock(&i915->display.audio.mutex); in intel_acomp_get_config()
840 audio_state = &i915->display.audio.state[cpu_transcoder]; in intel_acomp_get_config()
842 if (audio_state->encoder) in intel_acomp_get_config()
843 memcpy(crtc_state->eld, audio_state->eld, sizeof(audio_state->eld)); in intel_acomp_get_config()
845 mutex_unlock(&i915->display.audio.mutex); in intel_acomp_get_config()
851 struct drm_i915_private *i915 = to_i915(encoder->base.dev); in intel_audio_codec_get_config()
853 if (!crtc_state->has_audio) in intel_audio_codec_get_config()
856 if (i915->display.funcs.audio) in intel_audio_codec_get_config()
857 i915->display.funcs.audio->audio_codec_get_config(encoder, crtc_state); in intel_audio_codec_get_config()
879 * intel_audio_hooks_init - Set up chip specific audio hooks
885 i915->display.funcs.audio = &g4x_audio_funcs; in intel_audio_hooks_init()
888 i915->display.funcs.audio = &ibx_audio_funcs; in intel_audio_hooks_init()
890 i915->display.funcs.audio = &hsw_audio_funcs; in intel_audio_hooks_init()
906 aud_ts->m = 60; in get_aud_ts_cdclk_m_n()
907 aud_ts->n = cdclk * aud_ts->m / 24000; in get_aud_ts_cdclk_m_n()
915 get_aud_ts_cdclk_m_n(i915->display.cdclk.hw.ref, i915->display.cdclk.hw.cdclk, &aud_ts); in intel_audio_cdclk_change_post()
919 drm_dbg_kms(&i915->drm, "aud_ts_cdclk set to M=%u, N=%u\n", aud_ts.m, aud_ts.n); in intel_audio_cdclk_change_post()
925 bool enable) in glk_force_audio_cdclk_commit() argument
931 ret = drm_modeset_lock(&crtc->base.mutex, state->base.acquire_ctx); in glk_force_audio_cdclk_commit()
939 cdclk_state->force_min_cdclk = enable ? 2 * 96000 : 0; in glk_force_audio_cdclk_commit()
941 return drm_atomic_commit(&state->base); in glk_force_audio_cdclk_commit()
945 bool enable) in glk_force_audio_cdclk() argument
957 state = drm_atomic_state_alloc(&i915->drm); in glk_force_audio_cdclk()
958 if (drm_WARN_ON(&i915->drm, !state)) in glk_force_audio_cdclk()
961 state->acquire_ctx = &ctx; in glk_force_audio_cdclk()
962 to_intel_atomic_state(state)->internal = true; in glk_force_audio_cdclk()
966 enable); in glk_force_audio_cdclk()
967 if (ret == -EDEADLK) { in glk_force_audio_cdclk()
973 drm_WARN_ON(&i915->drm, ret); in glk_force_audio_cdclk()
984 struct drm_i915_private *i915 = to_i915(display->drm); in i915_audio_component_get_power()
992 if (i915->display.audio.power_refcount++ == 0) { in i915_audio_component_get_power()
995 i915->display.audio.freq_cntrl); in i915_audio_component_get_power()
996 drm_dbg_kms(&i915->drm, in i915_audio_component_get_power()
998 i915->display.audio.freq_cntrl); in i915_audio_component_get_power()
1001 /* Force CDCLK to 2*BCLK as long as we need audio powered. */ in i915_audio_component_get_power()
1017 struct drm_i915_private *i915 = to_i915(display->drm); in i915_audio_component_put_power()
1020 /* Stop forcing CDCLK to 2*BCLK if no need for audio to be powered. */ in i915_audio_component_put_power()
1021 if (--i915->display.audio.power_refcount == 0) in i915_audio_component_put_power()
1029 bool enable) in i915_audio_component_codec_wake_override() argument
1032 struct drm_i915_private *i915 = to_i915(display->drm); in i915_audio_component_codec_wake_override()
1041 * Enable/disable generating the codec wake signal, overriding the in i915_audio_component_codec_wake_override()
1048 if (enable) { in i915_audio_component_codec_wake_override()
1061 struct drm_i915_private *i915 = to_i915(display->drm); in i915_audio_component_get_cdclk_freq()
1063 if (drm_WARN_ON_ONCE(&i915->drm, !HAS_DDI(i915))) in i915_audio_component_get_cdclk_freq()
1064 return -ENODEV; in i915_audio_component_get_cdclk_freq()
1066 return i915->display.cdclk.hw.cdclk; in i915_audio_component_get_cdclk_freq()
1070 * get the intel audio state according to the parameter port and cpu_transcoder
1071 * MST & (cpu_transcoder >= 0): return the audio.state[cpu_transcoder].encoder],
1074 * Non-MST & (cpu_transcoder >= 0): only cpu_transcoder = 0 (the first device entry)
1076 * Non-MST & (cpu_transcoder < 0): get the right intel_encoder with port matched
1086 if (drm_WARN_ON(&i915->drm, in find_audio_state()
1087 cpu_transcoder >= ARRAY_SIZE(i915->display.audio.state))) in find_audio_state()
1090 audio_state = &i915->display.audio.state[cpu_transcoder]; in find_audio_state()
1091 encoder = audio_state->encoder; in find_audio_state()
1093 if (encoder && encoder->port == port && in find_audio_state()
1094 encoder->type == INTEL_OUTPUT_DP_MST) in find_audio_state()
1098 /* Non-MST */ in find_audio_state()
1106 audio_state = &i915->display.audio.state[cpu_transcoder]; in find_audio_state()
1107 encoder = audio_state->encoder; in find_audio_state()
1109 if (encoder && encoder->port == port && in find_audio_state()
1110 encoder->type != INTEL_OUTPUT_DP_MST) in find_audio_state()
1121 struct drm_i915_private *i915 = to_i915(display->drm); in i915_audio_component_sync_audio_rate()
1122 struct i915_audio_component *acomp = i915->display.audio.component; in i915_audio_component_sync_audio_rate()
1133 mutex_lock(&i915->display.audio.mutex); in i915_audio_component_sync_audio_rate()
1137 drm_dbg_kms(&i915->drm, "Not valid for port %c\n", port_name(port)); in i915_audio_component_sync_audio_rate()
1138 err = -ENODEV; in i915_audio_component_sync_audio_rate()
1142 encoder = audio_state->encoder; in i915_audio_component_sync_audio_rate()
1145 crtc = to_intel_crtc(encoder->base.crtc); in i915_audio_component_sync_audio_rate()
1148 acomp->aud_sample_rate[port] = rate; in i915_audio_component_sync_audio_rate()
1150 /* FIXME get rid of the crtc->config stuff */ in i915_audio_component_sync_audio_rate()
1151 hsw_audio_config_update(encoder, crtc->config); in i915_audio_component_sync_audio_rate()
1154 mutex_unlock(&i915->display.audio.mutex); in i915_audio_component_sync_audio_rate()
1164 struct drm_i915_private *i915 = to_i915(display->drm); in i915_audio_component_get_eld()
1168 mutex_lock(&i915->display.audio.mutex); in i915_audio_component_get_eld()
1172 drm_dbg_kms(&i915->drm, "Not valid for port %c\n", port_name(port)); in i915_audio_component_get_eld()
1173 mutex_unlock(&i915->display.audio.mutex); in i915_audio_component_get_eld()
1174 return -EINVAL; in i915_audio_component_get_eld()
1177 *enabled = audio_state->encoder != NULL; in i915_audio_component_get_eld()
1179 const u8 *eld = audio_state->eld; in i915_audio_component_get_eld()
1185 mutex_unlock(&i915->display.audio.mutex); in i915_audio_component_get_eld()
1203 struct drm_i915_private *i915 = to_i915(display->drm); in i915_audio_component_bind()
1207 if (drm_WARN_ON(&i915->drm, acomp->base.ops || acomp->base.dev)) in i915_audio_component_bind()
1208 return -EEXIST; in i915_audio_component_bind()
1210 if (drm_WARN_ON(&i915->drm, in i915_audio_component_bind()
1213 return -ENOMEM; in i915_audio_component_bind()
1215 drm_modeset_lock_all(&i915->drm); in i915_audio_component_bind()
1216 acomp->base.ops = &i915_audio_component_ops; in i915_audio_component_bind()
1217 acomp->base.dev = drv_kdev; in i915_audio_component_bind()
1219 for (i = 0; i < ARRAY_SIZE(acomp->aud_sample_rate); i++) in i915_audio_component_bind()
1220 acomp->aud_sample_rate[i] = 0; in i915_audio_component_bind()
1221 i915->display.audio.component = acomp; in i915_audio_component_bind()
1222 drm_modeset_unlock_all(&i915->drm); in i915_audio_component_bind()
1231 struct drm_i915_private *i915 = to_i915(display->drm); in i915_audio_component_unbind()
1234 drm_modeset_lock_all(&i915->drm); in i915_audio_component_unbind()
1235 acomp->base.ops = NULL; in i915_audio_component_unbind()
1236 acomp->base.dev = NULL; in i915_audio_component_unbind()
1237 i915->display.audio.component = NULL; in i915_audio_component_unbind()
1238 drm_modeset_unlock_all(&i915->drm); in i915_audio_component_unbind()
1242 if (i915->display.audio.power_refcount) in i915_audio_component_unbind()
1243 drm_err(&i915->drm, "audio power refcount %d after unbind\n", in i915_audio_component_unbind()
1244 i915->display.audio.power_refcount); in i915_audio_component_unbind()
1262 * i915_audio_component_init - initialize and register the audio component
1275 * functionality (i.e. without HDMI audio).
1294 drm_dbg_kms(&i915->drm, "use AUD_FREQ_CNTRL of 0x%x (init value 0x%x)\n", in i915_audio_component_init()
1297 i915->display.audio.freq_cntrl = aud_freq; in i915_audio_component_init()
1308 ret = component_add_typed(i915->drm.dev, in i915_audio_component_register()
1312 drm_err(&i915->drm, in i915_audio_component_register()
1313 "failed to add audio component (%d)\n", ret); in i915_audio_component_register()
1318 i915->display.audio.component_registered = true; in i915_audio_component_register()
1322 * i915_audio_component_cleanup - deregister the audio component
1325 * Deregisters the audio component, breaking any existing binding to the
1330 if (!i915->display.audio.component_registered) in i915_audio_component_cleanup()
1333 component_del(i915->drm.dev, &i915_audio_component_bind_ops); in i915_audio_component_cleanup()
1334 i915->display.audio.component_registered = false; in i915_audio_component_cleanup()
1338 * intel_audio_init() - Initialize the audio driver either using
1339 * component framework or using lpe audio bridge
1351 if (!i915->display.audio.lpe.platdev) in intel_audio_register()
1356 * intel_audio_deinit() - deinitialize the audio driver
1362 if (i915->display.audio.lpe.platdev != NULL) in intel_audio_deinit()