All of lore.kernel.org
 help / color / mirror / Atom feed
From: Biju Das <biju.das.jz@bp.renesas.com>
To: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Cc: Biju Das <biju.das.jz@bp.renesas.com>,
	Geert Uytterhoeven <geert+renesas@glider.be>,
	Prabhakar Mahadev Lad <prabhakar.mahadev-lad.rj@bp.renesas.com>,
	Mark Brown <broonie@kernel.org>,
	Miquel Raynal <miquel.raynal@bootlin.com>,
	Michael Walle <michael@walle.cc>,
	Biju Das <biju.das.au@gmail.com>,
	linux-renesas-soc@vger.kernel.org
Subject: [PATCH RFC 3/4] memory: renesas-rpc-if: Add support for overriding IO fixed values
Date: Wed,  8 Nov 2023 17:11:48 +0000	[thread overview]
Message-ID: <20231108171149.258656-4-biju.das.jz@bp.renesas.com> (raw)
In-Reply-To: <20231108171149.258656-1-biju.das.jz@bp.renesas.com>

Add support for overriding IO fixed values to control the pin state
based on the flash type.

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
---
 drivers/memory/renesas-rpc-if.c | 20 ++++++++++++++++++++
 include/memory/renesas-rpc-if.h |  1 +
 2 files changed, 21 insertions(+)

diff --git a/drivers/memory/renesas-rpc-if.c b/drivers/memory/renesas-rpc-if.c
index 9695b2d3ae59..17bc604cdfff 100644
--- a/drivers/memory/renesas-rpc-if.c
+++ b/drivers/memory/renesas-rpc-if.c
@@ -325,6 +325,26 @@ static void rpcif_rzg2l_timing_adjust_sdr(struct rpcif_priv *rpc)
 	regmap_write(rpc->regmap, RPCIF_PHYADD, 0x80000032);
 }
 
+int rpcif_set_iofv(struct device *dev, u32 val)
+{
+	struct rpcif_priv *rpc = dev_get_drvdata(dev);
+	int ret;
+
+	ret = pm_runtime_resume_and_get(dev);
+	if (ret)
+		return ret;
+
+	regmap_update_bits(rpc->regmap, RPCIF_CMNCR, RPCIF_CMNCR_IOFV(3),
+			   RPCIF_CMNCR_IO0FV(val & 0x3) |
+			   RPCIF_CMNCR_IO2FV((val >> 4) & 0x3) |
+			   RPCIF_CMNCR_IO3FV((val >> 6) & 0x3));
+
+	pm_runtime_put(dev);
+
+	return 0;
+}
+EXPORT_SYMBOL(rpcif_set_iofv);
+
 int rpcif_hw_init(struct device *dev, bool hyperflash)
 {
 	struct rpcif_priv *rpc = dev_get_drvdata(dev);
diff --git a/include/memory/renesas-rpc-if.h b/include/memory/renesas-rpc-if.h
index b8fa30fd6b50..124ca9c16a39 100644
--- a/include/memory/renesas-rpc-if.h
+++ b/include/memory/renesas-rpc-if.h
@@ -71,6 +71,7 @@ struct rpcif {
 
 int rpcif_sw_init(struct rpcif *rpc, struct device *dev);
 int rpcif_hw_init(struct device *dev, bool hyperflash);
+int rpcif_set_iofv(struct device *dev, u32 val);
 void rpcif_prepare(struct device *dev, const struct rpcif_op *op, u64 *offs,
 		   size_t *len);
 int rpcif_manual_xfer(struct device *dev);
-- 
2.25.1


  parent reply	other threads:[~2023-11-08 17:12 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-08 17:11 [PATCH RFC 0/4] Add set_iofv() callback Biju Das
2023-11-08 17:11 ` Biju Das
2023-11-08 17:11 ` [PATCH RFC 1/4] spi: spi-mem: " Biju Das
2023-11-08 17:11   ` Biju Das
2023-11-09  7:56   ` Geert Uytterhoeven
2023-11-09  7:56     ` Geert Uytterhoeven
2023-11-09  8:28     ` Biju Das
2023-11-08 17:11 ` [PATCH RFC 2/4] mtd: spi-nor: Add post_sfdp() callback Biju Das
2023-11-08 17:11   ` Biju Das
2023-11-08 17:11 ` Biju Das [this message]
2023-11-21  9:08   ` [PATCH RFC 3/4] memory: renesas-rpc-if: Add support for overriding IO fixed values Krzysztof Kozlowski
2023-11-08 17:11 ` [PATCH RFC 4/4] spi: rpc-if: Add set_iofv() callback Biju Das
2023-11-09  9:01 ` [PATCH RFC 0/4] " Michael Walle
2023-11-09  9:01   ` Michael Walle
2023-11-09 10:04   ` Biju Das
2023-11-09 10:48     ` Michael Walle
2023-11-09 10:48       ` Michael Walle
2023-11-09 11:48       ` Biju Das
2023-11-09 12:40         ` Michael Walle
2023-11-09 12:40           ` Michael Walle
2023-11-09 18:02           ` Biju Das
2023-11-10 10:11             ` Michael Walle
2023-11-10 10:11               ` Michael Walle
2023-11-10 11:35               ` Biju Das
2023-11-11 12:26                 ` Biju Das
2023-11-11 13:08                   ` Biju Das
2023-11-13 14:04                   ` Michael Walle
2023-11-13 14:04                     ` Michael Walle
2023-11-13 14:27                     ` Biju Das
2023-11-13 14:48                       ` Michael Walle
2023-11-13 14:48                         ` Michael Walle
2023-11-13 14:59                         ` Biju Das
2023-11-13 15:10                           ` Michael Walle
2023-11-13 15:10                             ` Michael Walle
2023-11-13 15:55                             ` Biju Das
2023-11-14 10:05                               ` Michael Walle
2023-11-14 10:05                                 ` Michael Walle
2023-11-12 20:24               ` Biju Das
2023-11-13 14:37                 ` Michael Walle
2023-11-13 14:37                   ` Michael Walle
2023-11-13 14:47                   ` Michael Walle
2023-11-13 14:47                     ` Michael Walle

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=20231108171149.258656-4-biju.das.jz@bp.renesas.com \
    --to=biju.das.jz@bp.renesas.com \
    --cc=biju.das.au@gmail.com \
    --cc=broonie@kernel.org \
    --cc=geert+renesas@glider.be \
    --cc=krzysztof.kozlowski@linaro.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=michael@walle.cc \
    --cc=miquel.raynal@bootlin.com \
    --cc=prabhakar.mahadev-lad.rj@bp.renesas.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.