Skip to content

Commit d8bde4f

Browse files
MrVanPratyush Yadav
authored andcommitted
mtd: spi-nor: support vcc-supply regulator
SPI NOR flashes needs power supply to work properly. The power supply maybe software controllable per board design. So add the support for an vcc-supply regulator. Signed-off-by: Peng Fan <[email protected]> Reviewed-by: Marco Felsch <[email protected]> [ta: move devm_regulator_get_enable() to spi_nor_probe().] Signed-off-by: Tudor Ambarus <[email protected]> Reviewed-by: Pratyush Yadav <[email protected]> Signed-off-by: Pratyush Yadav <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 07c8888 commit d8bde4f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

drivers/mtd/spi-nor/core.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include <linux/mtd/spi-nor.h>
1818
#include <linux/mutex.h>
1919
#include <linux/of_platform.h>
20+
#include <linux/regulator/consumer.h>
2021
#include <linux/sched/task_stack.h>
2122
#include <linux/sizes.h>
2223
#include <linux/slab.h>
@@ -3587,6 +3588,10 @@ static int spi_nor_probe(struct spi_mem *spimem)
35873588
char *flash_name;
35883589
int ret;
35893590

3591+
ret = devm_regulator_get_enable(dev, "vcc");
3592+
if (ret)
3593+
return ret;
3594+
35903595
nor = devm_kzalloc(dev, sizeof(*nor), GFP_KERNEL);
35913596
if (!nor)
35923597
return -ENOMEM;

0 commit comments

Comments
 (0)