From patchwork Mon Aug 7 15:42:55 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 9885635 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6DE08603B4 for ; Mon, 7 Aug 2017 15:44:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5D79E28685 for ; Mon, 7 Aug 2017 15:44:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 523AE286BA; Mon, 7 Aug 2017 15:44:51 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6E14728685 for ; Mon, 7 Aug 2017 15:44:48 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id DB1D2267329; Mon, 7 Aug 2017 17:44:24 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id A156F26732A; Mon, 7 Aug 2017 17:44:23 +0200 (CEST) Received: from mout.kundenserver.de (mout.kundenserver.de [217.72.192.74]) by alsa0.perex.cz (Postfix) with ESMTP id 0993A2672A8 for ; Mon, 7 Aug 2017 17:44:21 +0200 (CEST) Received: from wuerfel.lan ([78.43.238.10]) by mrelayeu.kundenserver.de (mreue103 [212.227.15.145]) with ESMTPA (Nemesis) id 0MRRcG-1e32M111E8-00SdTe; Mon, 07 Aug 2017 17:44:13 +0200 From: Arnd Bergmann To: Mark Brown Date: Mon, 7 Aug 2017 17:42:55 +0200 Message-Id: <20170807154409.205269-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:kj5ZZQntFKyQicV9xJeTV0WB2iK/dCQKlPRge+H3URewKrVJzg5 xv7UB8NhYFLFTQlUMdzU5DPXwRqqLbFlyeU4uZpxPwLghHMzPrRQaGOFPHfDvjX53FGwZ4r pERrnO91Yv6L/tRavXiixTUnAUYpH88DaLsGaRS5Qmt4KXOpAxyexdRQyF5FVRBJCnyKpXu b+TBbq7AfF9WJKADbHTRA== X-UI-Out-Filterresults: notjunk:1; V01:K0:WDPvEBNNpNE=:sa1U4kXM+Co7GEhUIXwoLt FL53kguPy4VfoS6wrah7d4HbEXV7m+9RT0ZtNv6OWAPTfqiInUwLgdikz3GlyIqfZbrzdW8g6 LjywAwdHHj6S9Uxn6OJTJ5iv5n0ySSqj1/AvCQy2SxSb9K6PHv0FddJNdGOT8Xwg4UTLT+6Tk I5GbWWVx3o6HcZK8FPM2Bi7Xqp0TYSptSivsHJSbDefEazI3wK+6+yvM9uOLrsf7G1lc+UPUe CFmOOYfflexZsDfzpXk0Z9u+dasl5VgdGzl7BhNlY73BMx87wpU9Nnza1Un/BaaVEN82C6/z2 3C396jMYlgALolVJoOTkLds70+cfN24fxRrOrj89qUhFUgVRW38hCgmCG+n0rENlEj7dx7iB4 hrZB8v9EJ9z3twyPB/Zu4R7R1qsQIGJ2ca+vnAELQL3C6ZYJjpvz2FxsoXoBCP4dtHtM4qiR9 4SxDDf5nW6Cp5mz1OrT5sAkeMy48WcF9sKJWlVtgupgjNAcuewiQXhtBpxwoofAr74wDQtYHH bLt6L5loVYA2/6E+w2Pb9N5i+aDGihXpeZdJve2xvveZONEeBMBfYBbHkn9BXLn1pUCzYy6TP 9agdTt9/EH6cQ8/cJdo4eFpOrn+QvEDuZjs3KTsJnCEJpTCgJyoAuqH3T8yA9LpFje0YAjZzx Z0eqlOSj6AgxRqa0GZowlUesnQl6qN4/S6iA7OsgsQ3zaxYgeDmrS+9HcXKFWVAXvBNTgova6 9NOpi86SDfhrHAoGTjORtMiytUY5lIJ++HdCMg== Cc: alsa-devel@alsa-project.org, Arnd Bergmann , Kuninori Morimoto , Mika Westeberg , linux-kernel@vger.kernel.org, Haojian Zhuang , linux-spi@vger.kernel.org, Geert Uytterhoeven , Andy Shevchenko , Robert Jarzmik , Daniel Mack Subject: [alsa-devel] [PATCH] SPI: fix building SPI_PXA on MMP X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP When the audio driver selects CONFIG_PXA_SSP on ARCH_MMP as a loadable module, and the PXA SPI driver is built-in, we get a link error in the SPI driver: drivers/spi/spi-pxa2xx.o: In function `pxa2xx_spi_remove': spi-pxa2xx.c:(.text+0x5f0): undefined reference to `pxa_ssp_free' drivers/spi/spi-pxa2xx.o: In function `pxa2xx_spi_probe': spi-pxa2xx.c:(.text+0xeac): undefined reference to `pxa_ssp_request' spi-pxa2xx.c:(.text+0x1468): undefined reference to `pxa_ssp_free' spi-pxa2xx.c:(.text+0x15bc): undefined reference to `pxa_ssp_free' The problem is that the PXA SPI driver only uses 'select SSP' specifically when building it for PXA, but we can also build it for PCI, which is meant for Intel x86 SoCs that use the same SPI block. When the sound driver forces the SSP to be a loadable module, the IS_ENABLED() check in include/linux/pxa2xx_ssp.h triggers but the spi driver can't reference the exported symbols. I had a different approach before, making the PCI case depend on X86, which fixed the problem by avoiding the MMP case. This goes a different route, making the driver select PXA_SSP also on MMP, which has an SSP that none of the boards in mainline Linux use for SPI. There is no harm in always enabling the build on MMP (PCI or not PCI), so I do that too, to document that this hardware is actually available on MMP. Link: https://patchwork.kernel.org/patch/8879921/ Signed-off-by: Arnd Bergmann --- drivers/spi/Kconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/spi/Kconfig b/drivers/spi/Kconfig index 9b31351fe429..f9f9b0940746 100644 --- a/drivers/spi/Kconfig +++ b/drivers/spi/Kconfig @@ -518,8 +518,8 @@ config SPI_PPC4xx config SPI_PXA2XX tristate "PXA2xx SSP SPI master" - depends on (ARCH_PXA || PCI || ACPI) - select PXA_SSP if ARCH_PXA + depends on (ARCH_PXA || ARCH_MMP || PCI || ACPI) + select PXA_SSP if ARCH_PXA || ARCH_MMP help This enables using a PXA2xx or Sodaville SSP port as a SPI master controller. The driver can be configured to use any SSP port and