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

Commit fb9b322e authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

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

parents 2a2d04c1 ff50b197
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.