X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fmtd%2Fnand%2Fedb7312.c;h=ba67bbec20d3a4fbab3ac9733d05ee7cc3f61229;hb=b297d520b9af536d5580ac505dd316be4cf5560c;hp=516c0e5e564cb2b03a8a02a73e0c58a90798ced8;hpb=dbe1ab9514c231c9b062140a107d9dea0eabefcc;p=linux-2.6 diff --git a/drivers/mtd/nand/edb7312.c b/drivers/mtd/nand/edb7312.c index 516c0e5e56..ba67bbec20 100644 --- a/drivers/mtd/nand/edb7312.c +++ b/drivers/mtd/nand/edb7312.c @@ -74,7 +74,7 @@ static struct mtd_partition partition_info[] = { /* * hardware specific access to control-lines * - * NAND_NCE: bit 0 -> bit 7 + * NAND_NCE: bit 0 -> bit 6 (bit 7 = 1) * NAND_CLE: bit 1 -> bit 4 * NAND_ALE: bit 2 -> bit 5 */ @@ -83,12 +83,12 @@ static void ep7312_hwcontrol(struct mtd_info *mtd, int cmd, unsigned int ctrl) struct nand_chip *chip = mtd->priv; if (ctrl & NAND_CTRL_CHANGE) { - unsigned char bits; + unsigned char bits = 0x80; - bits = (ctrl & (NAND_CLE | NAND_ALE)) << 3; - bits = (ctrl & NAND_NCE) << 7; + bits |= (ctrl & (NAND_CLE | NAND_ALE)) << 3; + bits |= (ctrl & NAND_NCE) ? 0x00 : 0x40; - clps_writeb((clps_readb(ep7312_pxdr) & 0xB0) | 0x10, + clps_writeb((clps_readb(ep7312_pxdr) & 0xF0) | bits, ep7312_pxdr); } if (cmd != NAND_CMD_NONE) @@ -125,7 +125,7 @@ static int __init ep7312_init(void) return -ENOMEM; } - /* map physical adress */ + /* map physical address */ ep7312_fio_base = ioremap(ep7312_fio_pbase, SZ_1K); if (!ep7312_fio_base) { printk("ioremap EDB7312 NAND flash failed\n"); @@ -198,6 +198,9 @@ static void __exit ep7312_cleanup(void) /* Release resources, unregister device */ nand_release(ap7312_mtd); + /* Release io resource */ + iounmap(this->IO_ADDR_R); + /* Free the MTD device structure */ kfree(ep7312_mtd); }