msm: mdss: ensure correct dsi phy init sequence is called

The DSI phy init sequence differs based on the hardware version and
the driver needs to execute the corresponding sequence appropriately.
Commit I0564216737cc6e98c1e8658862cf7af5dabd363c introduced a bug which
removes the hardware version check resulting in the incorrect phy
init sequence being called. Fix this by adding the required version
checks back in the driver.

kernel 3.14 upgrade conflicts:
	drivers/video/msm/mdss/msm_mdss_io_8974.c

Change-Id: Ia48f5dd7986920b9064b66c1de7c6abe10bcd365
Signed-off-by: Aravind Venkateswaran <aravindh@codeaurora.org>
This commit is contained in:
Aravind Venkateswaran 2014-07-02 23:36:45 -07:00 committed by David Keitel
parent b7ed11b1b1
commit 40fd052dc3
3 changed files with 298 additions and 297 deletions

View file

@ -1694,7 +1694,6 @@ int dsi_panel_device_register(struct device_node *pan_node,
mdss_dsi_clk_ctrl(ctrl_pdata, DSI_ALL_CLKS, 1);
ctrl_pdata->ctrl_state |=
(CTRL_STATE_PANEL_INIT | CTRL_STATE_MDP_ACTIVE);
ctrl_pdata->ctrl_rev = MIPI_INP(ctrl_pdata->ctrl_base);
} else {
pinfo->panel_power_on = 0;
}

View file

