diff options
| author | Padmanabhan Komanduru <pkomandu@codeaurora.org> | 2015-06-05 16:57:42 +0530 |
|---|---|---|
| committer | Jeevan Shriram <jshriram@codeaurora.org> | 2016-04-22 15:00:15 -0700 |
| commit | d5faefb4157bbbaeafabaaadd6a5904c23eb8f47 (patch) | |
| tree | d9af2c58bfc36cb8c7efc1132dd09b99b2bd9d35 | |
| parent | 7dcf51415ceaf2061413c08868bf998fdcfa3ee7 (diff) | |
msm: mdss: refactor support for controlling LCD mode selection GPIO
For certain board configurations, the enable port on display
connector card needs to be controlled via LCD mode selection
GPIO. For example, for DSC/single DSI mode, the GPIO needs to
be driven high and for non-DSC/split DSI mode, the GPIO
needs to be driven low. Add support for this.
CRs-Fixed: 1000724
Change-Id: I3546fc2b5dacd77e9d2cd2ea843481dc34bfef54
Signed-off-by: Padmanabhan Komanduru <pkomandu@codeaurora.org>
Signed-off-by: Aravind Venkateswaran <aravindh@codeaurora.org>
| -rw-r--r-- | Documentation/devicetree/bindings/fb/mdss-dsi-panel.txt | 10 | ||||
| -rw-r--r-- | Documentation/devicetree/bindings/fb/mdss-dsi.txt | 6 | ||||
| -rw-r--r-- | drivers/video/fbdev/msm/mdss_dsi.c | 17 | ||||
| -rw-r--r-- | drivers/video/fbdev/msm/mdss_dsi.h | 2 | ||||
| -rw-r--r-- | drivers/video/fbdev/msm/mdss_dsi_panel.c | 55 | ||||
| -rw-r--r-- | drivers/video/fbdev/msm/mdss_panel.h | 4 |
6 files changed, 48 insertions, 46 deletions
diff --git a/Documentation/devicetree/bindings/fb/mdss-dsi-panel.txt b/Documentation/devicetree/bindings/fb/mdss-dsi-panel.txt index 2cdbdf8bc499..18c1d214070b 100644 --- a/Documentation/devicetree/bindings/fb/mdss-dsi-panel.txt +++ b/Documentation/devicetree/bindings/fb/mdss-dsi-panel.txt @@ -275,10 +275,14 @@ Optional properties: to the physical width in the framebuffer information. - qcom,mdss-pan-physical-height-dimension: Specifies panel physical height in mm which corresponds to the physical height in the framebuffer information. -- qcom,mdss-dsi-panel-mode-gpio-state: String that specifies the mode state for panel if it is defined - in dsi controller. +- qcom,mdss-dsi-mode-sel-gpio-state: String that specifies the lcd mode for panel + (such as single-port/dual-port), if qcom,panel-mode-gpio + binding is defined in dsi controller. + "dual_port" = Set GPIO to LOW + "single_port" = Set GPIO to HIGH "high" = Set GPIO to HIGH "low" = Set GPIO to LOW + The default value is "dual_port". - qcom,mdss-tear-check-disable: Boolean to disable mdp tear check. Tear check is enabled by default to avoid tearing. Other tear-check properties are ignored if this property is present. The below tear check configuration properties can be individually tuned if @@ -575,7 +579,7 @@ Example: qcom,5v-boost-gpio = <&pm8994_gpios 14 0>; qcom,mdss-pan-physical-width-dimension = <60>; qcom,mdss-pan-physical-height-dimension = <140>; - qcom,mdss-dsi-panel-mode-gpio-state = "low"; + qcom,mdss-dsi-mode-sel-gpio-state = "dsc_mode"; qcom,mdss-tear-check-sync-cfg-height = <0xfff0>; qcom,mdss-tear-check-sync-init-val = <1280>; qcom,mdss-tear-check-sync-threshold-start = <4>; diff --git a/Documentation/devicetree/bindings/fb/mdss-dsi.txt b/Documentation/devicetree/bindings/fb/mdss-dsi.txt index 50e12ccde14f..4aeabcdd45b1 100644 --- a/Documentation/devicetree/bindings/fb/mdss-dsi.txt +++ b/Documentation/devicetree/bindings/fb/mdss-dsi.txt @@ -103,8 +103,8 @@ Optional properties: - qcom,platform-reset-gpio: Specifies the panel reset gpio. - qcom,platform-te-gpio: Specifies the gpio used for TE. - qcom,platform-bklight-en-gpio: Specifies the gpio used to enable display back-light -- qcom,platform-mode-gpio: Select video/command mode of panel through gpio when it supports - both modes. +- qcom,panel-mode-gpio: Specifies the GPIO to select video/command/single-port/dual-port + mode of panel through gpio when it supports these modes. - pinctrl-names: List of names to assign mdss pin states defined in pinctrl device node Refer to pinctrl-bindings.txt - pinctrl-<0..n>: Lists phandles each pointing to the pin configuration node within a pin @@ -245,7 +245,7 @@ Example: qcom,platform-te-gpio = <&msmgpio 24 0>; qcom,platform-enable-gpio = <&msmgpio 58 1>; qcom,platform-bklight-en-gpio = <&msmgpio 86 0>; - qcom,platform-mode-gpio = <&msmgpio 7 0>; + qcom,panel-mode-gpio = <&msmgpio 107 0>; qcom,dsi-irq-line; qcom,lane-map = "lane_map_3012"; qcom,display-id = "primary"; diff --git a/drivers/video/fbdev/msm/mdss_dsi.c b/drivers/video/fbdev/msm/mdss_dsi.c index bb4114e90b6c..903d8741ae13 100644 --- a/drivers/video/fbdev/msm/mdss_dsi.c +++ b/drivers/video/fbdev/msm/mdss_dsi.c @@ -3816,8 +3816,6 @@ static int mdss_dsi_parse_ctrl_params(struct platform_device *ctrl_pdev, static int mdss_dsi_parse_gpio_params(struct platform_device *ctrl_pdev, struct mdss_dsi_ctrl_pdata *ctrl_pdata) { - struct mdss_panel_info *pinfo = &(ctrl_pdata->panel_data.panel_info); - /* * If disp_en_gpio has been set previously (disp_en_gpio > 0) * while parsing the panel node, then do not override it @@ -3850,16 +3848,11 @@ static int mdss_dsi_parse_gpio_params(struct platform_device *ctrl_pdev, pr_err("%s:%d, reset gpio not specified\n", __func__, __LINE__); - if (pinfo->mode_gpio_state != MODE_GPIO_NOT_VALID) { - - ctrl_pdata->mode_gpio = of_get_named_gpio( - ctrl_pdev->dev.of_node, - "qcom,platform-mode-gpio", 0); - if (!gpio_is_valid(ctrl_pdata->mode_gpio)) - pr_info("%s:%d, mode gpio not specified\n", - __func__, __LINE__); - } else { - ctrl_pdata->mode_gpio = -EINVAL; + ctrl_pdata->lcd_mode_sel_gpio = of_get_named_gpio( + ctrl_pdev->dev.of_node, "qcom,panel-mode-gpio", 0); + if (!gpio_is_valid(ctrl_pdata->lcd_mode_sel_gpio)) { + pr_debug("%s:%d mode gpio not specified\n", __func__, __LINE__); + ctrl_pdata->lcd_mode_sel_gpio = -EINVAL; } return 0; diff --git a/drivers/video/fbdev/msm/mdss_dsi.h b/drivers/video/fbdev/msm/mdss_dsi.h index 1606f0c72a13..56e12dc5ca48 100644 --- a/drivers/video/fbdev/msm/mdss_dsi.h +++ b/drivers/video/fbdev/msm/mdss_dsi.h @@ -426,7 +426,7 @@ struct mdss_dsi_ctrl_pdata { int rst_gpio; int disp_en_gpio; int bklt_en_gpio; - int mode_gpio; + int lcd_mode_sel_gpio; int bklt_ctrl; /* backlight ctrl */ bool pwm_pmi; int pwm_period; diff --git a/drivers/video/fbdev/msm/mdss_dsi_panel.c b/drivers/video/fbdev/msm/mdss_dsi_panel.c index b6db0c2543af..366cbf33467e 100644 --- a/drivers/video/fbdev/msm/mdss_dsi_panel.c +++ b/drivers/video/fbdev/msm/mdss_dsi_panel.c @@ -248,17 +248,19 @@ static int mdss_dsi_request_gpios(struct mdss_dsi_ctrl_pdata *ctrl_pdata) goto bklt_en_gpio_err; } } - if (gpio_is_valid(ctrl_pdata->mode_gpio)) { - rc = gpio_request(ctrl_pdata->mode_gpio, "panel_mode"); + + if (gpio_is_valid(ctrl_pdata->lcd_mode_sel_gpio)) { + rc = gpio_request(ctrl_pdata->lcd_mode_sel_gpio, "mode_sel"); if (rc) { - pr_err("request panel mode gpio failed,rc=%d\n", + pr_err("request dsc/dual mode gpio failed,rc=%d\n", rc); - goto mode_gpio_err; + goto lcd_mode_sel_gpio_err; } } + return rc; -mode_gpio_err: +lcd_mode_sel_gpio_err: if (gpio_is_valid(ctrl_pdata->bklt_en_gpio)) gpio_free(ctrl_pdata->bklt_en_gpio); bklt_en_gpio_err: @@ -351,21 +353,17 @@ int mdss_dsi_panel_reset(struct mdss_panel_data *pdata, int enable) } } - if (gpio_is_valid(ctrl_pdata->mode_gpio)) { - bool out; - - if (pinfo->mode_gpio_state == MODE_GPIO_HIGH) - out = true; - else if (pinfo->mode_gpio_state == MODE_GPIO_LOW) - out = false; - - rc = gpio_direction_output(ctrl_pdata->mode_gpio, out); - if (rc) { - pr_err("%s: unable to set dir for mode gpio\n", - __func__); - goto exit; - } + if (gpio_is_valid(ctrl_pdata->lcd_mode_sel_gpio)) { + if ((pinfo->mode_sel_state == MODE_SEL_SINGLE_PORT) || + (pinfo->mode_sel_state == MODE_GPIO_HIGH)) + gpio_set_value( + ctrl_pdata->lcd_mode_sel_gpio, 1); + else if ((pinfo->mode_sel_state == MODE_SEL_DUAL_PORT) + || (pinfo->mode_sel_state == MODE_GPIO_LOW)) + gpio_set_value( + ctrl_pdata->lcd_mode_sel_gpio, 0); } + if (ctrl_pdata->ctrl_state & CTRL_STATE_PANEL_INIT) { pr_debug("%s: Panel Not properly turned OFF\n", __func__); @@ -383,8 +381,8 @@ int mdss_dsi_panel_reset(struct mdss_panel_data *pdata, int enable) } gpio_set_value((ctrl_pdata->rst_gpio), 0); gpio_free(ctrl_pdata->rst_gpio); - if (gpio_is_valid(ctrl_pdata->mode_gpio)) - gpio_free(ctrl_pdata->mode_gpio); + if (gpio_is_valid(ctrl_pdata->lcd_mode_sel_gpio)) + gpio_free(ctrl_pdata->lcd_mode_sel_gpio); } exit: @@ -2372,14 +2370,19 @@ static int mdss_panel_parse_dt(struct device_node *np, rc = of_property_read_u32(np, "qcom,mdss-dsi-stream", &tmp); pinfo->mipi.stream = (!rc ? tmp : 0); - data = of_get_property(np, "qcom,mdss-dsi-panel-mode-gpio-state", NULL); + data = of_get_property(np, "qcom,mdss-dsi-mode-sel-gpio-state", NULL); if (data) { - if (!strcmp(data, "high")) - pinfo->mode_gpio_state = MODE_GPIO_HIGH; + if (!strcmp(data, "single_port")) + pinfo->mode_sel_state = MODE_SEL_SINGLE_PORT; + else if (!strcmp(data, "dual_port")) + pinfo->mode_sel_state = MODE_SEL_DUAL_PORT; + else if (!strcmp(data, "high")) + pinfo->mode_sel_state = MODE_GPIO_HIGH; else if (!strcmp(data, "low")) - pinfo->mode_gpio_state = MODE_GPIO_LOW; + pinfo->mode_sel_state = MODE_GPIO_LOW; } else { - pinfo->mode_gpio_state = MODE_GPIO_NOT_VALID; + /* Set default mode as SPLIT mode */ + pinfo->mode_sel_state = MODE_SEL_DUAL_PORT; } rc = of_property_read_u32(np, "qcom,mdss-mdp-transfer-time-us", &tmp); diff --git a/drivers/video/fbdev/msm/mdss_panel.h b/drivers/video/fbdev/msm/mdss_panel.h index 33d8d7bd77bd..568e8f3b4151 100644 --- a/drivers/video/fbdev/msm/mdss_panel.h +++ b/drivers/video/fbdev/msm/mdss_panel.h @@ -114,6 +114,8 @@ enum { enum { MODE_GPIO_NOT_VALID = 0, + MODE_SEL_DUAL_PORT, + MODE_SEL_SINGLE_PORT, MODE_GPIO_HIGH, MODE_GPIO_LOW, }; @@ -588,7 +590,7 @@ struct mdss_panel_info { int panel_max_fps; int panel_max_vtotal; - u32 mode_gpio_state; + u32 mode_sel_state; u32 xstart_pix_align; u32 width_pix_align; u32 ystart_pix_align; |
