diff options
author | Philippe Langlais <philippe.langlais@stericsson.com> | 2012-04-06 11:51:14 +0200 |
---|---|---|
committer | Philippe Langlais <philippe.langlais@stericsson.com> | 2012-04-06 11:51:14 +0200 |
commit | 3b5766214a67f24913d4e046fc30eed7ec0ddc35 (patch) | |
tree | 65388dec2a13f78ede772136281607ae6c8ca9b7 /fs/yaffs2/yaffs_mtdif.c | |
parent | 70526554173aa46c8b13a59992b6fbc555fd4ee0 (diff) | |
parent | 78be8d8ebeafc24368e897c7fc78c301c1caf3c8 (diff) |
Merge remote-tracking branch 'jstultz/linaro-android-3.3' into stable-android-ux500-3.3-1
Conflicts:
arch/arm/common/Makefile
drivers/gpu/Makefile
drivers/misc/Kconfig
drivers/misc/Makefile
drivers/mmc/card/block.c
drivers/mmc/core/core.c
drivers/video/Kconfig
include/net/bluetooth/hci.h
include/net/bluetooth/hci_core.h
include/net/bluetooth/sco.h
kernel/printk.c
net/bluetooth/hci_conn.c
net/bluetooth/hci_event.c
net/bluetooth/l2cap_core.c
net/bluetooth/mgmt.c
net/bluetooth/sco.c
Diffstat (limited to 'fs/yaffs2/yaffs_mtdif.c')
-rw-r--r-- | fs/yaffs2/yaffs_mtdif.c | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/fs/yaffs2/yaffs_mtdif.c b/fs/yaffs2/yaffs_mtdif.c new file mode 100644 index 00000000000..7cf53b3d91b --- /dev/null +++ b/fs/yaffs2/yaffs_mtdif.c @@ -0,0 +1,54 @@ +/* + * YAFFS: Yet Another Flash File System. A NAND-flash specific file system. + * + * Copyright (C) 2002-2010 Aleph One Ltd. + * for Toby Churchill Ltd and Brightstar Engineering + * + * Created by Charles Manning <charles@aleph1.co.uk> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +#include "yportenv.h" + +#include "yaffs_mtdif.h" + +#include "linux/mtd/mtd.h" +#include "linux/types.h" +#include "linux/time.h" +#include "linux/mtd/nand.h" + +#include "yaffs_linux.h" + +int nandmtd_erase_block(struct yaffs_dev *dev, int block_no) +{ + struct mtd_info *mtd = yaffs_dev_to_mtd(dev); + u32 addr = + ((loff_t) block_no) * dev->param.total_bytes_per_chunk + * dev->param.chunks_per_block; + struct erase_info ei; + + int retval = 0; + + ei.mtd = mtd; + ei.addr = addr; + ei.len = dev->param.total_bytes_per_chunk * dev->param.chunks_per_block; + ei.time = 1000; + ei.retries = 2; + ei.callback = NULL; + ei.priv = (u_long) dev; + + retval = mtd->erase(mtd, &ei); + + if (retval == 0) + return YAFFS_OK; + else + return YAFFS_FAIL; +} + +int nandmtd_initialise(struct yaffs_dev *dev) +{ + return YAFFS_OK; +} |