staging: sm750fb: change definition of CRT_HORIZONTAL_TOTAL fields
authorMike Rapoport <mike.rapoport@gmail.com>
Mon, 15 Feb 2016 17:53:47 +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_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 6c6a5c9cc50cc2a5329930ea819c9c7853e1cb11..2b2f1c17989f9209e7cb57923e41e6384f7d8687 100644 (file)
@@ -83,8 +83,11 @@ static int programModeRegisters(mode_parameter_t *pModeParam, pll_value_t *pll)
                /* programe secondary pixel clock */
                POKE32(CRT_PLL_CTRL, formatPllReg(pll));
                POKE32(CRT_HORIZONTAL_TOTAL,
-               FIELD_VALUE(0, CRT_HORIZONTAL_TOTAL, TOTAL, pModeParam->horizontal_total - 1)
-               | FIELD_VALUE(0, CRT_HORIZONTAL_TOTAL, DISPLAY_END, pModeParam->horizontal_display_end - 1));
+                       (((pModeParam->horizontal_total - 1) <<
+                               CRT_HORIZONTAL_TOTAL_TOTAL_SHIFT) &
+                               CRT_HORIZONTAL_TOTAL_TOTAL_MASK) |
+                       ((pModeParam->horizontal_display_end - 1) &
+                               CRT_HORIZONTAL_TOTAL_DISPLAY_END_MASK));
 
                POKE32(CRT_HORIZONTAL_SYNC,
                FIELD_VALUE(0, CRT_HORIZONTAL_SYNC, WIDTH, pModeParam->horizontal_sync_width)
index 990d4e301b882a994732df6ff144d4afb224c64d..1b55a7f3677e3edeb3efc488ff9a9409e02d6db5 100644 (file)
 #define CRT_FB_WIDTH_OFFSET                           13:0
 
 #define CRT_HORIZONTAL_TOTAL                          0x08020C
-#define CRT_HORIZONTAL_TOTAL_TOTAL                    27:16
-#define CRT_HORIZONTAL_TOTAL_DISPLAY_END              11:0
+#define CRT_HORIZONTAL_TOTAL_TOTAL_SHIFT              16
+#define CRT_HORIZONTAL_TOTAL_TOTAL_MASK               (0xfff << 16)
+#define CRT_HORIZONTAL_TOTAL_DISPLAY_END_MASK         0xfff
 
 #define CRT_HORIZONTAL_SYNC                           0x080210
 #define CRT_HORIZONTAL_SYNC_WIDTH                     23:16