rk fb:
authorzwl <zwl@rockchips.com>
Thu, 6 Nov 2014 03:36:28 +0000 (11:36 +0800)
committerzwl <zwl@rockchips.com>
Thu, 6 Nov 2014 03:36:28 +0000 (11:36 +0800)
* avoid get the delay of power-ctrl error when 'rockchip,delay' is not set on lcdc node at dts file

Signed-off-by: zwl <zwl@rock-chips.com>
arch/arm/boot/dts/act8846.dtsi
arch/arm/boot/dts/rk3288-tb_8846.dts
drivers/video/rockchip/rk_fb.c

index 421a09a52e1418e6c0fef4c9f2827351a64d146d..c8ba4b5bdc585bb11f27dbc1ebad72aa01fabfe4 100644 (file)
@@ -82,6 +82,7 @@
                        reg = <10>;
                        regulator-compatible = "act_ldo7";
                        regulator-always-on;
+                       /* regulator-always-on; */
                        regulator-boot-on;
                };
 
@@ -93,4 +94,4 @@
                };
        };
                
-};
\ No newline at end of file
+};
index 3c15425a45f802184b77f313feb3993f7131479c..501bad5ec6c76f3c173007144f4ef0b562a92954 100644 (file)
        rockchip,cabc_mode = <0>;
        power_ctr: power_ctr {
                rockchip,debug = <0>;
+               /*lcd_18:lcd18 {
+                       rockchip,power_type = <REGULATOR>;
+                       rockchip,regulator_name = "vcc_18";
+                       rockchip,regulator_voltage = <1800000>;
+                       rockchip,delay = <5>;
+               };*/
+
                lcd_en:lcd_en {
                        rockchip,power_type = <GPIO>;
                        gpios = <&gpio7 GPIO_A3 GPIO_ACTIVE_HIGH>;
index 4a97c5fd7b4e0c3aa8e67dab23b4a4603246313a..6cdd2cee107d5d6be8987aca0370da6f723197dd 100755 (executable)
@@ -276,8 +276,11 @@ int rk_disp_pwr_ctr_parse_dt(struct rk_lcdc_driver *dev_drv)
                                        pwr_ctr->pwr_ctr.volt = 0;
                        }
                };
-               of_property_read_u32(child, "rockchip,delay", &val);
-               pwr_ctr->pwr_ctr.delay = val;
+
+               if (!of_property_read_u32(child, "rockchip,delay", &val))
+                       pwr_ctr->pwr_ctr.delay = val;
+               else
+                       pwr_ctr->pwr_ctr.delay = 0;
                list_add_tail(&pwr_ctr->list, &dev_drv->pwrlist_head);
        }
 
@@ -325,8 +328,9 @@ int rk_disp_pwr_enable(struct rk_lcdc_driver *dev_drv)
                        if (pwr_ctr->rgl_name)
                                regulator_lcd = regulator_get(NULL, pwr_ctr->rgl_name);
                        if (regulator_lcd == NULL) {
-                               dev_err(dev_drv->dev, "%s: regulator get failed,regulator name:%s\n",
-                                           __func__, pwr_ctr->rgl_name);
+                               dev_err(dev_drv->dev,
+                                       "%s: regulator get failed,regulator name:%s\n",
+                                       __func__, pwr_ctr->rgl_name);
                                continue;
                        }
                        regulator_set_voltage(regulator_lcd, pwr_ctr->volt, pwr_ctr->volt);
@@ -334,7 +338,10 @@ int rk_disp_pwr_enable(struct rk_lcdc_driver *dev_drv)
                                if (regulator_enable(regulator_lcd) == 0 || count == 0)
                                        break;
                                else
-                                       count--;
+                                       dev_err(dev_drv->dev,
+                                               "regulator_enable failed,count=%d\n",
+                                               count);
+                               count--;
                        }
                        regulator_put(regulator_lcd);
                        msleep(pwr_ctr->delay);
@@ -364,15 +371,19 @@ int rk_disp_pwr_disable(struct rk_lcdc_driver *dev_drv)
                        if (pwr_ctr->rgl_name)
                                regulator_lcd = regulator_get(NULL, pwr_ctr->rgl_name);
                        if (regulator_lcd == NULL) {
-                               dev_err(dev_drv->dev, "%s: regulator get failed,regulator name:%s\n",
-                                           __func__, pwr_ctr->rgl_name);
+                               dev_err(dev_drv->dev,
+                                       "%s: regulator get failed,regulator name:%s\n",
+                                       __func__, pwr_ctr->rgl_name);
                                continue;
                        }
                        while (regulator_is_enabled(regulator_lcd) > 0) {
                                if (regulator_disable(regulator_lcd) == 0 || count == 0)
                                        break;
                                else
-                                       count--;
+                                       dev_err(dev_drv->dev,
+                                               "regulator_disable failed,count=%d\n",
+                                               count);
+                               count--;
                        }
                        regulator_put(regulator_lcd);
                }