mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-11 07:34:31 +00:00
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>
This commit is contained in:
parent
71037d1ca0
commit
6d97786b4c
1 changed files with 6 additions and 3 deletions
|
@ -182,13 +182,15 @@ static int rockchip_spi_probe(struct udevice *bus)
|
||||||
static int rockchip_spi_claim_bus(struct udevice *dev)
|
static int rockchip_spi_claim_bus(struct udevice *dev)
|
||||||
{
|
{
|
||||||
struct udevice *bus = dev->parent;
|
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_priv *priv = dev_get_priv(bus);
|
||||||
struct rockchip_spi *regs = priv->regs;
|
struct rockchip_spi *regs = priv->regs;
|
||||||
struct dm_spi_slave_platdata *slave_plat = dev_get_parent_platdata(dev);
|
|
||||||
u8 spi_dfs, spi_tf;
|
u8 spi_dfs, spi_tf;
|
||||||
uint ctrlr0;
|
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;
|
int ret;
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Disable the SPI hardware */
|
/* Disable the SPI hardware */
|
||||||
rkspi_enable_chip(regs, 0);
|
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;
|
ctrlr0 |= (priv->tmode & TMOD_MASK) << TMOD_SHIFT;
|
||||||
|
|
||||||
writel(ctrlr0, ®s->ctrlr0);
|
writel(ctrlr0, ®s->ctrlr0);
|
||||||
|
#if !CONFIG_IS_ENABLED(PINCTRL_FULL)
|
||||||
ret = pinctrl_request(plat->pinctrl, plat->periph_id, slave_plat->cs);
|
ret = pinctrl_request(plat->pinctrl, plat->periph_id, slave_plat->cs);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
debug("%s: Cannot request pinctrl: %d\n", __func__, ret);
|
debug("%s: Cannot request pinctrl: %d\n", __func__, ret);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue