diff options
author | Mike Rapoport <mike.rapoport@gmail.com> | 2016-02-10 18:34:13 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-02-11 19:52:37 -0800 |
commit | 4c221d82cfdb4ec0050999dd305f85670ca09fd5 (patch) | |
tree | bd530de57c8e87f87ba588f4d60623482091708d /drivers/staging/sm750fb | |
parent | 26a3cc907c324261e3d0f76869f856d1273528d5 (diff) |
staging: sm750fb: change definition of PANEL_WINDOW_WIDTH fields
Use stratight-forward defintion of PANEL_WINDOW_WIDTH 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>
Diffstat (limited to 'drivers/staging/sm750fb')
-rw-r--r-- | drivers/staging/sm750fb/ddk750_reg.h | 5 | ||||
-rw-r--r-- | drivers/staging/sm750fb/sm750_hw.c | 7 |
2 files changed, 7 insertions, 5 deletions
diff --git a/drivers/staging/sm750fb/ddk750_reg.h b/drivers/staging/sm750fb/ddk750_reg.h index 7e0cc95ae290..6e6694d651d5 100644 --- a/drivers/staging/sm750fb/ddk750_reg.h +++ b/drivers/staging/sm750fb/ddk750_reg.h @@ -838,8 +838,9 @@ #define PANEL_FB_WIDTH_OFFSET_MASK 0x3fff #define PANEL_WINDOW_WIDTH 0x080014 -#define PANEL_WINDOW_WIDTH_WIDTH 27:16 -#define PANEL_WINDOW_WIDTH_X 11:0 +#define PANEL_WINDOW_WIDTH_WIDTH_SHIFT 16 +#define PANEL_WINDOW_WIDTH_WIDTH_MASK (0xfff << 16) +#define PANEL_WINDOW_WIDTH_X_MASK 0xfff #define PANEL_WINDOW_HEIGHT 0x080018 #define PANEL_WINDOW_HEIGHT_HEIGHT 27:16 diff --git a/drivers/staging/sm750fb/sm750_hw.c b/drivers/staging/sm750fb/sm750_hw.c index 9e350b459e9a..a0d72144392e 100644 --- a/drivers/staging/sm750fb/sm750_hw.c +++ b/drivers/staging/sm750fb/sm750_hw.c @@ -318,9 +318,10 @@ int hw_sm750_crtc_setMode(struct lynxfb_crtc *crtc, reg |= (fix->line_length & PANEL_FB_WIDTH_OFFSET_MASK); POKE32(PANEL_FB_WIDTH, reg); - POKE32(PANEL_WINDOW_WIDTH, - FIELD_VALUE(0, PANEL_WINDOW_WIDTH, WIDTH, var->xres - 1)| - FIELD_VALUE(0, PANEL_WINDOW_WIDTH, X, var->xoffset)); + reg = ((var->xres - 1) << PANEL_WINDOW_WIDTH_WIDTH_SHIFT) & + PANEL_WINDOW_WIDTH_WIDTH_MASK; + 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)| |