summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorVojtech Pavlik <vojtech@suse.cz>2004-09-16 19:10:08 +0200
committerVojtech Pavlik <vojtech@suse.cz>2004-09-16 19:10:08 +0200
commita21165ce22bea18419fc20f2b58b392680453ff4 (patch)
treee35a63a15ae5861cd93175f9bee84722c1a86c1e /include
parent5c5b9c24188adf7a37ad51844910f2dea4d0dfab (diff)
parent8718a604d60d615845e9d6bacd7107f795560694 (diff)
Merge suse.cz:/data2/bk/linus into suse.cz:/data2/bk/input
Diffstat (limited to 'include')
-rw-r--r--include/asm-ppc/8253pit.h10
-rw-r--r--include/asm-ppc64/8253pit.h10
-rw-r--r--include/linux/compat_ioctl.h17
-rw-r--r--include/linux/input.h2
-rw-r--r--include/linux/serio.h66
5 files changed, 88 insertions, 17 deletions
diff --git a/include/asm-ppc/8253pit.h b/include/asm-ppc/8253pit.h
new file mode 100644
index 000000000000..285f78488ccb
--- /dev/null
+++ b/include/asm-ppc/8253pit.h
@@ -0,0 +1,10 @@
+/*
+ * 8253/8254 Programmable Interval Timer
+ */
+
+#ifndef _8253PIT_H
+#define _8253PIT_H
+
+#define PIT_TICK_RATE 1193182UL
+
+#endif
diff --git a/include/asm-ppc64/8253pit.h b/include/asm-ppc64/8253pit.h
new file mode 100644
index 000000000000..285f78488ccb
--- /dev/null
+++ b/include/asm-ppc64/8253pit.h
@@ -0,0 +1,10 @@
+/*
+ * 8253/8254 Programmable Interval Timer
+ */
+
+#ifndef _8253PIT_H
+#define _8253PIT_H
+
+#define PIT_TICK_RATE 1193182UL
+
+#endif
diff --git a/include/linux/compat_ioctl.h b/include/linux/compat_ioctl.h
index 253d28dd1e17..77f59742c407 100644
--- a/include/linux/compat_ioctl.h
+++ b/include/linux/compat_ioctl.h
@@ -735,3 +735,20 @@ COMPATIBLE_IOCTL(SIOCSIWRETRY)
COMPATIBLE_IOCTL(SIOCGIWRETRY)
COMPATIBLE_IOCTL(SIOCSIWPOWER)
COMPATIBLE_IOCTL(SIOCGIWPOWER)
+/* hiddev */
+COMPATIBLE_IOCTL(HIDIOCGVERSION)
+COMPATIBLE_IOCTL(HIDIOCAPPLICATION)
+COMPATIBLE_IOCTL(HIDIOCGDEVINFO)
+COMPATIBLE_IOCTL(HIDIOCGSTRING)
+COMPATIBLE_IOCTL(HIDIOCINITREPORT)
+COMPATIBLE_IOCTL(HIDIOCGREPORT)
+COMPATIBLE_IOCTL(HIDIOCSREPORT)
+COMPATIBLE_IOCTL(HIDIOCGREPORTINFO)
+COMPATIBLE_IOCTL(HIDIOCGFIELDINFO)
+COMPATIBLE_IOCTL(HIDIOCGUSAGE)
+COMPATIBLE_IOCTL(HIDIOCSUSAGE)
+COMPATIBLE_IOCTL(HIDIOCGUCODE)
+COMPATIBLE_IOCTL(HIDIOCGFLAG)
+COMPATIBLE_IOCTL(HIDIOCSFLAG)
+COMPATIBLE_IOCTL(HIDIOCGCOLLECTIONINDEX)
+COMPATIBLE_IOCTL(HIDIOCGCOLLECTIONINFO)
diff --git a/include/linux/input.h b/include/linux/input.h
index b7a30bb6412e..43cb25e228d5 100644
--- a/include/linux/input.h
+++ b/include/linux/input.h
@@ -527,6 +527,8 @@ struct input_absinfo {
#define MSC_SERIAL 0x00
#define MSC_PULSELED 0x01
#define MSC_GESTURE 0x02
+#define MSC_RAW 0x03
+#define MSC_SCAN 0x04
#define MSC_MAX 0x07
/*
diff --git a/include/linux/serio.h b/include/linux/serio.h
index be0ccba864c6..f84b362a561f 100644
--- a/include/linux/serio.h
+++ b/include/linux/serio.h
@@ -17,12 +17,17 @@
#ifdef __KERNEL__
#include <linux/list.h>
+#include <linux/spinlock.h>
+#include <linux/device.h>
struct serio {
void *private;
- void *driver;
- char *name;
- char *phys;
+ void *port_data;
+
+ char name[32];
+ char phys[32];
+
+ unsigned int manual_bind;
unsigned short idbus;
unsigned short idvendor;
@@ -32,31 +37,43 @@ struct serio {
unsigned long type;
unsigned long event;
+ spinlock_t lock; /* protects critical sections from port's interrupt handler */
+
int (*write)(struct serio *, unsigned char);
int (*open)(struct serio *);
void (*close)(struct serio *);
- struct serio_dev *dev;
+ struct serio *parent, *child;
+
+ struct serio_driver *drv; /* accessed from interrupt, must be protected by serio->lock */
+
+ struct device dev;
struct list_head node;
};
+#define to_serio_port(d) container_of(d, struct serio, dev)
-struct serio_dev {
+struct serio_driver {
void *private;
- char *name;
+ char *description;
+
+ unsigned int manual_bind;
void (*write_wakeup)(struct serio *);
irqreturn_t (*interrupt)(struct serio *, unsigned char,
unsigned int, struct pt_regs *);
- void (*connect)(struct serio *, struct serio_dev *dev);
+ void (*connect)(struct serio *, struct serio_driver *drv);
int (*reconnect)(struct serio *);
void (*disconnect)(struct serio *);
void (*cleanup)(struct serio *);
+ struct device_driver driver;
+
struct list_head node;
};
+#define to_serio_driver(d) container_of(d, struct serio_driver, driver)
-int serio_open(struct serio *serio, struct serio_dev *dev);
+int serio_open(struct serio *serio, struct serio_driver *drv);
void serio_close(struct serio *serio);
void serio_rescan(struct serio *serio);
void serio_reconnect(struct serio *serio);
@@ -64,12 +81,11 @@ irqreturn_t serio_interrupt(struct serio *serio, unsigned char data, unsigned in
void serio_register_port(struct serio *serio);
void serio_register_port_delayed(struct serio *serio);
-void __serio_register_port(struct serio *serio);
void serio_unregister_port(struct serio *serio);
void serio_unregister_port_delayed(struct serio *serio);
-void __serio_unregister_port(struct serio *serio);
-void serio_register_device(struct serio_dev *dev);
-void serio_unregister_device(struct serio_dev *dev);
+
+void serio_register_driver(struct serio_driver *drv);
+void serio_unregister_driver(struct serio_driver *drv);
static __inline__ int serio_write(struct serio *serio, unsigned char data)
{
@@ -79,18 +95,34 @@ static __inline__ int serio_write(struct serio *serio, unsigned char data)
return -1;
}
-static __inline__ void serio_dev_write_wakeup(struct serio *serio)
+static __inline__ void serio_drv_write_wakeup(struct serio *serio)
{
- if (serio->dev && serio->dev->write_wakeup)
- serio->dev->write_wakeup(serio);
+ if (serio->drv && serio->drv->write_wakeup)
+ serio->drv->write_wakeup(serio);
}
static __inline__ void serio_cleanup(struct serio *serio)
{
- if (serio->dev && serio->dev->cleanup)
- serio->dev->cleanup(serio);
+ if (serio->drv && serio->drv->cleanup)
+ serio->drv->cleanup(serio);
+}
+
+
+/*
+ * Use the following fucntions to protect critical sections in
+ * driver code from port's interrupt handler
+ */
+static __inline__ void serio_pause_rx(struct serio *serio)
+{
+ spin_lock_irq(&serio->lock);
}
+static __inline__ void serio_continue_rx(struct serio *serio)
+{
+ spin_unlock_irq(&serio->lock);
+}
+
+
#endif
/*