Commit c98ec5ba authored by Ville Syrjälä's avatar Ville Syrjälä

drm/i915: Replace tmds_clock_speed and link_rate with just ls_clock

There's no need to distinguish between the DP link rate and HDMI TMDS
clock for the purposes of the LPE audio. Both are actually the same
thing more or less, which is the link symbol clock. So let's just
call the thing ls_clock and simplify the code.

Cc: Takashi Iwai <tiwai@suse.de>
Cc: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20170427160231.13337-6-ville.syrjala@linux.intel.comReviewed-by: default avatarTakashi Iwai <tiwai@suse.de>
parent d2205595
...@@ -3721,8 +3721,8 @@ int intel_lpe_audio_init(struct drm_i915_private *dev_priv); ...@@ -3721,8 +3721,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 pipe, int tmds_clk_speed, void *eld, int port, int pipe, int ls_clock,
bool dp_output, int link_rate); bool dp_output);
/* intel_i2c.c */ /* intel_i2c.c */
extern int intel_setup_gmbus(struct drm_i915_private *dev_priv); extern int intel_setup_gmbus(struct drm_i915_private *dev_priv);
......
...@@ -632,20 +632,9 @@ void intel_audio_codec_enable(struct intel_encoder *intel_encoder, ...@@ -632,20 +632,9 @@ void intel_audio_codec_enable(struct intel_encoder *intel_encoder,
(int) port, (int) pipe); (int) port, (int) pipe);
} }
switch (intel_encoder->type) { intel_lpe_audio_notify(dev_priv, connector->eld, port, pipe,
case INTEL_OUTPUT_HDMI: crtc_state->port_clock,
intel_lpe_audio_notify(dev_priv, connector->eld, port, pipe, intel_encoder->type == INTEL_OUTPUT_DP);
crtc_state->port_clock,
false, 0);
break;
case INTEL_OUTPUT_DP:
intel_lpe_audio_notify(dev_priv, connector->eld, port, pipe,
adjusted_mode->crtc_clock,
true, crtc_state->port_clock);
break;
default:
break;
}
} }
/** /**
...@@ -680,7 +669,7 @@ void intel_audio_codec_disable(struct intel_encoder *intel_encoder) ...@@ -680,7 +669,7 @@ void intel_audio_codec_disable(struct intel_encoder *intel_encoder)
(int) port, (int) pipe); (int) port, (int) pipe);
} }
intel_lpe_audio_notify(dev_priv, NULL, port, pipe, 0, false, 0); intel_lpe_audio_notify(dev_priv, NULL, port, pipe, 0, false);
} }
/** /**
......
...@@ -309,13 +309,14 @@ void intel_lpe_audio_teardown(struct drm_i915_private *dev_priv) ...@@ -309,13 +309,14 @@ void intel_lpe_audio_teardown(struct drm_i915_private *dev_priv)
* @eld : ELD data * @eld : ELD data
* @pipe: pipe id * @pipe: pipe id
* @port: port id * @port: port id
* @tmds_clk_speed: tmds clock frequency in Hz * @ls_clock: Link symbol clock in kHz
* @dp_output: Driving a DP output?
* *
* 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 pipe, int tmds_clk_speed, void *eld, int port, int pipe, int ls_clock,
bool dp_output, int link_rate) bool dp_output)
{ {
unsigned long irq_flags; unsigned long irq_flags;
struct intel_hdmi_lpe_audio_pdata *pdata = NULL; struct intel_hdmi_lpe_audio_pdata *pdata = NULL;
...@@ -337,12 +338,8 @@ void intel_lpe_audio_notify(struct drm_i915_private *dev_priv, ...@@ -337,12 +338,8 @@ void intel_lpe_audio_notify(struct drm_i915_private *dev_priv,
pdata->eld.port_id = port; pdata->eld.port_id = port;
pdata->eld.pipe_id = pipe; pdata->eld.pipe_id = pipe;
pdata->hdmi_connected = true; pdata->hdmi_connected = true;
pdata->ls_clock = ls_clock;
pdata->dp_output = dp_output; pdata->dp_output = dp_output;
if (tmds_clk_speed)
pdata->tmds_clock_speed = tmds_clk_speed;
if (link_rate)
pdata->link_rate = link_rate;
/* Unmute the amp for both DP and HDMI */ /* Unmute the amp for both DP and HDMI */
I915_WRITE(VLV_AUD_PORT_EN_DBG(port), I915_WRITE(VLV_AUD_PORT_EN_DBG(port),
...@@ -352,6 +349,7 @@ void intel_lpe_audio_notify(struct drm_i915_private *dev_priv, ...@@ -352,6 +349,7 @@ void intel_lpe_audio_notify(struct drm_i915_private *dev_priv,
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->ls_clock = 0;
pdata->dp_output = false; pdata->dp_output = false;
/* Mute the amp for both DP and HDMI */ /* Mute the amp for both DP and HDMI */
......
...@@ -38,10 +38,9 @@ struct intel_hdmi_lpe_audio_eld { ...@@ -38,10 +38,9 @@ struct intel_hdmi_lpe_audio_eld {
}; };
struct intel_hdmi_lpe_audio_pdata { struct intel_hdmi_lpe_audio_pdata {
int tmds_clock_speed; int ls_clock;
bool hdmi_connected; bool hdmi_connected;
bool dp_output; bool dp_output;
int link_rate;
struct intel_hdmi_lpe_audio_eld eld; struct intel_hdmi_lpe_audio_eld eld;
void (*notify_audio_lpe)(struct platform_device *pdev); void (*notify_audio_lpe)(struct platform_device *pdev);
spinlock_t lpe_audio_slock; spinlock_t lpe_audio_slock;
......
...@@ -1568,7 +1568,7 @@ static void had_audio_wq(struct work_struct *work) ...@@ -1568,7 +1568,7 @@ static void had_audio_wq(struct work_struct *work)
struct intel_hdmi_lpe_audio_eld *eld = &pdata->eld; struct intel_hdmi_lpe_audio_eld *eld = &pdata->eld;
dev_dbg(ctx->dev, "%s: HAD_NOTIFY_ELD : port = %d, tmds = %d\n", dev_dbg(ctx->dev, "%s: HAD_NOTIFY_ELD : port = %d, tmds = %d\n",
__func__, eld->port_id, pdata->tmds_clock_speed); __func__, eld->port_id, pdata->ls_clock);
switch (eld->pipe_id) { switch (eld->pipe_id) {
case 0: case 0:
...@@ -1589,8 +1589,13 @@ static void had_audio_wq(struct work_struct *work) ...@@ -1589,8 +1589,13 @@ static void had_audio_wq(struct work_struct *work)
memcpy(ctx->eld, eld->eld_data, sizeof(ctx->eld)); memcpy(ctx->eld, eld->eld_data, sizeof(ctx->eld));
ctx->dp_output = pdata->dp_output; ctx->dp_output = pdata->dp_output;
ctx->tmds_clock_speed = pdata->tmds_clock_speed; if (ctx->dp_output) {
ctx->link_rate = pdata->link_rate; ctx->tmds_clock_speed = 0;
ctx->link_rate = pdata->ls_clock;
} else {
ctx->tmds_clock_speed = pdata->ls_clock;
ctx->link_rate = 0;
}
had_process_hot_plug(ctx); had_process_hot_plug(ctx);
......
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