]> git.karo-electronics.de Git - linux-beck.git/commitdiff
staging: sm750fb: change definition of DE_DIMENSION fields
authorMike Rapoport <mike.rapoport@gmail.com>
Mon, 15 Feb 2016 17:53:59 +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 DE_DIMENSION 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/sm750_accel.c
drivers/staging/sm750fb/sm750_accel.h

index 55c38ae10b3a55746d7dcee7c21b1a23c54c79e7..cdbd766128604b4172c23cb06376d9cbc567f228 100644 (file)
@@ -119,8 +119,8 @@ int hw_fillrect(struct lynx_accel *accel,
                  (y & DE_DESTINATION_Y_MASK)); /* dpr4 */
 
        write_dpr(accel, DE_DIMENSION,
-                       FIELD_VALUE(0, DE_DIMENSION, X, width)|
-                       FIELD_VALUE(0, DE_DIMENSION, Y_ET, height)); /* dpr8 */
+                 ((width << DE_DIMENSION_X_SHIFT) & DE_DIMENSION_X_MASK) |
+                 (height & DE_DIMENSION_Y_ET_MASK)); /* dpr8 */
 
        deCtrl =
                FIELD_SET(0, DE_CONTROL, STATUS, START)|
@@ -261,8 +261,8 @@ unsigned int rop2)   /* ROP value */
                  ((dx << DE_DESTINATION_X_SHIFT) & DE_DESTINATION_X_MASK) |
                  (dy & DE_DESTINATION_Y_MASK)); /* dpr04 */
        write_dpr(accel, DE_DIMENSION,
-                 FIELD_VALUE(0, DE_DIMENSION, X,    width) |
-                 FIELD_VALUE(0, DE_DIMENSION, Y_ET, height)); /* dpr08 */
+                 ((width << DE_DIMENSION_X_SHIFT) & DE_DIMENSION_X_MASK) |
+                 (height & DE_DIMENSION_Y_ET_MASK)); /* dpr08 */
 
        de_ctrl = FIELD_VALUE(0, DE_CONTROL, ROP, rop2) |
                  FIELD_SET(0, DE_CONTROL, ROP_SELECT, ROP2) |
@@ -359,8 +359,8 @@ int hw_imageblit(struct lynx_accel *accel,
                  (dy & DE_DESTINATION_Y_MASK)); /* dpr04 */
 
        write_dpr(accel, DE_DIMENSION,
-                 FIELD_VALUE(0, DE_DIMENSION, X,    width) |
-                 FIELD_VALUE(0, DE_DIMENSION, Y_ET, height)); /* dpr08 */
+                 ((width << DE_DIMENSION_X_SHIFT) & DE_DIMENSION_X_MASK) |
+                 (height & DE_DIMENSION_Y_ET_MASK)); /* dpr08 */
 
        write_dpr(accel, DE_FOREGROUND, fColor);
        write_dpr(accel, DE_BACKGROUND, bColor);
index f8dc3f120f089e15750813ca262d986323cae384..c38ff4508265ee248dc921c35d0cfa6ecb5b1e86 100644 (file)
@@ -34,8 +34,9 @@
 #define DE_DESTINATION_Y_MASK                           0xffff
 
 #define DE_DIMENSION                                    0x8
-#define DE_DIMENSION_X                                  28:16
-#define DE_DIMENSION_Y_ET                               15:0
+#define DE_DIMENSION_X_SHIFT                            16
+#define DE_DIMENSION_X_MASK                             (0x1fff << 16)
+#define DE_DIMENSION_Y_ET_MASK                          0x1fff
 
 #define DE_CONTROL                                      0xC
 #define DE_CONTROL_STATUS                               31:31