* [PATCH v3 0/2] spi-nor: add optional vcc-supply and enable it for i.MX93
@ 2024-10-27 12:15 Peng Fan (OSS)
2024-10-27 12:15 ` [PATCH v3 1/2] dt-bindings: mtd: jedec,spi-nor: add optional vcc-supply Peng Fan (OSS)
2024-10-27 12:16 ` [PATCH v3 2/2] mtd: spi-nor: support vcc-supply regulator Peng Fan (OSS)
0 siblings, 2 replies; 5+ messages in thread
From: Peng Fan (OSS) @ 2024-10-27 12:15 UTC (permalink / raw)
To: Tudor Ambarus, Pratyush Yadav, Michael Walle, Miquel Raynal,
Richard Weinberger, Vignesh Raghavendra, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam, Marco Felsch
Cc: linux-mtd, devicetree, linux-kernel, imx, linux-arm-kernel,
Peng Fan
spi-nor flash needs power supply to work properly, the power supply
could be software controlled. So need enable the power before using the
flash.
Patch 1,2 is to add vcc-supply for spi-nor
Patch 3 is to add overlays for i.MX93-11x11-EVK
Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
Changes in v3:
- Rebased to linux-next next-20241025
- Drop patch 3 which is to add i.MX93 flexspi overlay device tree.
- Typo "spi nor" -> "SPI NOR" in patch 1
- Link to v2: https://lore.kernel.org/r/20240930-spi-v2-0-ed7f6bcbe0df@nxp.com
Changes in v2:
- Add A-b for patch 1, typo in patch 1
- Use devm_regulator_get_enable in patch 2
I still keep it in spi_nor_scan because it is in probe stage.
- Link to v1: https://lore.kernel.org/r/20240920-spi-v1-0-97f220c2e10c@nxp.com
---
Peng Fan (2):
dt-bindings: mtd: jedec,spi-nor: add optional vcc-supply
mtd: spi-nor: support vcc-supply regulator
Documentation/devicetree/bindings/mtd/jedec,spi-nor.yaml | 4 ++++
drivers/mtd/spi-nor/core.c | 5 +++++
2 files changed, 9 insertions(+)
---
base-commit: 7c98818f1183b7e4b6757901b41b0e37293aa28c
change-id: 20240920-spi-34231ea74761
Best regards,
--
Peng Fan <peng.fan@nxp.com>
^ permalink raw reply [flat|nested] 5+ messages in thread* [PATCH v3 1/2] dt-bindings: mtd: jedec,spi-nor: add optional vcc-supply
2024-10-27 12:15 [PATCH v3 0/2] spi-nor: add optional vcc-supply and enable it for i.MX93 Peng Fan (OSS)
@ 2024-10-27 12:15 ` Peng Fan (OSS)
2024-10-27 12:16 ` [PATCH v3 2/2] mtd: spi-nor: support vcc-supply regulator Peng Fan (OSS)
1 sibling, 0 replies; 5+ messages in thread
From: Peng Fan (OSS) @ 2024-10-27 12:15 UTC (permalink / raw)
To: Tudor Ambarus, Pratyush Yadav, Michael Walle, Miquel Raynal,
Richard Weinberger, Vignesh Raghavendra, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam, Marco Felsch
Cc: linux-mtd, devicetree, linux-kernel, imx, linux-arm-kernel,
Peng Fan
From: Peng Fan <peng.fan@nxp.com>
Introduce optional vcc-supply property, SPI NOR flashes needs power supply
to work properly. The power supply maybe software controlable per board
design.
Acked-by: Rob Herring (Arm) <robh@kernel.org>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
Documentation/devicetree/bindings/mtd/jedec,spi-nor.yaml | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/Documentation/devicetree/bindings/mtd/jedec,spi-nor.yaml b/Documentation/devicetree/bindings/mtd/jedec,spi-nor.yaml
index 6e3afb42926ea6d22f0dd2ebf39752e115502615..335f8204aa1ebce3d2b4686b2a06d0ea3791667c 100644
--- a/Documentation/devicetree/bindings/mtd/jedec,spi-nor.yaml
+++ b/Documentation/devicetree/bindings/mtd/jedec,spi-nor.yaml
@@ -96,6 +96,10 @@ properties:
If "broken-flash-reset" is present then having this property does not
make any difference.
+ vcc-supply:
+ description:
+ Supply for the SPI NOR power.
+
spi-cpol: true
spi-cpha: true
--
2.37.1
^ permalink raw reply related [flat|nested] 5+ messages in thread* [PATCH v3 2/2] mtd: spi-nor: support vcc-supply regulator
2024-10-27 12:15 [PATCH v3 0/2] spi-nor: add optional vcc-supply and enable it for i.MX93 Peng Fan (OSS)
2024-10-27 12:15 ` [PATCH v3 1/2] dt-bindings: mtd: jedec,spi-nor: add optional vcc-supply Peng Fan (OSS)
@ 2024-10-27 12:16 ` Peng Fan (OSS)
2024-10-28 8:51 ` Marco Felsch
2024-10-29 9:57 ` Tudor Ambarus
1 sibling, 2 replies; 5+ messages in thread
From: Peng Fan (OSS) @ 2024-10-27 12:16 UTC (permalink / raw)
To: Tudor Ambarus, Pratyush Yadav, Michael Walle, Miquel Raynal,
Richard Weinberger, Vignesh Raghavendra, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam, Marco Felsch
Cc: linux-mtd, devicetree, linux-kernel, imx, linux-arm-kernel,
Peng Fan
From: Peng Fan <peng.fan@nxp.com>
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 <peng.fan@nxp.com>
---
drivers/mtd/spi-nor/core.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/mtd/spi-nor/core.c b/drivers/mtd/spi-nor/core.c
index b6f374ded390a0c0429a61dd0579204e0e98bfa1..d95427c4f4d0839c5df348eeddea59582ef99d9d 100644
--- a/drivers/mtd/spi-nor/core.c
+++ b/drivers/mtd/spi-nor/core.c
@@ -17,6 +17,7 @@
#include <linux/mtd/spi-nor.h>
#include <linux/mutex.h>
#include <linux/of_platform.h>
+#include <linux/regulator/consumer.h>
#include <linux/sched/task_stack.h>
#include <linux/sizes.h>
#include <linux/slab.h>
@@ -3465,6 +3466,10 @@ int spi_nor_scan(struct spi_nor *nor, const char *name,
if (!nor->bouncebuf)
return -ENOMEM;
+ ret = devm_regulator_get_enable(dev, "vcc");
+ if (ret)
+ return ret;
+
ret = spi_nor_hw_reset(nor);
if (ret)
return ret;
--
2.37.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH v3 2/2] mtd: spi-nor: support vcc-supply regulator
2024-10-27 12:16 ` [PATCH v3 2/2] mtd: spi-nor: support vcc-supply regulator Peng Fan (OSS)
@ 2024-10-28 8:51 ` Marco Felsch
2024-10-29 9:57 ` Tudor Ambarus
1 sibling, 0 replies; 5+ messages in thread
From: Marco Felsch @ 2024-10-28 8:51 UTC (permalink / raw)
To: Peng Fan (OSS)
Cc: Tudor Ambarus, Pratyush Yadav, Michael Walle, Miquel Raynal,
Richard Weinberger, Vignesh Raghavendra, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam, linux-mtd, devicetree,
linux-kernel, imx, linux-arm-kernel, Peng Fan
On 24-10-27, Peng Fan (OSS) wrote:
> From: Peng Fan <peng.fan@nxp.com>
>
> 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 <peng.fan@nxp.com>
Reviewed-by: Marco Felsch <m.felsch@pengutronix.de>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v3 2/2] mtd: spi-nor: support vcc-supply regulator
2024-10-27 12:16 ` [PATCH v3 2/2] mtd: spi-nor: support vcc-supply regulator Peng Fan (OSS)
2024-10-28 8:51 ` Marco Felsch
@ 2024-10-29 9:57 ` Tudor Ambarus
1 sibling, 0 replies; 5+ messages in thread
From: Tudor Ambarus @ 2024-10-29 9:57 UTC (permalink / raw)
To: Peng Fan (OSS), Pratyush Yadav, Michael Walle, Miquel Raynal,
Richard Weinberger, Vignesh Raghavendra, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam, Marco Felsch
Cc: linux-mtd, devicetree, linux-kernel, imx, linux-arm-kernel,
Peng Fan
On 10/27/24 12:16 PM, Peng Fan (OSS) wrote:
> From: Peng Fan <peng.fan@nxp.com>
>
> 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 <peng.fan@nxp.com>
> ---
> drivers/mtd/spi-nor/core.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/drivers/mtd/spi-nor/core.c b/drivers/mtd/spi-nor/core.c
> index b6f374ded390a0c0429a61dd0579204e0e98bfa1..d95427c4f4d0839c5df348eeddea59582ef99d9d 100644
> --- a/drivers/mtd/spi-nor/core.c
> +++ b/drivers/mtd/spi-nor/core.c
> @@ -17,6 +17,7 @@
> #include <linux/mtd/spi-nor.h>
> #include <linux/mutex.h>
> #include <linux/of_platform.h>
> +#include <linux/regulator/consumer.h>
> #include <linux/sched/task_stack.h>
> #include <linux/sizes.h>
> #include <linux/slab.h>
> @@ -3465,6 +3466,10 @@ int spi_nor_scan(struct spi_nor *nor, const char *name,
> if (!nor->bouncebuf)
> return -ENOMEM;
>
> + ret = devm_regulator_get_enable(dev, "vcc");
> + if (ret)
> + return ret;
This is all looking good, but please move it to spi_nor_probe().
All the SPI NOR controllers need to move to spi/. We stopped adding
support for the SPI NOR controllers few years ago.
> +
> ret = spi_nor_hw_reset(nor);
> if (ret)
> return ret;
>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2024-10-29 10:25 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-27 12:15 [PATCH v3 0/2] spi-nor: add optional vcc-supply and enable it for i.MX93 Peng Fan (OSS)
2024-10-27 12:15 ` [PATCH v3 1/2] dt-bindings: mtd: jedec,spi-nor: add optional vcc-supply Peng Fan (OSS)
2024-10-27 12:16 ` [PATCH v3 2/2] mtd: spi-nor: support vcc-supply regulator Peng Fan (OSS)
2024-10-28 8:51 ` Marco Felsch
2024-10-29 9:57 ` Tudor Ambarus
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).