diff options
| author | Aravind Venkateswaran <aravindh@codeaurora.org> | 2013-03-08 22:11:59 -0800 |
|---|---|---|
| committer | David Keitel <dkeitel@codeaurora.org> | 2016-03-23 20:15:16 -0700 |
| commit | 0f0959e4434fb97ca55e09506f393a0db5e5e25d (patch) | |
| tree | c2eae47171352a8bcc515133950d704961c5b722 | |
| parent | e60425617f573bc40886a2a072bed01e3759d7db (diff) | |
msm: mdss: Fix handling of DSI panel enable gpio
Panel enable GPIO is optional for some panels. DSI driver
should not operate on this GPIO if it is not configured
in the device file of the panel.
Change-Id: Ic1c8510758e12276eeeb94af808cdc0afa4686aa
Signed-off-by: Aravind Venkateswaran <aravindh@codeaurora.org>
| -rw-r--r-- | drivers/video/fbdev/msm/mdss_dsi.c | 5 | ||||
| -rw-r--r-- | drivers/video/fbdev/msm/mdss_dsi_panel.c | 11 |
2 files changed, 7 insertions, 9 deletions
diff --git a/drivers/video/fbdev/msm/mdss_dsi.c b/drivers/video/fbdev/msm/mdss_dsi.c index 2ec588eb35e4..d7c026e2331d 100644 --- a/drivers/video/fbdev/msm/mdss_dsi.c +++ b/drivers/video/fbdev/msm/mdss_dsi.c @@ -718,7 +718,8 @@ int dsi_panel_device_register(struct platform_device *pdev, pr_err("request reset gpio failed, rc=%d\n", rc); gpio_free(ctrl_pdata->rst_gpio); - gpio_free(ctrl_pdata->disp_en_gpio); + if (gpio_is_valid(ctrl_pdata->disp_en_gpio)) + gpio_free(ctrl_pdata->disp_en_gpio); return -ENODEV; } } @@ -782,7 +783,7 @@ int dsi_panel_device_register(struct platform_device *pdev, devm_kfree(&pdev->dev, ctrl_pdata); if (ctrl_pdata->rst_gpio) gpio_free(ctrl_pdata->rst_gpio); - if (ctrl_pdata->disp_en_gpio) + if (gpio_is_valid(ctrl_pdata->disp_en_gpio)) gpio_free(ctrl_pdata->disp_en_gpio); return rc; } diff --git a/drivers/video/fbdev/msm/mdss_dsi_panel.c b/drivers/video/fbdev/msm/mdss_dsi_panel.c index 77a8e944cbbf..f173c4fdfb8b 100644 --- a/drivers/video/fbdev/msm/mdss_dsi_panel.c +++ b/drivers/video/fbdev/msm/mdss_dsi_panel.c @@ -45,7 +45,6 @@ void mdss_dsi_panel_reset(struct mdss_panel_data *pdata, int enable) if (!gpio_is_valid(ctrl_pdata->disp_en_gpio)) { pr_debug("%s:%d, reset line not configured\n", __func__, __LINE__); - return; } if (!gpio_is_valid(ctrl_pdata->rst_gpio)) { @@ -59,18 +58,16 @@ void mdss_dsi_panel_reset(struct mdss_panel_data *pdata, int enable) if (enable) { gpio_set_value((ctrl_pdata->rst_gpio), 1); msleep(20); - wmb(); gpio_set_value((ctrl_pdata->rst_gpio), 0); udelay(200); - wmb(); gpio_set_value((ctrl_pdata->rst_gpio), 1); msleep(20); - wmb(); - gpio_set_value((ctrl_pdata->disp_en_gpio), 1); - wmb(); + if (gpio_is_valid(ctrl_pdata->disp_en_gpio)) + gpio_set_value((ctrl_pdata->disp_en_gpio), 1); } else { gpio_set_value((ctrl_pdata->rst_gpio), 0); - gpio_set_value((ctrl_pdata->disp_en_gpio), 0); + if (gpio_is_valid(ctrl_pdata->disp_en_gpio)) + gpio_set_value((ctrl_pdata->disp_en_gpio), 0); } } |
