diff options
author | H Hartley Sweeten <hsweeten@visionengravers.com> | 2009-05-12 16:46:59 -0400 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2009-06-05 13:11:55 -0400 |
commit | f36e20c01ad0104688f2eaebdf2213e749929c97 (patch) | |
tree | 40e82b3977e792464e7ab9b1f0cf402feec309e9 /include/linux | |
parent | bf95efd41b1a760128eb25402791b0a4941eb655 (diff) |
mtd: plat_nand: allow platform to set partitions
Add optional callback to allow platform to initialize partitions.
Static partitions on a nand device could vary depending on the size of the
device. This patch allows an optional platform callback to be used to
setup this partition information at runtime.
Scan order is:
1) chip.part_probe_types
2) chip.set_parts
3) chip.partitions
4) full mtd device (fallback for no partitions)
Some of the existing nand drivers could possibly be replaced by the
plat_nand driver by using this patch. These include autcpu12.c and
ts7250.c drivers.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/mtd/nand.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h index 7f2d69356554..4030ebada49e 100644 --- a/include/linux/mtd/nand.h +++ b/include/linux/mtd/nand.h | |||
@@ -563,6 +563,7 @@ extern int nand_do_read(struct mtd_info *mtd, loff_t from, size_t len, | |||
563 | * @options: Option flags, e.g. 16bit buswidth | 563 | * @options: Option flags, e.g. 16bit buswidth |
564 | * @ecclayout: ecc layout info structure | 564 | * @ecclayout: ecc layout info structure |
565 | * @part_probe_types: NULL-terminated array of probe types | 565 | * @part_probe_types: NULL-terminated array of probe types |
566 | * @set_parts: platform specific function to set partitions | ||
566 | * @priv: hardware controller specific settings | 567 | * @priv: hardware controller specific settings |
567 | */ | 568 | */ |
568 | struct platform_nand_chip { | 569 | struct platform_nand_chip { |
@@ -574,6 +575,8 @@ struct platform_nand_chip { | |||
574 | int chip_delay; | 575 | int chip_delay; |
575 | unsigned int options; | 576 | unsigned int options; |
576 | const char **part_probe_types; | 577 | const char **part_probe_types; |
578 | void (*set_parts)(uint64_t size, | ||
579 | struct platform_nand_chip *chip); | ||
577 | void *priv; | 580 | void *priv; |
578 | }; | 581 | }; |
579 | 582 | ||