diff mbox

[U-Boot,v9,20/49] rockchip: spi: Avoid setting the pinctrl twice

Message ID 1453430653-3280-21-git-send-email-sjg@chromium.org
State Accepted
Delegated to: Simon Glass
Headers show

Commit Message

Simon Glass Jan. 22, 2016, 2:43 a.m. UTC
If full pinctrl is enabled we don't need to manually set the pinctrl in the
driver. It will happen automatically. Adjust the code to suit - we will
still use manual mode in SPL.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

Changes in v9: None
Changes in v2: None

 drivers/spi/rk_spi.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

Comments

Simon Glass Jan. 22, 2016, 3:18 p.m. UTC | #1
On 21 January 2016 at 19:43, Simon Glass <sjg@chromium.org> wrote:
> If full pinctrl is enabled we don't need to manually set the pinctrl in the
> driver. It will happen automatically. Adjust the code to suit - we will
> still use manual mode in SPL.
>
> Signed-off-by: Simon Glass <sjg@chromium.org>
> ---
>
> Changes in v9: None
> Changes in v2: None
>
>  drivers/spi/rk_spi.c | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)

Applied to u-boot-rockchip.
diff mbox

Patch

diff --git a/drivers/spi/rk_spi.c b/drivers/spi/rk_spi.c
index 62434be..2b58393 100644
--- a/drivers/spi/rk_spi.c
+++ b/drivers/spi/rk_spi.c
@@ -182,13 +182,15 @@  static int rockchip_spi_probe(struct udevice *bus)
 static int rockchip_spi_claim_bus(struct udevice *dev)
 {
 	struct udevice *bus = dev->parent;
-	struct rockchip_spi_platdata *plat = dev_get_platdata(bus);
 	struct rockchip_spi_priv *priv = dev_get_priv(bus);
 	struct rockchip_spi *regs = priv->regs;
-	struct dm_spi_slave_platdata *slave_plat = dev_get_parent_platdata(dev);
 	u8 spi_dfs, spi_tf;
 	uint ctrlr0;
+#if !CONFIG_IS_ENABLED(PINCTRL_FULL)
+	struct rockchip_spi_platdata *plat = dev_get_platdata(bus);
+	struct dm_spi_slave_platdata *slave_plat = dev_get_parent_platdata(dev);
 	int ret;
+#endif
 
 	/* Disable the SPI hardware */
 	rkspi_enable_chip(regs, 0);
@@ -249,12 +251,13 @@  static int rockchip_spi_claim_bus(struct udevice *dev)
 	ctrlr0 |= (priv->tmode & TMOD_MASK) << TMOD_SHIFT;
 
 	writel(ctrlr0, &regs->ctrlr0);
-
+#if !CONFIG_IS_ENABLED(PINCTRL_FULL)
 	ret = pinctrl_request(plat->pinctrl, plat->periph_id, slave_plat->cs);
 	if (ret) {
 		debug("%s: Cannot request pinctrl: %d\n", __func__, ret);
 		return ret;
 	}
+#endif
 
 	return 0;
 }