diff --git a/drivers/usb/misc/sisusbvga/sisusb.c b/drivers/usb/misc/sisusbvga/sisusb.c index 19aedbc85ea4735200ace707efa9deab27d0383b..738bd7c7451f160c88d79c2be0b5a41f5221d716 100644 --- a/drivers/usb/misc/sisusbvga/sisusb.c +++ b/drivers/usb/misc/sisusbvga/sisusb.c @@ -53,6 +53,7 @@ #include #include "sisusb.h" +#include "sisusb_init.h" #ifdef INCL_SISUSB_CON #include @@ -63,36 +64,6 @@ /* Forward declarations / clean-up routines */ #ifdef INCL_SISUSB_CON -int sisusb_setreg(struct sisusb_usb_data *sisusb, int port, u8 data); -int sisusb_getreg(struct sisusb_usb_data *sisusb, int port, u8 *data); -int sisusb_setidxreg(struct sisusb_usb_data *sisusb, int port, u8 index, u8 data); -int sisusb_getidxreg(struct sisusb_usb_data *sisusb, int port, u8 index, u8 *data); -int sisusb_setidxregandor(struct sisusb_usb_data *sisusb, int port, u8 idx, u8 myand, u8 myor); -int sisusb_setidxregor(struct sisusb_usb_data *sisusb, int port, u8 index, u8 myor); -int sisusb_setidxregand(struct sisusb_usb_data *sisusb, int port, u8 idx, u8 myand); - -int sisusb_writeb(struct sisusb_usb_data *sisusb, u32 adr, u8 data); -int sisusb_readb(struct sisusb_usb_data *sisusb, u32 adr, u8 *data); -int sisusb_writew(struct sisusb_usb_data *sisusb, u32 adr, u16 data); -int sisusb_readw(struct sisusb_usb_data *sisusb, u32 adr, u16 *data); -int sisusb_copy_memory(struct sisusb_usb_data *sisusb, char *src, - u32 dest, int length, size_t *bytes_written); - -int sisusb_reset_text_mode(struct sisusb_usb_data *sisusb, int init); - -extern int SiSUSBSetMode(struct SiS_Private *SiS_Pr, unsigned short ModeNo); -extern int SiSUSBSetVESAMode(struct SiS_Private *SiS_Pr, unsigned short VModeNo); - -extern void sisusb_init_concode(void); -extern int sisusb_console_init(struct sisusb_usb_data *sisusb, int first, int last); -extern void sisusb_console_exit(struct sisusb_usb_data *sisusb); - -extern void sisusb_set_cursor(struct sisusb_usb_data *sisusb, unsigned int location); - -extern int sisusbcon_do_font_op(struct sisusb_usb_data *sisusb, int set, int slot, - u8 *arg, int cmapsz, int ch512, int dorecalc, - struct vc_data *c, int fh, int uplock); - static int sisusb_first_vc = 0; static int sisusb_last_vc = 0; module_param_named(first, sisusb_first_vc, int, 0); @@ -1360,9 +1331,6 @@ sisusb_getreg(struct sisusb_usb_data *sisusb, int port, u8 *data) } #endif -#ifndef INCL_SISUSB_CON -static -#endif int sisusb_setidxreg(struct sisusb_usb_data *sisusb, int port, u8 index, u8 data) { @@ -1372,9 +1340,6 @@ sisusb_setidxreg(struct sisusb_usb_data *sisusb, int port, u8 index, u8 data) return ret; } -#ifndef INCL_SISUSB_CON -static -#endif int sisusb_getidxreg(struct sisusb_usb_data *sisusb, int port, u8 index, u8 *data) { @@ -1384,9 +1349,6 @@ sisusb_getidxreg(struct sisusb_usb_data *sisusb, int port, u8 index, u8 *data) return ret; } -#ifndef INCL_SISUSB_CON -static -#endif int sisusb_setidxregandor(struct sisusb_usb_data *sisusb, int port, u8 idx, u8 myand, u8 myor) @@ -1416,18 +1378,12 @@ sisusb_setidxregmask(struct sisusb_usb_data *sisusb, int port, u8 idx, return ret; } -#ifndef INCL_SISUSB_CON -static -#endif int sisusb_setidxregor(struct sisusb_usb_data *sisusb, int port, u8 index, u8 myor) { return(sisusb_setidxregandor(sisusb, port, index, 0xff, myor)); } -#ifndef INCL_SISUSB_CON -static -#endif int sisusb_setidxregand(struct sisusb_usb_data *sisusb, int port, u8 idx, u8 myand) { @@ -1449,6 +1405,8 @@ sisusb_readb(struct sisusb_usb_data *sisusb, u32 adr, u8 *data) return(sisusb_read_memio_byte(sisusb, SISUSB_TYPE_MEM, adr, data)); } +#if 0 + int sisusb_writew(struct sisusb_usb_data *sisusb, u32 adr, u16 data) { @@ -1461,6 +1419,8 @@ sisusb_readw(struct sisusb_usb_data *sisusb, u32 adr, u16 *data) return(sisusb_read_memio_word(sisusb, SISUSB_TYPE_MEM, adr, data)); } +#endif /* 0 */ + int sisusb_copy_memory(struct sisusb_usb_data *sisusb, char *src, u32 dest, int length, size_t *bytes_written) diff --git a/drivers/usb/misc/sisusbvga/sisusb_con.c b/drivers/usb/misc/sisusbvga/sisusb_con.c index 092281c172a11d6d8b44f4e38a1edbfa36f5c8d1..fb48feca835308ba30a351a37e748ea5282522d8 100644 --- a/drivers/usb/misc/sisusbvga/sisusb_con.c +++ b/drivers/usb/misc/sisusbvga/sisusb_con.c @@ -70,27 +70,9 @@ #include #include "sisusb.h" +#include "sisusb_init.h" #ifdef INCL_SISUSB_CON -extern int sisusb_setreg(struct sisusb_usb_data *, int, u8); -extern int sisusb_getreg(struct sisusb_usb_data *, int, u8 *); -extern int sisusb_setidxreg(struct sisusb_usb_data *, int, u8, u8); -extern int sisusb_getidxreg(struct sisusb_usb_data *, int, u8, u8 *); -extern int sisusb_setidxregor(struct sisusb_usb_data *, int, u8, u8); -extern int sisusb_setidxregand(struct sisusb_usb_data *, int, u8, u8); -extern int sisusb_setidxregandor(struct sisusb_usb_data *, int, u8, u8, u8); - -extern int sisusb_writeb(struct sisusb_usb_data *sisusb, u32 adr, u8 data); -extern int sisusb_readb(struct sisusb_usb_data *sisusb, u32 adr, u8 *data); -extern int sisusb_writew(struct sisusb_usb_data *sisusb, u32 adr, u16 data); -extern int sisusb_readw(struct sisusb_usb_data *sisusb, u32 adr, u16 *data); -extern int sisusb_copy_memory(struct sisusb_usb_data *sisusb, char *src, - u32 dest, int length, size_t *bytes_written); - -extern void sisusb_delete(struct kref *kref); -extern int sisusb_reset_text_mode(struct sisusb_usb_data *sisusb, int init); - -extern int SiSUSBSetMode(struct SiS_Private *SiS_Pr, unsigned short ModeNo); #define sisusbcon_writew(val, addr) (*(addr) = (val)) #define sisusbcon_readw(addr) (*(addr)) @@ -103,8 +85,6 @@ static struct sisusb_usb_data *mysisusbs[MAX_NR_CONSOLES]; /* Forward declaration */ static const struct consw sisusb_con; -extern struct mutex disconnect_mutex; - static inline void sisusbcon_memsetw(u16 *s, u16 c, unsigned int count) { @@ -1487,7 +1467,7 @@ static int sisusbdummycon_dummy(void) #define SISUSBCONDUMMY (void *)sisusbdummycon_dummy -const struct consw sisusb_dummy_con = { +static const struct consw sisusb_dummy_con = { .owner = THIS_MODULE, .con_startup = sisusbdummycon_startup, .con_init = sisusbdummycon_init, diff --git a/drivers/usb/misc/sisusbvga/sisusb_init.c b/drivers/usb/misc/sisusbvga/sisusb_init.c index 044fa4482f9f471764d99feaa43f9e8af01dfcda..968f0d38cff769b87cfb46135fe5bff37bf0739d 100644 --- a/drivers/usb/misc/sisusbvga/sisusb_init.c +++ b/drivers/usb/misc/sisusbvga/sisusb_init.c @@ -74,6 +74,7 @@ SiSUSB_InitPtr(struct SiS_Private *SiS_Pr) /* HELPER: Get ModeID */ /*********************************************/ +#if 0 unsigned short SiSUSB_GetModeID(int HDisplay, int VDisplay, int Depth) { @@ -157,6 +158,7 @@ SiSUSB_GetModeID(int HDisplay, int VDisplay, int Depth) return ModeIndex; } +#endif /* 0 */ /*********************************************/ /* HELPER: SetReg, GetReg */ @@ -233,7 +235,7 @@ SiS_DisplayOn(struct SiS_Private *SiS_Pr) /* HELPER: Init Port Addresses */ /*********************************************/ -void +static void SiSUSBRegInit(struct SiS_Private *SiS_Pr, unsigned long BaseAddr) { SiS_Pr->SiS_P3c4 = BaseAddr + 0x14; diff --git a/drivers/usb/misc/sisusbvga/sisusb_init.h b/drivers/usb/misc/sisusbvga/sisusb_init.h index 5b11577835c8d7d6a1fabe345bcd1126c4b63dd1..f05f83268af41df9ccce52a6d99e244d819b4cc1 100644 --- a/drivers/usb/misc/sisusbvga/sisusb_init.h +++ b/drivers/usb/misc/sisusbvga/sisusb_init.h @@ -690,7 +690,7 @@ static const struct SiS_CRT1Table SiSUSB_CRT1Table[] = 0x41}} /* 0x54 */ }; -static struct SiS_VCLKData SiSUSB_VCLKData[] = +static const struct SiS_VCLKData SiSUSB_VCLKData[] = { { 0x1b,0xe1, 25}, /* 0x00 */ { 0x4e,0xe4, 28}, /* 0x01 */ @@ -808,8 +808,8 @@ static struct SiS_VCLKData SiSUSB_VCLKData[] = { 0x2b,0xc2, 35} /* 0x71 768@576@60 */ }; -void SiSUSBRegInit(struct SiS_Private *SiS_Pr, unsigned long BaseAddr); -unsigned short SiSUSB_GetModeID(int HDisplay, int VDisplay, int Depth); +extern struct mutex disconnect_mutex; + int SiSUSBSetMode(struct SiS_Private *SiS_Pr, unsigned short ModeNo); int SiSUSBSetVESAMode(struct SiS_Private *SiS_Pr, unsigned short VModeNo); @@ -826,5 +826,19 @@ extern int sisusb_setidxregor(struct sisusb_usb_data *sisusb, int port, extern int sisusb_setidxregand(struct sisusb_usb_data *sisusb, int port, u8 idx, u8 myand); +void sisusb_delete(struct kref *kref); +int sisusb_writeb(struct sisusb_usb_data *sisusb, u32 adr, u8 data); +int sisusb_readb(struct sisusb_usb_data *sisusb, u32 adr, u8 *data); +int sisusb_copy_memory(struct sisusb_usb_data *sisusb, char *src, + u32 dest, int length, size_t *bytes_written); +int sisusb_reset_text_mode(struct sisusb_usb_data *sisusb, int init); +int sisusbcon_do_font_op(struct sisusb_usb_data *sisusb, int set, int slot, + u8 *arg, int cmapsz, int ch512, int dorecalc, + struct vc_data *c, int fh, int uplock); +void sisusb_set_cursor(struct sisusb_usb_data *sisusb, unsigned int location); +int sisusb_console_init(struct sisusb_usb_data *sisusb, int first, int last); +void sisusb_console_exit(struct sisusb_usb_data *sisusb); +void sisusb_init_concode(void); + #endif diff --git a/drivers/usb/misc/sisusbvga/sisusb_struct.h b/drivers/usb/misc/sisusbvga/sisusb_struct.h index 94edd4726c4249cd18040b4f310c2805153b941d..f325ecb29a61f9e9722063db9601ccb89df4cba2 100644 --- a/drivers/usb/misc/sisusbvga/sisusb_struct.h +++ b/drivers/usb/misc/sisusbvga/sisusb_struct.h @@ -161,7 +161,7 @@ struct SiS_Private const struct SiS_Ext *SiS_EModeIDTable; const struct SiS_Ext2 *SiS_RefIndex; const struct SiS_CRT1Table *SiS_CRT1Table; - struct SiS_VCLKData *SiS_VCLKData; + const struct SiS_VCLKData *SiS_VCLKData; const struct SiS_ModeResInfo *SiS_ModeResInfo; };