summaryrefslogtreecommitdiffstats
path: root/drivers/spi
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2016-01-21 19:43:44 -0700
committerSimon Glass <sjg@chromium.org>2016-01-21 20:42:34 -0700
commit6d97786b4c695b45056a00bac07124cac0a81204 (patch)
tree203d6c372a99090ae4f4d58c2c2e15ed4e13de3e /drivers/spi
parent71037d1ca0a302ac0db8846a18589f856b54341e (diff)
downloadblackbird-obmc-uboot-6d97786b4c695b45056a00bac07124cac0a81204.tar.gz
blackbird-obmc-uboot-6d97786b4c695b45056a00bac07124cac0a81204.zip
rockchip: spi: Avoid setting the pinctrl twice
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>
Diffstat (limited to 'drivers/spi')
-rw-r--r--drivers/spi/rk_spi.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/spi/rk_spi.c b/drivers/spi/rk_spi.c
index 62434be763..2b58393e35 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;
}
OpenPOWER on IntegriCloud