summaryrefslogtreecommitdiff
path: root/drivers/spi/mxs_spi.c
diff options
context:
space:
mode:
authorAlbert ARIBAUD <albert.u.boot@aribaud.net>2013-02-02 19:29:59 +0100
committerAlbert ARIBAUD <albert.u.boot@aribaud.net>2013-02-02 19:29:59 +0100
commite5f5c4a977c411c0cd3899a4f9487eea77a0e150 (patch)
tree391225b279509f4403eb6d5e973f0b25e789a8af /drivers/spi/mxs_spi.c
parent7cb70a34b976e68f6348ea0718780e8f38901482 (diff)
parent81ca840976e8e418ae8decaf03ea01f59b1b5be2 (diff)
downloadu-boot-imx-e5f5c4a977c411c0cd3899a4f9487eea77a0e150.zip
u-boot-imx-e5f5c4a977c411c0cd3899a4f9487eea77a0e150.tar.gz
u-boot-imx-e5f5c4a977c411c0cd3899a4f9487eea77a0e150.tar.bz2
Merge branch 'u-boot-imx/master' into 'u-boot-arm/master'
Diffstat (limited to 'drivers/spi/mxs_spi.c')
-rw-r--r--drivers/spi/mxs_spi.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/spi/mxs_spi.c b/drivers/spi/mxs_spi.c
index 42e4c99..bb865b7 100644
--- a/drivers/spi/mxs_spi.c
+++ b/drivers/spi/mxs_spi.c
@@ -80,7 +80,6 @@ struct spi_slave *spi_setup_slave(unsigned int bus, unsigned int cs,
unsigned int max_hz, unsigned int mode)
{
struct mxs_spi_slave *mxs_slave;
- uint32_t addr;
struct mxs_ssp_regs *ssp_regs;
int reg;
@@ -96,13 +95,11 @@ struct spi_slave *spi_setup_slave(unsigned int bus, unsigned int cs,
if (mxs_dma_init_channel(bus))
goto err_init;
- addr = MXS_SSP0_BASE + (bus * MXS_SPI_PORT_OFFSET);
-
mxs_slave->slave.bus = bus;
mxs_slave->slave.cs = cs;
mxs_slave->max_khz = max_hz / 1000;
mxs_slave->mode = mode;
- mxs_slave->regs = (struct mxs_ssp_regs *)addr;
+ mxs_slave->regs = mxs_ssp_regs_by_bus(bus);
ssp_regs = mxs_slave->regs;
reg = readl(&ssp_regs->hw_ssp_ctrl0);
@@ -140,7 +137,7 @@ int spi_claim_bus(struct spi_slave *slave)
writel(0, &ssp_regs->hw_ssp_cmd0);
- mx28_set_ssp_busclock(slave->bus, mxs_slave->max_khz);
+ mxs_set_ssp_busclock(slave->bus, mxs_slave->max_khz);
return 0;
}