diff options
author | Mike Rapoport <mike.rapoport@gmail.com> | 2016-02-10 18:34:14 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-02-11 19:52:37 -0800 |
commit | f91969f773478922173605c44fe0a966cf0e438d (patch) | |
tree | fc4497449f7021d3f010d0359c252d9b39fc8768 | |
parent | 4c221d82cfdb4ec0050999dd305f85670ca09fd5 (diff) |
staging: sm750fb: change definition of PANEL_WINDOW_HEIGHT fields
Use stratight-forward defintion of PANEL_WINDOW_HEIGHT register fields and
use open-coded implementation for register manipulations
Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/staging/sm750fb/ddk750_reg.h | 5 | ||||
-rw-r--r-- | drivers/staging/sm750fb/sm750_hw.c | 8 |
2 files changed, 8 insertions, 5 deletions
diff --git a/drivers/staging/sm750fb/ddk750_reg.h b/drivers/staging/sm750fb/ddk750_reg.h index 6e6694d651d5..d3359c5e8ced 100644 --- a/drivers/staging/sm750fb/ddk750_reg.h +++ b/drivers/staging/sm750fb/ddk750_reg.h @@ -843,8 +843,9 @@ #define PANEL_WINDOW_WIDTH_X_MASK 0xfff #define PANEL_WINDOW_HEIGHT 0x080018 -#define PANEL_WINDOW_HEIGHT_HEIGHT 27:16 -#define PANEL_WINDOW_HEIGHT_Y 11:0 +#define PANEL_WINDOW_HEIGHT_HEIGHT_SHIFT 16 +#define PANEL_WINDOW_HEIGHT_HEIGHT_MASK (0xfff << 16) +#define PANEL_WINDOW_HEIGHT_Y_MASK 0xfff #define PANEL_PLANE_TL 0x08001C #define PANEL_PLANE_TL_TOP 26:16 diff --git a/drivers/staging/sm750fb/sm750_hw.c b/drivers/staging/sm750fb/sm750_hw.c index a0d72144392e..0ea3106183d6 100644 --- a/drivers/staging/sm750fb/sm750_hw.c +++ b/drivers/staging/sm750fb/sm750_hw.c @@ -323,9 +323,11 @@ int hw_sm750_crtc_setMode(struct lynxfb_crtc *crtc, reg |= (var->xoffset & PANEL_WINDOW_WIDTH_X_MASK); POKE32(PANEL_WINDOW_WIDTH, reg); - POKE32(PANEL_WINDOW_HEIGHT, - FIELD_VALUE(0, PANEL_WINDOW_HEIGHT, HEIGHT, var->yres_virtual - 1)| - FIELD_VALUE(0, PANEL_WINDOW_HEIGHT, Y, var->yoffset)); + reg = ((var->yres_virtual - 1) << + PANEL_WINDOW_HEIGHT_HEIGHT_SHIFT); + reg &= PANEL_WINDOW_HEIGHT_HEIGHT_MASK; + reg |= (var->yoffset & PANEL_WINDOW_HEIGHT_Y_MASK); + POKE32(PANEL_WINDOW_HEIGHT, reg); POKE32(PANEL_PLANE_TL, 0); |