From: Mike Rapoport Date: Wed, 10 Feb 2016 16:34:00 +0000 (+0200) Subject: staging: sm750fb: use BIT macro for VGA_CONFIGURATION single-bit fields X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=d97981431f63ca2da4e8b9dcedc2cd3576286c0a;p=linux-beck.git staging: sm750fb: use BIT macro for VGA_CONFIGURATION single-bit fields 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 Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/sm750fb/ddk750_chip.c b/drivers/staging/sm750fb/ddk750_chip.c index d813cc6f1c6b..2d1128fc7b5a 100644 --- a/drivers/staging/sm750fb/ddk750_chip.c +++ b/drivers/staging/sm750fb/ddk750_chip.c @@ -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__) diff --git a/drivers/staging/sm750fb/ddk750_reg.h b/drivers/staging/sm750fb/ddk750_reg.h index ac3cb367fdc9..e873a1008b88 100644 --- a/drivers/staging/sm750fb/ddk750_reg.h +++ b/drivers/staging/sm750fb/ddk750_reg.h @@ -548,12 +548,8 @@ #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