rk32 lcdc: modify the mirror prop read
authorzwl <zwl@rock-chips.com>
Mon, 16 Jun 2014 11:19:52 +0000 (19:19 +0800)
committerzwl <zwl@rock-chips.com>
Mon, 16 Jun 2014 11:20:02 +0000 (19:20 +0800)
drivers/video/rockchip/lcdc/rk3288_lcdc.c
drivers/video/rockchip/rk_fb.c

index 35bb5621efca70e58a7c372f39b7e1f9ca5a86c3..0d4b53bbfff0862cfe123b05fc5546cf3a031d56 100755 (executable)
@@ -3512,11 +3512,32 @@ static int rk3288_lcdc_parse_dt(struct lcdc_device *lcdc_dev)
 {
        struct device_node *np = lcdc_dev->dev->of_node;
        int val;
+       int mirror;
+
        if (of_property_read_u32(np, "rockchip,prop", &val))
                lcdc_dev->prop = PRMRY; /*default set it as primary */
        else
                lcdc_dev->prop = val;
 
+       if (of_property_read_u32(np, "rockchip,mirror", &val))
+               mirror = NO_MIRROR;
+       else
+               mirror = val;
+
+       if (mirror == NO_MIRROR) {
+               lcdc_dev->driver.screen0->x_mirror = 0;
+               lcdc_dev->driver.screen0->y_mirror = 0;
+       } else if (mirror == X_MIRROR) {
+               lcdc_dev->driver.screen0->x_mirror = 1;
+               lcdc_dev->driver.screen0->y_mirror = 0;
+       } else if (mirror == Y_MIRROR) {
+               lcdc_dev->driver.screen0->x_mirror = 0;
+               lcdc_dev->driver.screen0->y_mirror = 1;
+       } else if (mirror == X_Y_MIRROR) {
+               lcdc_dev->driver.screen0->x_mirror = 1;
+               lcdc_dev->driver.screen0->y_mirror = 1;
+       }
+
        if (of_property_read_u32(np, "rockchip,cabc_mode", &val))
                lcdc_dev->driver.cabc_mode = 0; /* default set close cabc */
        else
index ed1cd3c66dec29d2dc33b54bfd78dca4b6ebb29a..9ffeabea3540900553fe36780564e60084651218 100755 (executable)
@@ -231,7 +231,6 @@ int rk_disp_pwr_ctr_parse_dt(struct rk_lcdc_driver *dev_drv)
        enum of_gpio_flags flags;
        u32 val = 0;
        u32 debug = 0;
-       u32 mirror = 0;
        int ret;
 
        INIT_LIST_HEAD(&dev_drv->pwrlist_head);
@@ -273,22 +272,6 @@ int rk_disp_pwr_ctr_parse_dt(struct rk_lcdc_driver *dev_drv)
                list_add_tail(&pwr_ctr->list, &dev_drv->pwrlist_head);
        }
 
-       of_property_read_u32(root, "rockchip,mirror", &mirror);
-
-       if (mirror == NO_MIRROR) {
-               dev_drv->screen0->x_mirror = 0;
-               dev_drv->screen0->y_mirror = 0;
-       } else if (mirror == X_MIRROR) {
-               dev_drv->screen0->x_mirror = 1;
-               dev_drv->screen0->y_mirror = 0;
-       } else if (mirror == Y_MIRROR) {
-               dev_drv->screen0->x_mirror = 0;
-               dev_drv->screen0->y_mirror = 1;
-       } else if (mirror == X_Y_MIRROR) {
-               dev_drv->screen0->x_mirror = 1;
-               dev_drv->screen0->y_mirror = 1;
-       }
-
        of_property_read_u32(root, "rockchip,debug", &debug);
 
        if (debug) {