diff options
author | Miquel Raynal <miquel.raynal@bootlin.com> | 2020-05-29 13:13:22 +0200 |
---|---|---|
committer | Miquel Raynal <miquel.raynal@bootlin.com> | 2020-06-26 08:35:08 +0200 |
commit | 35b6bcc970f759d4a86d6221d09ca28ea20467c8 (patch) | |
tree | e4fbcafb8ba76f30656658248fcf31097b469cd4 /drivers/mtd/nand/raw/internals.h | |
parent | a69ad11168dca68b3f0adc6882422f4a2e2cb050 (diff) | |
download | lwn-35b6bcc970f759d4a86d6221d09ca28ea20467c8.tar.gz lwn-35b6bcc970f759d4a86d6221d09ca28ea20467c8.zip |
mtd: rawnand: Allocate the interface configurations dynamically
Instead of manipulating the statically allocated structure and copy
timings around, allocate one at identification time and save it in the
nand_chip structure once it has been initialized.
All NAND chips using the same interface configuration during reset and
startup, we define a helper to retrieve a single reset interface
configuration object, shared across all NAND chips.
We use a second pointer to always have a reference on the currently
applied interface configuration, which may either point to the "best
interface configuration" or to the "default reset interface
configuration".
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Link: https://lore.kernel.org/linux-mtd/20200529111322.7184-29-miquel.raynal@bootlin.com
Diffstat (limited to 'drivers/mtd/nand/raw/internals.h')
-rw-r--r-- | drivers/mtd/nand/raw/internals.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/mtd/nand/raw/internals.h b/drivers/mtd/nand/raw/internals.h index 5ebfbb89e572..012876e14317 100644 --- a/drivers/mtd/nand/raw/internals.h +++ b/drivers/mtd/nand/raw/internals.h @@ -93,6 +93,7 @@ onfi_find_closest_sdr_mode(const struct nand_sdr_timings *spec_timings); int nand_choose_best_sdr_timings(struct nand_chip *chip, struct nand_interface_config *iface, struct nand_sdr_timings *spec_timings); +const struct nand_interface_config *nand_get_reset_interface_config(void); int nand_get_features(struct nand_chip *chip, int addr, u8 *subfeature_param); int nand_set_features(struct nand_chip *chip, int addr, u8 *subfeature_param); int nand_read_page_raw_notsupp(struct nand_chip *chip, u8 *buf, |