From: zwl Date: Mon, 16 Jun 2014 11:19:52 +0000 (+0800) Subject: rk32 lcdc: modify the mirror prop read X-Git-Tag: firefly_0821_release~5096 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=65b19c5e17856bd2d910da8ed5a391933c10e893;p=firefly-linux-kernel-4.4.55.git rk32 lcdc: modify the mirror prop read --- diff --git a/drivers/video/rockchip/lcdc/rk3288_lcdc.c b/drivers/video/rockchip/lcdc/rk3288_lcdc.c index 35bb5621efca..0d4b53bbfff0 100755 --- a/drivers/video/rockchip/lcdc/rk3288_lcdc.c +++ b/drivers/video/rockchip/lcdc/rk3288_lcdc.c @@ -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 diff --git a/drivers/video/rockchip/rk_fb.c b/drivers/video/rockchip/rk_fb.c index ed1cd3c66dec..9ffeabea3540 100755 --- a/drivers/video/rockchip/rk_fb.c +++ b/drivers/video/rockchip/rk_fb.c @@ -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) {