staging: sm750fb: change definition of PANEL_WINDOW_HEIGHT fields
authorMike Rapoport <mike.rapoport@gmail.com>
Wed, 10 Feb 2016 16:34:14 +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_WINDOW_HEIGHT 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 6e6694d651d5279be18860fa4a84f04e0cec63e0..d3359c5e8ced4265ec1f4f65aeb14d8142155816 100644 (file)
 #define PANEL_WINDOW_WIDTH_X_MASK                     0xfff
 
 #define PANEL_WINDOW_HEIGHT                           0x080018
-#define PANEL_WINDOW_HEIGHT_HEIGHT                    27:16
-#define PANEL_WINDOW_HEIGHT_Y                         11:0
+#define PANEL_WINDOW_HEIGHT_HEIGHT_SHIFT              16
+#define PANEL_WINDOW_HEIGHT_HEIGHT_MASK               (0xfff << 16)
+#define PANEL_WINDOW_HEIGHT_Y_MASK                    0xfff
 
 #define PANEL_PLANE_TL                                0x08001C
 #define PANEL_PLANE_TL_TOP                            26:16
index a0d72144392e4b0cf69bbffa705685a3e7e9364e..0ea3106183d6aee57e3b575c1f2652de48d7b0bd 100644 (file)
@@ -323,9 +323,11 @@ int hw_sm750_crtc_setMode(struct lynxfb_crtc *crtc,
                reg |= (var->xoffset & PANEL_WINDOW_WIDTH_X_MASK);
                POKE32(PANEL_WINDOW_WIDTH, reg);
 
-               POKE32(PANEL_WINDOW_HEIGHT,
-                       FIELD_VALUE(0, PANEL_WINDOW_HEIGHT, HEIGHT, var->yres_virtual - 1)|
-                       FIELD_VALUE(0, PANEL_WINDOW_HEIGHT, Y, var->yoffset));
+               reg = ((var->yres_virtual - 1) <<
+                      PANEL_WINDOW_HEIGHT_HEIGHT_SHIFT);
+               reg &= PANEL_WINDOW_HEIGHT_HEIGHT_MASK;
+               reg |= (var->yoffset & PANEL_WINDOW_HEIGHT_Y_MASK);
+               POKE32(PANEL_WINDOW_HEIGHT, reg);
 
                POKE32(PANEL_PLANE_TL, 0);