(CR):[Kane]:[factory]Modfiy panel into the DTSB mode
authorwangjiao <wangjiao1@huaqin.com>
Thu, 27 Dec 2018 12:55:43 +0000 (20:55 +0800)
committerxiest1 <xiest1@lenovo.com>
Tue, 5 Nov 2019 09:30:10 +0000 (17:30 +0800)
Change-Id: I77f1676dae79fa573a98d9f87ddddb234c5354a8
Signed-off-by: wangjiao <wangjiao1@huaqin.com>
arch/arm64/boot/dts/exynos/exynos9609-robusta2_common.dtsi
drivers/video/fbdev/exynos/dpu20/dsim.h [changed mode: 0644->0755]
drivers/video/fbdev/exynos/dpu20/dsim_drv.c

index 702310354c570a8176a98cb835fa3ec75f8eb111..839d1cab0e789ec26f783c6c79b54e006b4232e4 100755 (executable)
                samsung,pin-pud = <1>;
        };
 
+       lcd_reset: lcd_reset {
+               samsung,pins = "gpg1-4";
+               samsung,pin-function = <1>;
+               samsung,pin-pud = <3>;
+               samsung,pin-val = <1>;
+               samsung,pin-con-pdn =<3>;
+               samsung,pin-pud-pdn = <3>;
+       };
+
        codec_reset: codec-reset {
                samsung,pins ="gpg3-2";
                samsung,pin-pud = <0>;
        lcd_info = <&nt36672a>;
        /* reset, lcd_bias_enp, lcd_bias_enn, lcd_bl_en*/
        gpios = <&gpg1 4 0x1>, <&gpg3 1 0x1>, <&gpg3 0 0x1>, <&gpg2 1 0x1>;
+       pinctrl-names = "lcd_reset";
+       pinctrl-0 = <&lcd_reset>;
 };
 
 /* USI_0_SHUB */
old mode 100644 (file)
new mode 100755 (executable)
index 9ecff2f..45d5c07
@@ -197,6 +197,8 @@ struct dsim_resources {
        void __iomem *phy_regs_ex;
        struct regulator *regulator_1p8v;
        struct regulator *regulator_3p3v;
+       struct pinctrl *pinctrl;
+       struct pinctrl_state *lcd_reset_sleep;
 };
 
 struct dsim_device {
index 8407e9548343b8e556fe5fbf8b5e42932fe4b354..5d4565434cc39c07c207977c57c732dd226dedb1 100755 (executable)
@@ -656,6 +656,15 @@ int dsim_set_panel_power(struct dsim_device *dsim, bool on)
 
 
        if (on) {
+               ret = gpio_request_one(res->lcd_reset, GPIOF_OUT_INIT_LOW,
+                               "lcd_reset");
+               if (ret < 0) {
+                       dsim_err("failed LCD reset off\n");
+                       return -EINVAL;
+               }
+               gpio_free(res->lcd_reset);
+               usleep_range(30000, 35000);
+
                if (res->lcd_power[0] > 0) {
                        ret = gpio_request_one(res->lcd_power[0],
                                        GPIOF_OUT_INIT_HIGH, "lcd_power0");
@@ -717,14 +726,12 @@ int dsim_set_panel_power(struct dsim_device *dsim, bool on)
                        usleep_range(5000, 6000);
                }
 
-               ret = gpio_request_one(res->lcd_reset, GPIOF_OUT_INIT_LOW,
-                               "lcd_reset");
-               if (ret < 0) {
-                       dsim_err("failed LCD reset off\n");
-                       return -EINVAL;
+               if (dsim->res.pinctrl && dsim->res.lcd_reset_sleep) {
+                       if (pinctrl_select_state(dsim->res.pinctrl,
+                                               dsim->res.lcd_reset_sleep)) {
+                               decon_err("failed to turn off dism reset\n");
+                       }
                }
-               gpio_free(res->lcd_reset);
-               usleep_range(1000, 2000);
 
                if (res->lcd_power[1] > 0) {
                        ret = gpio_request_one(res->lcd_power[1],
@@ -1962,6 +1969,29 @@ static int dsim_init_resources(struct dsim_device *dsim, struct platform_device
 
        return 0;
 }
+int dsim_init_pinctrl(struct dsim_device *dsim)
+{
+       int ret = 0;
+
+       dsim->res.pinctrl = devm_pinctrl_get(dsim->dev);
+       if (IS_ERR(dsim->res.pinctrl)) {
+               decon_err("failed to get dsim-%d pinctrl\n", dsim->id);
+               ret = PTR_ERR(dsim->res.pinctrl);
+               dsim->res.pinctrl = NULL;
+               goto err;
+       }
+
+       dsim->res.lcd_reset_sleep = pinctrl_lookup_state(dsim->res.pinctrl, "lcd_reset");
+       if (IS_ERR(dsim->res.lcd_reset_sleep)) {
+               decon_err("failed to get hw_te_on pin state\n");
+               ret = PTR_ERR(dsim->res.lcd_reset_sleep);
+               dsim->res.lcd_reset_sleep = NULL;
+               goto err;
+       }
+
+err:
+       return ret;
+}
 
 static int dsim_probe(struct platform_device *pdev)
 {
@@ -2002,6 +2032,12 @@ static int dsim_probe(struct platform_device *pdev)
        setup_timer(&dsim->cmd_timer, dsim_cmd_fail_detector,
                        (unsigned long)dsim);
 
+       dsim_err("%s: dsim_init_pinctrl\n", __func__);
+       ret = dsim_init_pinctrl(dsim);
+       if (ret) {
+               dsim_err("%s: failed to get pin resources\n", __func__);
+       }
+
 #if defined(CONFIG_CPU_IDLE)
        dsim->idle_ip_index = exynos_get_idle_ip_index(dev_name(&pdev->dev));
        dsim_info("dsim idle_ip_index[%d]\n", dsim->idle_ip_index);