diff options
author | Mike Rapoport <mike.rapoport@gmail.com> | 2016-02-15 19:53:55 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-02-15 18:26:17 -0800 |
commit | fe3bd267a47bc3a54d8edfa85b66a90354c9e03d (patch) | |
tree | 3a76a636472a16be4762c1917fbcdf97d766857b /drivers/staging/sm750fb | |
parent | 672f75b0b390c0c524a0aef606b25d77ad0b2d4f (diff) |
staging: sm750fb: change definition of HWC_LOCATION fields
Use BIT() macro for single-bit fields of HWC_LOCATION register and
define HWC_LOCATION_{X,Y}_MASK for masking the address bits.
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/sm750_cursor.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/drivers/staging/sm750fb/sm750_cursor.c b/drivers/staging/sm750fb/sm750_cursor.c index 2799e8687b95..122d23f4b1ab 100644 --- a/drivers/staging/sm750fb/sm750_cursor.c +++ b/drivers/staging/sm750fb/sm750_cursor.c @@ -34,14 +34,11 @@ writel((data), cursor->mmio + (addr)) #define HWC_ADDRESS_ADDRESS_MASK 0x3ffffff #define HWC_LOCATION 0x4 -#define HWC_LOCATION_TOP 27:27 -#define HWC_LOCATION_TOP_INSIDE 0 -#define HWC_LOCATION_TOP_OUTSIDE 1 -#define HWC_LOCATION_Y 26:16 -#define HWC_LOCATION_LEFT 11:11 -#define HWC_LOCATION_LEFT_INSIDE 0 -#define HWC_LOCATION_LEFT_OUTSIDE 1 -#define HWC_LOCATION_X 10:0 +#define HWC_LOCATION_TOP BIT(27) +#define HWC_LOCATION_Y_SHIFT 16 +#define HWC_LOCATION_Y_MASK (0x7ff << 16) +#define HWC_LOCATION_LEFT BIT(11) +#define HWC_LOCATION_X_MASK 0x7ff #define HWC_COLOR_12 0x8 #define HWC_COLOR_12_2_RGB565 31:16 @@ -75,8 +72,8 @@ void hw_cursor_setPos(struct lynx_cursor *cursor, { u32 reg; - reg = FIELD_VALUE(0, HWC_LOCATION, Y, y)| - FIELD_VALUE(0, HWC_LOCATION, X, x); + reg = (((y << HWC_LOCATION_Y_SHIFT) & HWC_LOCATION_Y_MASK) | + (x & HWC_LOCATION_X_MASK)); POKE32(HWC_LOCATION, reg); } void hw_cursor_setColor(struct lynx_cursor *cursor, |