summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Agner <stefan.agner@toradex.com>2015-06-11 08:49:23 +0200
committerStefan Agner <stefan.agner@toradex.com>2015-06-11 08:49:23 +0200
commitcd586e4cf9dcc8b476311ab42caf74a5e67a53ec (patch)
treee2ba704c8eac1226c36ea472fefcdb6a58718017
parent0023dbc37a48843f5d0189c530c8c8872a14bac3 (diff)
video: fsl-dcu-fb: fix operating mode off
Operating mode off seems to be documented wrong. Adjust the defines to the observed values/behavior (swap TEST and OFF mode) and apply the values correctly.
-rw-r--r--drivers/video/fbdev/fsl-dcu-fb.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/video/fbdev/fsl-dcu-fb.c b/drivers/video/fbdev/fsl-dcu-fb.c
index a67a036..7047c73 100644
--- a/drivers/video/fbdev/fsl-dcu-fb.c
+++ b/drivers/video/fbdev/fsl-dcu-fb.c
@@ -31,9 +31,9 @@
#define DCU_MODE_RASTER_EN (1 << 14)
#define DCU_MODE_DCU_MODE(x) (x)
#define DCU_MODE_DCU_MODE_MASK 0x03
-#define DCU_MODE_OFF 0
+#define DCU_MODE_TEST 0
#define DCU_MODE_NORMAL 1
-#define DCU_MODE_TEST 2
+#define DCU_MODE_OFF 2
#define DCU_MODE_COLORBAR 3
#define DCU_BGND 0x0014
@@ -333,6 +333,7 @@ static void enable_controller(struct fb_info *info)
unsigned int dcu_mode;
dcu_mode = readl(dcufb->reg_base + DCU_DCU_MODE);
+ dcu_mode &= ~DCU_MODE_DCU_MODE_MASK;
writel(dcu_mode | DCU_MODE_DCU_MODE(DCU_MODE_NORMAL),
dcufb->reg_base + DCU_DCU_MODE);
}
@@ -341,8 +342,11 @@ static void disable_controller(struct fb_info *info)
{
struct mfb_info *mfbi = info->par;
struct dcu_fb_data *dcufb = mfbi->parent;
+ unsigned int dcu_mode;
- writel(DCU_MODE_DCU_MODE(DCU_MODE_OFF),
+ dcu_mode = readl(dcufb->reg_base + DCU_DCU_MODE);
+ dcu_mode &= ~DCU_MODE_DCU_MODE_MASK;
+ writel(dcu_mode | DCU_MODE_DCU_MODE(DCU_MODE_OFF),
dcufb->reg_base + DCU_DCU_MODE);
}