staging: sm750fb: merge struct sm750_state into struct sm750_dev
The struct sm750_state is never used on its own. Merge it into the struct sm750_dev. Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
5ef2f68857
commit
1757d106a9
3 changed files with 32 additions and 35 deletions
|
@ -676,7 +676,7 @@ static int sm750fb_set_drv(struct lynxfb_par *par)
|
||||||
/* chip specific phase */
|
/* chip specific phase */
|
||||||
share->accel.de_wait = (share->revid == SM750LE_REVISION_ID) ?
|
share->accel.de_wait = (share->revid == SM750LE_REVISION_ID) ?
|
||||||
hw_sm750le_deWait : hw_sm750_deWait;
|
hw_sm750le_deWait : hw_sm750_deWait;
|
||||||
switch (sm750_dev->state.dataflow) {
|
switch (sm750_dev->dataflow) {
|
||||||
case sm750_simul_pri:
|
case sm750_simul_pri:
|
||||||
output->paths = sm750_pnc;
|
output->paths = sm750_pnc;
|
||||||
crtc->channel = sm750_primary;
|
crtc->channel = sm750_primary;
|
||||||
|
@ -950,12 +950,12 @@ static void sm750fb_setup(struct lynx_share *share, char *src)
|
||||||
#endif
|
#endif
|
||||||
swap = 0;
|
swap = 0;
|
||||||
|
|
||||||
sm750_dev->state.initParm.chip_clk = 0;
|
sm750_dev->initParm.chip_clk = 0;
|
||||||
sm750_dev->state.initParm.mem_clk = 0;
|
sm750_dev->initParm.mem_clk = 0;
|
||||||
sm750_dev->state.initParm.master_clk = 0;
|
sm750_dev->initParm.master_clk = 0;
|
||||||
sm750_dev->state.initParm.powerMode = 0;
|
sm750_dev->initParm.powerMode = 0;
|
||||||
sm750_dev->state.initParm.setAllEngOff = 0;
|
sm750_dev->initParm.setAllEngOff = 0;
|
||||||
sm750_dev->state.initParm.resetMemory = 1;
|
sm750_dev->initParm.resetMemory = 1;
|
||||||
|
|
||||||
/* defaultly turn g_hwcursor on for both view */
|
/* defaultly turn g_hwcursor on for both view */
|
||||||
g_hwcursor = 3;
|
g_hwcursor = 3;
|
||||||
|
@ -972,13 +972,13 @@ static void sm750fb_setup(struct lynx_share *share, char *src)
|
||||||
if (!strncmp(opt, "swap", strlen("swap")))
|
if (!strncmp(opt, "swap", strlen("swap")))
|
||||||
swap = 1;
|
swap = 1;
|
||||||
else if (!strncmp(opt, "nocrt", strlen("nocrt")))
|
else if (!strncmp(opt, "nocrt", strlen("nocrt")))
|
||||||
sm750_dev->state.nocrt = 1;
|
sm750_dev->nocrt = 1;
|
||||||
else if (!strncmp(opt, "36bit", strlen("36bit")))
|
else if (!strncmp(opt, "36bit", strlen("36bit")))
|
||||||
sm750_dev->state.pnltype = sm750_doubleTFT;
|
sm750_dev->pnltype = sm750_doubleTFT;
|
||||||
else if (!strncmp(opt, "18bit", strlen("18bit")))
|
else if (!strncmp(opt, "18bit", strlen("18bit")))
|
||||||
sm750_dev->state.pnltype = sm750_dualTFT;
|
sm750_dev->pnltype = sm750_dualTFT;
|
||||||
else if (!strncmp(opt, "24bit", strlen("24bit")))
|
else if (!strncmp(opt, "24bit", strlen("24bit")))
|
||||||
sm750_dev->state.pnltype = sm750_24TFT;
|
sm750_dev->pnltype = sm750_24TFT;
|
||||||
#ifdef CAP_EXPANSION
|
#ifdef CAP_EXPANSION
|
||||||
else if (!strncmp(opt, "exp:", strlen("exp:")))
|
else if (!strncmp(opt, "exp:", strlen("exp:")))
|
||||||
exp_res = opt + strlen("exp:");
|
exp_res = opt + strlen("exp:");
|
||||||
|
@ -1003,10 +1003,10 @@ static void sm750fb_setup(struct lynx_share *share, char *src)
|
||||||
}
|
}
|
||||||
#ifdef CAP_EXPANSION
|
#ifdef CAP_EXPANSION
|
||||||
if (getExpRes(exp_res,
|
if (getExpRes(exp_res,
|
||||||
&sm750_dev->state.xLCD,
|
&sm750_dev->xLCD,
|
||||||
&sm750_dev->state.yLCD)) {
|
&sm750_dev->yLCD)) {
|
||||||
/* seems exp_res is not valid */
|
/* seems exp_res is not valid */
|
||||||
sm750_dev->state.xLCD = sm750_dev->state.yLCD = 0;
|
sm750_dev->xLCD = sm750_dev->yLCD = 0;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -1014,20 +1014,20 @@ NO_PARAM:
|
||||||
if (share->revid != SM750LE_REVISION_ID) {
|
if (share->revid != SM750LE_REVISION_ID) {
|
||||||
if (share->dual) {
|
if (share->dual) {
|
||||||
if (swap)
|
if (swap)
|
||||||
sm750_dev->state.dataflow = sm750_dual_swap;
|
sm750_dev->dataflow = sm750_dual_swap;
|
||||||
else
|
else
|
||||||
sm750_dev->state.dataflow = sm750_dual_normal;
|
sm750_dev->dataflow = sm750_dual_normal;
|
||||||
} else {
|
} else {
|
||||||
if (swap)
|
if (swap)
|
||||||
sm750_dev->state.dataflow = sm750_simul_sec;
|
sm750_dev->dataflow = sm750_simul_sec;
|
||||||
else
|
else
|
||||||
sm750_dev->state.dataflow = sm750_simul_pri;
|
sm750_dev->dataflow = sm750_simul_pri;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
/* SM750LE only have one crt channel */
|
/* SM750LE only have one crt channel */
|
||||||
sm750_dev->state.dataflow = sm750_simul_sec;
|
sm750_dev->dataflow = sm750_simul_sec;
|
||||||
/* sm750le do not have complex attributes */
|
/* sm750le do not have complex attributes */
|
||||||
sm750_dev->state.nocrt = 0;
|
sm750_dev->nocrt = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -47,15 +47,6 @@ struct init_status {
|
||||||
ushort resetMemory;
|
ushort resetMemory;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct sm750_state {
|
|
||||||
struct init_status initParm;
|
|
||||||
enum sm750_pnltype pnltype;
|
|
||||||
enum sm750_dataflow dataflow;
|
|
||||||
int nocrt;
|
|
||||||
int xLCD;
|
|
||||||
int yLCD;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct lynx_accel {
|
struct lynx_accel {
|
||||||
/* base virtual address of DPR registers */
|
/* base virtual address of DPR registers */
|
||||||
volatile unsigned char __iomem *dprBase;
|
volatile unsigned char __iomem *dprBase;
|
||||||
|
@ -113,7 +104,13 @@ struct lynx_share {
|
||||||
*/
|
*/
|
||||||
struct sm750_dev {
|
struct sm750_dev {
|
||||||
struct lynx_share share;
|
struct lynx_share share;
|
||||||
struct sm750_state state;
|
|
||||||
|
struct init_status initParm;
|
||||||
|
enum sm750_pnltype pnltype;
|
||||||
|
enum sm750_dataflow dataflow;
|
||||||
|
int nocrt;
|
||||||
|
int xLCD;
|
||||||
|
int yLCD;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* 0: no hardware cursor
|
* 0: no hardware cursor
|
||||||
|
|
|
@ -97,7 +97,7 @@ int hw_sm750_inithw(struct lynx_share *share, struct pci_dev *pdev)
|
||||||
struct init_status *parm;
|
struct init_status *parm;
|
||||||
|
|
||||||
sm750_dev = container_of(share, struct sm750_dev, share);
|
sm750_dev = container_of(share, struct sm750_dev, share);
|
||||||
parm = &sm750_dev->state.initParm;
|
parm = &sm750_dev->initParm;
|
||||||
if (parm->chip_clk == 0)
|
if (parm->chip_clk == 0)
|
||||||
parm->chip_clk = (getChipType() == SM750LE) ?
|
parm->chip_clk = (getChipType() == SM750LE) ?
|
||||||
DEFAULT_SM750LE_CHIP_CLOCK :
|
DEFAULT_SM750LE_CHIP_CLOCK :
|
||||||
|
@ -108,7 +108,7 @@ int hw_sm750_inithw(struct lynx_share *share, struct pci_dev *pdev)
|
||||||
if (parm->master_clk == 0)
|
if (parm->master_clk == 0)
|
||||||
parm->master_clk = parm->chip_clk/3;
|
parm->master_clk = parm->chip_clk/3;
|
||||||
|
|
||||||
ddk750_initHw((initchip_param_t *)&sm750_dev->state.initParm);
|
ddk750_initHw((initchip_param_t *)&sm750_dev->initParm);
|
||||||
/* for sm718,open pci burst */
|
/* for sm718,open pci burst */
|
||||||
if (share->devid == 0x718) {
|
if (share->devid == 0x718) {
|
||||||
POKE32(SYSTEM_CTRL,
|
POKE32(SYSTEM_CTRL,
|
||||||
|
@ -117,7 +117,7 @@ int hw_sm750_inithw(struct lynx_share *share, struct pci_dev *pdev)
|
||||||
|
|
||||||
if (getChipType() != SM750LE) {
|
if (getChipType() != SM750LE) {
|
||||||
/* does user need CRT ?*/
|
/* does user need CRT ?*/
|
||||||
if (sm750_dev->state.nocrt) {
|
if (sm750_dev->nocrt) {
|
||||||
POKE32(MISC_CTRL,
|
POKE32(MISC_CTRL,
|
||||||
FIELD_SET(PEEK32(MISC_CTRL),
|
FIELD_SET(PEEK32(MISC_CTRL),
|
||||||
MISC_CTRL,
|
MISC_CTRL,
|
||||||
|
@ -139,7 +139,7 @@ int hw_sm750_inithw(struct lynx_share *share, struct pci_dev *pdev)
|
||||||
DPMS, VPHP));
|
DPMS, VPHP));
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (sm750_dev->state.pnltype) {
|
switch (sm750_dev->pnltype) {
|
||||||
case sm750_doubleTFT:
|
case sm750_doubleTFT:
|
||||||
case sm750_24TFT:
|
case sm750_24TFT:
|
||||||
case sm750_dualTFT:
|
case sm750_dualTFT:
|
||||||
|
@ -147,7 +147,7 @@ int hw_sm750_inithw(struct lynx_share *share, struct pci_dev *pdev)
|
||||||
FIELD_VALUE(PEEK32(PANEL_DISPLAY_CTRL),
|
FIELD_VALUE(PEEK32(PANEL_DISPLAY_CTRL),
|
||||||
PANEL_DISPLAY_CTRL,
|
PANEL_DISPLAY_CTRL,
|
||||||
TFT_DISP,
|
TFT_DISP,
|
||||||
sm750_dev->state.pnltype));
|
sm750_dev->pnltype));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue