From patchwork Tue Aug 5 07:09:57 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Roese X-Patchwork-Id: 376583 X-Patchwork-Delegate: prafulla@marvell.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 1445314010F for ; Tue, 5 Aug 2014 17:10:44 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id A7D07B37EF; Tue, 5 Aug 2014 09:10:36 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 0fki7wGpOw06; Tue, 5 Aug 2014 09:10:36 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 9BC7BB37FC; Tue, 5 Aug 2014 09:09:21 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id AD3A9B37DB for ; Tue, 5 Aug 2014 09:09:15 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id yvQsmMPqllzO for ; Tue, 5 Aug 2014 09:09:15 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mo4-p05-ob.smtp.rzone.de (mo4-p05-ob.smtp.rzone.de [81.169.146.180]) by theia.denx.de (Postfix) with ESMTPS id 1C933B37BB for ; Tue, 5 Aug 2014 09:09:03 +0200 (CEST) X-RZG-AUTH: :IW0NeWC7b/q2i6W/qstXb1SBUuFnrGohfvxEndrDXKjzPMsB3oimjD61I4fPQhgcxm93 X-RZG-CLASS-ID: mo05 Received: from stefan-work.domain_not_set.invalid (b9168f0c.cgn.dg-w.de [185.22.143.12]) by post.strato.de (RZmta 35.2 AUTH) with ESMTPA id Y01725q7578vqIm; Tue, 5 Aug 2014 09:08:57 +0200 (CEST) From: Stefan Roese To: u-boot@lists.denx.de Date: Tue, 5 Aug 2014 09:09:57 +0200 Message-Id: <1407222612-1048-12-git-send-email-sr@denx.de> X-Mailer: git-send-email 2.0.4 In-Reply-To: <1407222612-1048-1-git-send-email-sr@denx.de> References: <1407222612-1048-1-git-send-email-sr@denx.de> Cc: trini@ti.com, Jagannadha Sutradharudu Teki Subject: [U-Boot] [PATCH v2 11/25] spi: kirkwood_spi.c: Compile MPP (pin-mux) only for kirkwood SoC's X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de Compile the pin multiplexing only on Kirkwood platforms. As the Armada XP doesn't need it. Signed-off-by: Stefan Roese Cc: Jagannadha Sutradharudu Teki Reviewed-by: Jagannadha Sutradharudu Teki --- 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 #include #include +#ifdef CONFIG_KIRKWOOD #include +#endif #include 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); }