From patchwork Fri Nov 10 14:54:43 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 10053305 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 CBBFD60631 for ; Fri, 10 Nov 2017 14:56:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BCB4B2B2CD for ; Fri, 10 Nov 2017 14:56:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B17642B2D5; Fri, 10 Nov 2017 14:56:14 +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=ham 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 E99752B2CD for ; Fri, 10 Nov 2017 14:56:13 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id A655F26705E; Fri, 10 Nov 2017 15:56:12 +0100 (CET) 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 24D962678FE; Fri, 10 Nov 2017 15:56:11 +0100 (CET) Received: from mout.kundenserver.de (mout.kundenserver.de [217.72.192.75]) by alsa0.perex.cz (Postfix) with ESMTP id 78D7A26705E for ; Fri, 10 Nov 2017 15:56:08 +0100 (CET) Received: from wuerfel.lan ([109.193.157.232]) by mrelayeu.kundenserver.de (mreue104 [212.227.15.145]) with ESMTPA (Nemesis) id 0M7sMi-1f8HVp3kkC-00vOfZ; Fri, 10 Nov 2017 15:55:54 +0100 From: Arnd Bergmann To: Mark Brown Date: Fri, 10 Nov 2017 15:54:43 +0100 Message-Id: <20171110145455.821805-2-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20171110145455.821805-1-arnd@arndb.de> References: <20171110145455.821805-1-arnd@arndb.de> X-Provags-ID: V03:K0:bAs0b0OXp3cZTF8DiUKK4tA9zp1ksUbAqyraYU5tSDynF+53bOS BwDUJtqzluywc/m3YJ3u+uFQh2VXPYLXTaNts0/68YvcSL7/h+EiQtEpMtq9CbJtww3z/tM 0fh4rbbMHVHdt0cIE2yamumSZgC1AiA2e5Uvyhxy0qw1X1QUND5ZcTdmfSbInJF3FcZZzyK ckWcpngF6trkMxwBZ8sgA== X-UI-Out-Filterresults: notjunk:1; V01:K0:0ucshRFLjl8=:O9gXzR1QKH1MFzo5bcNxvv kAZVD/z8T6i5vFazp07XkwGFUTlDDVgsC+w34bP7yACeOQtb8oY16qytDm82MXk0FY7IkR9/K OXKNujSqd1VVVe/1MLZ4yxgBsKrSVYdPUeUHgzdpz5si0Fk7ZjmY6SDQhr0lkMxMZObTPQoch v2qnjEcHX7pjUd56XWtV4VXPXZtmo63EhJPRch3LHWpO3b9xa5HadmkW8RmcGKkhCrxMDVzB4 zpqW3keUVYhTGUCdWEj9sPfpb6ZKw37/Yfgo9XSeFDXZK9UaOVtKin16g1aYaUR7bfZvc0z4e pAvWKwQIjzvJ48jkzCjVIx4nU+3RVxvAm6SrAvYLlcB9noz7Yx8Q3TtYZTFUZz42zxafBVUIQ LYSGA8KfJ9PjqxseUNw9vUrDdWciIm6S8BDE/wi1jDHg/fUvkXxir4tbiExcjcMhM+TEhqVgh 4r66O8P1ENFqPSXVGjY8WJctVOBNZ6OqVIAhrWtBdXkXUZWxCKA5FjZ1RF1y8v56pg7KShIb5 04iYxmjVLJOcgmDEuqvkhjN92kZ/yc9og9joDNgA+bDaI6bqSAXSTUjAPCwOmwl1uypvj5Y+s +FudAV7XEzYLYUM6Gwijvb3wPKy47wSNdMZk4dUk32KYT7+3lNqnJK9/N8HWUVLKmo55VrbMG xMMYf8oHtCECDfel8xLv5l/hEp+joWJsVsD72GYJ1UcQhO2Mgk9hMTAnMf2/jbiqhAa7bkdE3 7n+83lC6Ad66HB/KzqckDlv6TO9/ZvX8ZP8k1A== Cc: alsa-devel@alsa-project.org, Arnd Bergmann , linux-kernel@vger.kernel.org, Takashi Iwai , Liam Girdwood , Bard Liao , Charles Keepax Subject: [alsa-devel] [PATCH 2/2] ASoC: rt5514: work around link error 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 The main rt5514 driver optionally calls into the SPI back-end to load the firmware. This causes a link error when one driver selects rt5514 as built-in and another driver selects rt5514-spi as a loadable module: sound/soc/codecs/rt5514.o: In function `rt5514_dsp_voice_wake_up_put': rt5514.c:(.text+0xac8): undefined reference to `rt5514_spi_burst_write' As a workaround, this adds another silent symbol, to force rt5514-spi to be built-in for that configuration. I'm not overly happy with that solution, but couldn't come up with anything better. Using 'IS_REACHABLE()' would break the case that relies on the loadable module, and all other ideas would result in more complexity. Signed-off-by: Arnd Bergmann --- sound/soc/codecs/Kconfig | 4 ++++ sound/soc/codecs/Makefile | 1 + 2 files changed, 5 insertions(+) diff --git a/sound/soc/codecs/Kconfig b/sound/soc/codecs/Kconfig index 0838ae710941..a42ddbc93f3d 100644 --- a/sound/soc/codecs/Kconfig +++ b/sound/soc/codecs/Kconfig @@ -749,6 +749,10 @@ config SND_SOC_RT5514 config SND_SOC_RT5514_SPI tristate +config SND_SOC_RT5514_SPI_BUILTIN + bool # force RT5514_SPI to be built-in to avoid link errors + default SND_SOC_RT5514=y && SND_SOC_RT5514_SPI=m + config SND_SOC_RT5616 tristate "Realtek RT5616 CODEC" depends on I2C diff --git a/sound/soc/codecs/Makefile b/sound/soc/codecs/Makefile index 05018b7ca72b..0001069ce2a7 100644 --- a/sound/soc/codecs/Makefile +++ b/sound/soc/codecs/Makefile @@ -360,6 +360,7 @@ obj-$(CONFIG_SND_SOC_RT286) += snd-soc-rt286.o obj-$(CONFIG_SND_SOC_RT298) += snd-soc-rt298.o obj-$(CONFIG_SND_SOC_RT5514) += snd-soc-rt5514.o obj-$(CONFIG_SND_SOC_RT5514_SPI) += snd-soc-rt5514-spi.o +obj-$(CONFIG_SND_SOC_RT5514_SPI_BUILTIN) += snd-soc-rt5514-spi.o obj-$(CONFIG_SND_SOC_RT5616) += snd-soc-rt5616.o obj-$(CONFIG_SND_SOC_RT5631) += snd-soc-rt5631.o obj-$(CONFIG_SND_SOC_RT5640) += snd-soc-rt5640.o