Merge "msm: mdss: Initialize pan_name array to 0 and handle error case"
This commit is contained in:
commit
fff2d13b25
1 changed files with 39 additions and 9 deletions
|
@ -2416,13 +2416,16 @@ static int mdss_mdp_get_pan_cfg(struct mdss_panel_cfg *pan_cfg)
|
||||||
char *t = NULL;
|
char *t = NULL;
|
||||||
char pan_intf_str[MDSS_MAX_PANEL_LEN];
|
char pan_intf_str[MDSS_MAX_PANEL_LEN];
|
||||||
int rc, i, panel_len;
|
int rc, i, panel_len;
|
||||||
char pan_name[MDSS_MAX_PANEL_LEN];
|
char pan_name[MDSS_MAX_PANEL_LEN] = {'\0'};
|
||||||
|
|
||||||
if (!pan_cfg)
|
if (!pan_cfg)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
if (mdss_mdp_panel[0] == '0') {
|
if (mdss_mdp_panel[0] == '0') {
|
||||||
|
pr_debug("panel name is not set\n");
|
||||||
pan_cfg->lk_cfg = false;
|
pan_cfg->lk_cfg = false;
|
||||||
|
pan_cfg->pan_intf = MDSS_PANEL_INTF_INVALID;
|
||||||
|
return -EINVAL;
|
||||||
} else if (mdss_mdp_panel[0] == '1') {
|
} else if (mdss_mdp_panel[0] == '1') {
|
||||||
pan_cfg->lk_cfg = true;
|
pan_cfg->lk_cfg = true;
|
||||||
} else {
|
} else {
|
||||||
|
@ -2432,7 +2435,7 @@ static int mdss_mdp_get_pan_cfg(struct mdss_panel_cfg *pan_cfg)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* skip lk cfg and delimiter; ex: "0:" */
|
/* skip lk cfg and delimiter; ex: "1:" */
|
||||||
strlcpy(pan_name, &mdss_mdp_panel[2], MDSS_MAX_PANEL_LEN);
|
strlcpy(pan_name, &mdss_mdp_panel[2], MDSS_MAX_PANEL_LEN);
|
||||||
t = strnstr(pan_name, ":", MDSS_MAX_PANEL_LEN);
|
t = strnstr(pan_name, ":", MDSS_MAX_PANEL_LEN);
|
||||||
if (!t) {
|
if (!t) {
|
||||||
|
@ -2814,7 +2817,10 @@ static int mdss_mdp_probe(struct platform_device *pdev)
|
||||||
struct resource *res;
|
struct resource *res;
|
||||||
int rc;
|
int rc;
|
||||||
struct mdss_data_type *mdata;
|
struct mdss_data_type *mdata;
|
||||||
bool display_on = false;
|
uint32_t intf_sel = 0;
|
||||||
|
uint32_t split_display = 0;
|
||||||
|
int num_of_display_on = 0;
|
||||||
|
int i = 0;
|
||||||
|
|
||||||
if (!pdev->dev.of_node) {
|
if (!pdev->dev.of_node) {
|
||||||
pr_err("MDP driver only supports device tree probe\n");
|
pr_err("MDP driver only supports device tree probe\n");
|
||||||
|
@ -2941,7 +2947,6 @@ static int mdss_mdp_probe(struct platform_device *pdev)
|
||||||
*/
|
*/
|
||||||
mdss_mdp_footswitch_ctrl_splash(true);
|
mdss_mdp_footswitch_ctrl_splash(true);
|
||||||
mdss_hw_rev_init(mdata);
|
mdss_hw_rev_init(mdata);
|
||||||
display_on = true;
|
|
||||||
|
|
||||||
/*populate hw iomem base info from device tree*/
|
/*populate hw iomem base info from device tree*/
|
||||||
rc = mdss_mdp_parse_dt(pdev);
|
rc = mdss_mdp_parse_dt(pdev);
|
||||||
|
@ -3010,10 +3015,34 @@ static int mdss_mdp_probe(struct platform_device *pdev)
|
||||||
* clk/regulator votes else turn off clk/regulators because purpose
|
* clk/regulator votes else turn off clk/regulators because purpose
|
||||||
* here is to get mdp_rev.
|
* here is to get mdp_rev.
|
||||||
*/
|
*/
|
||||||
display_on = (bool)readl_relaxed(mdata->mdp_base +
|
intf_sel = readl_relaxed(mdata->mdp_base +
|
||||||
MDSS_MDP_REG_DISP_INTF_SEL);
|
MDSS_MDP_REG_DISP_INTF_SEL);
|
||||||
if (!display_on)
|
split_display = readl_relaxed(mdata->mdp_base +
|
||||||
|
MDSS_MDP_REG_SPLIT_DISPLAY_EN);
|
||||||
|
if (intf_sel != 0) {
|
||||||
|
for (i = 0; i < 4; i++)
|
||||||
|
num_of_display_on += ((intf_sel >> i*8) & 0x000000FF);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* For split display enabled - DSI0, DSI1 interfaces are
|
||||||
|
* considered as single display. So decrement
|
||||||
|
* 'num_of_display_on' by 1
|
||||||
|
*/
|
||||||
|
if (split_display)
|
||||||
|
num_of_display_on--;
|
||||||
|
}
|
||||||
|
if (!num_of_display_on) {
|
||||||
mdss_mdp_footswitch_ctrl_splash(false);
|
mdss_mdp_footswitch_ctrl_splash(false);
|
||||||
|
} else {
|
||||||
|
mdata->handoff_pending = true;
|
||||||
|
/*
|
||||||
|
* If multiple displays are enabled in LK, ctrl_splash off will
|
||||||
|
* be called multiple times during splash_cleanup. Need to
|
||||||
|
* enable it symmetrically
|
||||||
|
*/
|
||||||
|
for (i = 1; i < num_of_display_on; i++)
|
||||||
|
mdss_mdp_footswitch_ctrl_splash(true);
|
||||||
|
}
|
||||||
|
|
||||||
mdp_intr_cb = kcalloc(ARRAY_SIZE(mdp_irq_map),
|
mdp_intr_cb = kcalloc(ARRAY_SIZE(mdp_irq_map),
|
||||||
sizeof(struct intr_callback), GFP_KERNEL);
|
sizeof(struct intr_callback), GFP_KERNEL);
|
||||||
|
@ -3055,12 +3084,13 @@ static int mdss_mdp_probe(struct platform_device *pdev)
|
||||||
mdss_res->mdp_irq_export[0] = MDSS_MDP_INTR_WB_0_DONE |
|
mdss_res->mdp_irq_export[0] = MDSS_MDP_INTR_WB_0_DONE |
|
||||||
MDSS_MDP_INTR_WB_1_DONE;
|
MDSS_MDP_INTR_WB_1_DONE;
|
||||||
|
|
||||||
pr_info("mdss version = 0x%x, bootloader display is %s\n",
|
pr_info("mdss version = 0x%x, bootloader display is %s, num %d, intf_sel=0x%08x\n",
|
||||||
mdata->mdp_rev, display_on ? "on" : "off");
|
mdata->mdp_rev, num_of_display_on ? "on" : "off",
|
||||||
|
num_of_display_on, intf_sel);
|
||||||
|
|
||||||
probe_done:
|
probe_done:
|
||||||
if (IS_ERR_VALUE(rc)) {
|
if (IS_ERR_VALUE(rc)) {
|
||||||
if (display_on)
|
if (!num_of_display_on)
|
||||||
mdss_mdp_footswitch_ctrl_splash(false);
|
mdss_mdp_footswitch_ctrl_splash(false);
|
||||||
|
|
||||||
if (mdata->regulator_notif_register)
|
if (mdata->regulator_notif_register)
|
||||||
|
|
Loading…
Add table
Reference in a new issue