Commit b5f2be9a authored by Pierre-Louis Bossart's avatar Pierre-Louis Bossart Committed by Takashi Iwai

drm/i915: add DP support in LPE audio mode

If DisplayPort is detected, pass flag and link rate to audio driver
Signed-off-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Acked-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent eacc8daf
...@@ -3401,7 +3401,8 @@ int intel_lpe_audio_init(struct drm_i915_private *dev_priv); ...@@ -3401,7 +3401,8 @@ int intel_lpe_audio_init(struct drm_i915_private *dev_priv);
void intel_lpe_audio_teardown(struct drm_i915_private *dev_priv); void intel_lpe_audio_teardown(struct drm_i915_private *dev_priv);
void intel_lpe_audio_irq_handler(struct drm_i915_private *dev_priv); void intel_lpe_audio_irq_handler(struct drm_i915_private *dev_priv);
void intel_lpe_audio_notify(struct drm_i915_private *dev_priv, void intel_lpe_audio_notify(struct drm_i915_private *dev_priv,
void *eld, int port, int tmds_clk_speed); void *eld, int port, int tmds_clk_speed,
bool dp_output, int link_rate);
/* intel_i2c.c */ /* intel_i2c.c */
extern int intel_setup_gmbus(struct drm_device *dev); extern int intel_setup_gmbus(struct drm_device *dev);
......
...@@ -631,9 +631,20 @@ void intel_audio_codec_enable(struct intel_encoder *intel_encoder, ...@@ -631,9 +631,20 @@ void intel_audio_codec_enable(struct intel_encoder *intel_encoder,
if (acomp && acomp->audio_ops && acomp->audio_ops->pin_eld_notify) if (acomp && acomp->audio_ops && acomp->audio_ops->pin_eld_notify)
acomp->audio_ops->pin_eld_notify(acomp->audio_ops->audio_ptr, acomp->audio_ops->pin_eld_notify(acomp->audio_ops->audio_ptr,
(int) port, (int) pipe); (int) port, (int) pipe);
switch (intel_encoder->type) {
case INTEL_OUTPUT_HDMI:
intel_lpe_audio_notify(dev_priv, connector->eld, port,
crtc_state->port_clock,
false, 0);
break;
case INTEL_OUTPUT_DP:
intel_lpe_audio_notify(dev_priv, connector->eld, port, intel_lpe_audio_notify(dev_priv, connector->eld, port,
crtc_state->port_clock); adjusted_mode->crtc_clock,
true, crtc_state->port_clock);
break;
default:
break;
}
} }
/** /**
...@@ -668,7 +679,7 @@ void intel_audio_codec_disable(struct intel_encoder *intel_encoder) ...@@ -668,7 +679,7 @@ void intel_audio_codec_disable(struct intel_encoder *intel_encoder)
acomp->audio_ops->pin_eld_notify(acomp->audio_ops->audio_ptr, acomp->audio_ops->pin_eld_notify(acomp->audio_ops->audio_ptr,
(int) port, (int) pipe); (int) port, (int) pipe);
intel_lpe_audio_notify(dev_priv, NULL, port, 0); intel_lpe_audio_notify(dev_priv, NULL, port, 0, false, 0);
} }
/** /**
......
...@@ -332,7 +332,8 @@ void intel_lpe_audio_teardown(struct drm_i915_private *dev_priv) ...@@ -332,7 +332,8 @@ void intel_lpe_audio_teardown(struct drm_i915_private *dev_priv)
* Notify lpe audio driver of eld change. * Notify lpe audio driver of eld change.
*/ */
void intel_lpe_audio_notify(struct drm_i915_private *dev_priv, void intel_lpe_audio_notify(struct drm_i915_private *dev_priv,
void *eld, int port, int tmds_clk_speed) void *eld, int port, int tmds_clk_speed,
bool dp_output, int link_rate)
{ {
unsigned long irq_flags; unsigned long irq_flags;
struct intel_hdmi_lpe_audio_pdata *pdata = NULL; struct intel_hdmi_lpe_audio_pdata *pdata = NULL;
...@@ -351,12 +352,16 @@ void intel_lpe_audio_notify(struct drm_i915_private *dev_priv, ...@@ -351,12 +352,16 @@ void intel_lpe_audio_notify(struct drm_i915_private *dev_priv,
pdata->eld.port_id = port; pdata->eld.port_id = port;
pdata->hdmi_connected = true; pdata->hdmi_connected = true;
pdata->dp_output = dp_output;
if (tmds_clk_speed) if (tmds_clk_speed)
pdata->tmds_clock_speed = tmds_clk_speed; pdata->tmds_clock_speed = tmds_clk_speed;
if (link_rate)
pdata->link_rate = link_rate;
} else { } else {
memset(pdata->eld.eld_data, 0, memset(pdata->eld.eld_data, 0,
HDMI_MAX_ELD_BYTES); HDMI_MAX_ELD_BYTES);
pdata->hdmi_connected = false; pdata->hdmi_connected = false;
pdata->dp_output = false;
} }
if (pdata->notify_audio_lpe) if (pdata->notify_audio_lpe)
......
...@@ -38,6 +38,8 @@ struct intel_hdmi_lpe_audio_pdata { ...@@ -38,6 +38,8 @@ struct intel_hdmi_lpe_audio_pdata {
bool notify_pending; bool notify_pending;
int tmds_clock_speed; int tmds_clock_speed;
bool hdmi_connected; bool hdmi_connected;
bool dp_output;
int link_rate;
struct intel_hdmi_lpe_audio_eld eld; struct intel_hdmi_lpe_audio_eld eld;
void (*notify_audio_lpe)(void *audio_ptr); void (*notify_audio_lpe)(void *audio_ptr);
spinlock_t lpe_audio_slock; spinlock_t lpe_audio_slock;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment