From patchwork Thu Jun 5 15:10:18 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 4307181 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id AAADABEEA7 for ; Thu, 5 Jun 2014 16:26:40 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BB513201CE for ; Thu, 5 Jun 2014 16:26:39 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 794D320251 for ; Thu, 5 Jun 2014 16:26:38 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 103D426571A; Thu, 5 Jun 2014 18:26:34 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id AEB77265743; Thu, 5 Jun 2014 17:55:35 +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 25AE826574F; Thu, 5 Jun 2014 17:55:32 +0200 (CEST) Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.187]) by alsa0.perex.cz (Postfix) with ESMTP id 0775F265A58 for ; Thu, 5 Jun 2014 17:10:54 +0200 (CEST) Received: from wuerfel.localnet (HSI-KBW-134-3-133-35.hsi14.kabel-badenwuerttemberg.de [134.3.133.35]) by mrelayeu.kundenserver.de (node=mreue001) with ESMTP (Nemesis) id 0MSUzj-1XM5aa1Ms7-00TRTH; Thu, 05 Jun 2014 17:10:19 +0200 From: Arnd Bergmann To: linux-arm-kernel@lists.infradead.org Date: Thu, 05 Jun 2014 17:10:18 +0200 Message-ID: <4610731.9TBGyCy3TV@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.11.0-18-generic; KDE/4.11.5; x86_64; ; ) In-Reply-To: <539084F3.3050700@metafoo.de> References: <6181626.txoA4bpImf@wuerfel> <539084F3.3050700@metafoo.de> MIME-Version: 1.0 X-Provags-ID: V02:K0:/k5w5B3CEO98BFN37edRNR3gNWmV+2YMgDDrzyaJgB9 p7cDZJYvqFQtuSCnc8D8ZFVYyOWeoIToiExvdADTc8M5YenT4l 3tbY96IIG5eHBcobfH5HllMJKxa9QjmKRPzSIuQZBkSN0/aSh1 R7lUNyKjt2kyTSk9n+zW/A+t22fX3vkcvJna2hdslw0jiE7zIn mg0sgKHhH0U9jHd7N5b9Cr3t3luKK7EKWrl3Jj2deJb+UVAHKo lNVRiJLBfxc0j5Ch5Ax8IZIWRdo/LC6Gw+BPlCH9ILBBqqq06C XOvqkbPrpVg+ZSJlviIJ1XowzGhGvJe2h8pI6v7sZSxCJj3rY7 geI6bLWnus8yQxBV1YrU= Cc: alsa-devel@alsa-project.org, Lars-Peter Clausen , broonie@kernel.org, lgirdwood@gmail.com Subject: Re: [alsa-devel] [PATCH] ASoC: sigmadsp: remove I2C support 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP On Thursday 05 June 2014 16:55:47 Lars-Peter Clausen wrote: > On 06/05/2014 04:47 PM, Arnd Bergmann wrote: > > The newly added ADAU1781 codec comes with separate drivers for > > I2C and SPI modes, which gives us a new variation of the dependency > > problems: If SPI is enabled and the I2C core is a loadable module, > > selecting SND_SOC_ADAU1781_SPI as built-in leads to a link error because > > the common base code from sigmadsp.c now also gets built-in: > > > > sound/built-in.o: In function `sigma_action_write_i2c': > > :(.text+0x5d8d4): undefined reference to `i2c_master_send' > > > > Rather than adding yet more complex Kconfig logic, this converts the last > > user of process_sigma_firmware() to process_sigma_firmware_regmap(), > > which seems trivial after the driver itself now uses regmap as well. > > With that done, there is no more linker dependency from > > SND_SOC_ADAU1781_SPI to i2c_master_send. > > > > Signed-off-by: Arnd Bergmann > > Cc: Lars-Peter Clausen > > No this patch won't work. Regmap support for the adau1701 is rather limited > which is why we need native i2c support in the lib. Ah, I see. > But yea, I just noticed the same problem an hour ago and was thinking > hopefully I'll get to fixing this before it shows up in Arnd's randconfig > builds It's actually my second attempt after I finished writing the first patch for it. Is that better? 8<--------- commit 75b46664e7c26cf044da3322c31ce8e7c4a16715 Author: Arnd Bergmann Date: Thu Jun 5 15:47:35 2014 +0200 ASoC: fix ADAU 17x1 I2C dependencies The newly added ADAU1761 and ADAU1781 codecs come with separate drivers for I2C and SPI modes, which gives us a new variation of the dependency problems: If SPI is enabled and the I2C core is a loadable module, selecting SND_SOC_ADAU1781_SPI as built-in leads to a link error because the common base code from sigmadsp.c now also gets built-in: sound/built-in.o: In function `sigma_action_write_i2c': :(.text+0x5d8d4): undefined reference to `i2c_master_send' To avoid that, this adds another Kconfig hack similar to the existing SND_SOC_I2C_AND_SPI symbol: the new SND_SOC_SPI_AND_MAYBE_I2C helps us enable the adau17x1-spi drivers as loadable modules in this case, but built-in when I2C is either disabled or built-in as well. Signed-off-by: Arnd Bergmann Cc: Lars-Peter Clausen diff --git a/sound/soc/codecs/Kconfig b/sound/soc/codecs/Kconfig index cbfa1e1..41bca14 100644 --- a/sound/soc/codecs/Kconfig +++ b/sound/soc/codecs/Kconfig @@ -8,6 +8,11 @@ config SND_SOC_I2C_AND_SPI default y if I2C=y default y if SPI_MASTER=y +config SND_SOC_SPI_AND_MAYBE_I2C + tristate + default m if SPI_MASTER=y && I2C=m + default y if SPI_MASTER=y + menu "CODEC drivers" config SND_SOC_ALL_CODECS @@ -24,9 +29,9 @@ config SND_SOC_ALL_CODECS select SND_SOC_AD73311 select SND_SOC_ADAU1373 if I2C select SND_SOC_ADAU1761_I2C if I2C - select SND_SOC_ADAU1761_SPI if SPI + select SND_SOC_ADAU1761_SPI if SND_SOC_SPI_AND_MAYBE_I2C select SND_SOC_ADAU1781_I2C if I2C - select SND_SOC_ADAU1781_SPI if SPI + select SND_SOC_ADAU1781_SPI if SND_SOC_SPI_AND_MAYBE_I2C select SND_SOC_ADAV801 if SPI_MASTER select SND_SOC_ADAV803 if I2C select SND_SOC_ADAU1977_SPI if SPI_MASTER