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

Commit ff50b197 authored by Ritesh Kumar's avatar Ritesh Kumar Committed by Gerrit - the friendly Code Review server
Browse files

disp: msm: dsi: Update pll delay calculation as per latest DSI HPG



As per DSI HPG, pll delay should be 25usec for phy ver 4.0 and
100usec for phy ver 2.0 and 3.0. This change updates pll delay
calculation during dynamic DSI clock switch accordingly.

Change-Id: Ief5cbdc9304cf5ad025fe3bbe689b93834a1f710
Signed-off-by: default avatarAlthaf Neelanchirayil <aneelanc@codeaurora.org>
Signed-off-by: default avatarNirmal Abraham <nabrah@codeaurora.org>
parent 48d06e34
Loading
Loading
Loading
Loading
+13 −2
Original line number Diff line number Diff line
@@ -31,6 +31,7 @@
#include "dsi_pwr.h"
#include "sde_dbg.h"
#include "dsi_parser.h"
#include "dsi_phy.h"

#define to_dsi_display(x) container_of(x, struct dsi_display, host)
#define INT_BASE_10 10
@@ -4023,6 +4024,7 @@ static void _dsi_display_calc_pipe_delay(struct dsi_display *display,
	struct dsi_display_ctrl *m_ctrl;
	struct dsi_ctrl *dsi_ctrl;
	struct dsi_phy_cfg *cfg;
	int phy_ver;

	m_ctrl = &display->ctrl[display->clk_master_idx];
	dsi_ctrl = m_ctrl->ctrl;
@@ -4060,8 +4062,17 @@ static void _dsi_display_calc_pipe_delay(struct dsi_display *display,
			  ((cfg->timing.lane_v3[4] >> 1) + 1)) /
			 hr_bit_to_esc_ratio);

	/* 130 us pll delay recommended by h/w doc */
	delay->pll_delay = ((130 * esc_clk_rate_hz) / 1000000) * 2;
	/*
	 *100us pll delay recommended for phy ver 2.0 and 3.0
	 *25us pll delay recommended for phy ver 4.0
	 */
	phy_ver = dsi_phy_get_version(m_ctrl->phy);
	if (phy_ver <= DSI_PHY_VERSION_3_0)
		delay->pll_delay = 100;
	else
		delay->pll_delay = 25;

	delay->pll_delay = ((delay->pll_delay * esc_clk_rate_hz) / 1000000) * 2;
}

static int _dsi_display_dyn_update_clks(struct dsi_display *display,
+5 −0
Original line number Diff line number Diff line
@@ -103,6 +103,11 @@ static const struct of_device_id msm_dsi_phy_of_match[] = {
	{}
};

int dsi_phy_get_version(struct msm_dsi_phy *phy)
{
	return phy->ver_info->version;
}

static int dsi_phy_regmap_init(struct platform_device *pdev,
			       struct msm_dsi_phy *phy)
{
+8 −0
Original line number Diff line number Diff line
@@ -129,6 +129,14 @@ struct msm_dsi_phy *dsi_phy_get(struct device_node *of_node);
 */
void dsi_phy_put(struct msm_dsi_phy *dsi_phy);

/**
 * dsi_phy_get_version() - returns dsi phy version
 * @dsi_phy:         DSI PHY handle.
 *
 * Return: phy version
 */
int dsi_phy_get_version(struct msm_dsi_phy *phy);

/**
 * dsi_phy_drv_init() - initialize dsi phy driver
 * @dsi_phy:         DSI PHY handle.