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

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

Merge "msm: mdss: dp: fix check for audio support on the sink"

parents 98c7dad6 b0d01164
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -1013,9 +1013,10 @@ static int dp_get_cable_status(struct platform_device *pdev, u32 vote)
	return hpd;
}

static bool mdss_dp_is_dvi_mode(struct mdss_dp_drv_pdata *dp)
static bool mdss_dp_sink_audio_supp(struct mdss_dp_drv_pdata *dp)
{
	return hdmi_edid_is_dvi_mode(dp->panel_data.panel_info.edid_data);
	return hdmi_edid_is_audio_supported(
		dp->panel_data.panel_info.edid_data);
}

static int dp_audio_info_setup(struct platform_device *pdev,
@@ -1706,14 +1707,17 @@ static int mdss_dp_send_audio_notification(
		goto end;
	}

	if (!mdss_dp_is_dvi_mode(dp) || dp->audio_test_req) {
	if (mdss_dp_sink_audio_supp(dp) || dp->audio_test_req) {
		dp->audio_test_req = false;

		pr_debug("sending audio notification\n");
		flags |= MSM_EXT_DISP_HPD_AUDIO;

		if (dp->ext_audio_data.intf_ops.hpd)
			ret = dp->ext_audio_data.intf_ops.hpd(dp->ext_pdev,
					dp->ext_audio_data.type, val, flags);
	} else {
		pr_debug("sink does not support audio\n");
	}

end:
+20 −0
Original line number Diff line number Diff line
@@ -137,6 +137,7 @@ struct hdmi_edid_ctrl {
	u16 video_latency;
	u32 present_3d;
	u32 page_id;
	bool basic_audio_supp;
	u8 audio_data_block[MAX_NUMBER_ADB * MAX_AUDIO_DATA_BLOCK_SIZE];
	int adb_size;
	u8 spkr_alloc_data_block[MAX_SPKR_ALLOC_DATA_BLOCK_SIZE];
@@ -1289,6 +1290,14 @@ static void hdmi_edid_extract_sink_caps(struct hdmi_edid_ctrl *edid_ctrl,
		return;
	}

	/* Check if sink supports basic audio */
	if (in_buf[3] & BIT(6))
		edid_ctrl->basic_audio_supp = true;
	else
		edid_ctrl->basic_audio_supp = false;
	pr_debug("%s: basic audio supported: %s\n", __func__,
		edid_ctrl->basic_audio_supp ? "true" : "false");

	vsd = hdmi_edid_find_hfvsdb(in_buf);

	if (vsd) {
@@ -2627,6 +2636,17 @@ void hdmi_edid_set_max_pclk_rate(void *input, u32 max_pclk_khz)
	edid_ctrl->init_data.max_pclk_khz = max_pclk_khz;
}

bool hdmi_edid_is_audio_supported(void *input)
{
	struct hdmi_edid_ctrl *edid_ctrl = (struct hdmi_edid_ctrl *)input;

	/*
	 * return true if basic audio is supported or if an audio
	 * data block was successfully parsed.
	 */
	return (edid_ctrl->basic_audio_supp || edid_ctrl->adb_size);
}

void hdmi_edid_deinit(void *input)
{
	struct hdmi_edid_ctrl *edid_ctrl = (struct hdmi_edid_ctrl *)input;
+1 −0
Original line number Diff line number Diff line
@@ -80,5 +80,6 @@ void hdmi_edid_get_hdr_data(void *edid_ctrl,
void hdmi_edid_config_override(void *input, bool enable,
		struct hdmi_edid_override_data *data);
void hdmi_edid_set_max_pclk_rate(void *input, u32 max_pclk_khz);
bool hdmi_edid_is_audio_supported(void *input);

#endif /* __HDMI_EDID_H__ */