From 6014a31dd607a6e6224b17c6d74df45ffeb45328 Mon Sep 17 00:00:00 2001 From: Mike Rapoport Date: Mon, 15 Feb 2016 19:53:52 +0200 Subject: [PATCH] staging: sm750fb: change definition of PANEL_VERTICAL_TOTAL fields Use stratight-forward definition of PANEL_VERTICAL_TOTAL register fields and use open-coded implementation for register manipulation Signed-off-by: Mike Rapoport Signed-off-by: Greg Kroah-Hartman --- drivers/staging/sm750fb/ddk750_mode.c | 7 +++++-- drivers/staging/sm750fb/ddk750_reg.h | 5 +++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/staging/sm750fb/ddk750_mode.c b/drivers/staging/sm750fb/ddk750_mode.c index 4394ad1ff154..7c4f3fba0e80 100644 --- a/drivers/staging/sm750fb/ddk750_mode.c +++ b/drivers/staging/sm750fb/ddk750_mode.c @@ -148,8 +148,11 @@ static int programModeRegisters(mode_parameter_t *pModeParam, pll_value_t *pll) PANEL_HORIZONTAL_SYNC_START_MASK)); POKE32(PANEL_VERTICAL_TOTAL, - FIELD_VALUE(0, PANEL_VERTICAL_TOTAL, TOTAL, pModeParam->vertical_total - 1) - | FIELD_VALUE(0, PANEL_VERTICAL_TOTAL, DISPLAY_END, pModeParam->vertical_display_end - 1)); + (((pModeParam->vertical_total - 1) << + PANEL_VERTICAL_TOTAL_TOTAL_SHIFT) & + PANEL_VERTICAL_TOTAL_TOTAL_MASK) | + ((pModeParam->vertical_display_end - 1) & + PANEL_VERTICAL_TOTAL_DISPLAY_END_MASK)); POKE32(PANEL_VERTICAL_SYNC, FIELD_VALUE(0, PANEL_VERTICAL_SYNC, HEIGHT, pModeParam->vertical_sync_height) diff --git a/drivers/staging/sm750fb/ddk750_reg.h b/drivers/staging/sm750fb/ddk750_reg.h index fd28eb0be68a..0ecbac58f8fd 100644 --- a/drivers/staging/sm750fb/ddk750_reg.h +++ b/drivers/staging/sm750fb/ddk750_reg.h @@ -868,8 +868,9 @@ #define PANEL_HORIZONTAL_SYNC_START_MASK 0xfff #define PANEL_VERTICAL_TOTAL 0x08002C -#define PANEL_VERTICAL_TOTAL_TOTAL 26:16 -#define PANEL_VERTICAL_TOTAL_DISPLAY_END 10:0 +#define PANEL_VERTICAL_TOTAL_TOTAL_SHIFT 16 +#define PANEL_VERTICAL_TOTAL_TOTAL_MASK (0x7ff << 16) +#define PANEL_VERTICAL_TOTAL_DISPLAY_END_MASK 0x7ff #define PANEL_VERTICAL_SYNC 0x080030 #define PANEL_VERTICAL_SYNC_HEIGHT 21:16 -- 2.39.5