Message ID | 1407222612-1048-12-git-send-email-sr@denx.de |
---|---|
State | Superseded |
Delegated to: | Prafulla Wadaskar |
Headers | show |
On Tue, Aug 5, 2014 at 12:39 PM, Stefan Roese <sr@denx.de> wrote: > Compile the pin multiplexing only on Kirkwood platforms. As the > Armada XP doesn't need it. > > Signed-off-by: Stefan Roese <sr@denx.de> > Cc: Jagannadha Sutradharudu Teki <jaganna@xilinx.com> > --- > > Changes in v2: None > > drivers/spi/kirkwood_spi.c | 10 ++++++++++ > 1 file changed, 10 insertions(+) > > diff --git a/drivers/spi/kirkwood_spi.c b/drivers/spi/kirkwood_spi.c > index 9710f12..ce2ba96 100644 > --- a/drivers/spi/kirkwood_spi.c > +++ b/drivers/spi/kirkwood_spi.c > @@ -13,22 +13,28 @@ > #include <spi.h> > #include <asm/io.h> > #include <asm/arch/soc.h> > +#ifdef CONFIG_KIRKWOOD > #include <asm/arch/mpp.h> > +#endif > #include <asm/arch-mvebu/spi.h> > > static struct kwspi_registers *spireg = (struct kwspi_registers *)KW_SPI_BASE; > > +#ifdef CONFIG_KIRKWOOD > static u32 cs_spi_mpp_back[2]; > +#endif > > 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; > +#ifdef CONFIG_KIRKWOOD > static const u32 kwspi_mpp_config[2][2] = { > { MPP0_SPI_SCn, 0 }, /* if cs == 0 */ > { MPP7_SPI_SCn, 0 } /* if cs != 0 */ > }; > +#endif > > 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); > > +#ifdef CONFIG_KIRKWOOD > /* program mpp registers to select SPI_CSn */ > kirkwood_mpp_conf(kwspi_mpp_config[cs ? 1 : 0], cs_spi_mpp_back); > +#endif > > return slave; > } > > void spi_free_slave(struct spi_slave *slave) > { > +#ifdef CONFIG_KIRKWOOD > kirkwood_mpp_conf(cs_spi_mpp_back, NULL); > +#endif > free(slave); > } > > -- > 2.0.4 Reviewed-by: Jagannadha Sutradharudu Teki <jaganna@xilinx.com> thanks!
diff --git a/drivers/spi/kirkwood_spi.c b/drivers/spi/kirkwood_spi.c index 9710f12..ce2ba96 100644 --- a/drivers/spi/kirkwood_spi.c +++ b/drivers/spi/kirkwood_spi.c @@ -13,22 +13,28 @@ #include <spi.h> #include <asm/io.h> #include <asm/arch/soc.h> +#ifdef CONFIG_KIRKWOOD #include <asm/arch/mpp.h> +#endif #include <asm/arch-mvebu/spi.h> static struct kwspi_registers *spireg = (struct kwspi_registers *)KW_SPI_BASE; +#ifdef CONFIG_KIRKWOOD static u32 cs_spi_mpp_back[2]; +#endif 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; +#ifdef CONFIG_KIRKWOOD static const u32 kwspi_mpp_config[2][2] = { { MPP0_SPI_SCn, 0 }, /* if cs == 0 */ { MPP7_SPI_SCn, 0 } /* if cs != 0 */ }; +#endif 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); +#ifdef CONFIG_KIRKWOOD /* program mpp registers to select SPI_CSn */ kirkwood_mpp_conf(kwspi_mpp_config[cs ? 1 : 0], cs_spi_mpp_back); +#endif return slave; } void spi_free_slave(struct spi_slave *slave) { +#ifdef CONFIG_KIRKWOOD kirkwood_mpp_conf(cs_spi_mpp_back, NULL); +#endif free(slave); }
Compile the pin multiplexing only on Kirkwood platforms. As the Armada XP doesn't need it. Signed-off-by: Stefan Roese <sr@denx.de> Cc: Jagannadha Sutradharudu Teki <jaganna@xilinx.com> --- Changes in v2: None drivers/spi/kirkwood_spi.c | 10 ++++++++++ 1 file changed, 10 insertions(+)