From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
To: Conor Dooley <conor+dt@kernel.org>,
Geert Uytterhoeven <geert+renesas@glider.be>,
Jaroslav Kysela <perex@perex.cz>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Liam Girdwood <lgirdwood@gmail.com>,
Mark Brown <broonie@kernel.org>, Rob Herring <robh@kernel.org>,
Takashi Iwai <tiwai@suse.com>,
devicetree@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
linux-sound@vger.kernel.org, linux-spi@vger.kernel.org
Subject: [PATCH 2/7] spi: sh-msiof: ignore driver probing if it was MSIOF Sound
Date: Wed, 9 Apr 2025 01:05:07 +0000 [thread overview]
Message-ID: <8734eib0vx.wl-kuninori.morimoto.gx@renesas.com> (raw)
In-Reply-To: <875xjeb0wu.wl-kuninori.morimoto.gx@renesas.com>
Renesas MSIOF (Clock-Synchronized Serial Interface with FIFO) can work as
both SPI and I2S. MSIOF-I2S will use Audio Graph Card/Card2 driver which
Of-Graph in DT.
MSIOF-SPI/I2S are using same DT compatible properties.
MSIOF-I2S uses Of-Graph for Audio-Graph-Card/Card2,
MSIOF-SPI doesn't use Of-Graph.
Check "port" node when driver probing
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
drivers/spi/spi-sh-msiof.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/drivers/spi/spi-sh-msiof.c b/drivers/spi/spi-sh-msiof.c
index 8a98c313548e..51415131eff1 100644
--- a/drivers/spi/spi-sh-msiof.c
+++ b/drivers/spi/spi-sh-msiof.c
@@ -20,6 +20,7 @@
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/of.h>
+#include <linux/of_graph.h>
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
#include <linux/sh_dma.h>
@@ -1276,10 +1277,19 @@ static int sh_msiof_spi_probe(struct platform_device *pdev)
const struct sh_msiof_chipdata *chipdata;
struct sh_msiof_spi_info *info;
struct sh_msiof_spi_priv *p;
+ struct device_node *port;
unsigned long clksrc;
int i;
int ret;
+ /* Check whether MSIOF is used as I2S mode or SPI mode by checking "port" node */
+ port = of_graph_get_next_port(pdev->dev.of_node, NULL);
+ if (port) {
+ /* It was MSIOF-I2S */
+ of_node_put(port);
+ return -ENODEV;
+ }
+
chipdata = of_device_get_match_data(&pdev->dev);
if (chipdata) {
info = sh_msiof_spi_parse_dt(&pdev->dev);
--
2.43.0
next prev parent reply other threads:[~2025-04-09 1:05 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-09 1:04 [PATCH 0/7] ASoC: add Renesas MSIOF sound driver Kuninori Morimoto
2025-03-18 2:06 ` [PATCH 1/7] spi: renesas,sh-msiof: Living separately from MSIOF I2S Sound Kuninori Morimoto
2025-04-09 6:31 ` Krzysztof Kozlowski
2025-04-09 23:19 ` Kuninori Morimoto
2025-04-10 5:48 ` Krzysztof Kozlowski
2025-04-09 1:05 ` Kuninori Morimoto [this message]
2025-04-09 7:09 ` [PATCH 2/7] spi: sh-msiof: ignore driver probing if it was MSIOF Sound Geert Uytterhoeven
2025-04-09 23:31 ` Kuninori Morimoto
2025-04-09 1:05 ` [PATCH 3/7] ASoC: rsnd: allow to use ADG only Kuninori Morimoto
2025-04-09 1:05 ` [PATCH 4/7] ASoC: rsnd: enable to use "adg" clock Kuninori Morimoto
2025-04-09 1:05 ` [PATCH 5/7] ASoC: renesas: add MSIOF sound Documentation Kuninori Morimoto
2025-04-09 6:37 ` Krzysztof Kozlowski
2025-04-09 7:01 ` Geert Uytterhoeven
2025-04-09 7:52 ` Krzysztof Kozlowski
2025-04-09 8:09 ` Geert Uytterhoeven
2025-04-09 12:08 ` Krzysztof Kozlowski
2025-04-09 7:41 ` Krzysztof Kozlowski
2025-04-10 0:49 ` Kuninori Morimoto
2025-04-10 5:46 ` Krzysztof Kozlowski
2025-04-10 7:02 ` Kuninori Morimoto
2025-04-09 1:05 ` [PATCH 6/7] ASoC: renesas: add MSIOF sound support Kuninori Morimoto
2025-04-09 6:38 ` Krzysztof Kozlowski
2025-04-09 23:25 ` Kuninori Morimoto
2025-04-10 5:45 ` Krzysztof Kozlowski
2025-04-10 6:29 ` Kuninori Morimoto
2025-04-10 6:33 ` Krzysztof Kozlowski
2025-04-09 7:28 ` Geert Uytterhoeven
2025-04-09 23:45 ` Kuninori Morimoto
2025-04-10 2:37 ` Kuninori Morimoto
2025-04-10 7:39 ` Geert Uytterhoeven
2025-04-10 23:04 ` Kuninori Morimoto
2025-04-10 7:47 ` Geert Uytterhoeven
2025-04-10 23:08 ` Kuninori Morimoto
2025-04-09 1:05 ` [PATCH 7/7] arm64: dts: renesas: sparrow hawk: Add MSIOF Sound support Kuninori Morimoto
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=8734eib0vx.wl-kuninori.morimoto.gx@renesas.com \
--to=kuninori.morimoto.gx@renesas.com \
--cc=broonie@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=geert+renesas@glider.be \
--cc=krzk+dt@kernel.org \
--cc=lgirdwood@gmail.com \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=linux-spi@vger.kernel.org \
--cc=perex@perex.cz \
--cc=robh@kernel.org \
--cc=tiwai@suse.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