Commit 7e47c211 authored by Timur Tabi's avatar Timur Tabi Committed by Florian Tobias Schandinat

drivers/video: fsl-diu-fb: remove unused panel operating mode support

The MFB_TYPE_xxx macros indicate different "operating modes" of each AOI,
but this feature is not actually used in the driver.  The mfb_index.type
field is always set to MFB_TYPE_OUTPUT, so just delete it and any code
that references it.
Signed-off-by: default avatarTimur Tabi <timur@freescale.com>
Signed-off-by: default avatarFlorian Tobias Schandinat <FlorianSchandinat@gmx.de>
parent 2572df91
...@@ -49,12 +49,6 @@ ...@@ -49,12 +49,6 @@
#define INT_PARERR 0x08 /* Display parameters error interrupt */ #define INT_PARERR 0x08 /* Display parameters error interrupt */
#define INT_LS_BF_VS 0x10 /* Lines before vsync. interrupt */ #define INT_LS_BF_VS 0x10 /* Lines before vsync. interrupt */
/* Panels'operation modes */
#define MFB_TYPE_OUTPUT 0 /* Panel output to display */
#define MFB_TYPE_OFF 1 /* Panel off */
#define MFB_TYPE_WB 2 /* Panel written back to memory */
#define MFB_TYPE_TEST 3 /* Panel generate color bar */
struct diu_hw { struct diu_hw {
struct diu __iomem *diu_reg; struct diu __iomem *diu_reg;
spinlock_t reg_lock; spinlock_t reg_lock;
...@@ -370,7 +364,6 @@ enum mfb_index { ...@@ -370,7 +364,6 @@ enum mfb_index {
struct mfb_info { struct mfb_info {
enum mfb_index index; enum mfb_index index;
int type;
char *id; char *id;
int registered; int registered;
unsigned long pseudo_palette[16]; unsigned long pseudo_palette[16];
...@@ -388,7 +381,6 @@ struct mfb_info { ...@@ -388,7 +381,6 @@ struct mfb_info {
static struct mfb_info mfb_template[] = { static struct mfb_info mfb_template[] = {
{ {
.index = PLANE0, .index = PLANE0,
.type = MFB_TYPE_OUTPUT,
.id = "Panel0", .id = "Panel0",
.registered = 0, .registered = 0,
.count = 0, .count = 0,
...@@ -397,7 +389,6 @@ static struct mfb_info mfb_template[] = { ...@@ -397,7 +389,6 @@ static struct mfb_info mfb_template[] = {
}, },
{ {
.index = PLANE1_AOI0, .index = PLANE1_AOI0,
.type = MFB_TYPE_OUTPUT,
.id = "Panel1 AOI0", .id = "Panel1 AOI0",
.registered = 0, .registered = 0,
.g_alpha = 0xff, .g_alpha = 0xff,
...@@ -407,7 +398,6 @@ static struct mfb_info mfb_template[] = { ...@@ -407,7 +398,6 @@ static struct mfb_info mfb_template[] = {
}, },
{ {
.index = PLANE1_AOI1, .index = PLANE1_AOI1,
.type = MFB_TYPE_OUTPUT,
.id = "Panel1 AOI1", .id = "Panel1 AOI1",
.registered = 0, .registered = 0,
.g_alpha = 0xff, .g_alpha = 0xff,
...@@ -417,7 +407,6 @@ static struct mfb_info mfb_template[] = { ...@@ -417,7 +407,6 @@ static struct mfb_info mfb_template[] = {
}, },
{ {
.index = PLANE2_AOI0, .index = PLANE2_AOI0,
.type = MFB_TYPE_OUTPUT,
.id = "Panel2 AOI0", .id = "Panel2 AOI0",
.registered = 0, .registered = 0,
.g_alpha = 0xff, .g_alpha = 0xff,
...@@ -427,7 +416,6 @@ static struct mfb_info mfb_template[] = { ...@@ -427,7 +416,6 @@ static struct mfb_info mfb_template[] = {
}, },
{ {
.index = PLANE2_AOI1, .index = PLANE2_AOI1,
.type = MFB_TYPE_OUTPUT,
.id = "Panel2 AOI1", .id = "Panel2 AOI1",
.registered = 0, .registered = 0,
.g_alpha = 0xff, .g_alpha = 0xff,
...@@ -517,62 +505,57 @@ void wr_reg_wa(u32 *reg, u32 val) ...@@ -517,62 +505,57 @@ void wr_reg_wa(u32 *reg, u32 val)
} while (in_be32(reg) != val); } while (in_be32(reg) != val);
} }
static int fsl_diu_enable_panel(struct fb_info *info) static void fsl_diu_enable_panel(struct fb_info *info)
{ {
struct mfb_info *pmfbi, *cmfbi, *mfbi = info->par; struct mfb_info *pmfbi, *cmfbi, *mfbi = info->par;
struct diu *hw = dr.diu_reg; struct diu *hw = dr.diu_reg;
struct diu_ad *ad = mfbi->ad; struct diu_ad *ad = mfbi->ad;
struct fsl_diu_data *machine_data = mfbi->parent; struct fsl_diu_data *machine_data = mfbi->parent;
int res = 0;
if (mfbi->type != MFB_TYPE_OFF) { switch (mfbi->index) {
switch (mfbi->index) { case PLANE0:
case PLANE0: if (hw->desc[0] != ad->paddr)
if (hw->desc[0] != ad->paddr) wr_reg_wa(&hw->desc[0], ad->paddr);
wr_reg_wa(&hw->desc[0], ad->paddr); break;
break; case PLANE1_AOI0:
case PLANE1_AOI0: cmfbi = machine_data->fsl_diu_info[2]->par;
cmfbi = machine_data->fsl_diu_info[2]->par; if (hw->desc[1] != ad->paddr) { /* AOI0 closed */
if (hw->desc[1] != ad->paddr) { /* AOI0 closed */ if (cmfbi->count > 0) /* AOI1 open */
if (cmfbi->count > 0) /* AOI1 open */ ad->next_ad =
ad->next_ad = cpu_to_le32(cmfbi->ad->paddr);
cpu_to_le32(cmfbi->ad->paddr); else
else ad->next_ad = 0;
ad->next_ad = 0; wr_reg_wa(&hw->desc[1], ad->paddr);
wr_reg_wa(&hw->desc[1], ad->paddr);
}
break;
case PLANE2_AOI0:
cmfbi = machine_data->fsl_diu_info[4]->par;
if (hw->desc[2] != ad->paddr) { /* AOI0 closed */
if (cmfbi->count > 0) /* AOI1 open */
ad->next_ad =
cpu_to_le32(cmfbi->ad->paddr);
else
ad->next_ad = 0;
wr_reg_wa(&hw->desc[2], ad->paddr);
}
break;
case PLANE1_AOI1:
pmfbi = machine_data->fsl_diu_info[1]->par;
ad->next_ad = 0;
if (hw->desc[1] == machine_data->dummy_ad->paddr)
wr_reg_wa(&hw->desc[1], ad->paddr);
else /* AOI0 open */
pmfbi->ad->next_ad = cpu_to_le32(ad->paddr);
break;
case PLANE2_AOI1:
pmfbi = machine_data->fsl_diu_info[3]->par;
ad->next_ad = 0;
if (hw->desc[2] == machine_data->dummy_ad->paddr)
wr_reg_wa(&hw->desc[2], ad->paddr);
else /* AOI0 was open */
pmfbi->ad->next_ad = cpu_to_le32(ad->paddr);
break;
} }
} else break;
res = -EINVAL; case PLANE2_AOI0:
return res; cmfbi = machine_data->fsl_diu_info[4]->par;
if (hw->desc[2] != ad->paddr) { /* AOI0 closed */
if (cmfbi->count > 0) /* AOI1 open */
ad->next_ad =
cpu_to_le32(cmfbi->ad->paddr);
else
ad->next_ad = 0;
wr_reg_wa(&hw->desc[2], ad->paddr);
}
break;
case PLANE1_AOI1:
pmfbi = machine_data->fsl_diu_info[1]->par;
ad->next_ad = 0;
if (hw->desc[1] == machine_data->dummy_ad->paddr)
wr_reg_wa(&hw->desc[1], ad->paddr);
else /* AOI0 open */
pmfbi->ad->next_ad = cpu_to_le32(ad->paddr);
break;
case PLANE2_AOI1:
pmfbi = machine_data->fsl_diu_info[3]->par;
ad->next_ad = 0;
if (hw->desc[2] == machine_data->dummy_ad->paddr)
wr_reg_wa(&hw->desc[2], ad->paddr);
else /* AOI0 was open */
pmfbi->ad->next_ad = cpu_to_le32(ad->paddr);
break;
}
} }
static void fsl_diu_disable_panel(struct fb_info *info) static void fsl_diu_disable_panel(struct fb_info *info)
...@@ -849,11 +832,6 @@ static void update_lcdc(struct fb_info *info) ...@@ -849,11 +832,6 @@ static void update_lcdc(struct fb_info *info)
hw = dr.diu_reg; hw = dr.diu_reg;
if (mfbi->type == MFB_TYPE_OFF) {
fsl_diu_disable_panel(info);
return;
}
diu_ops.set_monitor_port(machine_data->monitor_port); diu_ops.set_monitor_port(machine_data->monitor_port);
gamma_table_base = pool.gamma.vaddr; gamma_table_base = pool.gamma.vaddr;
cursor_base = pool.cursor.vaddr; cursor_base = pool.cursor.vaddr;
...@@ -1205,11 +1183,8 @@ static int fsl_diu_open(struct fb_info *info, int user) ...@@ -1205,11 +1183,8 @@ static int fsl_diu_open(struct fb_info *info, int user)
res = fsl_diu_set_par(info); res = fsl_diu_set_par(info);
if (res < 0) if (res < 0)
mfbi->count--; mfbi->count--;
else { else
res = fsl_diu_enable_panel(info); fsl_diu_enable_panel(info);
if (res < 0)
mfbi->count--;
}
} }
spin_unlock(&diu_lock); spin_unlock(&diu_lock);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment