diff options
author | Phil Edworthy <PHIL.EDWORTHY@renesas.com> | 2016-11-29 12:58:31 +0000 |
---|---|---|
committer | Jagan Teki <jagan@amarulasolutions.com> | 2016-12-15 16:57:27 +0100 |
commit | 7d403f284c814d6df9f1d116e691d6468c75282a (patch) | |
tree | 4d0d721aa123f69dfc17d74a09e58f1bb508fdc9 /drivers/spi/cadence_qspi.c | |
parent | 7e76c4b08a30c0a90813ae56cd876555bef8d9f6 (diff) | |
download | u-boot-7d403f284c814d6df9f1d116e691d6468c75282a.tar.gz |
spi: cadence_qspi: Use spi mode at the point it is needed
Instead of extracting mode settings and passing them as separate
args to another function, just pass the SPI mode as an arg.
Signed-off-by: Phil Edworthy <phil.edworthy@renesas.com>
Reviewed-by: Jagan Teki <jagan@openedev.com>
Diffstat (limited to 'drivers/spi/cadence_qspi.c')
-rw-r--r-- | drivers/spi/cadence_qspi.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/spi/cadence_qspi.c b/drivers/spi/cadence_qspi.c index 1051afb74c..55192d6d49 100644 --- a/drivers/spi/cadence_qspi.c +++ b/drivers/spi/cadence_qspi.c @@ -170,14 +170,12 @@ static int cadence_spi_probe(struct udevice *bus) static int cadence_spi_set_mode(struct udevice *bus, uint mode) { struct cadence_spi_priv *priv = dev_get_priv(bus); - unsigned int clk_pol = (mode & SPI_CPOL) ? 1 : 0; - unsigned int clk_pha = (mode & SPI_CPHA) ? 1 : 0; /* Disable QSPI */ cadence_qspi_apb_controller_disable(priv->regbase); /* Set SPI mode */ - cadence_qspi_apb_set_clk_mode(priv->regbase, clk_pol, clk_pha); + cadence_qspi_apb_set_clk_mode(priv->regbase, mode); /* Enable QSPI */ cadence_qspi_apb_controller_enable(priv->regbase); |