这个是网上一个大侠写的W83977驱动程序。我不明白其中一些为什么那样也,看手册头都看晕了都没办法。
//KBD port--------------------------------------------
w977_select_device(W977_DEVICE_KBC, efbase[1]); //select logic device
w977_write_reg(0x60, 0x0, efbase[1]); //address 这里把0X60和0X0写到0X3F0和0X3F1是什么意思,手册上不是这样的啊
{CR60, CR 61 (Default 0x00, 0x60 if PENKBC= 1 during POR, default 0x00 otherwise)
These two registers select the first KBC I/O base address [0x100:0xFFF] on 1 byte boundary.
CR62, CR 63 (Default 0x00, 0x64 if PENKBC= 1 during POR, default 0x00 otherwise)
These two registers select the second KBC I/O base address [0x100:0xFFF] on 1 byte boundary.这一段是手册上写的}
w977_write_reg(0x61, 0x60, efbase[1]); //address--0x060
w977_write_reg(0x62, 0x0, efbase[1]); //address
w977_write_reg(0x63, 0x64, efbase[1]); //address--0x064
蓝色的代码不清楚为什么要这样写,这几个函数定义在下面贴出来
//set irq number
w977_write_reg(0x70, 0x05, efbase[1]); //irq for keyboard irq5--active H
w977_write_reg(0x72, 0x04, efbase[1]); //irq for mouse irq4--active H