bf60x: pm: add pint suspend and resume support
[linux-2.6.git] / arch / arm / mach-omap1 / board-nand.c
blob4d0835327d2038580ce707f57d7aac5b2a2269c6
1 /*
2 * linux/arch/arm/mach-omap1/board-nand.c
4 * Common OMAP1 board NAND code
6 * Copyright (C) 2004, 2012 Texas Instruments, Inc.
7 * Copyright (C) 2002 MontaVista Software, Inc.
8 * Copyright (C) 2001 RidgeRun, Inc.
9 * Author: RidgeRun, Inc.
10 * Greg Lonnon (glonnon@ridgerun.com) or info@ridgerun.com
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License version 2 as
14 * published by the Free Software Foundation.
16 #include <linux/kernel.h>
17 #include <linux/io.h>
18 #include <linux/mtd/mtd.h>
19 #include <linux/mtd/nand.h>
21 #include "common.h"
23 void omap1_nand_cmd_ctl(struct mtd_info *mtd, int cmd, unsigned int ctrl)
25 struct nand_chip *this = mtd->priv;
26 unsigned long mask;
28 if (cmd == NAND_CMD_NONE)
29 return;
31 mask = (ctrl & NAND_CLE) ? 0x02 : 0;
32 if (ctrl & NAND_ALE)
33 mask |= 0x04;
35 writeb(cmd, this->IO_ADDR_W + mask);