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

Commit 183c55d6 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: hdmi: Enable HDMI on 8084 MTP conditionally"

parents 6dd600c5 1fa957a3
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -35,6 +35,8 @@ Optional properties:
  on liquid devices. Required property for liquid devices.
- qcom,hdmi-tx-mux-lpm: gpio required for hdmi mux configuration
  selection on liquid devices. Required property for liquid devices.
- qcom,conditional-power-on: Enables HPD conditionally on MTP targets.
  Required property for MTP devices which are reworked to expose HDMI port.

[Optional child nodes]: These nodes are for devices which are
dependent on HDMI Tx controller. If HDMI Tx controller is disabled then
@@ -73,6 +75,8 @@ Example:
		qcom,hdmi-tx-mux-en = <&msmgpio 83 0>;
		qcom,hdmi-tx-mux-sel = <&msmgpio 85 0>;

		qcom,conditional-power-on;

		qcom,msm-hdmi-audio-rx {
			compatible = "qcom,msm-hdmi-audio-codec-rx";
		};
+46 −5
Original line number Diff line number Diff line
@@ -99,6 +99,12 @@ enum msm_hdmi_supported_audio_sample_rates {
	AUDIO_SAMPLE_RATE_MAX
};

enum hdmi_tx_hpd_states {
	HPD_OFF,
	HPD_ON,
	HPD_ON_CONDITIONAL_MTP
};

/* parameters for clock regeneration */
struct hdmi_tx_audio_acr {
	u32 n;
@@ -513,7 +519,13 @@ static ssize_t hdmi_tx_sysfs_wta_hpd(struct device *dev,
	    (!hdmi_ctrl->mhl_hpd_on || hdmi_ctrl->hpd_feature_on))
		return 0;

	if (0 == hpd && hdmi_ctrl->hpd_feature_on) {
	switch (hpd) {
	case HPD_OFF:
		if (!hdmi_ctrl->hpd_feature_on) {
			DEV_DBG("%s: HPD is already off\n", __func__);
			return ret;
		}

		rc = hdmi_tx_sysfs_enable_hpd(hdmi_ctrl, false);

		if (hdmi_ctrl->panel_power_on && hdmi_ctrl->hpd_state) {
@@ -524,11 +536,37 @@ static ssize_t hdmi_tx_sysfs_wta_hpd(struct device *dev,
		hdmi_tx_send_cable_notification(hdmi_ctrl, 0);
		DEV_DBG("%s: Hdmi state switch to %d\n", __func__,
			hdmi_ctrl->sdev.state);
	} else if (1 == hpd && !hdmi_ctrl->hpd_feature_on) {
		break;
	case HPD_ON:
		if (hdmi_ctrl->pdata.cond_power_on) {
			DEV_ERR("%s: hpd state %d not allowed w/ cond. hpd\n",
				__func__, hpd);
			return ret;
		}

		if (hdmi_ctrl->hpd_feature_on) {
			DEV_DBG("%s: HPD is already on\n", __func__);
			return ret;
		}

		rc = hdmi_tx_sysfs_enable_hpd(hdmi_ctrl, true);
	} else {
		DEV_DBG("%s: hpd is already '%s'. return\n", __func__,
			hdmi_ctrl->hpd_feature_on ? "enabled" : "disabled");
		break;
	case HPD_ON_CONDITIONAL_MTP:
		if (!hdmi_ctrl->pdata.cond_power_on) {
			DEV_ERR("%s: hpd state %d not allowed w/o cond. hpd\n",
				__func__, hpd);
			return ret;
		}

		if (hdmi_ctrl->hpd_feature_on) {
			DEV_DBG("%s: HPD is already on\n", __func__);
			return ret;
		}

		rc = hdmi_tx_sysfs_enable_hpd(hdmi_ctrl, true);
		break;
	default:
		DEV_ERR("%s: Invalid HPD state requested\n", __func__);
		return ret;
	}

@@ -3682,6 +3720,9 @@ static int hdmi_tx_get_dt_data(struct platform_device *pdev,
		pdata->primary = tmp ? true : false;
	}

	pdata->cond_power_on = of_property_read_bool(pdev->dev.of_node,
		"qcom,conditional-power-on");

	return rc;

error:
+2 −1
Original line number Diff line number Diff line
/* Copyright (c) 2010-2013, The Linux Foundation. All rights reserved.
/* Copyright (c) 2010-2014, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -34,6 +34,7 @@ enum hdmi_tx_power_module_type {
/* Data filled from device tree */
struct hdmi_tx_platform_data {
	bool primary;
	bool cond_power_on;
	struct dss_io_data io[HDMI_TX_MAX_IO];
	struct dss_module_power power_data[HDMI_TX_MAX_PM];
};