staging: sm750fb: use BIT macro for VGA_CONFIGURATION single-bit fields
authorMike Rapoport <mike.rapoport@gmail.com>
Wed, 10 Feb 2016 16:34:00 +0000 (18:34 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 12 Feb 2016 03:52:37 +0000 (19:52 -0800)
Replace complex defintion of VGA_CONFIGURATION register fields with BIT()
macro and use open-coded implementation for VGA_CONFIGURATION
manipulations.

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/sm750fb/ddk750_chip.c
drivers/staging/sm750fb/ddk750_reg.h

index d813cc6f1c6b10e83a85c5cd8b681012bcf4728d..2d1128fc7b5a7b15060339921f4e7ff507d67834 100644 (file)
@@ -211,8 +211,7 @@ int ddk750_initHw(initchip_param_t *pInitParam)
        if (getChipType() != SM750LE) {
                /*      set panel pll and graphic mode via mmio_88 */
                reg = PEEK32(VGA_CONFIGURATION);
-               reg = FIELD_SET(reg, VGA_CONFIGURATION, PLL, PANEL);
-               reg = FIELD_SET(reg, VGA_CONFIGURATION, MODE, GRAPHIC);
+               reg |= (VGA_CONFIGURATION_PLL | VGA_CONFIGURATION_MODE);
                POKE32(VGA_CONFIGURATION, reg);
        } else {
 #if defined(__i386__) || defined(__x86_64__)
index ac3cb367fdc9bf16f60c85602d38fc1557b6c7c1..e873a1008b882f6c9dec6f6c68b587c86bc68ac0 100644 (file)
 
 #define VGA_CONFIGURATION                             0x000088
 #define VGA_CONFIGURATION_USER_DEFINE                 5:4
-#define VGA_CONFIGURATION_PLL                         2:2
-#define VGA_CONFIGURATION_PLL_VGA                     0
-#define VGA_CONFIGURATION_PLL_PANEL                   1
-#define VGA_CONFIGURATION_MODE                        1:1
-#define VGA_CONFIGURATION_MODE_TEXT                   0
-#define VGA_CONFIGURATION_MODE_GRAPHIC                1
+#define VGA_CONFIGURATION_PLL                         BIT(2)
+#define VGA_CONFIGURATION_MODE                        BIT(1)
 
 #endif