staging: sm750fb: change definition of CRT_HORIZONTAL_SYNC fields
authorMike Rapoport <mike.rapoport@gmail.com>
Mon, 15 Feb 2016 17:53:48 +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_HORIZONTAL_SYNC 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 2b2f1c17989f9209e7cb57923e41e6384f7d8687..d425ea1bbe76d6c700f4e2aa6031556a89f5d0d0 100644 (file)
@@ -90,8 +90,11 @@ static int programModeRegisters(mode_parameter_t *pModeParam, pll_value_t *pll)
                                CRT_HORIZONTAL_TOTAL_DISPLAY_END_MASK));
 
                POKE32(CRT_HORIZONTAL_SYNC,
-               FIELD_VALUE(0, CRT_HORIZONTAL_SYNC, WIDTH, pModeParam->horizontal_sync_width)
-               | FIELD_VALUE(0, CRT_HORIZONTAL_SYNC, START, pModeParam->horizontal_sync_start - 1));
+                       ((pModeParam->horizontal_sync_width <<
+                               CRT_HORIZONTAL_SYNC_WIDTH_SHIFT) &
+                               CRT_HORIZONTAL_SYNC_WIDTH_MASK) |
+                       ((pModeParam->horizontal_sync_start - 1) &
+                               CRT_HORIZONTAL_SYNC_START_MASK));
 
                POKE32(CRT_VERTICAL_TOTAL,
                FIELD_VALUE(0, CRT_VERTICAL_TOTAL, TOTAL, pModeParam->vertical_total - 1)
index 1b55a7f3677e3edeb3efc488ff9a9409e02d6db5..fc6fa2349ebc22ba7a5ab730a287a9f9a2c87ebe 100644 (file)
 #define CRT_HORIZONTAL_TOTAL_DISPLAY_END_MASK         0xfff
 
 #define CRT_HORIZONTAL_SYNC                           0x080210
-#define CRT_HORIZONTAL_SYNC_WIDTH                     23:16
-#define CRT_HORIZONTAL_SYNC_START                     11:0
+#define CRT_HORIZONTAL_SYNC_WIDTH_SHIFT               16
+#define CRT_HORIZONTAL_SYNC_WIDTH_MASK                (0xff << 16)
+#define CRT_HORIZONTAL_SYNC_START_MASK                0xfff
 
 #define CRT_VERTICAL_TOTAL                            0x080214
 #define CRT_VERTICAL_TOTAL_TOTAL                      26:16