From: Marco Felsch <m.felsch@pengutronix.de>
To: Miquel Raynal <miquel.raynal@bootlin.com>
Cc: "Peng Fan (OSS)" <peng.fan@oss.nxp.com>,
Tudor Ambarus <tudor.ambarus@linaro.org>,
Pratyush Yadav <pratyush@kernel.org>,
Michael Walle <mwalle@kernel.org>,
Richard Weinberger <richard@nod.at>,
Vignesh Raghavendra <vigneshr@ti.com>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Shawn Guo <shawnguo@kernel.org>,
Sascha Hauer <s.hauer@pengutronix.de>,
Pengutronix Kernel Team <kernel@pengutronix.de>,
Fabio Estevam <festevam@gmail.com>,
linux-mtd@lists.infradead.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, imx@lists.linux.dev,
linux-arm-kernel@lists.infradead.org, Peng Fan <peng.fan@nxp.com>
Subject: Re: [PATCH v2 2/3] mtd: spi-nor: support vcc-supply regulator
Date: Mon, 30 Sep 2024 11:36:35 +0200 [thread overview]
Message-ID: <20240930093635.6pyp4qole3qynllq@pengutronix.de> (raw)
In-Reply-To: <20240930111914.4b412581@xps-13>
Hi Miquel,
On 24-09-30, Miquel Raynal wrote:
> Hi,
>
> peng.fan@oss.nxp.com wrote on Mon, 30 Sep 2024 17:22:25 +0800:
>
> > 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 9d6e85bf227b..5249c8b13916 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>
> > @@ -3462,6 +3463,10 @@ int spi_nor_scan(struct spi_nor *nor, const char *name,
> > if (!nor->bouncebuf)
> > return -ENOMEM;
> >
> > + ret = devm_regulator_get_enable(dev, "vcc");
>
> _optional ?
The regulator optional API is different compared to other optional APIs.
If we would use optional here, we would need to check the returned error
code. On the other hand if the non optional API is used and the
regualtor is missing, a dummy regualtor is returned (as pointed out by
Marc).
Please see the _optional API doc to see more information about the
_optional usage.
Regards,
Marco
> > + if (ret)
> > + return ret;
> > +
> > ret = spi_nor_hw_reset(nor);
> > if (ret)
> > return ret;
> >
>
>
> Thanks,
> Miquèl
>
next prev parent reply other threads:[~2024-09-30 9:36 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-30 9:22 [PATCH v2 0/3] spi-nor: add optional vcc-supply and enable it for i.MX93 Peng Fan (OSS)
2024-09-30 9:22 ` [PATCH v2 1/3] dt-bindings: mtd: jedec,spi-nor: add optional vcc-supply Peng Fan (OSS)
2024-09-30 9:18 ` Miquel Raynal
2024-10-06 0:39 ` Peng Fan
2024-09-30 9:22 ` [PATCH v2 2/3] mtd: spi-nor: support vcc-supply regulator Peng Fan (OSS)
2024-09-30 9:19 ` Miquel Raynal
2024-09-30 9:36 ` Marco Felsch [this message]
2024-09-30 9:21 ` Marc Kleine-Budde
2024-09-30 9:25 ` Marc Kleine-Budde
2024-10-07 7:50 ` Michael Walle
2024-10-29 9:50 ` Tudor Ambarus
2024-09-30 9:22 ` [PATCH v2 3/3] arm64: dts: imx93-11x11-evk: add overlays for flexspi flash Peng Fan (OSS)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240930093635.6pyp4qole3qynllq@pengutronix.de \
--to=m.felsch@pengutronix.de \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=festevam@gmail.com \
--cc=imx@lists.linux.dev \
--cc=kernel@pengutronix.de \
--cc=krzk+dt@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=miquel.raynal@bootlin.com \
--cc=mwalle@kernel.org \
--cc=peng.fan@nxp.com \
--cc=peng.fan@oss.nxp.com \
--cc=pratyush@kernel.org \
--cc=richard@nod.at \
--cc=robh@kernel.org \
--cc=s.hauer@pengutronix.de \
--cc=shawnguo@kernel.org \
--cc=tudor.ambarus@linaro.org \
--cc=vigneshr@ti.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).