ps2功能 gscps2芯片 linux 驱动程序
/*
- drivers/input/serio/gscps2.c
- Copyright © 2004-2006 Helge Deller deller@gmx.de
- Copyright © 2002 Laurent Canet canetl@esiee.fr
- Copyright © 2002 Thibaut Varene varenet@parisc-linux.org
- Pieces of code based on linux-2.4’s hp_mouse.c & hp_keyb.c
- Copyright
- HP GSC PS/2 port driver, found in PA/RISC Workstations
- This file is subject to the terms and conditions of the GNU General Public
- License. See the file “COPYING” in the main directory of this archive
- for more details.
- TODO:
-
- Dino testing (did HP ever shipped a machine on which this port
-
was usable/enabled ?)
*/
#include <linux/init.h>
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/serio.h>
#include <linux/input.h>
#include <linux/interrupt.h>
#include <linux/spinlock.h>
#include <linux/delay.h>
#include <linux/ioport.h>
#include <asm/irq.h>
#include <asm/io.h>
#include <asm/parisc-device.h>
MODULE_AUTHOR("");
MODULE_DESCRIPTION(“HP GSC PS2 port driver”);
MODULE_LICENSE(“GPL”);
#define PFX "gscps2.c: "
/*
- Driver constants
*/
/* various constants */
#define ENABLE 1
#define DISABLE 0
#define GSC_DINO_OFFSET 0x0800 /* offset for DINO controller versus LASI one */
/* PS/2 IO port offsets /
#define GSC_ID 0x00 / device ID offset (see: GSC_ID_XXX) /
#define GSC_RESET 0x00 / reset port offset /
#define GSC_RCVDATA 0x04 / receive port offset /
#define GSC_XMTDATA 0x04 / transmit port offset /
#define GSC_CONTROL 0x08 / see: Control register bits /
#define GSC_STATUS 0x0C / see: Status register bits */
/* Control register bits /
#define GSC_CTRL_ENBL 0x01 / enable interface /
#define GSC_CTRL_LPBXR 0x02 / loopback operation /
#define GSC_CTRL_DIAG 0x20 / directly control clock/data line /
#define GSC_CTRL_DATDIR 0x40 / data line direct control /
#define GSC_CTRL_CLKDIR 0x80 / clock line direct control */
/* Status register bits /
#define GSC_STAT_RBNE 0x01 / Receive Buffer Not Empty /
#define GSC_STAT_TBNE 0x02 / Transmit Buffer Not Empty /
#define GSC_STAT_
原文地址:https://blog.csdn.net/baidu_37552881/article/details/144776905
免责声明:本站文章内容转载自网络资源,如本站内容侵犯了原著者的合法权益,可联系本站删除。更多内容请关注自学内容网(zxcms.com)!