Commit 265fa2e1 authored by Ville Syrjälä's avatar Ville Syrjälä

drm/i915: Remove hdmi_connected from LPE audio pdata

We can determine that the pipe was shut down from pipe<0, so there's
no point in duplicating that information as 'hdmi_connected'.

v2: Use pipe<0 instead of port<0 as we'll want to do per-port
    PCM devices later
    Initialize pipe to -1 to inidicate inactive initial state

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-7-ville.syrjala@linux.intel.comReviewed-by: default avatarTakashi Iwai <tiwai@suse.de>
parent c98ec5ba
...@@ -111,6 +111,7 @@ lpe_audio_platdev_create(struct drm_i915_private *dev_priv) ...@@ -111,6 +111,7 @@ lpe_audio_platdev_create(struct drm_i915_private *dev_priv)
pinfo.size_data = sizeof(*pdata); pinfo.size_data = sizeof(*pdata);
pinfo.dma_mask = DMA_BIT_MASK(32); pinfo.dma_mask = DMA_BIT_MASK(32);
pdata->pipe = -1;
spin_lock_init(&pdata->lpe_audio_slock); spin_lock_init(&pdata->lpe_audio_slock);
platdev = platform_device_register_full(&pinfo); platdev = platform_device_register_full(&pinfo);
...@@ -332,12 +333,12 @@ void intel_lpe_audio_notify(struct drm_i915_private *dev_priv, ...@@ -332,12 +333,12 @@ void intel_lpe_audio_notify(struct drm_i915_private *dev_priv,
audio_enable = I915_READ(VLV_AUD_PORT_EN_DBG(port)); audio_enable = I915_READ(VLV_AUD_PORT_EN_DBG(port));
pdata->eld.port_id = port;
if (eld != NULL) { if (eld != NULL) {
memcpy(pdata->eld.eld_data, eld, memcpy(pdata->eld.eld_data, eld,
HDMI_MAX_ELD_BYTES); HDMI_MAX_ELD_BYTES);
pdata->eld.port_id = port; pdata->pipe = pipe;
pdata->eld.pipe_id = pipe;
pdata->hdmi_connected = true;
pdata->ls_clock = ls_clock; pdata->ls_clock = ls_clock;
pdata->dp_output = dp_output; pdata->dp_output = dp_output;
...@@ -348,7 +349,7 @@ void intel_lpe_audio_notify(struct drm_i915_private *dev_priv, ...@@ -348,7 +349,7 @@ void intel_lpe_audio_notify(struct drm_i915_private *dev_priv,
} 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->pipe = -1;
pdata->ls_clock = 0; pdata->ls_clock = 0;
pdata->dp_output = false; pdata->dp_output = false;
......
...@@ -33,13 +33,12 @@ struct platform_device; ...@@ -33,13 +33,12 @@ struct platform_device;
struct intel_hdmi_lpe_audio_eld { struct intel_hdmi_lpe_audio_eld {
int port_id; int port_id;
int pipe_id;
unsigned char eld_data[HDMI_MAX_ELD_BYTES]; unsigned char eld_data[HDMI_MAX_ELD_BYTES];
}; };
struct intel_hdmi_lpe_audio_pdata { struct intel_hdmi_lpe_audio_pdata {
int pipe;
int ls_clock; int ls_clock;
bool hdmi_connected;
bool dp_output; bool dp_output;
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);
......
...@@ -1559,7 +1559,7 @@ static void had_audio_wq(struct work_struct *work) ...@@ -1559,7 +1559,7 @@ static void had_audio_wq(struct work_struct *work)
pm_runtime_get_sync(ctx->dev); pm_runtime_get_sync(ctx->dev);
mutex_lock(&ctx->mutex); mutex_lock(&ctx->mutex);
if (!pdata->hdmi_connected) { if (pdata->pipe < 0) {
dev_dbg(ctx->dev, "%s: Event: HAD_NOTIFY_HOT_UNPLUG\n", dev_dbg(ctx->dev, "%s: Event: HAD_NOTIFY_HOT_UNPLUG\n",
__func__); __func__);
memset(ctx->eld, 0, sizeof(ctx->eld)); /* clear the old ELD */ memset(ctx->eld, 0, sizeof(ctx->eld)); /* clear the old ELD */
...@@ -1570,7 +1570,7 @@ static void had_audio_wq(struct work_struct *work) ...@@ -1570,7 +1570,7 @@ static void had_audio_wq(struct work_struct *work)
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->ls_clock); __func__, eld->port_id, pdata->ls_clock);
switch (eld->pipe_id) { switch (pdata->pipe) {
case 0: case 0:
ctx->had_config_offset = AUDIO_HDMI_CONFIG_A; ctx->had_config_offset = AUDIO_HDMI_CONFIG_A;
break; break;
...@@ -1582,7 +1582,7 @@ static void had_audio_wq(struct work_struct *work) ...@@ -1582,7 +1582,7 @@ static void had_audio_wq(struct work_struct *work)
break; break;
default: default:
dev_dbg(ctx->dev, "Invalid pipe %d\n", dev_dbg(ctx->dev, "Invalid pipe %d\n",
eld->pipe_id); pdata->pipe);
break; break;
} }
......
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