diff options
author | Mike Rapoport <mike.rapoport@gmail.com> | 2016-02-15 17:53:56 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-02-16 02:26:17 (GMT) |
commit | 6aa178eeda2f987e7457dd316fe4b57105c4b1a6 (patch) | |
tree | 7dba9d19564fcf1ddd10096b8988716a9da1b644 /drivers | |
parent | fe3bd267a47bc3a54d8edfa85b66a90354c9e03d (diff) | |
download | linux-6aa178eeda2f987e7457dd316fe4b57105c4b1a6.tar.xz |
staging: sm750fb: change definition of HWC_COLOR_{12, 3} fields
Use straight-forward definition of HWC_COLOR_{12,3} register fields instead
of magic numbers
Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/staging/sm750fb/sm750_cursor.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/staging/sm750fb/sm750_cursor.c b/drivers/staging/sm750fb/sm750_cursor.c index 122d23f..37decce 100644 --- a/drivers/staging/sm750fb/sm750_cursor.c +++ b/drivers/staging/sm750fb/sm750_cursor.c @@ -41,11 +41,12 @@ writel((data), cursor->mmio + (addr)) #define HWC_LOCATION_X_MASK 0x7ff #define HWC_COLOR_12 0x8 -#define HWC_COLOR_12_2_RGB565 31:16 -#define HWC_COLOR_12_1_RGB565 15:0 +#define HWC_COLOR_12_2_RGB565_SHIFT 16 +#define HWC_COLOR_12_2_RGB565_MASK (0xffff << 16) +#define HWC_COLOR_12_1_RGB565_MASK 0xffff #define HWC_COLOR_3 0xC -#define HWC_COLOR_3_RGB565 15:0 +#define HWC_COLOR_3_RGB565_MASK 0xffff /* hw_cursor_xxx works for voyager,718 and 750 */ @@ -79,7 +80,10 @@ void hw_cursor_setPos(struct lynx_cursor *cursor, void hw_cursor_setColor(struct lynx_cursor *cursor, u32 fg, u32 bg) { - POKE32(HWC_COLOR_12, (fg<<16)|(bg&0xffff)); + u32 reg = (fg << HWC_COLOR_12_2_RGB565_SHIFT) & + HWC_COLOR_12_2_RGB565_MASK; + + POKE32(HWC_COLOR_12, reg | (bg & HWC_COLOR_12_1_RGB565_MASK)); POKE32(HWC_COLOR_3, 0xffe0); } |