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: 9885639 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 1F90A603B4 for ; Mon, 7 Aug 2017 15:45:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1137A286D0 for ; Mon, 7 Aug 2017 15:45:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0A504286EB; Mon, 7 Aug 2017 15:45:58 +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=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BC892285C4 for ; Mon, 7 Aug 2017 15:45:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751961AbdHGPoc (ORCPT ); Mon, 7 Aug 2017 11:44:32 -0400 Received: from mout.kundenserver.de ([217.72.192.74]:60173 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751457AbdHGPoa (ORCPT ); Mon, 7 Aug 2017 11:44:30 -0400 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 Cc: Andy Shevchenko , Mika Westeberg , Daniel Mack , Haojian Zhuang , Robert Jarzmik , alsa-devel@alsa-project.org, Kuninori Morimoto , Arnd Bergmann , Geert Uytterhoeven , linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] SPI: fix building SPI_PXA on MMP 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== Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.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