Skip to content

Commit

Permalink
dev: gcdb: add pinfo into target_ldo_ctrl
Browse files Browse the repository at this point in the history
Add pinfo as parameter into target_ldo_ctrl() so that
target_ldo_ctrl() can be customized base on panel info.

Change-Id: Ibc291e01d98e5725c1b8ee35917f7c678915ce53
  • Loading branch information
Kuogee Hsieh committed Aug 28, 2014
1 parent 34eb60a commit 93bcff6
Show file tree
Hide file tree
Showing 11 changed files with 23 additions and 17 deletions.
14 changes: 8 additions & 6 deletions dev/gcdb/display/gcdb_display.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,13 @@ static uint32_t mdss_dsi_panel_clock(uint8_t enable,
return ret;
}

static int mdss_dsi_panel_power(uint8_t enable)
static int mdss_dsi_panel_power(uint8_t enable,
struct msm_panel_info *pinfo)
{
int ret = NO_ERROR;

if (enable) {
ret = target_ldo_ctrl(enable);
ret = target_ldo_ctrl(enable, pinfo);
if (ret) {
dprintf(CRITICAL, "LDO control enable failed\n");
return ret;
Expand All @@ -118,7 +119,7 @@ static int mdss_dsi_panel_power(uint8_t enable)
return ret;
}

ret = target_ldo_ctrl(enable);
ret = target_ldo_ctrl(enable, pinfo);
if (ret) {
dprintf(CRITICAL, "ldo control disable failed\n");
return ret;
Expand Down Expand Up @@ -297,12 +298,13 @@ static uint32_t mdss_edp_panel_disable(void)
return target_edp_panel_disable();
}

static int mdss_edp_panel_power(uint8_t enable)
static int mdss_edp_panel_power(uint8_t enable,
struct msm_panel_info *pinfo)
{
int ret = NO_ERROR;

if (enable) {
ret = target_ldo_ctrl(enable);
ret = target_ldo_ctrl(enable, pinfo);
if (ret) {
dprintf(CRITICAL, "LDO control enable failed\n");
return ret;
Expand All @@ -322,7 +324,7 @@ static int mdss_edp_panel_power(uint8_t enable)
return ret;
}

ret = target_ldo_ctrl(enable);
ret = target_ldo_ctrl(enable, pinfo);
if (ret) {
dprintf(CRITICAL, "%s: ldo control disable failed\n", __func__);
return ret;
Expand Down
2 changes: 1 addition & 1 deletion dev/gcdb/display/gcdb_display.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ int target_backlight_ctrl(struct backlight *bl, uint8_t enable);
int target_panel_clock(uint8_t enable, struct msm_panel_info *pinfo);
int target_panel_reset(uint8_t enable, struct panel_reset_sequence *resetseq,
struct msm_panel_info *pinfo);
int target_ldo_ctrl(uint8_t enable);
int target_ldo_ctrl(uint8_t enable, struct msm_panel_info *pinfo);

int gcdb_display_init(const char *panel_name, uint32_t rev, void *base);
bool gcdb_display_cmdline_arg(char *panel_name, char *pbuf, uint16_t buf_size);
Expand Down
4 changes: 2 additions & 2 deletions platform/msm_shared/display.c
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ int msm_display_init(struct msm_fb_panel_data *pdata)

/* Turn on panel */
if (pdata->power_func)
ret = pdata->power_func(1);
ret = pdata->power_func(1, &(panel->panel_info));

if (ret)
goto msm_display_init_out;
Expand Down Expand Up @@ -390,7 +390,7 @@ int msm_display_off()

/* Disable panel */
if (panel->power_func)
ret = panel->power_func(0);
ret = panel->power_func(0, pinfo);

msm_display_off_out:
return ret;
Expand Down
2 changes: 1 addition & 1 deletion platform/msm_shared/include/msm_panel.h
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ struct msm_fb_panel_data {
int rotate;

/* function entry chain */
int (*power_func) (int enable);
int (*power_func) (int enable, struct msm_panel_info *);
int (*clk_func) (int enable);
int (*bl_func) (int enable);
int (*pll_clk_func) (int enable, struct msm_panel_info *);
Expand Down
2 changes: 1 addition & 1 deletion target/apq8084/target_display.c
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ int target_panel_reset(uint8_t enable, struct panel_reset_sequence *resetseq,
return NO_ERROR;
}

int target_ldo_ctrl(uint8_t enable)
int target_ldo_ctrl(uint8_t enable, struct msm_panel_info *pinfo)
{
uint32_t ldocounter = 0;
uint32_t pm8x41_ldo_base = 0x13F00;
Expand Down
2 changes: 1 addition & 1 deletion target/msm8226/target_display.c
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ int target_panel_reset(uint8_t enable, struct panel_reset_sequence *resetseq,
return ret;
}

int target_ldo_ctrl(uint8_t enable)
int target_ldo_ctrl(uint8_t enable, struct msm_panel_info *pinfo)
{
uint32_t ret = NO_ERROR;
uint32_t ldocounter = 0;
Expand Down
2 changes: 1 addition & 1 deletion target/msm8610/target_display.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ int target_panel_reset(uint8_t enable, struct panel_reset_sequence *resetseq,
return 0;
}

int target_ldo_ctrl(uint8_t enable)
int target_ldo_ctrl(uint8_t enable, struct msm_panel_info *pinfo)
{
uint32_t ldocounter = 0;
uint32_t pm8x41_ldo_base = 0x13F00;
Expand Down
2 changes: 1 addition & 1 deletion target/msm8916/target_display.c
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ int target_panel_reset(uint8_t enable, struct panel_reset_sequence *resetseq,
return ret;
}

int target_ldo_ctrl(uint8_t enable)
int target_ldo_ctrl(uint8_t enable, struct msm_panel_info *pinfo)
{
/*
* The PMIC regulators needed for display are enabled in SBL.
Expand Down
2 changes: 1 addition & 1 deletion target/msm8974/target_display.c
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ int target_panel_reset(uint8_t enable, struct panel_reset_sequence *resetseq,
return NO_ERROR;
}

int target_ldo_ctrl(uint8_t enable)
int target_ldo_ctrl(uint8_t enable, struct msm_panel_info *pinfo)
{
uint32_t ldocounter = 0;
uint32_t pm8x41_ldo_base = 0x13F00;
Expand Down
2 changes: 1 addition & 1 deletion target/msm8994/target_display.c
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ int target_panel_reset(uint8_t enable, struct panel_reset_sequence *resetseq,
return NO_ERROR;
}

int target_ldo_ctrl(uint8_t enable)
int target_ldo_ctrl(uint8_t enable, struct msm_panel_info *pinfo)
{
if (enable) {
regulator_enable(); /* L2, L12, L14, and L28 */
Expand Down
6 changes: 5 additions & 1 deletion target/target_display.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright (c) 2012-2013, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2014, The Linux Foundation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
Expand Down Expand Up @@ -62,6 +62,10 @@ __WEAK int target_display_post_off()
{
return 0;
}
__WEAK int target_ldo_ctrl(uint8_t enable, struct msm_panel_info *pinfo)
{
return 0;
}

__WEAK void target_edp_panel_init(struct msm_panel_info *pinfo)
{
Expand Down

0 comments on commit 93bcff6

Please sign in to comment.