staging: xgifb: eliminate global XGI_Pr data
Move vb_device_info into xgifb_video_info. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
7d2ab0c62d
commit
f2df8c097a
@ -52,15 +52,15 @@ MODULE_DEVICE_TABLE(pci, xgifb_pci_table);
|
||||
|
||||
#define SEQ_DATA 0x15
|
||||
|
||||
#define XGISR XGI_Pr.P3c4
|
||||
#define XGICR XGI_Pr.P3d4
|
||||
#define XGIDACA XGI_Pr.P3c8
|
||||
#define XGIDACD XGI_Pr.P3c9
|
||||
#define XGIPART1 XGI_Pr.Part1Port
|
||||
#define XGIPART2 XGI_Pr.Part2Port
|
||||
#define XGIPART3 XGI_Pr.Part3Port
|
||||
#define XGIPART4 XGI_Pr.Part4Port
|
||||
#define XGIPART5 XGI_Pr.Part5Port
|
||||
#define XGISR (xgifb_info->dev_info.P3c4)
|
||||
#define XGICR (xgifb_info->dev_info.P3d4)
|
||||
#define XGIDACA (xgifb_info->dev_info.P3c8)
|
||||
#define XGIDACD (xgifb_info->dev_info.P3c9)
|
||||
#define XGIPART1 (xgifb_info->dev_info.Part1Port)
|
||||
#define XGIPART2 (xgifb_info->dev_info.Part2Port)
|
||||
#define XGIPART3 (xgifb_info->dev_info.Part3Port)
|
||||
#define XGIPART4 (xgifb_info->dev_info.Part4Port)
|
||||
#define XGIPART5 (xgifb_info->dev_info.Part5Port)
|
||||
#define XGIDAC2A XGIPART5
|
||||
#define XGIDAC2D (XGIPART5 + 1)
|
||||
|
||||
@ -143,9 +143,6 @@ static int XGIfb_tvplug = -1;
|
||||
/* TW: For ioctl XGIFB_GET_INFO */
|
||||
/* XGIfb_info XGIfbinfo; */
|
||||
|
||||
/* TW: XGI private structure */
|
||||
static struct vb_device_info XGI_Pr;
|
||||
|
||||
#define MD_XGI300 1
|
||||
#define MD_XGI315 2
|
||||
|
||||
|
@ -1650,6 +1650,7 @@ static int XGIfb_pan_display(struct fb_var_screeninfo *var,
|
||||
|
||||
static int XGIfb_blank(int blank, struct fb_info *info)
|
||||
{
|
||||
struct xgifb_video_info *xgifb_info = info->par;
|
||||
u8 reg;
|
||||
|
||||
reg = xgifb_reg_get(XGICR, 0x17);
|
||||
@ -2002,14 +2003,15 @@ static int __devinit xgifb_probe(struct pci_dev *pdev,
|
||||
hw_info->pjIOAddress = (unsigned char *)xgifb_info->vga_base;
|
||||
/* XGI_Pr.RelIO = ioremap(pci_resource_start(pdev, 2), 128) + 0x30; */
|
||||
printk("XGIfb: Relocate IO address: %lx [%08lx]\n",
|
||||
(unsigned long)pci_resource_start(pdev, 2), XGI_Pr.RelIO);
|
||||
(unsigned long)pci_resource_start(pdev, 2),
|
||||
xgifb_info->dev_info.RelIO);
|
||||
|
||||
if (pci_enable_device(pdev)) {
|
||||
ret = -EIO;
|
||||
goto error;
|
||||
}
|
||||
|
||||
XGIRegInit(&XGI_Pr, (unsigned long)hw_info->pjIOAddress);
|
||||
XGIRegInit(&xgifb_info->dev_info, (unsigned long)hw_info->pjIOAddress);
|
||||
|
||||
xgifb_reg_set(XGISR, IND_XGI_PASSWORD, XGI_PASSWORD);
|
||||
reg1 = xgifb_reg_get(XGISR, IND_XGI_PASSWORD);
|
||||
@ -2292,7 +2294,9 @@ static int __devinit xgifb_probe(struct pci_dev *pdev,
|
||||
XGIbios_mode[xgifb_info->mode_idx].xres) &&
|
||||
(XGI21_LCDCapList[m].LVDSVDE ==
|
||||
XGIbios_mode[xgifb_info->mode_idx].yres)) {
|
||||
xgifb_reg_set(XGI_Pr.P3d4, 0x36, m);
|
||||
xgifb_reg_set(xgifb_info->dev_info.P3d4,
|
||||
0x36,
|
||||
m);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -2364,11 +2368,12 @@ static int __devinit xgifb_probe(struct pci_dev *pdev,
|
||||
XGIfb_bpp_to_var(xgifb_info, &fb_info->var);
|
||||
|
||||
fb_info->var.pixclock = (u32) (1000000000 /
|
||||
XGIfb_mode_rate_to_dclock(&XGI_Pr, hw_info,
|
||||
XGIfb_mode_rate_to_dclock(&xgifb_info->dev_info,
|
||||
hw_info,
|
||||
XGIbios_mode[xgifb_info->mode_idx].mode_no,
|
||||
xgifb_info->rate_idx));
|
||||
|
||||
if (XGIfb_mode_rate_to_ddata(&XGI_Pr, hw_info,
|
||||
if (XGIfb_mode_rate_to_ddata(&xgifb_info->dev_info, hw_info,
|
||||
XGIbios_mode[xgifb_info->mode_idx].mode_no,
|
||||
xgifb_info->rate_idx,
|
||||
&fb_info->var.left_margin,
|
||||
|
@ -3,6 +3,7 @@
|
||||
#include <linux/ioctl.h>
|
||||
#include <linux/types.h>
|
||||
|
||||
#include "vb_struct.h"
|
||||
#include "vgatypes.h"
|
||||
|
||||
#define DISPTYPE_CRT1 0x00000008L
|
||||
@ -57,6 +58,7 @@ enum xgi_tv_plug { /* vicki@030226 */
|
||||
struct xgifb_video_info {
|
||||
struct fb_info *fb_info;
|
||||
struct xgi_hw_device_info hw_info;
|
||||
struct vb_device_info dev_info;
|
||||
|
||||
int mode_idx;
|
||||
int rate_idx;
|
||||
|
Loading…
Reference in New Issue
Block a user