]> git.karo-electronics.de Git - linux-beck.git/commitdiff
staging: sm750fb: change definition of PANEL_VERTICAL_SYNC fields
authorMike Rapoport <mike.rapoport@gmail.com>
Mon, 15 Feb 2016 17:53:53 +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 PANEL_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 7c4f3fba0e8034e70965d6c7003b821aca57dd35..ccb4e067661a8647b3e967cf4ac58fc1f63a3b8c 100644 (file)
@@ -155,8 +155,11 @@ static int programModeRegisters(mode_parameter_t *pModeParam, pll_value_t *pll)
                                PANEL_VERTICAL_TOTAL_DISPLAY_END_MASK));
 
                POKE32(PANEL_VERTICAL_SYNC,
-               FIELD_VALUE(0, PANEL_VERTICAL_SYNC, HEIGHT, pModeParam->vertical_sync_height)
-               | FIELD_VALUE(0, PANEL_VERTICAL_SYNC, START, pModeParam->vertical_sync_start - 1));
+                       ((pModeParam->vertical_sync_height <<
+                               PANEL_VERTICAL_SYNC_HEIGHT_SHIFT) &
+                               PANEL_VERTICAL_SYNC_HEIGHT_MASK) |
+                       ((pModeParam->vertical_sync_start - 1) &
+                               PANEL_VERTICAL_SYNC_START_MASK));
 
                tmp = DISPLAY_CTRL_TIMING | DISPLAY_CTRL_PLANE;
                if (pModeParam->vertical_sync_polarity)
index 0ecbac58f8fd8d35512b0787d3b0e0217982518e..a274c31c9318f7a54f0a4bd285271c9a3ed26248 100644 (file)
 #define PANEL_VERTICAL_TOTAL_DISPLAY_END_MASK         0x7ff
 
 #define PANEL_VERTICAL_SYNC                           0x080030
-#define PANEL_VERTICAL_SYNC_HEIGHT                    21:16
-#define PANEL_VERTICAL_SYNC_START                     10:0
+#define PANEL_VERTICAL_SYNC_HEIGHT_SHIFT              16
+#define PANEL_VERTICAL_SYNC_HEIGHT_MASK               (0x3f << 16)
+#define PANEL_VERTICAL_SYNC_START_MASK                0x7ff
 
 #define PANEL_CURRENT_LINE                            0x080034
 #define PANEL_CURRENT_LINE_LINE                       10:0