/*
- Xilinx XPS PS/2 device driver
- © 2005 MontaVista Software, Inc.
- © 2008 Xilinx, Inc.
- This program is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License as published by the
- Free Software Foundation; either version 2 of the License, or (at your
- option) any later version.
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation, Inc.,
- 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <linux/module.h>
#include <linux/serio.h>
#include <linux/interrupt.h>
#include <linux/errno.h>
#include <linux/slab.h>
#include <linux/list.h>
#include <linux/io.h>
#include <linux/of_address.h>
#include <linux/of_device.h>
#include <linux/of_irq.h>
#include <linux/of_platform.h>
#define DRIVER_NAME “xilinx_ps2”
/* Register offsets for the xps2 device /
#define XPS2_SRST_OFFSET 0x00000000 / Software Reset register /
#define XPS2_STATUS_OFFSET 0x00000004 / Status register /
#define XPS2_RX_DATA_OFFSET 0x00000008 / Receive Data register /
#define XPS2_TX_DATA_OFFSET 0x0000000C / Transmit Data register /
#define XPS2_GIER_OFFSET 0x0000002C / Global Interrupt Enable reg /
#define XPS2_IPISR_OFFSET 0x00000030 / Interrupt Status register /
#define XPS2_IPIER_OFFSET 0x00000038 / Interrupt Enable register */
/* Reset Register Bit Definitions /
#define XPS2_SRST_RESET 0x0000000A / Software Reset */
/* Status Register Bit Positions /
#define XPS2_STATUS_RX_FULL 0x00000001 / Receive Full /
#define XPS2_STATUS_TX_FULL 0x00000002 / Transmit Full */
/*
- Bit definitions for ISR/IER registers. Both the registers have the same bit
- definitions and are only defined once.
/
#define XPS2_IPIXR_WDT_TOUT 0x00000001 / Watchdog Timeout Interrupt /
#define XPS2_IPIXR_TX_NOACK 0x00000002 / Transmit No ACK Interrupt /
#define XPS2_IPIXR_TX_ACK 0x00000004 / Transmit ACK (Data) Interrupt /
#define XPS2_IPIXR_RX_OVF 0x00000008 / Receive Overflow Interrupt /
#define XPS2_IPIXR_RX_ERR 0x00000010 / Receive Error Interrupt /
#define XPS2_IPIXR_RX_FULL 0x00000020 / Receive Data Interrupt */
/* Mask for all the Transmit Interrupts */
#define XPS2_IPIXR_TX_ALL (XPS2_IPIXR_TX_NOACK | XPS2_IPIXR_TX_ACK)
/* Mask for all the Receive Interrupts */
#define XPS2_IPIX