Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit aabac832 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "drm/msm/dp: validate audio ops in cable disconnect path" into dev/msm-4.14-display

parents 0be473cf 951f1eab
Loading
Loading
Loading
Loading
+18 −11
Original line number Diff line number Diff line
@@ -669,6 +669,9 @@ static int dp_audio_notify(struct dp_audio_private *audio, u32 state)
	int rc = 0;
	struct msm_ext_disp_init_data *ext = &audio->ext_audio_data;

	if (!ext->intf_ops.audio_notify)
		goto end;

	rc = ext->intf_ops.audio_notify(audio->ext_pdev,
			&ext->codec, state);
	if (rc) {
@@ -710,6 +713,7 @@ static int dp_audio_on(struct dp_audio *dp_audio)

	audio->session_on = true;

	if (ext->intf_ops.audio_config) {
		rc = ext->intf_ops.audio_config(audio->ext_pdev,
				&ext->codec,
				EXT_DISPLAY_CABLE_CONNECT);
@@ -717,6 +721,7 @@ static int dp_audio_on(struct dp_audio *dp_audio)
			pr_err("failed to config audio, err=%d\n", rc);
			goto end;
		}
	}

	rc = dp_audio_notify(audio, EXT_DISPLAY_CABLE_CONNECT);
	if (rc)
@@ -752,11 +757,13 @@ static int dp_audio_off(struct dp_audio *dp_audio)

	pr_debug("success\n");
end:
	if (ext->intf_ops.audio_config) {
		rc = ext->intf_ops.audio_config(audio->ext_pdev,
				&ext->codec,
				EXT_DISPLAY_CABLE_DISCONNECT);
		if (rc)
			pr_err("failed to config audio, err=%d\n", rc);
	}

	audio->session_on = false;
	audio->engine_on  = false;
+8 −1
Original line number Diff line number Diff line
@@ -632,8 +632,11 @@ static int dp_display_process_hpd_low(struct dp_display_private *dp)
	int rc = 0, idx;
	struct dp_panel *dp_panel;

	mutex_lock(&dp->session_lock);

	if (!dp->dp_display.is_connected) {
		pr_debug("HPD already off\n");
		mutex_unlock(&dp->session_lock);
		return 0;
	}

@@ -646,10 +649,14 @@ static int dp_display_process_hpd_low(struct dp_display_private *dp)

		dp_panel = dp->active_panels[idx];

		if (dp_panel->audio_supported)
		if (dp_panel->audio_supported) {
			dp_panel->audio->off(dp_panel->audio);
			dp_panel->audio_supported = false;
		}
	}

	mutex_unlock(&dp->session_lock);

	dp_display_process_mst_hpd_low(dp);

	rc = dp_display_send_hpd_notification(dp, false);