Those who are subscribed to the cvs list will now know I've posted an update
to the Puru Puru (rumble) Pack driver - the change does not affect
functionality in any way, but (in theory) should make for better use of the
DC's resources.
A unified patch is below....
===================================================================
RCS file: /cvsroot/linuxdc/linux-sh-dc/drivers/char/joystick/purupuru.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- linuxdc/linux-sh-dc/drivers/char/joystick/purupuru.c 2002/02/21 01:48:06
1.1
+++ linuxdc/linux-sh-dc/drivers/char/joystick/purupuru.c 2002/02/22 01:26:23
1.2
@@ -32,6 +32,7 @@
#include <asm/uaccess.h>
#include <linux/mm.h>
#include <asm/atomic.h>
+#include <linux/interrupt.h>
#define PURU_MINOR_BASE 64
#define PPP_VERSION 1
@@ -333,13 +334,9 @@
return -EINVAL;
}
-void dc_purupuru_wake(struct maple_driver_data *data)
+/* vblank interrupt handling */
+void switchoff_puru(unsigned long x)
{
- if (last_jiffies == -1) {
- last_jiffies = jiffies;
- return;
- }
-
int gap;
if (time_before(jiffies, last_jiffies)) {
gap =
@@ -367,6 +364,20 @@
return;
}
+DECLARE_TASKLET(switchoff_tasklet, switchoff_puru, (unsigned long) 0);
+
+void dc_purupuru_wake(struct maple_driver_data *data)
+{
+ if (last_jiffies == -1) {
+ last_jiffies = jiffies;
+ return;
+ }
+
+ tasklet_schedule(&switchoff_tasklet);
+
+
+}
+
/*
* Link the maple, input and fops
@@ -409,6 +420,7 @@
printk(KERN_INFO "purupuru.c: adding Puru Puru Pack input%d\n",
dev->number);
+ tasklet_enable(&switchoff_tasklet);
handler->minor = PURU_MINOR_BASE + dev->number;
return handle;
@@ -435,6 +447,7 @@
maple_register_driver(&dc_purupuru_driver);
printk("Puru Puru Pack driver for Dreamcast Linux version 0.1\n");
+ tasklet_disable(&switchoff_tasklet);
return 0;
}
|