From: Mike Rapoport Date: Wed, 10 Feb 2016 16:34:11 +0000 (+0200) Subject: staging: sm750fb: change definition of PANEL_FB_ADDRESS fields X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=4463690afc066b7034cd5c2bd6b0be88ab7c99ef;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git staging: sm750fb: change definition of PANEL_FB_ADDRESS fields Use BIT() macro for single-bit fields of PANEL_FB_ADDRESS register and define PANEL_FB_ADDRESS_ADDRESS_MASK for masking the address bits. Signed-off-by: Mike Rapoport Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/sm750fb/ddk750_reg.h b/drivers/staging/sm750fb/ddk750_reg.h index cdc5867038d8..1b96af3f475d 100644 --- a/drivers/staging/sm750fb/ddk750_reg.h +++ b/drivers/staging/sm750fb/ddk750_reg.h @@ -828,13 +828,9 @@ #define PANEL_COLOR_KEY_VALUE 15:0 #define PANEL_FB_ADDRESS 0x08000C -#define PANEL_FB_ADDRESS_STATUS 31:31 -#define PANEL_FB_ADDRESS_STATUS_CURRENT 0 -#define PANEL_FB_ADDRESS_STATUS_PENDING 1 -#define PANEL_FB_ADDRESS_EXT 27:27 -#define PANEL_FB_ADDRESS_EXT_LOCAL 0 -#define PANEL_FB_ADDRESS_EXT_EXTERNAL 1 -#define PANEL_FB_ADDRESS_ADDRESS 25:0 +#define PANEL_FB_ADDRESS_STATUS BIT(31) +#define PANEL_FB_ADDRESS_EXT BIT(27) +#define PANEL_FB_ADDRESS_ADDRESS_MASK 0x1ffffff #define PANEL_FB_WIDTH 0x080010 #define PANEL_FB_WIDTH_WIDTH 29:16 diff --git a/drivers/staging/sm750fb/sm750_hw.c b/drivers/staging/sm750fb/sm750_hw.c index 964c5f0a7687..938ea7262646 100644 --- a/drivers/staging/sm750fb/sm750_hw.c +++ b/drivers/staging/sm750fb/sm750_hw.c @@ -308,9 +308,7 @@ int hw_sm750_crtc_setMode(struct lynxfb_crtc *crtc, if (crtc->channel != sm750_secondary) { /* set pitch, offset ,width,start address ,etc... */ POKE32(PANEL_FB_ADDRESS, - FIELD_SET(0, PANEL_FB_ADDRESS, STATUS, CURRENT)| - FIELD_SET(0, PANEL_FB_ADDRESS, EXT, LOCAL)| - FIELD_VALUE(0, PANEL_FB_ADDRESS, ADDRESS, crtc->oScreen)); + crtc->oScreen & PANEL_FB_ADDRESS_ADDRESS_MASK); reg = var->xres * (var->bits_per_pixel >> 3); /* crtc->channel is not equal to par->index on numeric,be aware of that */ @@ -538,8 +536,8 @@ int hw_sm750_pan_display(struct lynxfb_crtc *crtc, total += crtc->oScreen; if (crtc->channel == sm750_primary) { POKE32(PANEL_FB_ADDRESS, - FIELD_VALUE(PEEK32(PANEL_FB_ADDRESS), - PANEL_FB_ADDRESS, ADDRESS, total)); + PEEK32(PANEL_FB_ADDRESS) | + (total & PANEL_FB_ADDRESS_ADDRESS_MASK)); } else { POKE32(CRT_FB_ADDRESS, FIELD_VALUE(PEEK32(CRT_FB_ADDRESS),