staging: sm750fb: change definition of PANEL_FB_ADDRESS fields
authorMike Rapoport <mike.rapoport@gmail.com>
Wed, 10 Feb 2016 16:34:11 +0000 (18:34 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 12 Feb 2016 03:52:37 +0000 (19:52 -0800)
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 <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/sm750fb/ddk750_reg.h
drivers/staging/sm750fb/sm750_hw.c

index cdc5867038d8ee16995b5e486dddd37c6fbee27f..1b96af3f475dc8b5047947b8ce7d6eec30abac3f 100644 (file)
 #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
index 964c5f0a76879ec7b0bd9232cf1d63fb42953a36..938ea726264605b499bb9f7578e14dcd2e07b425 100644 (file)
@@ -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),