Skip to content

Commit cf06681

Browse files
morimotobroonie
authored andcommitted
spi: sh-msiof: ignore driver probing if it was MSIOF Sound
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 <[email protected]> Reviewed-by: Geert Uytterhoeven <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent c4887bd commit cf06681

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

drivers/spi/spi-sh-msiof.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include <linux/kernel.h>
2121
#include <linux/module.h>
2222
#include <linux/of.h>
23+
#include <linux/of_graph.h>
2324
#include <linux/platform_device.h>
2425
#include <linux/pm_runtime.h>
2526
#include <linux/sh_dma.h>
@@ -1281,6 +1282,11 @@ static int sh_msiof_spi_probe(struct platform_device *pdev)
12811282
int i;
12821283
int ret;
12831284

1285+
/* Check whether MSIOF is used as I2S mode or SPI mode by checking "port" node */
1286+
struct device_node *port __free(device_node) = of_graph_get_next_port(dev->of_node, NULL);
1287+
if (port) /* It was MSIOF-I2S */
1288+
return -ENODEV;
1289+
12841290
chipdata = of_device_get_match_data(dev);
12851291
if (chipdata) {
12861292
info = sh_msiof_spi_parse_dt(dev);

0 commit comments

Comments
 (0)