summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLin Huang <hl@rock-chips.com>2016-10-21 02:50:45 (GMT)
committerchrome-bot <chrome-bot@chromium.org>2016-10-22 01:41:39 (GMT)
commit9c3873dfbcb429992dfdbbfb6954a2620b5f9f06 (patch)
tree88a74d7b3805c74147df4b5f8bda2e183ada0331 /src
parent17145da59b99f9967caebc96e4d46b556471ba5d (diff)
downloaddepthcharge-9c3873dfbcb429992dfdbbfb6954a2620b5f9f06.tar.gz
depthcharge-9c3873dfbcb429992dfdbbfb6954a2620b5f9f06.tar.xz
rockchip: video: fix VOP_STANDBY bit setting error
when we set the VOP_STANDBY bit, it will also set the VOP_STANDBY + 16 bit before, so fix it. BUG=chrome-os-partner:58675 BRANCH=none TEST=Boot from kevin, and display work Change-Id: I2b5cb21e700fc4b8662c8a5c990ebbcb9ecd44f4 Signed-off-by: Lin Huang <hl@rock-chips.com> Reviewed-on: https://chromium-review.googlesource.com/401403 Commit-Ready: Julius Werner <jwerner@chromium.org> Reviewed-by: Julius Werner <jwerner@chromium.org>
Diffstat (limited to 'src')
-rw-r--r--src/drivers/video/rk3288.c11
-rw-r--r--src/drivers/video/rk3399.c9
2 files changed, 7 insertions, 13 deletions
diff --git a/src/drivers/video/rk3288.c b/src/drivers/video/rk3288.c
index e64d09b..9ab06e7 100644
--- a/src/drivers/video/rk3288.c
+++ b/src/drivers/video/rk3288.c
@@ -23,11 +23,8 @@ typedef struct {
GpioOps *backlight_gpio;
} RkDisplay;
-#define RK_CLRSETBITS(clr, set) ((((clr) | (set)) << 16) | set)
-#define RK_SETBITS(set) RK_CLRSETBITS(0, set)
-#define RK_CLRBITS(clr) RK_CLRSETBITS(clr, 0)
-
-#define VOP_STANDBY_EN 22
+#define VOP_STANDBY_EN 1
+#define VOP_STANDBY_OFFSET 22
static uint32_t *vop0_sys_ctrl = (uint32_t *)0xff930008;
static uint32_t *vop1_sys_ctrl = (uint32_t *)0xff940008;
@@ -42,10 +39,10 @@ static int rk3288_backlight_update(DisplayOps *me, uint8_t enable)
static int rk3288_display_stop(DisplayOps *me)
{
/* set vop0 to standby */
- writel(RK_SETBITS(1 << VOP_STANDBY_EN), vop0_sys_ctrl);
+ setbits_le32(vop0_sys_ctrl, VOP_STANDBY_EN << VOP_STANDBY_OFFSET);
/* set vop1 to standby */
- writel(RK_SETBITS(1 << VOP_STANDBY_EN), vop1_sys_ctrl);
+ setbits_le32(vop1_sys_ctrl, VOP_STANDBY_EN << VOP_STANDBY_OFFSET);
/* wait frame complete (60Hz) to enter standby */
mdelay(17);
diff --git a/src/drivers/video/rk3399.c b/src/drivers/video/rk3399.c
index 39471f8..fd1def4 100644
--- a/src/drivers/video/rk3399.c
+++ b/src/drivers/video/rk3399.c
@@ -19,11 +19,8 @@
#include "drivers/ec/cros/ec.h"
#include "drivers/video/rk3399.h"
-#define RK_CLRSETBITS(clr, set) ((((clr) | (set)) << 16) | set)
-#define RK_SETBITS(set) RK_CLRSETBITS(0, set)
-#define RK_CLRBITS(clr) RK_CLRSETBITS(clr, 0)
-
-#define VOP_STANDBY_EN 22
+#define VOP_STANDBY_EN 1
+#define VOP_STANDBY_OFFSET 22
// Set backlight to 80% by default when on
// This mirrors default value from the kernel
@@ -57,7 +54,7 @@ static int rockchip_display_init(DisplayOps *me)
static int rockchip_display_stop(DisplayOps *me)
{
/* set vop0 to standby */
- writel(RK_SETBITS(1 << VOP_STANDBY_EN), vop0_sys_ctrl);
+ setbits_le32(vop0_sys_ctrl, VOP_STANDBY_EN << VOP_STANDBY_OFFSET);
/* wait frame complete (60Hz) to enter standby */
mdelay(17);