#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/parport.h>
#include <linux/interrupt.h>
#include <linux/platform_device.h>
#define AX_SPR_BUSY (1<<7)
#define AX_SPR_ACK (1<<6)
#define AX_SPR_SLCT (1<<4)
#define AX_SPR_ERR (1<<3)
#define AX_CPR_nDOE (1<<5)
#define AX_CPR_SLCTIN (1<<3)
#define AX_CPR_nINIT (1<<2)
#define AX_CPR_ATFD (1<<1)
#define AX_CPR_STRB (1<<0)
struct parport_state suspend;
unsigned char irq_enabled;
static inline struct ax_drvdata *pp_to_drv(struct parport *p)
parport_ax88796_read_data(struct parport *p)
struct ax_drvdata *dd = pp_to_drv(p);
return readb(dd->spp_data);
parport_ax88796_write_data(struct parport *p, unsigned char data)
struct ax_drvdata *dd = pp_to_drv(p);
writeb(data, dd->spp_data);
parport_ax88796_read_control(struct parport *p)
struct ax_drvdata *dd = pp_to_drv(p);
unsigned int cpr = readb(dd->spp_cpr);
if (!(cpr & AX_CPR_STRB))
ret |= PARPORT_CONTROL_STROBE;
if (!(cpr & AX_CPR_ATFD))
ret |= PARPORT_CONTROL_AUTOFD;
ret |= PARPORT_CONTROL_INIT;
if (!(cpr & AX_CPR_SLCTIN))
ret |= PARPORT_CONTROL_SELECT;