OneNAND: interrupt based wait support
Subsystems (3)
박경민
maintainerPATCH 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
@@ -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
@@ -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;
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 mechanismTo 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