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

Commit e74f5d6e authored by Vinu Deokaran's avatar Vinu Deokaran Committed by David Keitel
Browse files

msm: mdss: read display id from device tree



Add support to read display ID string from device tree. The string
could be empty if it's not defined in the device tree.

Change-Id: I70584a1e20b7394145e40d83a2af7775f0117506
Signed-off-by: default avatarVinu Deokaran <vinud@codeaurora.org>
parent 4971f30c
Loading
Loading
Loading
Loading
+6 −0
Original line number Original line Diff line number Diff line
@@ -127,6 +127,11 @@ Optional properties:
					"lane_map_3210" = <3 2 1 0>
					"lane_map_3210" = <3 2 1 0>
- qcom,pluggable			Boolean to enable hotplug feature.
- qcom,pluggable			Boolean to enable hotplug feature.
- qcom,timing-db-mode:			Boolean specifies dsi timing mode registers are supported or not.
- qcom,timing-db-mode:			Boolean specifies dsi timing mode registers are supported or not.
- qcom,display-id			A string indicates the display ID for the controller.
					The possible values are:
					- "primary"
					- "secondary"
					- "tertiary"


Example:
Example:
	mdss_dsi: qcom,mdss_dsi@0 {
	mdss_dsi: qcom,mdss_dsi@0 {
@@ -241,5 +246,6 @@ Example:
			qcom,platform-mode-gpio = <&msmgpio 7 0>;
			qcom,platform-mode-gpio = <&msmgpio 7 0>;
			qcom,dsi-irq-line;
			qcom,dsi-irq-line;
			qcom,lane-map = "lane_map_3012";
			qcom,lane-map = "lane_map_3012";
			qcom,display-id = "primary";
	        };
	        };
	};
	};
+6 −0
Original line number Original line Diff line number Diff line
@@ -47,6 +47,11 @@ Optional properties:
  HDMI interface will remain powered on from LK to kernel with continuous
  HDMI interface will remain powered on from LK to kernel with continuous
  display of bootup logo.
  display of bootup logo.
- qcom,pluggable: boolean to enable hotplug feature.
- qcom,pluggable: boolean to enable hotplug feature.
- qcom,display-id: A string indicates the display ID for the controller.
		   The possible values are:
		   - "primary"
		   - "secondary"
		   - "tertiary"


[Optional child nodes]: These nodes are for devices which are
[Optional child nodes]: These nodes are for devices which are
dependent on HDMI Tx controller. If HDMI Tx controller is disabled then
dependent on HDMI Tx controller. If HDMI Tx controller is disabled then
@@ -90,6 +95,7 @@ Example:


		qcom,conditional-power-on;
		qcom,conditional-power-on;
		qcom,pluggable;
		qcom,pluggable;
		qcom,display-id = "secondary";


		qcom,msm-hdmi-audio-rx {
		qcom,msm-hdmi-audio-rx {
			compatible = "qcom,msm-hdmi-audio-codec-rx";
			compatible = "qcom,msm-hdmi-audio-codec-rx";
+9 −0
Original line number Original line Diff line number Diff line
@@ -3630,6 +3630,15 @@ static int mdss_dsi_parse_ctrl_params(struct platform_device *ctrl_pdev,
	pinfo->is_pluggable = of_property_read_bool(ctrl_pdev->dev.of_node,
	pinfo->is_pluggable = of_property_read_bool(ctrl_pdev->dev.of_node,
		"qcom,pluggable");
		"qcom,pluggable");


	data = of_get_property(ctrl_pdev->dev.of_node,
		"qcom,display-id", &len);
	if (!data || len <= 0)
		pr_err("%s:%d Unable to read qcom,display-id, data=%p,len=%d\n",
			__func__, __LINE__, data, len);
	else
		snprintf(ctrl_pdata->panel_data.panel_info.display_id,
			MDSS_DISPLAY_ID_MAX_LEN, "%s", data);

	return 0;
	return 0;




+10 −1
Original line number Original line Diff line number Diff line
@@ -4844,9 +4844,10 @@ static void hdmi_tx_put_dt_data(struct device *dev,
static int hdmi_tx_get_dt_data(struct platform_device *pdev,
static int hdmi_tx_get_dt_data(struct platform_device *pdev,
	struct hdmi_tx_platform_data *pdata)
	struct hdmi_tx_platform_data *pdata)
{
{
	int i, rc = 0;
	int i, rc = 0, len = 0;
	struct device_node *of_node = NULL;
	struct device_node *of_node = NULL;
	struct hdmi_tx_ctrl *hdmi_ctrl = platform_get_drvdata(pdev);
	struct hdmi_tx_ctrl *hdmi_ctrl = platform_get_drvdata(pdev);
	const char *data;


	if (!pdev || !pdata) {
	if (!pdev || !pdata) {
		DEV_ERR("%s: invalid input\n", __func__);
		DEV_ERR("%s: invalid input\n", __func__);
@@ -4911,6 +4912,14 @@ static int hdmi_tx_get_dt_data(struct platform_device *pdev,
	pdata->pluggable = of_property_read_bool(pdev->dev.of_node,
	pdata->pluggable = of_property_read_bool(pdev->dev.of_node,
		"qcom,pluggable");
		"qcom,pluggable");


	data = of_get_property(pdev->dev.of_node, "qcom,display-id", &len);
	if (!data || len <= 0)
		pr_err("%s:%d Unable to read qcom,display-id, data=%p,len=%d\n",
			__func__, __LINE__, data, len);
	else
		snprintf(hdmi_ctrl->panel_data.panel_info.display_id,
			MDSS_DISPLAY_ID_MAX_LEN, "%s", data);

	return rc;
	return rc;


error:
error: