staging: sm750fb: change definition of CRT_VERTICAL_SYNC fields
authorMike Rapoport <mike.rapoport@gmail.com>
Mon, 15 Feb 2016 17:53:50 +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_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 c8862e844a54a28b9a4b43757b55f50debc0cb49..97d803df04a1d788cd656f118922550452bf008a 100644 (file)
@@ -104,8 +104,11 @@ static int programModeRegisters(mode_parameter_t *pModeParam, pll_value_t *pll)
                                CRT_VERTICAL_TOTAL_DISPLAY_END_MASK));
 
                POKE32(CRT_VERTICAL_SYNC,
-               FIELD_VALUE(0, CRT_VERTICAL_SYNC, HEIGHT, pModeParam->vertical_sync_height)
-               | FIELD_VALUE(0, CRT_VERTICAL_SYNC, START, pModeParam->vertical_sync_start - 1));
+                       ((pModeParam->vertical_sync_height <<
+                               CRT_VERTICAL_SYNC_HEIGHT_SHIFT) &
+                               CRT_VERTICAL_SYNC_HEIGHT_MASK) |
+                       ((pModeParam->vertical_sync_start - 1) &
+                               CRT_VERTICAL_SYNC_START_MASK));
 
 
                tmp = DISPLAY_CTRL_TIMING | DISPLAY_CTRL_PLANE;
index 7b076a554a97f1cccd0db7b541d33b31f1956dd8..e0b39389331c22009ced403892f5b54c394c9458 100644 (file)
 #define CRT_VERTICAL_TOTAL_DISPLAY_END_MASK           (0x7ff)
 
 #define CRT_VERTICAL_SYNC                             0x080218
-#define CRT_VERTICAL_SYNC_HEIGHT                      21:16
-#define CRT_VERTICAL_SYNC_START                       10:0
+#define CRT_VERTICAL_SYNC_HEIGHT_SHIFT                16
+#define CRT_VERTICAL_SYNC_HEIGHT_MASK                 (0x3f << 16)
+#define CRT_VERTICAL_SYNC_START_MASK                  0x7ff
 
 #define CRT_SIGNATURE_ANALYZER                        0x08021C
 #define CRT_SIGNATURE_ANALYZER_STATUS                 31:16