* [PATCH v1] drivers: spi: spi-sunxi: Add Kconfig option for sun4i_spi_parse_pins
@ 2022-04-25 6:21 qianfanguijin
2022-04-26 3:55 ` Samuel Holland
0 siblings, 1 reply; 2+ messages in thread
From: qianfanguijin @ 2022-04-25 6:21 UTC (permalink / raw)
To: u-boot; +Cc: Jagan Teki, qianfan Zhao
From: qianfan Zhao <qianfanguijin@163.com>
spi-sunxi driver will init pins based on "pinctrl-0", but the
implementation is very limited.
Adding an Kconfig option if you really need this feature, or disable it
and config pinmux at board's board_init.
Signed-off-by: qianfan Zhao <qianfanguijin@163.com>
---
drivers/spi/Kconfig | 10 ++++++++++
drivers/spi/spi-sunxi.c | 4 ++++
2 files changed, 14 insertions(+)
diff --git a/drivers/spi/Kconfig b/drivers/spi/Kconfig
index d07e9a28af..9c2fe96ac1 100644
--- a/drivers/spi/Kconfig
+++ b/drivers/spi/Kconfig
@@ -382,6 +382,16 @@ config SPI_SUNXI
Same controller driver can reuse in all Allwinner SoC variants.
+config SUNXI_SPI_PARSE_PINS
+ bool "Enable sun4i_spi_parse_pins feature"
+ depends on SPI_SUNXI
+ default y
+ help
+ Enable sun4i_spi_parse_pins support when spi driver probing.
+
+ The default pinmux configuration for SUN50I is SUN50I_GPC_SPI0(4),
+ and SUNXI_GPC_SPI0(3) for others.
+
config STM32_QSPI
bool "STM32F7 QSPI driver"
depends on STM32F4 || STM32F7 || ARCH_STM32MP
diff --git a/drivers/spi/spi-sunxi.c b/drivers/spi/spi-sunxi.c
index bc2f544e86..f48562a59b 100644
--- a/drivers/spi/spi-sunxi.c
+++ b/drivers/spi/spi-sunxi.c
@@ -180,6 +180,7 @@ static void sun4i_spi_set_cs(struct udevice *bus, u8 cs, bool enable)
writel(reg, SPI_REG(priv, SPI_TCR));
}
+#if CONFIG_IS_ENABLED(SUNXI_SPI_PARSE_PINS)
static int sun4i_spi_parse_pins(struct udevice *dev)
{
const void *fdt = gd->fdt_blob;
@@ -259,6 +260,7 @@ static int sun4i_spi_parse_pins(struct udevice *dev)
}
return 0;
}
+#endif /* CONFIG_IS_ENABLED(SUNXI_SPI_PARSE_PINS) */
static inline int sun4i_spi_set_clock(struct udevice *dev, bool enable)
{
@@ -506,7 +508,9 @@ static int sun4i_spi_probe(struct udevice *bus)
return ret;
}
+#if CONFIG_IS_ENABLED(SUNXI_SPI_PARSE_PINS)
sun4i_spi_parse_pins(bus);
+#endif
priv->variant = plat->variant;
priv->base = plat->base;
--
2.25.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v1] drivers: spi: spi-sunxi: Add Kconfig option for sun4i_spi_parse_pins
2022-04-25 6:21 [PATCH v1] drivers: spi: spi-sunxi: Add Kconfig option for sun4i_spi_parse_pins qianfanguijin
@ 2022-04-26 3:55 ` Samuel Holland
0 siblings, 0 replies; 2+ messages in thread
From: Samuel Holland @ 2022-04-26 3:55 UTC (permalink / raw)
To: qianfanguijin; +Cc: u-boot, Jagan Teki
On 4/25/22 1:21 AM, qianfanguijin@163.com wrote:
> From: qianfan Zhao <qianfanguijin@163.com>
>
> spi-sunxi driver will init pins based on "pinctrl-0", but the
> implementation is very limited.
>
> Adding an Kconfig option if you really need this feature, or disable it
> and config pinmux at board's board_init.
This code has already been removed in U-Boot master by:
https://lore.kernel.org/u-boot/20220318035420.15058-24-samuel@sholland.org/
Pin setup is now handled by the separate pinctrl driver.
Regards,
Samuel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-04-26 3:56 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-25 6:21 [PATCH v1] drivers: spi: spi-sunxi: Add Kconfig option for sun4i_spi_parse_pins qianfanguijin
2022-04-26 3:55 ` Samuel Holland
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.