[PATCH 01/03] uio: Add enable_irq() callback

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Magnus Damm
Date: Tuesday, May 20, 2008 - 3:51 am

Add enable_irq() callback to struct uio_info. This callback is needed by
the uio_platform driver so interrupts can be enabled before blocking.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
---

 drivers/uio/uio.c          |    6 ++++++
 include/linux/uio_driver.h |    1 +
 2 files changed, 7 insertions(+)

--- 0001/drivers/uio/uio.c
+++ work/drivers/uio/uio.c	2008-05-19 14:52:08.000000000 +0900
@@ -365,6 +365,9 @@ static unsigned int uio_poll(struct file
 	if (idev->info->irq == UIO_IRQ_NONE)
 		return -EIO;
 
+	if (idev->info->enable_irq)
+		idev->info->enable_irq(idev->info);
+
 	poll_wait(filep, &idev->wait, wait);
 	if (listener->event_count != atomic_read(&idev->event))
 		return POLLIN | POLLRDNORM;
@@ -391,6 +394,9 @@ static ssize_t uio_read(struct file *fil
 	do {
 		set_current_state(TASK_INTERRUPTIBLE);
 
+		if (idev->info->enable_irq)
+			idev->info->enable_irq(idev->info);
+
 		event_count = atomic_read(&idev->event);
 		if (event_count != listener->event_count) {
 			if (copy_to_user(buf, &event_count, count))
--- 0001/include/linux/uio_driver.h
+++ work/include/linux/uio_driver.h	2008-05-19 14:52:08.000000000 +0900
@@ -64,6 +64,7 @@ struct uio_info {
 	void			*priv;
 	irqreturn_t (*handler)(int irq, struct uio_info *dev_info);
 	int (*mmap)(struct uio_info *info, struct vm_area_struct *vma);
+	void (*enable_irq)(struct uio_info *info);
 	int (*open)(struct uio_info *info, struct inode *inode);
 	int (*release)(struct uio_info *info, struct inode *inode);
 };
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 00/03][RFC] Reusable UIO Platform Driver, Magnus Damm, (Tue May 20, 3:51 am)
[PATCH 01/03] uio: Add enable_irq() callback, Magnus Damm, (Tue May 20, 3:51 am)
[PATCH 02/03] uio: Add uio_platform driver, Magnus Damm, (Tue May 20, 3:51 am)
Re: [PATCH 00/03][RFC] Reusable UIO Platform Driver, Hans J. Koch, (Tue May 20, 2:07 pm)
Re: [PATCH 00/03][RFC] Reusable UIO Platform Driver, Magnus Damm, (Tue May 20, 8:31 pm)
Re: [PATCH 00/03][RFC] Reusable UIO Platform Driver, Paul Mundt, (Wed May 21, 12:49 am)
Re: [PATCH 00/03][RFC] Reusable UIO Platform Driver, Magnus Damm, (Wed May 21, 1:09 am)
Re: [PATCH 00/03][RFC] Reusable UIO Platform Driver, Magnus Damm, (Wed May 21, 1:22 am)
Re: [PATCH 00/03][RFC] Reusable UIO Platform Driver, Magnus Damm, (Wed May 21, 3:50 am)
Re: [PATCH 00/03][RFC] Reusable UIO Platform Driver, Magnus Damm, (Wed May 21, 4:56 am)
Re: [PATCH 01/03] uio: Add enable_irq() callback, Magnus Damm, (Wed May 21, 4:58 am)
Re: [PATCH 01/03] uio: Add enable_irq() callback, Hans J. Koch, (Thu May 22, 1:18 pm)
Re: [PATCH 01/03] uio: Add enable_irq() callback, Magnus Damm, (Thu May 22, 6:24 pm)
Re: [PATCH 01/03] uio: Add enable_irq() callback, Hans J. Koch, (Fri May 23, 1:43 am)