Commit 4aceea20 authored by Stefan Roese's avatar Stefan Roese Committed by Tom Rini

spi: kirkwood_spi.c: Compile MPP (pin-mux) only for kirkwood SoC's

Compile the pin multiplexing only on Kirkwood platforms. As the
Armada XP doesn't need it.
Signed-off-by: default avatarStefan Roese <>
Reviewed-by: default avatarJagannadha Sutradharudu Teki <>
Tested-by: default avatarLuka Perkov <>
Acked-by: default avatarPrafulla Wadaskar <>
parent 24c04977
......@@ -13,22 +13,28 @@
#include <spi.h>
#include <asm/io.h>
#include <asm/arch/soc.h>
#include <asm/arch/mpp.h>
#include <asm/arch-mvebu/spi.h>
static struct kwspi_registers *spireg = (struct kwspi_registers *)KW_SPI_BASE;
static u32 cs_spi_mpp_back[2];
struct spi_slave *spi_setup_slave(unsigned int bus, unsigned int cs,
unsigned int max_hz, unsigned int mode)
struct spi_slave *slave;
u32 data;
static const u32 kwspi_mpp_config[2][2] = {
{ MPP0_SPI_SCn, 0 }, /* if cs == 0 */
{ MPP7_SPI_SCn, 0 } /* if cs != 0 */
if (!spi_cs_is_valid(bus, cs))
return NULL;
......@@ -51,15 +57,19 @@ struct spi_slave *spi_setup_slave(unsigned int bus, unsigned int cs,
writel(KWSPI_SMEMRDIRQ, &spireg->irq_cause);
writel(KWSPI_IRQMASK, &spireg->irq_mask);
/* program mpp registers to select SPI_CSn */
kirkwood_mpp_conf(kwspi_mpp_config[cs ? 1 : 0], cs_spi_mpp_back);
return slave;
void spi_free_slave(struct spi_slave *slave)
kirkwood_mpp_conf(cs_spi_mpp_back, NULL);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment