From f5d7f1905fb2e1b57e0b2f75ef21ce8b016a34b3 Mon Sep 17 00:00:00 2001 From: Mike Rapoport Date: Wed, 10 Feb 2016 18:34:09 +0200 Subject: [PATCH] staging: sm750fb: remove PANEL_DISPLAY_CTRL_TFT_DISP defines The PANEL_DISPLAY_CTRL_TFT_DISP definitions artificially encode PANEL_DISPLAY_CTRL_DUAL_DISPLAY and PANEL_DISPLAY_CTRL_DOUBLE_PIXEL bits combinations. Replace the PANEL_DISPLAY_CTRL_TFT_DISP usage with direct use of the bits defined in the datasheet. Signed-off-by: Mike Rapoport Signed-off-by: Greg Kroah-Hartman --- drivers/staging/sm750fb/ddk750_reg.h | 6 ------ drivers/staging/sm750fb/sm750_hw.c | 17 ++++++++++------- 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/drivers/staging/sm750fb/ddk750_reg.h b/drivers/staging/sm750fb/ddk750_reg.h index 67533840b78e..6df382790a74 100644 --- a/drivers/staging/sm750fb/ddk750_reg.h +++ b/drivers/staging/sm750fb/ddk750_reg.h @@ -791,12 +791,6 @@ #define PANEL_DISPLAY_CTRL_VBIASEN BIT(26) #define PANEL_DISPLAY_CTRL_DATA BIT(25) #define PANEL_DISPLAY_CTRL_FPVDDEN BIT(24) - -#define PANEL_DISPLAY_CTRL_TFT_DISP 19:18 -#define PANEL_DISPLAY_CTRL_TFT_DISP_24 0 -#define PANEL_DISPLAY_CTRL_TFT_DISP_36 1 -#define PANEL_DISPLAY_CTRL_TFT_DISP_18 2 - #define PANEL_DISPLAY_CTRL_DUAL_DISPLAY BIT(19) #define PANEL_DISPLAY_CTRL_DOUBLE_PIXEL BIT(18) #define PANEL_DISPLAY_CTRL_FIFO 17:16 diff --git a/drivers/staging/sm750fb/sm750_hw.c b/drivers/staging/sm750fb/sm750_hw.c index 384989184537..d96595433195 100644 --- a/drivers/staging/sm750fb/sm750_hw.c +++ b/drivers/staging/sm750fb/sm750_hw.c @@ -130,17 +130,20 @@ int hw_sm750_inithw(struct sm750_dev *sm750_dev, struct pci_dev *pdev) POKE32(SYSTEM_CTRL, val); } + val = PEEK32(PANEL_DISPLAY_CTRL) & + ~(PANEL_DISPLAY_CTRL_DUAL_DISPLAY | + PANEL_DISPLAY_CTRL_DOUBLE_PIXEL); switch (sm750_dev->pnltype) { - case sm750_doubleTFT: case sm750_24TFT: + break; + case sm750_doubleTFT: + val |= PANEL_DISPLAY_CTRL_DOUBLE_PIXEL; + break; case sm750_dualTFT: - POKE32(PANEL_DISPLAY_CTRL, - FIELD_VALUE(PEEK32(PANEL_DISPLAY_CTRL), - PANEL_DISPLAY_CTRL, - TFT_DISP, - sm750_dev->pnltype)); - break; + val |= PANEL_DISPLAY_CTRL_DUAL_DISPLAY; + break; } + POKE32(PANEL_DISPLAY_CTRL, val); } else { /* for 750LE ,no DVI chip initialization makes Monitor no signal */ /* Set up GPIO for software I2C to program DVI chip in the -- 2.20.1