[patch 2.6.19-rc6] rtc framework handles periodic irqs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The RTC framework has an irq_set_freq() method that should be used to
manage the periodic IRQ frequency, but the current ioctl logic doesn't
know how to do that.  This patch teaches it how.

This means that drivers implementing irq_set_freq() will automatically
support RTC_IRQP_{READ,SET} ioctls; that logic doesn't need duplication
within the driver.

Signed-off-by: David Brownell <[email protected]>

Index: g26/drivers/rtc/rtc-dev.c
===================================================================
--- g26.orig/drivers/rtc/rtc-dev.c	2006-11-12 12:24:31.000000000 -0800
+++ g26/drivers/rtc/rtc-dev.c	2006-11-12 15:37:17.000000000 -0800
@@ -214,7 +214,7 @@ static int rtc_dev_ioctl(struct inode *i
 	struct rtc_wkalrm alarm;
 	void __user *uarg = (void __user *) arg;
 
-	/* check that the calles has appropriate permissions
+	/* check that the calling task has appropriate permissions
 	 * for certain ioctls. doing this check here is useful
 	 * to avoid duplicate code in each driver.
 	 */
@@ -299,6 +299,17 @@ static int rtc_dev_ioctl(struct inode *i
 
 		err = rtc_set_time(class_dev, &tm);
 		break;
+
+	case RTC_IRQP_READ:
+		if (ops->irq_set_freq)
+			err = put_user(rtc->irq_freq, (unsigned long *) arg);
+		break;
+
+	case RTC_IRQP_SET:
+		if (ops->irq_set_freq)
+			err = rtc_irq_set_freq(class_dev, rtc->irq_task, arg);
+		break;
+
 #if 0
 	case RTC_EPOCH_SET:
 #ifndef rtc_epoch
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux