From patchwork Thu Jun 5 14:47:06 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 4307061 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id EF7409F387 for ; Thu, 5 Jun 2014 16:16:35 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 26B9B2034F for ; Thu, 5 Jun 2014 16:16:35 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 638A8202F2 for ; Thu, 5 Jun 2014 16:16:33 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 761E62656ED; Thu, 5 Jun 2014 18:16:26 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,NO_DNS_FOR_FROM, UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 1AFD926572E; Thu, 5 Jun 2014 17:31:43 +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 868EF2656F3; Thu, 5 Jun 2014 17:31:39 +0200 (CEST) Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.130]) by alsa0.perex.cz (Postfix) with ESMTP id 9F3222656C6 for ; Thu, 5 Jun 2014 16:47:42 +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=mreue006) with ESMTP (Nemesis) id 0M7z6r-1WWmuA1HZR-00vcZ5; Thu, 05 Jun 2014 16:47:07 +0200 From: Arnd Bergmann To: broonie@kernel.org Date: Thu, 05 Jun 2014 16:47:06 +0200 Message-ID: <6181626.txoA4bpImf@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.11.0-18-generic; KDE/4.11.5; x86_64; ; ) MIME-Version: 1.0 X-Provags-ID: V02:K0:PjVAE75Eqg9VIqnIsbWuansReRkChFP2RpH1CYzOiJE silYMJoMKcevXq1nAA+Vjvaj1/7c5lHTdN6RX/HPBcFObzYXbO 1RBWC44g3DHy3ny8M4c2jzBFnaIWyoCz805R1vpLDz+WpC2Ysj 9q0eTR9hbk2uqbPoWykhDtzVffuxPRpz6XwMb7KGmosamPwul9 vXXEFIHm9aWl/lbYjWJ3pyuhKj8aV4C+JyD31yu481jzIQrPEn bSX8MxzsMqoP6YYAaTeZpQMaqwavcwjOZScvx0d6o55NZs7bzV hYQ5QjwIGSSSrJ0m8lQL/iS7jJoeOYRLjNvKEYAlgBFt4RRAh/ D3V40rWETiX43iSAzmFE= Cc: alsa-devel@alsa-project.org, Lars-Peter Clausen , lgirdwood@gmail.com, linux-arm-kernel@lists.infradead.org Subject: [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 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 --- I hope this is the last ASoC patch I have for the moment, sorry for spamming everybody ;-) sound/soc/codecs/adau1701.c | 5 +++-- sound/soc/codecs/sigmadsp.c | 27 --------------------------- sound/soc/codecs/sigmadsp.h | 3 --- 3 files changed, 3 insertions(+), 32 deletions(-) diff --git a/sound/soc/codecs/adau1701.c b/sound/soc/codecs/adau1701.c index d71c59c..1b5e306 100644 --- a/sound/soc/codecs/adau1701.c +++ b/sound/soc/codecs/adau1701.c @@ -239,7 +239,6 @@ static int adau1701_reg_read(void *context, unsigned int reg, static int adau1701_reset(struct snd_soc_codec *codec, unsigned int clkdiv) { struct adau1701 *adau1701 = snd_soc_codec_get_drvdata(codec); - struct i2c_client *client = to_i2c_client(codec->dev); int ret; if (clkdiv != ADAU1707_CLKDIV_UNSET && @@ -282,7 +281,9 @@ static int adau1701_reset(struct snd_soc_codec *codec, unsigned int clkdiv) * know the correct PLL setup */ if (clkdiv != ADAU1707_CLKDIV_UNSET) { - ret = process_sigma_firmware(client, ADAU1701_FIRMWARE); + ret = process_sigma_firmware_regmap(codec->dev, + adau1701->regmap, + ADAU1701_FIRMWARE); if (ret) { dev_warn(codec->dev, "Failed to load firmware\n"); return ret; diff --git a/sound/soc/codecs/sigmadsp.c b/sound/soc/codecs/sigmadsp.c index 4068f24..209f98f 100644 --- a/sound/soc/codecs/sigmadsp.c +++ b/sound/soc/codecs/sigmadsp.c @@ -10,7 +10,6 @@ #include #include #include -#include #include #include @@ -198,30 +197,6 @@ static int _process_sigma_firmware(struct device *dev, return ret; } -#if IS_ENABLED(CONFIG_I2C) - -static int sigma_action_write_i2c(void *control_data, - const struct sigma_action *sa, size_t len) -{ - return i2c_master_send(control_data, (const unsigned char *)&sa->addr, - len); -} - -int process_sigma_firmware(struct i2c_client *client, const char *name) -{ - struct sigma_firmware ssfw; - - ssfw.control_data = client; - ssfw.write = sigma_action_write_i2c; - - return _process_sigma_firmware(&client->dev, &ssfw, name); -} -EXPORT_SYMBOL(process_sigma_firmware); - -#endif - -#if IS_ENABLED(CONFIG_REGMAP) - static int sigma_action_write_regmap(void *control_data, const struct sigma_action *sa, size_t len) { @@ -241,6 +216,4 @@ int process_sigma_firmware_regmap(struct device *dev, struct regmap *regmap, } EXPORT_SYMBOL(process_sigma_firmware_regmap); -#endif - MODULE_LICENSE("GPL"); diff --git a/sound/soc/codecs/sigmadsp.h b/sound/soc/codecs/sigmadsp.h index e439cbd..38a455b 100644 --- a/sound/soc/codecs/sigmadsp.h +++ b/sound/soc/codecs/sigmadsp.h @@ -12,9 +12,6 @@ #include #include -struct i2c_client; - -extern int process_sigma_firmware(struct i2c_client *client, const char *name); extern int process_sigma_firmware_regmap(struct device *dev, struct regmap *regmap, const char *name);