summaryrefslogtreecommitdiffstats
path: root/drivers/staging/sm750fb
diff options
context:
space:
mode:
authorMike Rapoport2016-02-10 17:34:16 +0100
committerGreg Kroah-Hartman2016-02-12 04:52:37 +0100
commit27b047bbe1ee9c07749fb558a3d220dfd7288331 (patch)
treef06fc8c5d7d64ca8525a98d1232f6fdb6975df23 /drivers/staging/sm750fb
parentstaging: sm750fb: change definition of PANEL_PLANE_TL fields (diff)
downloadkernel-qcow2-linux-27b047bbe1ee9c07749fb558a3d220dfd7288331.tar.gz
kernel-qcow2-linux-27b047bbe1ee9c07749fb558a3d220dfd7288331.tar.xz
kernel-qcow2-linux-27b047bbe1ee9c07749fb558a3d220dfd7288331.zip
staging: sm750fb: change definition of PANEL_PLANE_BR fields
Use stratight-forward defintion of PANEL_PLANE_BR register fields and use open-coded implementation for register manipulations Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/sm750fb')
-rw-r--r--drivers/staging/sm750fb/ddk750_reg.h5
-rw-r--r--drivers/staging/sm750fb/sm750_hw.c7
2 files changed, 7 insertions, 5 deletions
diff --git a/drivers/staging/sm750fb/ddk750_reg.h b/drivers/staging/sm750fb/ddk750_reg.h
index b8460a5b8c2c..65510983bae2 100644
--- a/drivers/staging/sm750fb/ddk750_reg.h
+++ b/drivers/staging/sm750fb/ddk750_reg.h
@@ -853,8 +853,9 @@
#define PANEL_PLANE_TL_LEFT_MASK 0xeff
#define PANEL_PLANE_BR 0x080020
-#define PANEL_PLANE_BR_BOTTOM 26:16
-#define PANEL_PLANE_BR_RIGHT 10:0
+#define PANEL_PLANE_BR_BOTTOM_SHIFT 16
+#define PANEL_PLANE_BR_BOTTOM_MASK (0xeff << 16)
+#define PANEL_PLANE_BR_RIGHT_MASK 0xeff
#define PANEL_HORIZONTAL_TOTAL 0x080024
#define PANEL_HORIZONTAL_TOTAL_TOTAL 27:16
diff --git a/drivers/staging/sm750fb/sm750_hw.c b/drivers/staging/sm750fb/sm750_hw.c
index 0ea3106183d6..5951d1a03c29 100644
--- a/drivers/staging/sm750fb/sm750_hw.c
+++ b/drivers/staging/sm750fb/sm750_hw.c
@@ -331,9 +331,10 @@ int hw_sm750_crtc_setMode(struct lynxfb_crtc *crtc,
POKE32(PANEL_PLANE_TL, 0);
- POKE32(PANEL_PLANE_BR,
- FIELD_VALUE(0, PANEL_PLANE_BR, BOTTOM, var->yres - 1)|
- FIELD_VALUE(0, PANEL_PLANE_BR, RIGHT, var->xres - 1));
+ reg = ((var->yres - 1) << PANEL_PLANE_BR_BOTTOM_SHIFT) &
+ PANEL_PLANE_BR_BOTTOM_MASK;
+ reg |= ((var->xres - 1) & PANEL_PLANE_BR_RIGHT_MASK);
+ POKE32(PANEL_PLANE_BR, reg);
/* set pixel format */
reg = PEEK32(PANEL_DISPLAY_CTRL);