diff options
author | Mike Rapoport <mike.rapoport@gmail.com> | 2016-02-15 19:54:04 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-02-15 18:26:17 -0800 |
commit | d6a4cba73c63bb027275ec4d318ed52fb123cbfd (patch) | |
tree | 3cce09067e921c1a0f6215a6de4913993d47235a /drivers/staging/sm750fb | |
parent | 8bac9c84cc3ca633184b435707d0e2ca34acd92c (diff) | |
download | linux-d6a4cba73c63bb027275ec4d318ed52fb123cbfd.tar.gz linux-d6a4cba73c63bb027275ec4d318ed52fb123cbfd.tar.bz2 linux-d6a4cba73c63bb027275ec4d318ed52fb123cbfd.zip |
staging: sm750fb: change definition of CRT_FB_WIDTH fields
Use stratight-forward definition of CRT_FB_WIDTH register fields
and use open-coded implementation for register manipulation
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 | 9 |
2 files changed, 7 insertions, 7 deletions
diff --git a/drivers/staging/sm750fb/ddk750_reg.h b/drivers/staging/sm750fb/ddk750_reg.h index a274c31c9318..3d365087ba71 100644 --- a/drivers/staging/sm750fb/ddk750_reg.h +++ b/drivers/staging/sm750fb/ddk750_reg.h @@ -1376,8 +1376,9 @@ #define CRT_FB_ADDRESS_ADDRESS 25:0 #define CRT_FB_WIDTH 0x080208 -#define CRT_FB_WIDTH_WIDTH 29:16 -#define CRT_FB_WIDTH_OFFSET 13:0 +#define CRT_FB_WIDTH_WIDTH_SHIFT 16 +#define CRT_FB_WIDTH_WIDTH_MASK (0x3fff << 16) +#define CRT_FB_WIDTH_OFFSET_MASK 0x3fff #define CRT_HORIZONTAL_TOTAL 0x08020C #define CRT_HORIZONTAL_TOTAL_TOTAL_SHIFT 16 diff --git a/drivers/staging/sm750fb/sm750_hw.c b/drivers/staging/sm750fb/sm750_hw.c index 807d9928f815..751fa3b6a55b 100644 --- a/drivers/staging/sm750fb/sm750_hw.c +++ b/drivers/staging/sm750fb/sm750_hw.c @@ -342,11 +342,10 @@ int hw_sm750_crtc_setMode(struct lynxfb_crtc *crtc, POKE32(CRT_FB_ADDRESS, crtc->oScreen); reg = var->xres * (var->bits_per_pixel >> 3); /* crtc->channel is not equal to par->index on numeric,be aware of that */ - reg = ALIGN(reg, crtc->line_pad); - - POKE32(CRT_FB_WIDTH, - FIELD_VALUE(0, CRT_FB_WIDTH, WIDTH, reg)| - FIELD_VALUE(0, CRT_FB_WIDTH, OFFSET, fix->line_length)); + reg = ALIGN(reg, crtc->line_pad) << CRT_FB_WIDTH_WIDTH_SHIFT; + reg &= CRT_FB_WIDTH_WIDTH_MASK; + reg |= (fix->line_length & CRT_FB_WIDTH_OFFSET_MASK); + POKE32(CRT_FB_WIDTH, reg); /* SET PIXEL FORMAT */ reg = PEEK32(CRT_DISPLAY_CTRL); |