staging: sm750fb: change definition of CRT_FB_ADDRESS fields
authorMike Rapoport <mike.rapoport@gmail.com>
Mon, 15 Feb 2016 17:54:05 +0000 (19:54 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 16 Feb 2016 02:26:17 +0000 (18:26 -0800)
Use stratight-forward definition of CRT_FB_ADDRESS 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>
drivers/staging/sm750fb/ddk750_reg.h
drivers/staging/sm750fb/sm750_hw.c

index 3d365087ba7101fb39f419be20b49f2881f21630..95c5cac878bf58e3e101447ab40c3426992482a0 100644 (file)
 #define CRT_DISPLAY_CTRL_FORMAT_32                    (0x2 << 0)
 
 #define CRT_FB_ADDRESS                                0x080204
-#define CRT_FB_ADDRESS_STATUS                         31:31
-#define CRT_FB_ADDRESS_STATUS_CURRENT                 0
-#define CRT_FB_ADDRESS_STATUS_PENDING                 1
-#define CRT_FB_ADDRESS_EXT                            27:27
-#define CRT_FB_ADDRESS_EXT_LOCAL                      0
-#define CRT_FB_ADDRESS_EXT_EXTERNAL                   1
-#define CRT_FB_ADDRESS_ADDRESS                        25:0
+#define CRT_FB_ADDRESS_STATUS                         BIT(31)
+#define CRT_FB_ADDRESS_EXT                            BIT(27)
+#define CRT_FB_ADDRESS_ADDRESS_MASK                   0x3ffffff
 
 #define CRT_FB_WIDTH                                  0x080208
 #define CRT_FB_WIDTH_WIDTH_SHIFT                      16
index 751fa3b6a55b602af4bb878334d6ee2f277507ac..2daeedd88c30bb0ef76f64b660d4d021f84939b3 100644 (file)
@@ -548,8 +548,8 @@ int hw_sm750_pan_display(struct lynxfb_crtc *crtc,
                       (total & PANEL_FB_ADDRESS_ADDRESS_MASK));
        } else {
                POKE32(CRT_FB_ADDRESS,
-                       FIELD_VALUE(PEEK32(CRT_FB_ADDRESS),
-                               CRT_FB_ADDRESS, ADDRESS, total));
+                      PEEK32(CRT_FB_ADDRESS) |
+                      (total & CRT_FB_ADDRESS_ADDRESS_MASK));
        }
        return 0;
 }