Source
/*
* Copyright (C) 2005-2007 Jiri Slaby <jirislaby@gmail.com>
*
* 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 need a userspace library to cooperate with this driver. It (and other
* info) may be obtained here:
* http://www.fi.muni.cz/~xslaby/phantom.html
* or alternatively, you might use OpenHaptics provided by Sensable.
*/
/* irq control in caddr space */
static DEFINE_MUTEX(phantom_mutex);
static struct class *phantom_class;
static int phantom_major;
struct phantom_device {
unsigned int opened;
void __iomem *caddr;
u32 __iomem *iaddr;
u32 __iomem *oaddr;
unsigned long status;
atomic_t counter;
wait_queue_head_t wait;
struct cdev cdev;
struct mutex open_lock;
spinlock_t regs_lock;
/* used in NOT_OH mode */
struct phm_regs oregs;
u32 ctl_reg;
};