staging: sm750fb: change definition of CRT_VERTICAL_TOTAL fields
authorMike Rapoport <mike.rapoport@gmail.com>
Mon, 15 Feb 2016 17:53:49 +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_VERTICAL_TOTAL 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 d425ea1bbe76d6c700f4e2aa6031556a89f5d0d0..c8862e844a54a28b9a4b43757b55f50debc0cb49 100644 (file)
@@ -97,8 +97,11 @@ static int programModeRegisters(mode_parameter_t *pModeParam, pll_value_t *pll)
                                CRT_HORIZONTAL_SYNC_START_MASK));
 
                POKE32(CRT_VERTICAL_TOTAL,
-               FIELD_VALUE(0, CRT_VERTICAL_TOTAL, TOTAL, pModeParam->vertical_total - 1)
-               | FIELD_VALUE(0, CRT_VERTICAL_TOTAL, DISPLAY_END, pModeParam->vertical_display_end - 1));
+                       (((pModeParam->vertical_total - 1) <<
+                               CRT_VERTICAL_TOTAL_TOTAL_SHIFT) &
+                               CRT_VERTICAL_TOTAL_TOTAL_MASK) |
+                       ((pModeParam->vertical_display_end - 1) &
+                               CRT_VERTICAL_TOTAL_DISPLAY_END_MASK));
 
                POKE32(CRT_VERTICAL_SYNC,
                FIELD_VALUE(0, CRT_VERTICAL_SYNC, HEIGHT, pModeParam->vertical_sync_height)
index fc6fa2349ebc22ba7a5ab730a287a9f9a2c87ebe..7b076a554a97f1cccd0db7b541d33b31f1956dd8 100644 (file)
 #define CRT_HORIZONTAL_SYNC_START_MASK                0xfff
 
 #define CRT_VERTICAL_TOTAL                            0x080214
-#define CRT_VERTICAL_TOTAL_TOTAL                      26:16
-#define CRT_VERTICAL_TOTAL_DISPLAY_END                10:0
+#define CRT_VERTICAL_TOTAL_TOTAL_SHIFT                16
+#define CRT_VERTICAL_TOTAL_TOTAL_MASK                 (0x7ff << 16)
+#define CRT_VERTICAL_TOTAL_DISPLAY_END_MASK           (0x7ff)
 
 #define CRT_VERTICAL_SYNC                             0x080218
 #define CRT_VERTICAL_SYNC_HEIGHT                      21:16