]> git.karo-electronics.de Git - linux-beck.git/commitdiff
staging: sm750fb: change definition of PANEL_PLANE_BR fields
authorMike Rapoport <mike.rapoport@gmail.com>
Wed, 10 Feb 2016 16:34:16 +0000 (18:34 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 12 Feb 2016 03:52:37 +0000 (19:52 -0800)
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>
drivers/staging/sm750fb/ddk750_reg.h
drivers/staging/sm750fb/sm750_hw.c

index b8460a5b8c2cfe2e8492b5bb55ef0593f89e6292..65510983bae25571534d69d496d3bc2148d6c8e7 100644 (file)
 #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
index 0ea3106183d6aee57e3b575c1f2652de48d7b0bd..5951d1a03c29abb522b1fd719240bd15f6ed066e 100644 (file)
@@ -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);