diff options
-rw-r--r-- | include/linux/mtd/nand.h | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h index b8792be3c4e0..05c6ecc07036 100644 --- a/include/linux/mtd/nand.h +++ b/include/linux/mtd/nand.h | |||
@@ -510,4 +510,51 @@ extern int nand_do_read_ecc (struct mtd_info *mtd, loff_t from, size_t len, | |||
510 | #define NAND_SMALL_BADBLOCK_POS 5 | 510 | #define NAND_SMALL_BADBLOCK_POS 5 |
511 | #define NAND_LARGE_BADBLOCK_POS 0 | 511 | #define NAND_LARGE_BADBLOCK_POS 0 |
512 | 512 | ||
513 | /** | ||
514 | * struct platform_nand_chip - chip level device structure | ||
515 | * | ||
516 | * @nr_chips: max. number of chips to scan for | ||
517 | * @chip_offs: chip number offset | ||
518 | * @nr_partitions: number of partitions pointed to be partitoons (or zero) | ||
519 | * @partitions: mtd partition list | ||
520 | * @chip_delay: R/B delay value in us | ||
521 | * @options: Option flags, e.g. 16bit buswidth | ||
522 | * @priv: hardware controller specific settings | ||
523 | */ | ||
524 | struct platform_nand_chip { | ||
525 | int nr_chips; | ||
526 | int chip_offset; | ||
527 | int nr_partitions; | ||
528 | struct mtd_partition *partitions; | ||
529 | int chip_delay; | ||
530 | unsigned int options; | ||
531 | void *priv; | ||
532 | }; | ||
533 | |||
534 | /** | ||
535 | * struct platform_nand_ctrl - controller level device structure | ||
536 | * | ||
537 | * @hwcontrol: platform specific hardware control structure | ||
538 | * @dev_ready: platform specific function to read ready/busy pin | ||
539 | * @select_chip: platform specific chip select function | ||
540 | * @priv_data: private data to transport driver specific settings | ||
541 | * | ||
542 | * All fields are optional and depend on the hardware driver requirements | ||
543 | */ | ||
544 | struct platform_nand_ctrl { | ||
545 | void (*hwcontrol)(struct mtd_info *mtd, int cmd); | ||
546 | int (*dev_ready)(struct mtd_info *mtd); | ||
547 | void (*select_chip)(struct mtd_info *mtd, int chip); | ||
548 | void *priv; | ||
549 | }; | ||
550 | |||
551 | /* Some helpers to access the data structures */ | ||
552 | static inline | ||
553 | struct platform_nand_chip *get_platform_nandchip(struct mtd_info *mtd) | ||
554 | { | ||
555 | struct nand_chip *chip = mtd->priv; | ||
556 | |||
557 | return chip->priv; | ||
558 | } | ||
559 | |||
513 | #endif /* __LINUX_MTD_NAND_H */ | 560 | #endif /* __LINUX_MTD_NAND_H */ |