]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - sound/x86/intel_hdmi_audio.c
drm/i915: Remove hdmi_connected from LPE audio pdata
[linux.git] / sound / x86 / intel_hdmi_audio.c
index c505b019e09ce0795cc8ddd79cf1f8c6a18d32ff..1a095189db8349227ae825beb19406ac70ea973c 100644 (file)
@@ -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->pipe < 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,9 +1568,9 @@ 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->tmds_clock_speed);
+                       __func__, eld->port_id, pdata->ls_clock);
 
-               switch (eld->pipe_id) {
+               switch (pdata->pipe) {
                case 0:
                        ctx->had_config_offset = AUDIO_HDMI_CONFIG_A;
                        break;
@@ -1582,15 +1582,20 @@ static void had_audio_wq(struct work_struct *work)
                        break;
                default:
                        dev_dbg(ctx->dev, "Invalid pipe %d\n",
-                               eld->pipe_id);
+                               pdata->pipe);
                        break;
                }
 
                memcpy(ctx->eld, eld->eld_data, sizeof(ctx->eld));
 
                ctx->dp_output = pdata->dp_output;
-               ctx->tmds_clock_speed = pdata->tmds_clock_speed;
-               ctx->link_rate = pdata->link_rate;
+               if (ctx->dp_output) {
+                       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);
 
@@ -1665,6 +1670,11 @@ static int __maybe_unused hdmi_lpe_audio_resume(struct device *dev)
 static void hdmi_lpe_audio_free(struct snd_card *card)
 {
        struct snd_intelhad *ctx = card->private_data;
+       struct intel_hdmi_lpe_audio_pdata *pdata = ctx->dev->platform_data;
+
+       spin_lock_irq(&pdata->lpe_audio_slock);
+       pdata->notify_audio_lpe = NULL;
+       spin_unlock_irq(&pdata->lpe_audio_slock);
 
        cancel_work_sync(&ctx->hdmi_audio_wq);
 
@@ -1806,13 +1816,8 @@ static int hdmi_lpe_audio_probe(struct platform_device *pdev)
 
        spin_lock_irq(&pdata->lpe_audio_slock);
        pdata->notify_audio_lpe = notify_audio_lpe;
-       pdata->notify_pending = false;
        spin_unlock_irq(&pdata->lpe_audio_slock);
 
-       /* runtime PM isn't enabled as default, since it won't save much on
-        * BYT/CHT devices; user who want the runtime PM should adjust the
-        * power/ontrol and power/autosuspend_delay_ms sysfs entries instead
-        */
        pm_runtime_use_autosuspend(&pdev->dev);
        pm_runtime_mark_last_busy(&pdev->dev);
        pm_runtime_set_active(&pdev->dev);