From 4463690afc066b7034cd5c2bd6b0be88ab7c99ef Mon Sep 17 00:00:00 2001 From: Mike Rapoport Date: Wed, 10 Feb 2016 18:34:11 +0200 Subject: [PATCH] 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 --- drivers/staging/sm750fb/ddk750_reg.h | 10 +++------- drivers/staging/sm750fb/sm750_hw.c | 8 +++----- 2 files changed, 6 insertions(+), 12 deletions(-) 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), -- 2.20.1