Skip to contentSkip to conversation

OneNAND: interrupt based wait support

PATCH In review 박경민 2 participants 2 messages Nov 3, 2006

Subsystems (3)
lore
Share & tools
lore

박경민

author maintainer
#0 lore raw

PATCH 1/1 OneNAND: interrupt based wait support

MTD: OneNAND: interrupt based wait support

We can use the two methods to wait.
1. polling: read interrupt status register
2. interrupt: use kernel ineterrupt mechanism

To use interrupt method, you first connect onenand interrupt pin to your platform and configure interrupt properly

--

drivers/mtd/onenand/generic.c +1 -0
index af06a80..cdf80c6 100644
@@ -63,6 +63,7 @@ static int __devinit generic_onenand_pro
 	}
 
 	info->onenand.mmcontrol = pdata->mmcontrol;
+	info->onenand.irq = platform_get_irq(pdev, 0);
 
 	info->mtd.name = pdev->dev.bus_id;
 	info->mtd.priv = &info->onenand;
drivers/mtd/onenand/onenand_base.c +107 -2

133 lines not on this page · raw message

include/linux/mtd/onenand.h +4 -0
index 6f045b5..df963f1 100644
@@ -13,6 +13,7 @@ #ifndef __LINUX_MTD_ONENAND_H
 #define __LINUX_MTD_ONENAND_H
 
 #include <linux/spinlock.h>
+#include <linux/completion.h>
 #include <linux/mtd/onenand_regs.h>
 #include <linux/mtd/bbm.h>
 
@@ -120,6 +121,9 @@ struct onenand_chip {
 	int (*block_markbad)(struct mtd_info *mtd, loff_t ofs);
 	int (*scan_bbt)(struct mtd_info *mtd);
 
+	struct completion	complete;
+	int			irq;
+
 	spinlock_t		chip_lock;
 	wait_queue_head_t	wq;
 	onenand_state_t		state;
#1 lore raw
Quoted 7 lines · 박경민

MTD: OneNAND: interrupt based wait support

We can use the two methods to wait.
1. polling: read interrupt status register
2. interrupt: use kernel ineterrupt mechanism

To use interrupt method, you first connect onenand interrupt pin to your platform and configure interrupt properly

Just curious, but do you have an example platform you've tested this on? It would be good to get the platform code for that as an example if possible.

josh