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

Commit abfaa085 authored by Dhaval Patel's avatar Dhaval Patel
Browse files

drm/msm/dsi-staging: add dsi phy isolate enable config



The DSI controller can work isolated from phy without
pll locking. That allows to verify the dsi controller
specific changes by isolating phy. Add debug property
support for isolating the phy from dsi.

Change-Id: Ibbfa23e0c2fc9e0e4db152cd83c65e0516617d04
Signed-off-by: default avatarDhaval Patel <pdhaval@codeaurora.org>
parent 010f517c
Loading
Loading
Loading
Loading
+4 −0
Original line number Original line Diff line number Diff line
@@ -96,3 +96,7 @@ Optional properties:
					If ping pong split enabled, this time should not be higher
					If ping pong split 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,dsi-phy-isolation-enabled:	A boolean property enables the phy isolation from dsi
					controller. This must be enabled for debugging purpose
					only with simulator panel. It should not be enabled for
					normal DSI panels.
+6 −2
Original line number Original line Diff line number Diff line
@@ -108,14 +108,15 @@ static void dsi_catalog_cmn_init(struct dsi_ctrl_hw *ctrl,
 * @ctrl:        Pointer to DSI controller hw object.
 * @ctrl:        Pointer to DSI controller hw object.
 * @version:     DSI controller version.
 * @version:     DSI controller version.
 * @index:       DSI controller instance ID.
 * @index:       DSI controller instance ID.
 * @phy_isolation_enabled:       DSI controller works isolated from phy.
 *
 *
 * This function setups the catalog information in the dsi_ctrl_hw object.
 * This function setups the catalog information in the dsi_ctrl_hw object.
 *
 *
 * return: error code for failure and 0 for success.
 * return: error code for failure and 0 for success.
 */
 */
int dsi_catalog_ctrl_setup(struct dsi_ctrl_hw *ctrl,
int dsi_catalog_ctrl_setup(struct dsi_ctrl_hw *ctrl,
			   enum dsi_ctrl_version version,
		   enum dsi_ctrl_version version, u32 index,
			   u32 index)
		   bool phy_isolation_enabled)
{
{
	int rc = 0;
	int rc = 0;


@@ -135,8 +136,11 @@ int dsi_catalog_ctrl_setup(struct dsi_ctrl_hw *ctrl,


	switch (version) {
	switch (version) {
	case DSI_CTRL_VERSION_1_4:
	case DSI_CTRL_VERSION_1_4:
		dsi_catalog_cmn_init(ctrl, version);
		break;
	case DSI_CTRL_VERSION_2_0:
	case DSI_CTRL_VERSION_2_0:
	case DSI_CTRL_VERSION_2_2:
	case DSI_CTRL_VERSION_2_2:
		ctrl->phy_isolation_enabled = phy_isolation_enabled;
		dsi_catalog_cmn_init(ctrl, version);
		dsi_catalog_cmn_init(ctrl, version);
		break;
		break;
	default:
	default:
+3 −2
Original line number Original line Diff line number Diff line
@@ -23,14 +23,15 @@
 * @ctrl:        Pointer to DSI controller hw object.
 * @ctrl:        Pointer to DSI controller hw object.
 * @version:     DSI controller version.
 * @version:     DSI controller version.
 * @index:       DSI controller instance ID.
 * @index:       DSI controller instance ID.
 * @phy_isolation_enabled:       DSI controller works isolated from phy.
 *
 *
 * This function setups the catalog information in the dsi_ctrl_hw object.
 * This function setups the catalog information in the dsi_ctrl_hw object.
 *
 *
 * return: error code for failure and 0 for success.
 * return: error code for failure and 0 for success.
 */
 */
int dsi_catalog_ctrl_setup(struct dsi_ctrl_hw *ctrl,
int dsi_catalog_ctrl_setup(struct dsi_ctrl_hw *ctrl,
			   enum dsi_ctrl_version version,
		   enum dsi_ctrl_version version, u32 index,
			   u32 index);
		   bool phy_isolation_enabled);


/**
/**
 * dsi_catalog_phy_setup() - return catalog info for dsi phy hardware
 * dsi_catalog_phy_setup() - return catalog info for dsi phy hardware
+36 −12
Original line number Original line Diff line number Diff line
@@ -1262,13 +1262,41 @@ static int dsi_enable_io_clamp(struct dsi_ctrl *dsi_ctrl,
	return 0;
	return 0;
}
}


static int dsi_ctrl_dts_parse(struct dsi_ctrl *dsi_ctrl,
				  struct device_node *of_node)
{
	u32 index = 0;
	int rc = 0;

	if (!dsi_ctrl || !of_node) {
		pr_err("invalid dsi_ctrl:%d or of_node:%d\n",
					dsi_ctrl != NULL, of_node != NULL);
		return -EINVAL;
	}

	rc = of_property_read_u32(of_node, "cell-index", &index);
	if (rc) {
		pr_debug("cell index not set, default to 0\n");
		index = 0;
	}

	dsi_ctrl->cell_index = index;
	dsi_ctrl->name = of_get_property(of_node, "label", NULL);
	if (!dsi_ctrl->name)
		dsi_ctrl->name = DSI_CTRL_DEFAULT_LABEL;

	dsi_ctrl->phy_isolation_enabled = of_property_read_bool(of_node,
				    "qcom,dsi-phy-isolation-enabled");

	return 0;
}

static int dsi_ctrl_dev_probe(struct platform_device *pdev)
static int dsi_ctrl_dev_probe(struct platform_device *pdev)
{
{
	struct dsi_ctrl *dsi_ctrl;
	struct dsi_ctrl *dsi_ctrl;
	struct dsi_ctrl_list_item *item;
	struct dsi_ctrl_list_item *item;
	const struct of_device_id *id;
	const struct of_device_id *id;
	enum dsi_ctrl_version version;
	enum dsi_ctrl_version version;
	u32 index = 0;
	int rc = 0;
	int rc = 0;


	id = of_match_node(msm_dsi_of_match, pdev->dev.of_node);
	id = of_match_node(msm_dsi_of_match, pdev->dev.of_node);
@@ -1285,22 +1313,18 @@ static int dsi_ctrl_dev_probe(struct platform_device *pdev)
	if (!dsi_ctrl)
	if (!dsi_ctrl)
		return -ENOMEM;
		return -ENOMEM;


	rc = of_property_read_u32(pdev->dev.of_node, "cell-index", &index);
	if (rc) {
		pr_debug("cell index not set, default to 0\n");
		index = 0;
	}

	dsi_ctrl->cell_index = index;
	dsi_ctrl->version = version;
	dsi_ctrl->version = version;
	dsi_ctrl->irq_info.irq_num = -1;
	dsi_ctrl->irq_info.irq_num = -1;
	dsi_ctrl->irq_info.irq_stat_mask = 0x0;
	dsi_ctrl->irq_info.irq_stat_mask = 0x0;


	spin_lock_init(&dsi_ctrl->irq_info.irq_lock);
	spin_lock_init(&dsi_ctrl->irq_info.irq_lock);


	dsi_ctrl->name = of_get_property(pdev->dev.of_node, "label", NULL);
	rc = dsi_ctrl_dts_parse(dsi_ctrl, pdev->dev.of_node);
	if (!dsi_ctrl->name)
	if (rc) {
		dsi_ctrl->name = DSI_CTRL_DEFAULT_LABEL;
		pr_err("ctrl:%d dts parse failed, rc = %d\n",
						dsi_ctrl->cell_index, rc);
		goto fail;
	}


	rc = dsi_ctrl_init_regmap(pdev, dsi_ctrl);
	rc = dsi_ctrl_init_regmap(pdev, dsi_ctrl);
	if (rc) {
	if (rc) {
@@ -1321,7 +1345,7 @@ static int dsi_ctrl_dev_probe(struct platform_device *pdev)
	}
	}


	rc = dsi_catalog_ctrl_setup(&dsi_ctrl->hw, dsi_ctrl->version,
	rc = dsi_catalog_ctrl_setup(&dsi_ctrl->hw, dsi_ctrl->version,
				    dsi_ctrl->cell_index);
		    dsi_ctrl->cell_index, dsi_ctrl->phy_isolation_enabled);
	if (rc) {
	if (rc) {
		pr_err("Catalog does not support version (%d)\n",
		pr_err("Catalog does not support version (%d)\n",
		       dsi_ctrl->version);
		       dsi_ctrl->version);
+3 −0
Original line number Original line Diff line number Diff line
@@ -190,6 +190,8 @@ struct dsi_ctrl_interrupts {
 * @debugfs_root:        Root for debugfs entries.
 * @debugfs_root:        Root for debugfs entries.
 * @misr_enable:         Frame MISR enable/disable
 * @misr_enable:         Frame MISR enable/disable
 * @misr_cache:          Cached Frame MISR value
 * @misr_cache:          Cached Frame MISR value
 * @phy_isolation_enabled:    A boolean property allows to isolate the phy from
 *                          dsi controller and run only dsi controller.
 */
 */
struct dsi_ctrl {
struct dsi_ctrl {
	struct platform_device *pdev;
	struct platform_device *pdev;
@@ -232,6 +234,7 @@ struct dsi_ctrl {
	bool misr_enable;
	bool misr_enable;
	u32 misr_cache;
	u32 misr_cache;


	bool phy_isolation_enabled;
};
};


/**
/**
Loading