From 8d91c1e411f55d7ea91b1183a2e9f8088fb4d5be Mon Sep 17 00:00:00 2001 From: André Fabian Silva Delgado Date: Tue, 15 Dec 2015 14:52:16 -0300 Subject: Linux-libre 4.3.2-gnu --- drivers/staging/xgifb/Makefile | 2 +- drivers/staging/xgifb/XGI_main_26.c | 12 +++++----- drivers/staging/xgifb/vb_init.h | 4 ++-- drivers/staging/xgifb/vb_setmode.h | 34 ++++++++++++++-------------- drivers/staging/xgifb/vb_util.c | 42 ----------------------------------- drivers/staging/xgifb/vb_util.h | 44 ++++++++++++++++++++++++++++++++----- 6 files changed, 65 insertions(+), 73 deletions(-) delete mode 100644 drivers/staging/xgifb/vb_util.c (limited to 'drivers/staging/xgifb') diff --git a/drivers/staging/xgifb/Makefile b/drivers/staging/xgifb/Makefile index 55e519905..964a843c4 100644 --- a/drivers/staging/xgifb/Makefile +++ b/drivers/staging/xgifb/Makefile @@ -1,4 +1,4 @@ obj-$(CONFIG_FB_XGI) += xgifb.o -xgifb-y := XGI_main_26.o vb_init.o vb_setmode.o vb_util.o +xgifb-y := XGI_main_26.o vb_init.o vb_setmode.o diff --git a/drivers/staging/xgifb/XGI_main_26.c b/drivers/staging/xgifb/XGI_main_26.c index 943d463cf..5a6251a45 100644 --- a/drivers/staging/xgifb/XGI_main_26.c +++ b/drivers/staging/xgifb/XGI_main_26.c @@ -18,8 +18,8 @@ #define Index_CR_GPIO_Reg1 0x48 #define Index_CR_GPIO_Reg3 0x4a -#define GPIOG_EN (1<<6) -#define GPIOG_READ (1<<1) +#define GPIOG_EN BIT(6) +#define GPIOG_READ BIT(1) static char *forcecrt2type; static char *mode; @@ -29,7 +29,7 @@ static unsigned int refresh_rate; /* -------------------- Macro definitions ---------------------------- */ #ifdef DEBUG -static void dumpVGAReg(void) +static void dumpVGAReg(struct xgifb_video_info *xgifb_info) { u8 i, reg; @@ -48,7 +48,7 @@ static void dumpVGAReg(void) } } #else -static inline void dumpVGAReg(void) +static inline void dumpVGAReg(struct xgifb_video_info *xgifb_info) { } #endif @@ -1073,7 +1073,7 @@ static int XGIfb_do_set_var(struct fb_var_screeninfo *var, int isactive, } XGIfb_bpp_to_var(xgifb_info, var); /*update ARGB info*/ - dumpVGAReg(); + dumpVGAReg(xgifb_info); return 0; } @@ -2019,7 +2019,7 @@ static int xgifb_probe(struct pci_dev *pdev, goto error_mtrr; } - dumpVGAReg(); + dumpVGAReg(xgifb_info); return 0; diff --git a/drivers/staging/xgifb/vb_init.h b/drivers/staging/xgifb/vb_init.h index 24573026a..500cabe41 100644 --- a/drivers/staging/xgifb/vb_init.h +++ b/drivers/staging/xgifb/vb_init.h @@ -1,6 +1,6 @@ #ifndef _VBINIT_ #define _VBINIT_ -extern unsigned char XGIInitNew(struct pci_dev *pdev); -extern void XGIRegInit(struct vb_device_info *, unsigned long); +unsigned char XGIInitNew(struct pci_dev *pdev); +void XGIRegInit(struct vb_device_info *, unsigned long); #endif diff --git a/drivers/staging/xgifb/vb_setmode.h b/drivers/staging/xgifb/vb_setmode.h index 5301bec64..6f082a7a5 100644 --- a/drivers/staging/xgifb/vb_setmode.h +++ b/drivers/staging/xgifb/vb_setmode.h @@ -1,23 +1,23 @@ #ifndef _VBSETMODE_ #define _VBSETMODE_ -extern void InitTo330Pointer(unsigned char, struct vb_device_info *); -extern void XGI_UnLockCRT2(struct vb_device_info *); -extern void XGI_LockCRT2(struct vb_device_info *); -extern void XGI_DisplayOff(struct xgifb_video_info *, - struct xgi_hw_device_info *, - struct vb_device_info *); -extern void XGI_GetVBType(struct vb_device_info *); -extern void XGI_SenseCRT1(struct vb_device_info *); -extern unsigned char XGISetModeNew(struct xgifb_video_info *xgifb_info, - struct xgi_hw_device_info *HwDeviceExtension, - unsigned short ModeNo); +void InitTo330Pointer(unsigned char, struct vb_device_info *); +void XGI_UnLockCRT2(struct vb_device_info *); +void XGI_LockCRT2(struct vb_device_info *); +void XGI_DisplayOff(struct xgifb_video_info *, + struct xgi_hw_device_info *, + struct vb_device_info *); +void XGI_GetVBType(struct vb_device_info *); +void XGI_SenseCRT1(struct vb_device_info *); +unsigned char XGISetModeNew(struct xgifb_video_info *xgifb_info, + struct xgi_hw_device_info *HwDeviceExtension, + unsigned short ModeNo); -extern unsigned char XGI_SearchModeID(unsigned short ModeNo, - unsigned short *ModeIdIndex); -extern unsigned short XGI_GetRatePtrCRT2(struct xgi_hw_device_info *pXGIHWDE, - unsigned short ModeNo, - unsigned short ModeIdIndex, - struct vb_device_info *); +unsigned char XGI_SearchModeID(unsigned short ModeNo, + unsigned short *ModeIdIndex); +unsigned short XGI_GetRatePtrCRT2(struct xgi_hw_device_info *pXGIHWDE, + unsigned short ModeNo, + unsigned short ModeIdIndex, + struct vb_device_info *); #endif diff --git a/drivers/staging/xgifb/vb_util.c b/drivers/staging/xgifb/vb_util.c deleted file mode 100644 index be3437ca3..000000000 --- a/drivers/staging/xgifb/vb_util.c +++ /dev/null @@ -1,42 +0,0 @@ -#include "vgatypes.h" -#include "vb_util.h" - -void xgifb_reg_set(unsigned long port, u8 index, u8 data) -{ - outb(index, port); - outb(data, port + 1); -} - -u8 xgifb_reg_get(unsigned long port, u8 index) -{ - outb(index, port); - return inb(port + 1); -} - -void xgifb_reg_and_or(unsigned long port, u8 index, - unsigned data_and, unsigned data_or) -{ - u8 temp; - - temp = xgifb_reg_get(port, index); /* XGINew_Part1Port index 02 */ - temp = (temp & data_and) | data_or; - xgifb_reg_set(port, index, temp); -} - -void xgifb_reg_and(unsigned long port, u8 index, unsigned data_and) -{ - u8 temp; - - temp = xgifb_reg_get(port, index); /* XGINew_Part1Port index 02 */ - temp &= data_and; - xgifb_reg_set(port, index, temp); -} - -void xgifb_reg_or(unsigned long port, u8 index, unsigned data_or) -{ - u8 temp; - - temp = xgifb_reg_get(port, index); /* XGINew_Part1Port index 02 */ - temp |= data_or; - xgifb_reg_set(port, index, temp); -} diff --git a/drivers/staging/xgifb/vb_util.h b/drivers/staging/xgifb/vb_util.h index 9161de1d3..7bd395fb3 100644 --- a/drivers/staging/xgifb/vb_util.h +++ b/drivers/staging/xgifb/vb_util.h @@ -1,9 +1,43 @@ #ifndef _VBUTIL_ #define _VBUTIL_ -extern void xgifb_reg_set(unsigned long, u8, u8); -extern u8 xgifb_reg_get(unsigned long, u8); -extern void xgifb_reg_or(unsigned long, u8, unsigned); -extern void xgifb_reg_and(unsigned long, u8, unsigned); -extern void xgifb_reg_and_or(unsigned long, u8, unsigned, unsigned); +static inline void xgifb_reg_set(unsigned long port, u8 index, u8 data) +{ + outb(index, port); + outb(data, port + 1); +} + +static inline u8 xgifb_reg_get(unsigned long port, u8 index) +{ + outb(index, port); + return inb(port + 1); +} + +static inline void xgifb_reg_and_or(unsigned long port, u8 index, + unsigned data_and, unsigned data_or) +{ + u8 temp; + + temp = xgifb_reg_get(port, index); + temp = (temp & data_and) | data_or; + xgifb_reg_set(port, index, temp); +} + +static inline void xgifb_reg_and(unsigned long port, u8 index, unsigned data_and) +{ + u8 temp; + + temp = xgifb_reg_get(port, index); + temp &= data_and; + xgifb_reg_set(port, index, temp); +} + +static inline void xgifb_reg_or(unsigned long port, u8 index, unsigned data_or) +{ + u8 temp; + + temp = xgifb_reg_get(port, index); + temp |= data_or; + xgifb_reg_set(port, index, temp); +} #endif -- cgit v1.2.3-54-g00ecf