From patchwork Fri Jun 27 09:54: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: 364850 X-Patchwork-Delegate: jagannadh.teki@gmail.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 0AA011400D2 for ; Fri, 27 Jun 2014 20:00:01 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 594EEA77FD; Fri, 27 Jun 2014 11:59:46 +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 cwZzU1dFj8AV; Fri, 27 Jun 2014 11:59:46 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 06EC3A77E8; Fri, 27 Jun 2014 11:56:37 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 2FD9BA7831 for ; Fri, 27 Jun 2014 11:55:33 +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 2Ejq4laKTi4o for ; Fri, 27 Jun 2014 11:55:29 +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-p04-ob.smtp.rzone.de (mo4-p04-ob.smtp.rzone.de [81.169.146.176]) by theia.denx.de (Postfix) with ESMTPS id 37236A77F5 for ; Fri, 27 Jun 2014 11:54:49 +0200 (CEST) X-RZG-CLASS-ID: mo04 X-RZG-AUTH: :IW0NeWC7b/q2i6W/qstXb1SBUuFnrGohfvxEndrDXKjzPMsB3oimjD61I4fPQhgcxmp3 Received: from stefan-work.domain_not_set.invalid (b9168f11.cgn.dg-w.de [185.22.143.17]) by post.strato.de (RZmta 34.5 SBL|AUTH) with ESMTPA id R07c6dq5R9seoMc; Fri, 27 Jun 2014 11:54:40 +0200 (CEST) From: Stefan Roese To: u-boot@lists.denx.de Date: Fri, 27 Jun 2014 11:54:57 +0200 Message-Id: <1403862911-6138-12-git-send-email-sr@denx.de> X-Mailer: git-send-email 2.0.1 In-Reply-To: <1403862911-6138-1-git-send-email-sr@denx.de> References: <1403862911-6138-1-git-send-email-sr@denx.de> Cc: trini@ti.com, Jagannadha Sutradharudu Teki Subject: [U-Boot] [PATCH v1 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 --- 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); }