@ -280,7 +280,6 @@ struct mdss_dsi_ctrl_pdata {
void (*switch_mode) (struct mdss_panel_data *pdata, int mode);
struct mdss_panel_data panel_data;
unsigned char *ctrl_base;
u32 ctrl_rev;
struct dss_io_data ctrl_io;
struct dss_io_data mmss_misc_io;
struct dss_io_data phy_io;
@ -400,7 +399,6 @@ int mdss_dsi_enable_bus_clocks(struct mdss_dsi_ctrl_pdata *ctrl_pdata);
void mdss_dsi_disable_bus_clocks(struct mdss_dsi_ctrl_pdata *ctrl_pdata);
int mdss_dsi_panel_reset(struct mdss_panel_data *pdata, int enable);
void mdss_dsi_phy_disable(struct mdss_dsi_ctrl_pdata *ctrl);
void mdss_dsi_phy_init(struct mdss_panel_data *pdata);
void mdss_dsi_phy_sw_reset(unsigned char *ctrl_base);
void mdss_dsi_cmd_test_pattern(struct mdss_dsi_ctrl_pdata *ctrl);
void mdss_dsi_video_test_pattern(struct mdss_dsi_ctrl_pdata *ctrl);
@ -423,7 +421,6 @@ int mdss_dsi_panel_init(struct device_node *node,
bool cmd_cfg_cont_splash);
int mdss_panel_get_dst_fmt(u32 bpp, char mipi_mode, u32 pixel_packing,
char *dst_format);
void mdss_dsi_20nm_phy_init(struct mdss_panel_data *pdata);
int mdss_dsi_register_recovery_handler(struct mdss_dsi_ctrl_pdata *ctrl,
struct mdss_panel_recovery *recovery);

View file

@ -26,6 +26,297 @@
static struct dsi_clk_desc dsi_pclk;
void mdss_dsi_phy_sw_reset(unsigned char *ctrl_base)
{
/* start phy sw reset */
MIPI_OUTP(ctrl_base + 0x12c, 0x0001);
udelay(1000);
wmb();
/* end phy sw reset */
MIPI_OUTP(ctrl_base + 0x12c, 0x0000);
udelay(100);
wmb();
}
void mdss_dsi_phy_disable(struct mdss_dsi_ctrl_pdata *ctrl)
{
struct mdss_dsi_ctrl_pdata *ctrl0 = NULL;
if (ctrl == NULL) {
pr_err("%s: Invalid input data\n", __func__);
return;
}
/*
* In dual-dsi configuration, the phy should be disabled for the
* first controller only when the second controller is disabled.
* This is true regardless of whether broadcast mode is enabled
* or not.
*/
if ((ctrl->ndx == DSI_CTRL_0) &&
mdss_dsi_get_ctrl_by_index(DSI_CTRL_1)) {
pr_debug("%s: Dual dsi detected. skipping config for ctrl%d\n",
__func__, ctrl->ndx);
return;
}
if (ctrl->ndx == DSI_CTRL_1) {
ctrl0 = mdss_dsi_get_ctrl_by_index(DSI_CTRL_0);
if (ctrl0) {
MIPI_OUTP(ctrl0->phy_io.base + 0x0170, 0x000);
MIPI_OUTP(ctrl0->phy_io.base + 0x0298, 0x000);
} else {
pr_warn("%s: Unable to get control%d\n",
__func__, DSI_CTRL_0);
}
}
MIPI_OUTP(ctrl->phy_io.base + 0x0170, 0x000);
MIPI_OUTP(ctrl->phy_io.base + 0x0298, 0x000);
/*
* Wait for the registers writes to complete in order to
* ensure that the phy is completely disabled
*/
wmb();
}
static void mdss_dsi_phy_init(struct mdss_panel_data *pdata)
{
struct mdss_dsi_phy_ctrl *pd;
int i, off, ln, offset;
struct mdss_dsi_ctrl_pdata *ctrl_pdata = NULL, *temp_ctrl = NULL;
u32 ctrl_rev;
ctrl_pdata = container_of(pdata, struct mdss_dsi_ctrl_pdata,
panel_data);
if (!ctrl_pdata) {
pr_err("%s: Invalid input data\n", __func__);
return;
}
temp_ctrl = ctrl_pdata;
pd = &(((ctrl_pdata->panel_data).panel_info.mipi).dsi_phy_db);
/* Strength ctrl 0 */
MIPI_OUTP((ctrl_pdata->phy_io.base) + 0x0184, pd->strength[0]);
/*
* Phy regulator ctrl settings.
* In dual dsi configuration, the second controller also uses
* the regulators of the first controller, irrespective of whether
* broadcast mode is enabled or not.
*/
if (ctrl_pdata->ndx == DSI_CTRL_1) {
temp_ctrl = mdss_dsi_get_ctrl_by_index(DSI_CTRL_0);
if (!temp_ctrl) {
pr_err("%s: Unable to get master ctrl\n", __func__);
return;
}
}
/* Regulator ctrl 0 */
MIPI_OUTP((temp_ctrl->phy_io.base) + 0x280, 0x0);
/* Regulator ctrl - CAL_PWR_CFG */
MIPI_OUTP((temp_ctrl->phy_io.base) + 0x298, pd->regulator[6]);
/* Regulator ctrl - TEST */
MIPI_OUTP((temp_ctrl->phy_io.base) + 0x294, pd->regulator[5]);
/* Regulator ctrl 3 */
MIPI_OUTP((temp_ctrl->phy_io.base) + 0x28c, pd->regulator[3]);
/* Regulator ctrl 2 */
MIPI_OUTP((temp_ctrl->phy_io.base) + 0x288, pd->regulator[2]);
/* Regulator ctrl 1 */
MIPI_OUTP((temp_ctrl->phy_io.base) + 0x284, pd->regulator[1]);
/* Regulator ctrl 0 */
MIPI_OUTP((temp_ctrl->phy_io.base) + 0x280, pd->regulator[0]);
/* Regulator ctrl 4 */
MIPI_OUTP((temp_ctrl->phy_io.base) + 0x290, pd->regulator[4]);
/* LDO ctrl */
if (pd->reg_ldo_mode)
MIPI_OUTP((ctrl_pdata->phy_io.base) + 0x1dc, 0x25);
else
MIPI_OUTP((ctrl_pdata->phy_io.base) + 0x1dc, 0x00);
off = 0x0140; /* phy timing ctrl 0 - 11 */
for (i = 0; i < 12; i++) {
MIPI_OUTP((ctrl_pdata->phy_io.base) + off, pd->timing[i]);
wmb();
off += 4;
}
/* MMSS_DSI_0_PHY_DSIPHY_CTRL_1 */
MIPI_OUTP((ctrl_pdata->phy_io.base) + 0x0174, 0x00);
/* MMSS_DSI_0_PHY_DSIPHY_CTRL_0 */
MIPI_OUTP((ctrl_pdata->phy_io.base) + 0x0170, 0x5f);
wmb();
/* Strength ctrl 1 */
MIPI_OUTP((ctrl_pdata->phy_io.base) + 0x0188, pd->strength[1]);
wmb();
/* 4 lanes + clk lane configuration */
/* lane config n * (0 - 4) & DataPath setup */
for (ln = 0; ln < 5; ln++) {
off = (ln * 0x40);
for (i = 0; i < 9; i++) {
offset = i + (ln * 9);
MIPI_OUTP((ctrl_pdata->phy_io.base) + off,
pd->lanecfg[offset]);
wmb();
off += 4;
}
}
/* MMSS_DSI_0_PHY_DSIPHY_CTRL_0 */
MIPI_OUTP((ctrl_pdata->phy_io.base) + 0x0170, 0x5f);
wmb();
ctrl_rev = MIPI_INP(ctrl_pdata->ctrl_base);
/* DSI_0_PHY_DSIPHY_GLBL_TEST_CTRL */
if (((ctrl_pdata->panel_data).panel_info.pdest == DISPLAY_1) ||
(ctrl_rev == MDSS_DSI_HW_REV_103_1))
MIPI_OUTP((ctrl_pdata->phy_io.base) + 0x01d4, 0x01);
else
MIPI_OUTP((ctrl_pdata->phy_io.base) + 0x01d4, 0x00);
wmb();
off = 0x01b4; /* phy BIST ctrl 0 - 5 */
for (i = 0; i < 6; i++) {
MIPI_OUTP((ctrl_pdata->phy_io.base) + off, pd->bistctrl[i]);
wmb();
off += 4;
}
}
static void mdss_dsi_20nm_phy_init(struct mdss_panel_data *pdata)
{
struct mdss_dsi_phy_ctrl *pd;
int i, off, ln, offset;
struct mdss_dsi_ctrl_pdata *ctrl_pdata = NULL, *temp_ctrl = NULL;
ctrl_pdata = container_of(pdata, struct mdss_dsi_ctrl_pdata,
panel_data);
if (!ctrl_pdata) {
pr_err("%s: Invalid input data\n", __func__);
return;
}
temp_ctrl = ctrl_pdata;
pd = &(((ctrl_pdata->panel_data).panel_info.mipi).dsi_phy_db);
/* Strength ctrl 0 */
MIPI_OUTP((ctrl_pdata->phy_io.base) + 0x0184, pd->strength[0]);
/*
* Phy regulator ctrl settings.
* In dual dsi configuration, the second controller also uses
* the regulators of the first controller, irrespective of whether
* broadcast mode is enabled or not.
*/
if (ctrl_pdata->ndx == DSI_CTRL_1) {
temp_ctrl = mdss_dsi_get_ctrl_by_index(DSI_CTRL_0);
if (!temp_ctrl) {
pr_err("%s: Unable to get master ctrl\n", __func__);
return;
}
}
if (pd->reg_ldo_mode) {
/* Regulator ctrl 0 */
MIPI_OUTP((temp_ctrl->phy_io.base) + 0x280, 0x0);
/* Regulator ctrl - CAL_PWR_CFG */
MIPI_OUTP((temp_ctrl->phy_io.base) + 0x298, pd->regulator[6]);
udelay(1000);
/* Regulator ctrl - TEST */
MIPI_OUTP((temp_ctrl->phy_io.base) + 0x294, pd->regulator[5]);
/* Regulator ctrl 3 */
MIPI_OUTP((temp_ctrl->phy_io.base) + 0x28c, pd->regulator[3]);
/* Regulator ctrl 2 */
MIPI_OUTP((temp_ctrl->phy_io.base) + 0x288, pd->regulator[2]);
/* Regulator ctrl 1 */
MIPI_OUTP((temp_ctrl->phy_io.base) + 0x284, pd->regulator[1]);
/* Regulator ctrl 4 */
MIPI_OUTP((temp_ctrl->phy_io.base) + 0x290, pd->regulator[4]);
/* LDO ctrl */
MIPI_OUTP((ctrl_pdata->phy_io.base) + 0x1dc, 0x1d);
} else {
/* Regulator ctrl 0 */
MIPI_OUTP((temp_ctrl->phy_io.base) + 0x280, 0x0);
/* Regulator ctrl - CAL_PWR_CFG */
MIPI_OUTP((temp_ctrl->phy_io.base) + 0x298, pd->regulator[6]);
udelay(1000);
/* Regulator ctrl 1 */
MIPI_OUTP((temp_ctrl->phy_io.base) + 0x284, pd->regulator[1]);
/* Regulator ctrl 2 */
MIPI_OUTP((temp_ctrl->phy_io.base) + 0x288, pd->regulator[2]);
/* Regulator ctrl 3 */
MIPI_OUTP((temp_ctrl->phy_io.base) + 0x28c, pd->regulator[3]);
/* Regulator ctrl 4 */
MIPI_OUTP((temp_ctrl->phy_io.base) + 0x290, pd->regulator[4]);
/* LDO ctrl */
MIPI_OUTP((ctrl_pdata->phy_io.base) + 0x1dc, 0x00);
/* Regulator ctrl 0 */
MIPI_OUTP((temp_ctrl->phy_io.base) + 0x280, pd->regulator[0]);
}
off = 0x0140; /* phy timing ctrl 0 - 11 */
for (i = 0; i < 12; i++) {
MIPI_OUTP((ctrl_pdata->phy_io.base) + off, pd->timing[i]);
wmb();
off += 4;
}
/* Currently the Phy settings for the DSI 0 is done in clk prepare*/
if (ctrl_pdata->ndx == DSI_CTRL_1) {
/* MMSS_DSI_0_PHY_DSIPHY_CTRL_1 */
MIPI_OUTP((ctrl_pdata->phy_io.base) + 0x0174, 0x00);
/* MMSS_DSI_0_PHY_DSIPHY_CTRL_0 */
MIPI_OUTP((ctrl_pdata->phy_io.base) + 0x0170, 0x5f);
wmb();
/* Strength ctrl 1 */
MIPI_OUTP((ctrl_pdata->phy_io.base) + 0x0188, pd->strength[1]);
wmb();
/* MMSS_DSI_0_PHY_DSIPHY_CTRL_0 */
MIPI_OUTP((ctrl_pdata->phy_io.base) + 0x0170, 0x7f);
wmb();
/* DSI_0_PHY_DSIPHY_GLBL_TEST_CTRL */
MIPI_OUTP((ctrl_pdata->phy_io.base) + 0x01d4, 0x00);
/* MMSS_DSI_0_PHY_DSIPHY_CTRL_2 */
MIPI_OUTP((ctrl_pdata->phy_io.base) + 0x0178, 0x00);
MIPI_OUTP((ctrl_pdata->phy_io.base) + 0x0178, 0x02);
MIPI_OUTP((ctrl_pdata->phy_io.base) + 0x0178, 0x03);
wmb();
}
/* 4 lanes + clk lane configuration */
/* lane config n * (0 - 4) & DataPath setup */
for (ln = 0; ln < 5; ln++) {
off = (ln * 0x40);
for (i = 0; i < 9; i++) {
offset = i + (ln * 9);
MIPI_OUTP((ctrl_pdata->phy_io.base) + off,
pd->lanecfg[offset]);
wmb();
off += 4;
}
}
off = 0x01b4; /* phy BIST ctrl 0 - 5 */
for (i = 0; i < 6; i++) {
MIPI_OUTP((ctrl_pdata->phy_io.base) + off, pd->bistctrl[i]);
wmb();
off += 4;
}
}
int mdss_dsi_clk_init(struct platform_device *pdev,
struct mdss_dsi_ctrl_pdata *ctrl)
{
@ -725,6 +1016,7 @@ static int mdss_dsi_core_power_ctrl(struct mdss_dsi_ctrl_pdata *ctrl,
{
int rc = 0;
struct mdss_panel_data *pdata = NULL;
u32 ctrl_rev;
if (!ctrl) {
pr_err("%s: invalid input\n", __func__);
@ -767,7 +1059,11 @@ static int mdss_dsi_core_power_ctrl(struct mdss_dsi_ctrl_pdata *ctrl,
*/
if (!pdata->panel_info.panel_power_on)
mdss_dsi_phy_sw_reset(ctrl->ctrl_base);
mdss_dsi_phy_init(pdata);
ctrl_rev = MIPI_INP(ctrl->ctrl_base);
if (ctrl_rev == MDSS_DSI_HW_REV_103)
mdss_dsi_20nm_phy_init(pdata);
else
mdss_dsi_phy_init(pdata);
mdss_dsi_ctrl_setup(pdata);
@ -1025,7 +1321,7 @@ int mdss_dsi_clk_ctrl(struct mdss_dsi_ctrl_pdata *ctrl,
*/
if (link_changed && (!bus_changed && !ctrl->bus_clk_cnt)) {
pr_err("%s: Trying to enable link clks w/o enabling bus clks for ctrl%d",
__func__, ctrl->ndx);
__func__, mctrl->ndx);
goto error_mctrl_start;
}
@ -1091,297 +1387,6 @@ no_error:
return rc;
}
void mdss_dsi_phy_sw_reset(unsigned char *ctrl_base)
{
/* start phy sw reset */
MIPI_OUTP(ctrl_base + 0x12c, 0x0001);
udelay(1000);
wmb();
/* end phy sw reset */
MIPI_OUTP(ctrl_base + 0x12c, 0x0000);
udelay(100);
wmb();
}
void mdss_dsi_phy_disable(struct mdss_dsi_ctrl_pdata *ctrl)
{
struct mdss_dsi_ctrl_pdata *ctrl0 = NULL;
if (ctrl == NULL) {
pr_err("%s: Invalid input data\n", __func__);
return;
}
/*
* In dual-dsi configuration, the phy should be disabled for the
* first controller only when the second controller is disabled.
* This is true regardless of whether broadcast mode is enabled
* or not.
*/
if ((ctrl->ndx == DSI_CTRL_0) &&
mdss_dsi_get_ctrl_by_index(DSI_CTRL_1)) {
pr_debug("%s: Dual dsi detected. skipping config for ctrl%d\n",
__func__, ctrl->ndx);
return;
}
if (ctrl->ndx == DSI_CTRL_1) {
ctrl0 = mdss_dsi_get_ctrl_by_index(DSI_CTRL_0);
if (ctrl0) {
MIPI_OUTP(ctrl0->phy_io.base + 0x0170, 0x000);
MIPI_OUTP(ctrl0->phy_io.base + 0x0298, 0x000);
} else {
pr_warn("%s: Unable to get control%d\n",
__func__, DSI_CTRL_0);
}
}
MIPI_OUTP(ctrl->phy_io.base + 0x0170, 0x000);
MIPI_OUTP(ctrl->phy_io.base + 0x0298, 0x000);
/*
* Wait for the registers writes to complete in order to
* ensure that the phy is completely disabled
*/
wmb();
}
void mdss_dsi_phy_init(struct mdss_panel_data *pdata)
{
struct mdss_dsi_phy_ctrl *pd;
int i, off, ln, offset;
struct mdss_dsi_ctrl_pdata *ctrl_pdata = NULL, *temp_ctrl = NULL;
u32 ctrl_rev;
ctrl_pdata = container_of(pdata, struct mdss_dsi_ctrl_pdata,
panel_data);
if (!ctrl_pdata) {
pr_err("%s: Invalid input data\n", __func__);
return;
}
temp_ctrl = ctrl_pdata;
pd = &(((ctrl_pdata->panel_data).panel_info.mipi).dsi_phy_db);
/* Strength ctrl 0 */
MIPI_OUTP((ctrl_pdata->phy_io.base) + 0x0184, pd->strength[0]);
/*
* Phy regulator ctrl settings.
* In dual dsi configuration, the second controller also uses
* the regulators of the first controller, irrespective of whether
* broadcast mode is enabled or not.
*/
if (ctrl_pdata->ndx == DSI_CTRL_1) {
temp_ctrl = mdss_dsi_get_ctrl_by_index(DSI_CTRL_0);
if (!temp_ctrl) {
pr_err("%s: Unable to get master ctrl\n", __func__);
return;
}
}
/* Regulator ctrl 0 */
MIPI_OUTP((temp_ctrl->phy_io.base) + 0x280, 0x0);
/* Regulator ctrl - CAL_PWR_CFG */
MIPI_OUTP((temp_ctrl->phy_io.base) + 0x298, pd->regulator[6]);
/* Regulator ctrl - TEST */
MIPI_OUTP((temp_ctrl->phy_io.base) + 0x294, pd->regulator[5]);
/* Regulator ctrl 3 */
MIPI_OUTP((temp_ctrl->phy_io.base) + 0x28c, pd->regulator[3]);
/* Regulator ctrl 2 */
MIPI_OUTP((temp_ctrl->phy_io.base) + 0x288, pd->regulator[2]);
/* Regulator ctrl 1 */
MIPI_OUTP((temp_ctrl->phy_io.base) + 0x284, pd->regulator[1]);
/* Regulator ctrl 0 */
MIPI_OUTP((temp_ctrl->phy_io.base) + 0x280, pd->regulator[0]);
/* Regulator ctrl 4 */
MIPI_OUTP((temp_ctrl->phy_io.base) + 0x290, pd->regulator[4]);
/* LDO ctrl */
if (pd->reg_ldo_mode)
MIPI_OUTP((ctrl_pdata->phy_io.base) + 0x1dc, 0x25);
else
MIPI_OUTP((ctrl_pdata->phy_io.base) + 0x1dc, 0x00);
off = 0x0140; /* phy timing ctrl 0 - 11 */
for (i = 0; i < 12; i++) {
MIPI_OUTP((ctrl_pdata->phy_io.base) + off, pd->timing[i]);
wmb();
off += 4;
}
/* MMSS_DSI_0_PHY_DSIPHY_CTRL_1 */
MIPI_OUTP((ctrl_pdata->phy_io.base) + 0x0174, 0x00);
/* MMSS_DSI_0_PHY_DSIPHY_CTRL_0 */
MIPI_OUTP((ctrl_pdata->phy_io.base) + 0x0170, 0x5f);
wmb();
/* Strength ctrl 1 */
MIPI_OUTP((ctrl_pdata->phy_io.base) + 0x0188, pd->strength[1]);
wmb();
/* 4 lanes + clk lane configuration */
/* lane config n * (0 - 4) & DataPath setup */
for (ln = 0; ln < 5; ln++) {
off = (ln * 0x40);
for (i = 0; i < 9; i++) {
offset = i + (ln * 9);
MIPI_OUTP((ctrl_pdata->phy_io.base) + off,
pd->lanecfg[offset]);
wmb();
off += 4;
}
}
/* MMSS_DSI_0_PHY_DSIPHY_CTRL_0 */
MIPI_OUTP((ctrl_pdata->phy_io.base) + 0x0170, 0x5f);
wmb();
ctrl_rev = MIPI_INP(ctrl_pdata->ctrl_base);
/* DSI_0_PHY_DSIPHY_GLBL_TEST_CTRL */
if (((ctrl_pdata->panel_data).panel_info.pdest == DISPLAY_1) ||
(ctrl_rev == MDSS_DSI_HW_REV_103_1))
MIPI_OUTP((ctrl_pdata->phy_io.base) + 0x01d4, 0x01);
else
MIPI_OUTP((ctrl_pdata->phy_io.base) + 0x01d4, 0x00);
wmb();
off = 0x01b4; /* phy BIST ctrl 0 - 5 */
for (i = 0; i < 6; i++) {
MIPI_OUTP((ctrl_pdata->phy_io.base) + off, pd->bistctrl[i]);
wmb();
off += 4;
}
}
void mdss_dsi_20nm_phy_init(struct mdss_panel_data *pdata)
{
struct mdss_dsi_phy_ctrl *pd;
int i, off, ln, offset;
struct mdss_dsi_ctrl_pdata *ctrl_pdata = NULL, *temp_ctrl = NULL;
ctrl_pdata = container_of(pdata, struct mdss_dsi_ctrl_pdata,
panel_data);
if (!ctrl_pdata) {
pr_err("%s: Invalid input data\n", __func__);
return;
}
temp_ctrl = ctrl_pdata;
pd = &(((ctrl_pdata->panel_data).panel_info.mipi).dsi_phy_db);
/* Strength ctrl 0 */
MIPI_OUTP((ctrl_pdata->phy_io.base) + 0x0184, pd->strength[0]);
/*
* Phy regulator ctrl settings.
* In dual dsi configuration, the second controller also uses
* the regulators of the first controller, irrespective of whether
* broadcast mode is enabled or not.
*/
if (ctrl_pdata->ndx == DSI_CTRL_1) {
temp_ctrl = mdss_dsi_get_ctrl_by_index(DSI_CTRL_0);
if (!temp_ctrl) {
pr_err("%s: Unable to get master ctrl\n", __func__);
return;
}
}
if (pd->reg_ldo_mode) {
/* Regulator ctrl 0 */
MIPI_OUTP((temp_ctrl->phy_io.base) + 0x280, 0x0);
/* Regulator ctrl - CAL_PWR_CFG */
MIPI_OUTP((temp_ctrl->phy_io.base) + 0x298, pd->regulator[6]);
udelay(1000);
/* Regulator ctrl - TEST */
MIPI_OUTP((temp_ctrl->phy_io.base) + 0x294, pd->regulator[5]);
/* Regulator ctrl 3 */
MIPI_OUTP((temp_ctrl->phy_io.base) + 0x28c, pd->regulator[3]);
/* Regulator ctrl 2 */
MIPI_OUTP((temp_ctrl->phy_io.base) + 0x288, pd->regulator[2]);
/* Regulator ctrl 1 */
MIPI_OUTP((temp_ctrl->phy_io.base) + 0x284, pd->regulator[1]);
/* Regulator ctrl 4 */
MIPI_OUTP((temp_ctrl->phy_io.base) + 0x290, pd->regulator[4]);
/* LDO ctrl */
MIPI_OUTP((ctrl_pdata->phy_io.base) + 0x1dc, 0x1d);
} else {
/* Regulator ctrl 0 */
MIPI_OUTP((temp_ctrl->phy_io.base) + 0x280, 0x0);
/* Regulator ctrl - CAL_PWR_CFG */
MIPI_OUTP((temp_ctrl->phy_io.base) + 0x298, pd->regulator[6]);
udelay(1000);
/* Regulator ctrl 1 */
MIPI_OUTP((temp_ctrl->phy_io.base) + 0x284, pd->regulator[1]);
/* Regulator ctrl 2 */
MIPI_OUTP((temp_ctrl->phy_io.base) + 0x288, pd->regulator[2]);
/* Regulator ctrl 3 */
MIPI_OUTP((temp_ctrl->phy_io.base) + 0x28c, pd->regulator[3]);
/* Regulator ctrl 4 */
MIPI_OUTP((temp_ctrl->phy_io.base) + 0x290, pd->regulator[4]);
/* LDO ctrl */
MIPI_OUTP((ctrl_pdata->phy_io.base) + 0x1dc, 0x00);
/* Regulator ctrl 0 */
MIPI_OUTP((temp_ctrl->phy_io.base) + 0x280, pd->regulator[0]);
}
off = 0x0140; /* phy timing ctrl 0 - 11 */
for (i = 0; i < 12; i++) {
MIPI_OUTP((ctrl_pdata->phy_io.base) + off, pd->timing[i]);
wmb();
off += 4;
}
/* Currently the Phy settings for the DSI 0 is done in clk prepare*/
if (ctrl_pdata->ndx == DSI_CTRL_1) {
/* MMSS_DSI_0_PHY_DSIPHY_CTRL_1 */
MIPI_OUTP((ctrl_pdata->phy_io.base) + 0x0174, 0x00);
/* MMSS_DSI_0_PHY_DSIPHY_CTRL_0 */
MIPI_OUTP((ctrl_pdata->phy_io.base) + 0x0170, 0x5f);
wmb();
/* Strength ctrl 1 */
MIPI_OUTP((ctrl_pdata->phy_io.base) + 0x0188, pd->strength[1]);
wmb();
/* MMSS_DSI_0_PHY_DSIPHY_CTRL_0 */
MIPI_OUTP((ctrl_pdata->phy_io.base) + 0x0170, 0x7f);
wmb();
/* DSI_0_PHY_DSIPHY_GLBL_TEST_CTRL */
MIPI_OUTP((ctrl_pdata->phy_io.base) + 0x01d4, 0x00);
/* MMSS_DSI_0_PHY_DSIPHY_CTRL_2 */
MIPI_OUTP((ctrl_pdata->phy_io.base) + 0x0178, 0x00);
MIPI_OUTP((ctrl_pdata->phy_io.base) + 0x0178, 0x02);
MIPI_OUTP((ctrl_pdata->phy_io.base) + 0x0178, 0x03);
wmb();
}
/* 4 lanes + clk lane configuration */
/* lane config n * (0 - 4) & DataPath setup */
for (ln = 0; ln < 5; ln++) {
off = (ln * 0x40);
for (i = 0; i < 9; i++) {
offset = i + (ln * 9);
MIPI_OUTP((ctrl_pdata->phy_io.base) + off,
pd->lanecfg[offset]);
wmb();
off += 4;
}
}
off = 0x01b4; /* phy BIST ctrl 0 - 5 */
for (i = 0; i < 6; i++) {
MIPI_OUTP((ctrl_pdata->phy_io.base) + off, pd->bistctrl[i]);
wmb();
off += 4;
}
}
void mdss_edp_clk_deinit(struct mdss_edp_drv_pdata *edp_drv)
{
if (edp_drv->aux_clk)