staging: sm750fb: change definition of CRT_AUTO_CENTERING_BR fields
authorMike Rapoport <mike.rapoport@gmail.com>
Mon, 15 Feb 2016 17:53:46 +0000 (19:53 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 16 Feb 2016 02:26:17 +0000 (18:26 -0800)
Use stratight-forward definition of CRT_AUTO_CENTERING_BR register fields
and use open-coded implementation for register manipulation

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/sm750fb/ddk750_mode.c
drivers/staging/sm750fb/ddk750_reg.h

index 9e762183e3f3acc182071fcacb9fe47de73624c9..6c6a5c9cc50cc2a5329930ea819c9c7853e1cb11 100644 (file)
@@ -28,8 +28,9 @@ static unsigned long displayControlAdjust_SM750LE(mode_parameter_t *pModeParam,
        POKE32(CRT_AUTO_CENTERING_TL, 0);
 
        POKE32(CRT_AUTO_CENTERING_BR,
-       FIELD_VALUE(0, CRT_AUTO_CENTERING_BR, BOTTOM, y - 1)
-       | FIELD_VALUE(0, CRT_AUTO_CENTERING_BR, RIGHT, x - 1));
+               (((y - 1) << CRT_AUTO_CENTERING_BR_BOTTOM_SHIFT) &
+                       CRT_AUTO_CENTERING_BR_BOTTOM_MASK) |
+               ((x - 1) & CRT_AUTO_CENTERING_BR_RIGHT_MASK));
 
        /* Assume common fields in dispControl have been properly set before
           calling this function.
index 1d8d577c6a736923b48c21ba4620e1d0340f8922..990d4e301b882a994732df6ff144d4afb224c64d 100644 (file)
     #define CRT_AUTO_CENTERING_TL_LEFT_MASK           0x7ff
 
     #define CRT_AUTO_CENTERING_BR                     0x080284
-    #define CRT_AUTO_CENTERING_BR_BOTTOM              26:16
-    #define CRT_AUTO_CENTERING_BR_RIGHT               10:0
+    #define CRT_AUTO_CENTERING_BR_BOTTOM_MASK         (0x7ff << 16)
+    #define CRT_AUTO_CENTERING_BR_BOTTOM_SHIFT        16
+    #define CRT_AUTO_CENTERING_BR_RIGHT_MASK          0x7ff
 #endif
 
 /* sm750le new register to control panel output */