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

Commit 8c274ddc 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/dsi-staging: enable dsi idle to turn off phy"

parents 35cf9f99 797e0894
Loading
Loading
Loading
Loading
+6 −0
Original line number Original line Diff line number Diff line
@@ -121,6 +121,11 @@ Optional properties:
					If ping pong split is enabled, this time should not be higher
					If ping pong split is enabled, this time should not be higher
					than two times the dsi link rate time.
					than two times the dsi link rate time.
					If the property is not specified, then the default value is 14000 us.
					If the property is not specified, then the default value is 14000 us.
- qcom,panel-allow-phy-poweroff:	A boolean property indicates that panel allows to turn off the phy power
					supply during idle screen. A panel should be able to handle the dsi lanes
					in floating state(not LP00 or LP11) to turn on this property. Software
					turns off PHY pmic power supply, phy ldo and DSI Lane ldo during
					idle screen (footswitch control off) when this property is enabled.


[1] Documentation/devicetree/bindings/clocks/clock-bindings.txt
[1] Documentation/devicetree/bindings/clocks/clock-bindings.txt
[2] Documentation/devicetree/bindings/graph.txt
[2] Documentation/devicetree/bindings/graph.txt
@@ -229,4 +234,5 @@ Example:
		vddio-supply = <&pma8084_l12>;
		vddio-supply = <&pma8084_l12>;


		qcom,dsi-phy-regulator-ldo-mode;
		qcom,dsi-phy-regulator-ldo-mode;
		qcom,panel-allow-phy-poweroff;
	};
	};
+33 −5
Original line number Original line Diff line number Diff line
@@ -36,6 +36,8 @@


#define MISR_BUFF_SIZE	256
#define MISR_BUFF_SIZE	256


#define MAX_NAME_SIZE	64

