[linux-audio-dev] Re: tiny patch for RTC async I/O in 2.3.41

New Message Reply About this list Date view Thread view Subject view Author view Other groups

Subject: [linux-audio-dev] Re: tiny patch for RTC async I/O in 2.3.41
From: Paul Barton-Davis (pbd_AT_Op.Net)
Date: ma tammi  31 2000 - 13:19:19 EST


>Can you add "SMP cleanup" to the changelog, as version 1.09c credited to
>me?
>
>And, can you kill the 2.2.x compatibility code. RTC is sufficiently
>different that it will not work on 2.2.x without more backporting
>anyway.

OK, here's a new patch, as requested. If you want a test program for
the async capabilities, let me know. I have one.

--p

--- linux/drivers/char/rtc.c.orig Tue Jan 25 17:13:47 2000
+++ linux/drivers/char/rtc.c Mon Jan 31 13:16:44 2000
@@ -34,10 +34,11 @@
  * 1.09 Nikita Schmidt: epoch support and some Alpha cleanup.
  * 1.09a Pete Zaitcev: Sun SPARC
  * 1.09b Jeff Garzik: Modularize, init cleanup
- *
+ * 1.09c Jeff Garzik: SMP cleanup
+ * 1.10 Paul Barton-Davis: add support for async I/O
  */
 
-#define RTC_VERSION "1.09b"
+#define RTC_VERSION "1.10"
 
 #define RTC_IRQ 8 /* Can't see this changing soon. */
 #define RTC_IO_EXTENT 0x10 /* Only really two ports, but... */
@@ -80,6 +81,8 @@
  * ioctls.
  */
 
+static struct fasync_struct *rtc_async_queue;
+
 static DECLARE_WAIT_QUEUE_HEAD(rtc_wait);
 
 static spinlock_t rtc_lock = SPIN_LOCK_UNLOCKED;
@@ -153,6 +156,9 @@
 
         wake_up_interruptible(&rtc_wait);
 
+ if (rtc_async_queue)
+ kill_fasync (rtc_async_queue, SIGIO, POLL_IN);
+
         if (atomic_read(&rtc_status) & RTC_TIMER_ON)
                 mod_timer(&rtc_irq_timer, jiffies + HZ/rtc_freq + 2*HZ/100);
 }
@@ -480,6 +486,12 @@
         return 0;
 }
 
+static int rtc_fasync (int fd, struct file *filp, int on)
+
+{
+ return fasync_helper (fd, filp, on, &rtc_async_queue);
+}
+
 static int rtc_release(struct inode *inode, struct file *file)
 {
         /*
@@ -504,6 +516,10 @@
                 del_timer(&rtc_irq_timer);
         }
 
+ if (file->f_flags & FASYNC) {
+ rtc_fasync (-1, file, 0);
+ }
+
         MOD_DEC_USE_COUNT;
 
         spin_lock_irqsave (&rtc_lock, flags);
@@ -542,7 +558,9 @@
         NULL, /* No mmap */
         rtc_open,
         NULL, /* flush */
- rtc_release
+ rtc_release,
+ NULL, /* fsync */
+ rtc_fasync
 };
 
 static struct miscdevice rtc_dev=


New Message Reply About this list Date view Thread view Subject view Author view Other groups

This archive was generated by hypermail 2b28 : pe maalis 10 2000 - 07:23:27 EST