summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMasahiro Yamada <yamada.masahiro@socionext.com>2017-03-30 10:15:05 +0200
committerBoris Brezillon <boris.brezillon@free-electrons.com>2017-04-25 14:18:38 +0200
commit477544c62a84d3bacd9f90ba75ffc16c04d78071 (patch)
treee9a1cdeaaa0862bd8d64483b14c0883357766a48 /include
parentmtd: nand: allocate aligned buffers if NAND_OWN_BUFFERS is unset (diff)
downloadlinux-477544c62a84d3bacd9f90ba75ffc16c04d78071.tar.xz
linux-477544c62a84d3bacd9f90ba75ffc16c04d78071.zip
mtd: nand: allow drivers to request minimum alignment for passed buffer
In some cases, nand_do_{read,write}_ops is passed with unaligned ops->datbuf. Drivers using DMA will be unhappy about unaligned buffer. The new struct member, buf_align, represents the minimum alignment the driver require for the buffer. If the buffer passed from the upper MTD layer does not have enough alignment, nand_do_*_ops will use bufpoi. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/mtd/nand.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
index 9e0c93c44bef..8f67b1581683 100644
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
@@ -755,6 +755,7 @@ struct nand_manufacturer_ops {
* setting the read-retry mode. Mostly needed for MLC NAND.
* @ecc: [BOARDSPECIFIC] ECC control structure
* @buffers: buffer structure for read/write
+ * @buf_align: minimum buffer alignment required by a platform
* @hwcontrol: platform-specific hardware control structure
* @erase: [REPLACEABLE] erase function
* @scan_bbt: [REPLACEABLE] function to scan bad block table
@@ -905,6 +906,7 @@ struct nand_chip {
struct nand_ecc_ctrl ecc;
struct nand_buffers *buffers;
+ unsigned long buf_align;
struct nand_hw_control hwcontrol;
uint8_t *bbt;