Commit 4463690a authored by Mike Rapoport's avatar Mike Rapoport Committed by Greg Kroah-Hartman

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: default avatarMike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent c4e893b7
...@@ -828,13 +828,9 @@ ...@@ -828,13 +828,9 @@
#define PANEL_COLOR_KEY_VALUE 15:0 #define PANEL_COLOR_KEY_VALUE 15:0
#define PANEL_FB_ADDRESS 0x08000C #define PANEL_FB_ADDRESS 0x08000C
#define PANEL_FB_ADDRESS_STATUS 31:31 #define PANEL_FB_ADDRESS_STATUS BIT(31)
#define PANEL_FB_ADDRESS_STATUS_CURRENT 0 #define PANEL_FB_ADDRESS_EXT BIT(27)
#define PANEL_FB_ADDRESS_STATUS_PENDING 1 #define PANEL_FB_ADDRESS_ADDRESS_MASK 0x1ffffff
#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_WIDTH 0x080010 #define PANEL_FB_WIDTH 0x080010
#define PANEL_FB_WIDTH_WIDTH 29:16 #define PANEL_FB_WIDTH_WIDTH 29:16
......
...@@ -308,9 +308,7 @@ int hw_sm750_crtc_setMode(struct lynxfb_crtc *crtc, ...@@ -308,9 +308,7 @@ int hw_sm750_crtc_setMode(struct lynxfb_crtc *crtc,
if (crtc->channel != sm750_secondary) { if (crtc->channel != sm750_secondary) {
/* set pitch, offset ,width,start address ,etc... */ /* set pitch, offset ,width,start address ,etc... */
POKE32(PANEL_FB_ADDRESS, POKE32(PANEL_FB_ADDRESS,
FIELD_SET(0, PANEL_FB_ADDRESS, STATUS, CURRENT)| crtc->oScreen & PANEL_FB_ADDRESS_ADDRESS_MASK);
FIELD_SET(0, PANEL_FB_ADDRESS, EXT, LOCAL)|
FIELD_VALUE(0, PANEL_FB_ADDRESS, ADDRESS, crtc->oScreen));
reg = var->xres * (var->bits_per_pixel >> 3); reg = var->xres * (var->bits_per_pixel >> 3);
/* crtc->channel is not equal to par->index on numeric,be aware of that */ /* 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, ...@@ -538,8 +536,8 @@ int hw_sm750_pan_display(struct lynxfb_crtc *crtc,
total += crtc->oScreen; total += crtc->oScreen;
if (crtc->channel == sm750_primary) { if (crtc->channel == sm750_primary) {
POKE32(PANEL_FB_ADDRESS, POKE32(PANEL_FB_ADDRESS,
FIELD_VALUE(PEEK32(PANEL_FB_ADDRESS), PEEK32(PANEL_FB_ADDRESS) |
PANEL_FB_ADDRESS, ADDRESS, total)); (total & PANEL_FB_ADDRESS_ADDRESS_MASK));
} else { } else {
POKE32(CRT_FB_ADDRESS, POKE32(CRT_FB_ADDRESS,
FIELD_VALUE(PEEK32(CRT_FB_ADDRESS), FIELD_VALUE(PEEK32(CRT_FB_ADDRESS),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment