#ifndef _GPIO_H #define _GPIO_H #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #ifndef INIT_BY_KMF #define DBG_MSG1(id, fmt,args...) printk(KERN_EMERG " " fmt, ## args) #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35) #include #else #include //Change the location of sisdev.h to sis516 #endif #else #include #endif #include "gpio_pin_define.h" #define QB_start 48 #define QB_end 63 #define MMIOBASE_Peripheral 0xbe0f0000 #define IRQ_Peripheral 44 #define SIS326_GPIO_MAXNUM 64 #define S2IC_GPIO_MAXNUM GPIO_NOT_USE #define GPO_IVDD_SEL_REG 0xbe000030 //[29] output High set 1; output low set 0 #define GPO_VBUS_EN_REG 0xbe0000e5 //[7] output high set 1, low set 0 #define IRQ_VGAWakeUp 19 #define IRQ_PWRBTN 20 #define GPIO_For516VIP_FREQ 0 // temporary for sis516VIP #define GPIO_ForRebootTest 0 // temporary for Reboot test #define QuickBuildGPIO_Enable 1 //enable Customer QuickBuild Control GPIO /******************************************************************************* *******************************************************************************/ #define STATUS_SUCCESS 0 #define STATUS_DEVICE_ID_ERROR 1 #define STATUS_DATA_ERROR 2 #define STATUS_SYSTEM_ERROR 3 //#define TRIGGER_MODE_Rising 1 //#define TRIGGER_MODE_Falling 2 //#define TRIGGER_MODE_RisingFailling 3 #define GPIO_LOWLEVEL_TRIGGER 0 #define GPIO_HIGHLEVEL_TRIGGER 1 #define GPIO_FALLINGEDGE_TRIGGER 2 #define GPIO_RISINGEDGE_TRIGGER 3 /* SiS 326: New Power Button Setting */ #define PWRBTN_MMIO 0xbe0f0400 #define PowerOff_StatusBit (1<<1) #define PWRBTN_En_Offset 0x4 #define PowerOff_EnableBit (1<<1) /* SiS 326: PWN_LED Setting */ #define PWN_LED_MMIO 0xbe0f0100 #define LED_GREEN_REG1 0x0 #define LED_GREEN_REG2 0x4 #define LED_RED_REG1 0x8 #define LED_RED_REG2 0xc typedef struct _GPIO_CALLBACK { void (*function)(void); }GPIO_CALLBACK; typedef struct _TIMER_CALLBACK { void (*function)(void); UINT8 minisecond; }TIMER_CALLBACK; typedef struct _SYSLEMLED { UINT8 LED_EntryOFF; UINT8 LED_PowerSaveOn; UINT8 LED_OFF; UINT8 LED_PowerSaveOff; UINT8 LED_EntryOn; UINT8 LED_DPMSON; UINT8 LED_LogoOn; UINT8 LED_07; UINT8 LED_EntryLinux; UINT8 LED_09; UINT8 LED_AllReady; UINT8 LED_0B; UINT8 LED_0C; UINT8 LED_0D; UINT8 LED_0E; }SYSTEMLED,*PSYSTEMLED; typedef struct _GPIO_DEV_ { UINT8* mmio_vbase; INT32 irq; struct cdev cdev; GPIO_CALLBACK callbackfuntable[S2IC_GPIO_MAXNUM]; TIMER_CALLBACK timer0callbackfuntable; TIMER_CALLBACK timer1callbackfuntable; }GPIO_DEV,*PGPIO_DEV; #define RM_GPIO_SEL_REG 0xbe000210 #define R_EN_2ND_UARTA (1<<13) #define R_EN_1ST_UARTB (1<<14) #define LVDS_GPIO_SEL_REG 0xbe000200 #define LVDS_GPIO_SEL_REG1 0xbe00025c #define GPIO_HDMI_SEL_REG 0xbe000034 #if GPIO_For516VIP_FREQ void Start_516VSync(void); UINT16 GPIO_Get_516VSyncFreq(void); #endif extern INT32 GetCustomerData(INT8 *pcTableName, INT8 **tablestart, UINT32 *tablesize); extern void GPIOWriteFun(UINT8 index, UINT8 value); #if (CONFIG_CHIPID != 0x330) void EMI_DRAM_SSC(UINT8 level, void *ssc_value_188, void *ssc_value_1a8, void *ssc_value_Magic_Number); #else void EMI_DRAM_SSC(UINT8 level); #endif #endif // end of #ifndef _GPIO_H