msm: mdss: override DSI hw configuration

MSM8996/8994/8992 is configured for split display
configuration as default option. However, bootloader
can override this configuration to single dsi by
selecting a single dsi panel on one of controller
and set "none" to another controller. This requires
hardware override.

Change-Id: I3e585079548e92f6d576615059987321dfad132a
Signed-off-by: Dhaval Patel <pdhaval@codeaurora.org>
This commit is contained in:
Dhaval Patel 2015-06-02 16:56:33 -07:00 committed by David Keitel
parent 54a956d002
commit 71ab9b2d78

View file

@ -2545,6 +2545,24 @@ static void mdss_dsi_parse_pll_src_cfg(struct platform_device *pdev)
return;
}
static void mdss_dsi_update_hw_cfg(char *panel_cfg)
{
const char *pan;
struct dsi_shared_data *sdata = mdss_dsi_res->shared_data;
if (!panel_cfg)
return;
if (mdss_dsi_is_hw_config_split(sdata)) {
pan = strnstr(panel_cfg, NONE_PANEL, strlen(panel_cfg));
if (pan) {
pr_debug("moving to single DSI configuraiton\n");
sdata->hw_config = SINGLE_DSI;
sdata->pll_src_config = PLL_SRC_DEFAULT;
}
}
}
static int mdss_dsi_validate_pll_src_config(struct dsi_shared_data *sdata)
{
int rc = 0;
@ -2554,8 +2572,6 @@ static int mdss_dsi_validate_pll_src_config(struct dsi_shared_data *sdata)
* - For split dsi config, only PLL0 is supported
* - For dual dsi config, DSI0-PLL0 and DSI1-PLL1 is the only
* possible configuration
* - For single dsi, it is not possible to source the clocks for
* DSI0 from PLL1.
*/
if (mdss_dsi_is_hw_config_split(sdata) &&
mdss_dsi_is_pll_src_pll1(sdata)) {
@ -2572,15 +2588,6 @@ static int mdss_dsi_validate_pll_src_config(struct dsi_shared_data *sdata)
sdata->pll_src_config = PLL_SRC_DEFAULT;
}
if (mdss_dsi_is_hw_config_single(sdata) &&
mdss_dsi_is_dsi0_active(sdata) &&
mdss_dsi_is_pll_src_pll1(sdata)) {
pr_err("%s: unsupported PLL config: using PLL1 for DSI1\n",
__func__);
rc = -EINVAL;
goto error;
}
error:
return rc;
}
@ -2602,6 +2609,7 @@ static int mdss_dsi_probe(struct platform_device *pdev)
{
struct mdss_panel_cfg *pan_cfg = NULL;
struct mdss_util_intf *util;
char *panel_cfg;
int rc = 0;
util = mdss_get_util_intf();
@ -2629,6 +2637,14 @@ static int mdss_dsi_probe(struct platform_device *pdev)
return -ENODEV;
}
pan_cfg = util->panel_intf_type(MDSS_PANEL_INTF_DSI);
if (IS_ERR_OR_NULL(pan_cfg)) {
rc = PTR_ERR(pan_cfg);
goto error;
} else {
panel_cfg = pan_cfg->arg_cfg;
}
rc = mdss_dsi_res_init(pdev);
if (rc) {
pr_err("%s Unable to set dsi res\n", __func__);
@ -2642,6 +2658,9 @@ static int mdss_dsi_probe(struct platform_device *pdev)
return rc;
}
/* support hw config override until full support is not added */
mdss_dsi_update_hw_cfg(panel_cfg);
mdss_dsi_parse_pll_src_cfg(pdev);
of_platform_populate(pdev->dev.of_node, mdss_dsi_ctrl_dt_match,