diff mbox

[06/11] drm/i915: Remove hdmi_connected from LPE audio pdata

Message ID 20170425202730.1384-7-ville.syrjala@linux.intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Ville Syrjälä April 25, 2017, 8:27 p.m. UTC
From: Ville Syrjälä <ville.syrjala@linux.intel.com>

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

Cc: Takashi Iwai <tiwai@suse.de>
Cc: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/intel_lpe_audio.c | 5 ++---
 include/drm/intel_lpe_audio.h          | 3 +--
 sound/x86/intel_hdmi_audio.c           | 4 ++--
 3 files changed, 5 insertions(+), 7 deletions(-)
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_lpe_audio.c b/drivers/gpu/drm/i915/intel_lpe_audio.c
index 5a1a37e963f1..1696359bf6e5 100644
--- a/drivers/gpu/drm/i915/intel_lpe_audio.c
+++ b/drivers/gpu/drm/i915/intel_lpe_audio.c
@@ -335,9 +335,8 @@  void intel_lpe_audio_notify(struct drm_i915_private *dev_priv,
 	if (eld != NULL) {
 		memcpy(pdata->eld.eld_data, eld,
 			HDMI_MAX_ELD_BYTES);
-		pdata->eld.port_id = port;
 		pdata->eld.pipe_id = pipe;
-		pdata->hdmi_connected = true;
+		pdata->port = port;
 		pdata->ls_clock = ls_clock;
 		pdata->dp_output = dp_output;
 
@@ -348,7 +347,7 @@  void intel_lpe_audio_notify(struct drm_i915_private *dev_priv,
 	} else {
 		memset(pdata->eld.eld_data, 0,
 			HDMI_MAX_ELD_BYTES);
-		pdata->hdmi_connected = false;
+		pdata->port = -1;
 		pdata->ls_clock = 0;
 		pdata->dp_output = false;
 
diff --git a/include/drm/intel_lpe_audio.h b/include/drm/intel_lpe_audio.h
index 8bf804ce8905..826d531c3ecc 100644
--- a/include/drm/intel_lpe_audio.h
+++ b/include/drm/intel_lpe_audio.h
@@ -32,14 +32,13 @@  struct platform_device;
 #define HDMI_MAX_ELD_BYTES	128
 
 struct intel_hdmi_lpe_audio_eld {
-	int port_id;
 	int pipe_id;
 	unsigned char eld_data[HDMI_MAX_ELD_BYTES];
 };
 
 struct intel_hdmi_lpe_audio_pdata {
+	int port;
 	int ls_clock;
-	bool hdmi_connected;
 	bool dp_output;
 	struct intel_hdmi_lpe_audio_eld eld;
 	void (*notify_audio_lpe)(struct platform_device *pdev);
diff --git a/sound/x86/intel_hdmi_audio.c b/sound/x86/intel_hdmi_audio.c
index 4eaf5de54f61..71f14a2a7fe4 100644
--- a/sound/x86/intel_hdmi_audio.c
+++ b/sound/x86/intel_hdmi_audio.c
@@ -1559,7 +1559,7 @@  static void had_audio_wq(struct work_struct *work)
 
 	pm_runtime_get_sync(ctx->dev);
 	mutex_lock(&ctx->mutex);
-	if (!pdata->hdmi_connected) {
+	if (pdata->port < 0) {
 		dev_dbg(ctx->dev, "%s: Event: HAD_NOTIFY_HOT_UNPLUG\n",
 			__func__);
 		memset(ctx->eld, 0, sizeof(ctx->eld)); /* clear the old ELD */
@@ -1568,7 +1568,7 @@  static void had_audio_wq(struct work_struct *work)
 		struct intel_hdmi_lpe_audio_eld *eld = &pdata->eld;
 
 		dev_dbg(ctx->dev, "%s: HAD_NOTIFY_ELD : port = %d, tmds = %d\n",
-			__func__, eld->port_id,	pdata->ls_clock);
+			__func__, pdata->port, pdata->ls_clock);
 
 		switch (eld->pipe_id) {
 		case 0: