diff options
author | Miquel Raynal <miquel.raynal@bootlin.com> | 2021-05-26 11:32:40 +0200 |
---|---|---|
committer | Miquel Raynal <miquel.raynal@bootlin.com> | 2021-05-26 16:26:32 +0200 |
commit | b85c943d181ac58e3a34a5f79c73d421f4da7b00 (patch) | |
tree | 97fcc5ffc019c5599f47a96d4d89635f1584032c /include/linux/mtd | |
parent | 10e96f8b4e7521197a50b370ce0923ab6a8d0ca0 (diff) | |
download | linux-stable-b85c943d181ac58e3a34a5f79c73d421f4da7b00.tar.gz linux-stable-b85c943d181ac58e3a34a5f79c73d421f4da7b00.tar.bz2 linux-stable-b85c943d181ac58e3a34a5f79c73d421f4da7b00.zip |
mtd: rawnand: Add a helper to parse the gpio-cs DT property
New chips may feature a lot of CS because of their extended length. As
many controllers have been designed a decade ago, they usually only
feature just a couple. This does not mean that the entire range of
these chips cannot be accessed: it is just a matter of adding more
GPIO CS in the hardware design. A DT property has been added to
describe the CS array: cs-gpios.
Here is the code parsing it this new property, allocating what needs to
be, requesting the GPIOs and returning an array with the additional
available CS. The first entries of this array are left empty and are
reserved for native CS.
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20210526093242.183847-3-miquel.raynal@bootlin.com
Diffstat (limited to 'include/linux/mtd')
-rw-r--r-- | include/linux/mtd/rawnand.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/mtd/rawnand.h b/include/linux/mtd/rawnand.h index d41d39360fff..b2f9dd3cbd69 100644 --- a/include/linux/mtd/rawnand.h +++ b/include/linux/mtd/rawnand.h @@ -1595,4 +1595,8 @@ static inline void *nand_get_data_buf(struct nand_chip *chip) return chip->data_buf; } +/* Parse the gpio-cs property */ +int rawnand_dt_parse_gpio_cs(struct device *dev, struct gpio_desc ***cs_array, + unsigned int *ncs_array); + #endif /* __LINUX_MTD_RAWNAND_H */ |