staging: sm750fb: change definition of PANEL_HORIZONTAL_SYNC fields
authorMike Rapoport <mike.rapoport@gmail.com>
Mon, 15 Feb 2016 17:53:51 +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_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 97d803df04a1d788cd656f118922550452bf008a..4394ad1ff154643165227bb7cbff2b1745ff3587 100644 (file)
@@ -141,8 +141,11 @@ static int programModeRegisters(mode_parameter_t *pModeParam, pll_value_t *pll)
                POKE32(PANEL_HORIZONTAL_TOTAL, reg);
 
                POKE32(PANEL_HORIZONTAL_SYNC,
-               FIELD_VALUE(0, PANEL_HORIZONTAL_SYNC, WIDTH, pModeParam->horizontal_sync_width)
-               | FIELD_VALUE(0, PANEL_HORIZONTAL_SYNC, START, pModeParam->horizontal_sync_start - 1));
+                       ((pModeParam->horizontal_sync_width <<
+                               PANEL_HORIZONTAL_SYNC_WIDTH_SHIFT) &
+                               PANEL_HORIZONTAL_SYNC_WIDTH_MASK) |
+                       ((pModeParam->horizontal_sync_start - 1) &
+                               PANEL_HORIZONTAL_SYNC_START_MASK));
 
                POKE32(PANEL_VERTICAL_TOTAL,
                FIELD_VALUE(0, PANEL_VERTICAL_TOTAL, TOTAL, pModeParam->vertical_total - 1)
index e0b39389331c22009ced403892f5b54c394c9458..fd28eb0be68a0f2c1dbc10dfcae11591a4717217 100644 (file)
 #define PANEL_HORIZONTAL_TOTAL_DISPLAY_END_MASK       0xfff
 
 #define PANEL_HORIZONTAL_SYNC                         0x080028
-#define PANEL_HORIZONTAL_SYNC_WIDTH                   23:16
-#define PANEL_HORIZONTAL_SYNC_START                   11:0
+#define PANEL_HORIZONTAL_SYNC_WIDTH_SHIFT             16
+#define PANEL_HORIZONTAL_SYNC_WIDTH_MASK              (0xff << 16)
+#define PANEL_HORIZONTAL_SYNC_START_MASK              0xfff
 
 #define PANEL_VERTICAL_TOTAL                          0x08002C
 #define PANEL_VERTICAL_TOTAL_TOTAL                    26:16