static DEFINE_MUTEX(dsi_display_list_lock);
static DEFINE_MUTEX(dsi_display_list_lock);
static LIST_HEAD(dsi_display_list);
static LIST_HEAD(dsi_display_list);
static char dsi_display_primary[MAX_CMDLINE_PARAM_LEN];
static char dsi_display_primary[MAX_CMDLINE_PARAM_LEN];
@@ -719,6 +721,8 @@ static int dsi_display_debugfs_init(struct dsi_display *display)
{
{
	int rc = 0;
	int rc = 0;
	struct dentry *dir, *dump_file, *misr_data;
	struct dentry *dir, *dump_file, *misr_data;
	char name[MAX_NAME_SIZE];
	int i;


	dir = debugfs_create_dir(display->name, NULL);
	dir = debugfs_create_dir(display->name, NULL);
	if (IS_ERR_OR_NULL(dir)) {
	if (IS_ERR_OR_NULL(dir)) {
@@ -752,6 +756,24 @@ static int dsi_display_debugfs_init(struct dsi_display *display)
		goto error_remove_dir;
		goto error_remove_dir;
	}
	}


	for (i = 0; i < display->ctrl_count; i++) {
		struct msm_dsi_phy *phy = display->ctrl[i].phy;

		if (!phy || !phy->name)
			continue;

		snprintf(name, ARRAY_SIZE(name),
				"%s_allow_phy_power_off", phy->name);
		dump_file = debugfs_create_bool(name, 0600, dir,
				&phy->allow_phy_power_off);
		if (IS_ERR_OR_NULL(dump_file)) {
			rc = PTR_ERR(dump_file);
			pr_err("[%s] debugfs create %s failed, rc=%d\n",
			       display->name, name, rc);
			goto error_remove_dir;
		}
	}

	display->root = dir;
	display->root = dir;
	return rc;
	return rc;
error_remove_dir:
error_remove_dir:
@@ -969,7 +991,7 @@ static int dsi_display_phy_enable(struct dsi_display *display);
/**
/**
 * dsi_display_phy_idle_on() - enable DSI PHY while coming out of idle screen.
 * dsi_display_phy_idle_on() - enable DSI PHY while coming out of idle screen.
 * @dsi_display:         DSI display handle.
 * @dsi_display:         DSI display handle.
 * @enable:           enable/disable DSI PHY.
 * @mmss_clamp:          True if clamp is enabled.
 *
 *
 * Return: error code.
 * Return: error code.
 */
 */
@@ -1016,7 +1038,6 @@ static int dsi_display_phy_idle_on(struct dsi_display *display,
/**
/**
 * dsi_display_phy_idle_off() - disable DSI PHY while going to idle screen.
 * dsi_display_phy_idle_off() - disable DSI PHY while going to idle screen.
 * @dsi_display:         DSI display handle.
 * @dsi_display:         DSI display handle.
 * @enable:           enable/disable DSI PHY.
 *
 *
 * Return: error code.
 * Return: error code.
 */
 */
@@ -1031,10 +1052,17 @@ static int dsi_display_phy_idle_off(struct dsi_display *display)
		return -EINVAL;
		return -EINVAL;
	}
	}


	if (!display->panel->allow_phy_power_off) {
	for (i = 0; i < display->ctrl_count; i++) {
		pr_debug("panel doesn't support this feature\n");
		struct msm_dsi_phy *phy = display->ctrl[i].phy;

		if (!phy)
			continue;

		if (!phy->allow_phy_power_off) {
			pr_debug("phy doesn't support this feature\n");
			return 0;
			return 0;
		}
		}
	}


	m_ctrl = &display->ctrl[display->cmd_master_idx];
	m_ctrl = &display->ctrl[display->cmd_master_idx];


+16 −0
Original line number Original line Diff line number Diff line
@@ -290,6 +290,10 @@ static int dsi_phy_settings_init(struct platform_device *pdev,


	/* Actual timing values are dependent on panel */
	/* Actual timing values are dependent on panel */
	timing->count_per_lane = phy->ver_info->timing_cfg_count;
	timing->count_per_lane = phy->ver_info->timing_cfg_count;

	phy->allow_phy_power_off = of_property_read_bool(pdev->dev.of_node,
			"qcom,panel-allow-phy-poweroff");

	return 0;
	return 0;
err:
err:
	lane->count_per_lane = 0;
	lane->count_per_lane = 0;
@@ -896,6 +900,8 @@ int dsi_phy_idle_ctrl(struct msm_dsi_phy *phy, bool enable)
		return -EINVAL;
		return -EINVAL;
	}
	}


	pr_debug("[%s] enable=%d\n", phy->name, enable);

	mutex_lock(&phy->phy_lock);
	mutex_lock(&phy->phy_lock);
	if (enable) {
	if (enable) {
		if (phy->hw.ops.phy_idle_on)
		if (phy->hw.ops.phy_idle_on)
@@ -904,7 +910,17 @@ int dsi_phy_idle_ctrl(struct msm_dsi_phy *phy, bool enable)
		if (phy->hw.ops.regulator_enable)
		if (phy->hw.ops.regulator_enable)
			phy->hw.ops.regulator_enable(&phy->hw,
			phy->hw.ops.regulator_enable(&phy->hw,
				&phy->cfg.regulators);
				&phy->cfg.regulators);

		if (phy->hw.ops.enable)
			phy->hw.ops.enable(&phy->hw, &phy->cfg);

		phy->dsi_phy_state = DSI_PHY_ENGINE_ON;
	} else {
	} else {
		phy->dsi_phy_state = DSI_PHY_ENGINE_OFF;

		if (phy->hw.ops.disable)
			phy->hw.ops.disable(&phy->hw, &phy->cfg);

		if (phy->hw.ops.phy_idle_off)
		if (phy->hw.ops.phy_idle_off)
			phy->hw.ops.phy_idle_off(&phy->hw);
			phy->hw.ops.phy_idle_off(&phy->hw);
	}
	}
+3 −0
Original line number Original line Diff line number Diff line
@@ -67,6 +67,7 @@ enum phy_engine_state {
 * @mode:              Current mode.
 * @mode:              Current mode.
 * @data_lanes:        Number of data lanes used.
 * @data_lanes:        Number of data lanes used.
 * @dst_format:        Destination format.
 * @dst_format:        Destination format.
 * @allow_phy_power_off: True if PHY is allowed to power off when idle
 */
 */
struct msm_dsi_phy {
struct msm_dsi_phy {
	struct platform_device *pdev;
	struct platform_device *pdev;
@@ -88,6 +89,8 @@ struct msm_dsi_phy {
	struct dsi_mode_info mode;
	struct dsi_mode_info mode;
	enum dsi_data_lanes data_lanes;
	enum dsi_data_lanes data_lanes;
	enum dsi_pixel_format dst_format;
	enum dsi_pixel_format dst_format;

	bool allow_phy_power_off;
};
};


/**
/**