From patchwork Fri Mar 25 15:31:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 554052 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 43C9EC433EF for ; Fri, 25 Mar 2022 15:34:03 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id A95091693; Fri, 25 Mar 2022 16:33:11 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz A95091693 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1648222441; bh=kp1/WrInRghrNEKOwLYg4Ose32CgpVXaqmLFkunHM6Y=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=FYJRaeuHiVDxCotC8BD8+BlFtr4k1UiIPoECLG6Liz9xytyvfwwAgB/qOVnLtEOdg 9SntOm55UbDoqvfgFjBNEaZFA7ODj7s53glMbwcaHDppQ9lFLtgJDCkIaefN4UZmgu m3GjuRtGAmUWs2fPEiOjYAicSy18DM7b0rtnuG9g= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 3A8EFF80162; Fri, 25 Mar 2022 16:33:11 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 74143F80212; Fri, 25 Mar 2022 16:33:09 +0100 (CET) Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id E193FF80115 for ; Fri, 25 Mar 2022 16:33:06 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz E193FF80115 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="X+ltaJMb" Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 22951616B2; Fri, 25 Mar 2022 15:33:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 74813C340F4; Fri, 25 Mar 2022 15:33:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1648222384; bh=kp1/WrInRghrNEKOwLYg4Ose32CgpVXaqmLFkunHM6Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=X+ltaJMb2cQTcVo0oCuA2zcuIarzYDRsdSzxLAalFV/hHPJzQGoWx9gtTffJ8vthz M1dJ3JjOZzrACoErouuDlXLdpllGnDpUZrYjn/BKo5j8+7jVYNzRIIhZFBKTPJyOIv YyuUxNL1yzaF5DHMGCJimNHLuST2Myzod13bS5GGmk8ce14R4+Y+NwtW01B7wwxPHt 9VcjjW90j/okeJ6n7RFosg95ITLYteoWJD9ugfoxKSrgD+h6B57hlBkZuNZHjQ0Tls ffsgqKVEEcvPlN7AHMtOmAULbarfraajI6MKBb2i0AULZRxJ/3A2ez7XYGEZyh4i4o dLqdlpf6krZeQ== From: Mark Brown To: Liam Girdwood Subject: [PATCH v1 1/7] ASoC: wm8731: Update to modern DAI terminology Date: Fri, 25 Mar 2022 15:31:15 +0000 Message-Id: <20220325153121.1598494-2-broonie@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220325153121.1598494-1-broonie@kernel.org> References: <20220325153121.1598494-1-broonie@kernel.org> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=966; h=from:subject; bh=kp1/WrInRghrNEKOwLYg4Ose32CgpVXaqmLFkunHM6Y=; b=owEBbQGS/pANAwAKASTWi3JdVIfQAcsmYgBiPeBE602cFlW45NJSaUYpIMeJgYKnkN2Ni0O1lw7d 57mXm16JATMEAAEKAB0WIQSt5miqZ1cYtZ/in+ok1otyXVSH0AUCYj3gRAAKCRAk1otyXVSH0OIAB/ 9OfNZCfc0Sh465QnqFKzfMScS1TjkHbg+aSQndP7yZsNpZeUCG2sOmoZRQ9h2pzMfsjE3/8SHFw3MC uXpb7Xf/lMyhKCF19Sk107colyAdAnCSYoJk5bbhsdB9WVW245NhRxP7+Bu5nBbN9AC97kWSj6KlKJ EdA1PvBX+IGBjC8HxkrlFw/n03pMGb8M5rjI4f6lRjHDm6DVljBP5JAndef/c6379zwtrQZjXVOfcm ayVDLDRg+dvqd4ZByjQxuqMFWje5mmfYJ0Y/M4RXPw804z/f3Lw2Pi/Je8d1sZEEhw5kzRBm+jhC3Y ya2qPQfgC34SEGR3ZsD3r/81oQgY+1 X-Developer-Key: i=broonie@kernel.org; a=openpgp; fpr=3F2568AAC26998F9E813A1C5C3F436CA30F5D8EB Cc: patches@opensource.cirrus.com, alsa-devel@alsa-project.org, Mark Brown X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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" As part of retiring the old defines used to specify DAI formats update the wm8731 driver to use the modern names. Signed-off-by: Mark Brown Acked-by: Charles Keepax --- sound/soc/codecs/wm8731.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/sound/soc/codecs/wm8731.c b/sound/soc/codecs/wm8731.c index 5d4949c2ec9b..5b399c631faf 100644 --- a/sound/soc/codecs/wm8731.c +++ b/sound/soc/codecs/wm8731.c @@ -429,12 +429,11 @@ static int wm8731_set_dai_fmt(struct snd_soc_dai *codec_dai, struct snd_soc_component *component = codec_dai->component; u16 iface = 0; - /* set master/slave audio interface */ - switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) { - case SND_SOC_DAIFMT_CBM_CFM: + switch (fmt & SND_SOC_DAIFMT_CLOCK_PROVIDER_MASK) { + case SND_SOC_DAIFMT_CBP_CFP: iface |= 0x0040; break; - case SND_SOC_DAIFMT_CBS_CFS: + case SND_SOC_DAIFMT_CBC_CFC: break; default: return -EINVAL; From patchwork Fri Mar 25 15:31:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 554051 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 119C0C433F5 for ; Fri, 25 Mar 2022 15:34:56 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 48C8B16F2; Fri, 25 Mar 2022 16:34:03 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 48C8B16F2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1648222494; bh=6Bi9GTvPd1v1a+BxZ0BqQppBlQg1pcrXvlQDy4BF64s=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=AjjqMa9EiuDDhR0rqMFCZPgYQ3kQtqH5Mxa6AeLRrJfHW9eepkjxWfg1lCCRZE5BI AZEHgC41uEThI8EvLG5MuOy2qJQn9TFSm6/Sd8em9TtwxOHwqHA2QTUXnR1AljH738 xXifCmtykUz/mmOL+w0BdjKwFn2aZJIRyn87NLjA= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id CD84DF8051A; Fri, 25 Mar 2022 16:33:17 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 8D12BF8051C; Fri, 25 Mar 2022 16:33:13 +0100 (CET) Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 1A455F800AA for ; Fri, 25 Mar 2022 16:33:08 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 1A455F800AA Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="H9PpOVvi" Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id EB51B617B1; Fri, 25 Mar 2022 15:33:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 075BFC340F3; Fri, 25 Mar 2022 15:33:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1648222386; bh=6Bi9GTvPd1v1a+BxZ0BqQppBlQg1pcrXvlQDy4BF64s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=H9PpOVviwwk7dRIHuSpDKdIK+T/W+tUZZoqHkyXpKXFrJZywy+yDN6CJWpHPW4qRU 9pHAmwzQ2T/yuARuvQMhUsvK/A99HOTcKJLuTc+mMlU51gvxGNhNtybMf6LZWj56VC wQyVm923BJ8Zis0S10+qIBDudoESZkZRhfkLqi7gLMCnSS+U7+SEbKeNx3v/9Ws0ob oltVrNeO25zrvddjWir/cir69sFVVX1QCnxEnFpr/5/fH7N1/KuWWKigVe9s1dU5uM TxQiwITRq4ZlppTTbsMk7DdLUWMPJvCxf4HdHZT3fvyMoP4V7EzbNNe/bTQQJIO/sz JTBtyD8skwVTA== From: Mark Brown To: Liam Girdwood Subject: [PATCH v1 2/7] ASoC: wm8731: Factor component init out of bus code Date: Fri, 25 Mar 2022 15:31:16 +0000 Message-Id: <20220325153121.1598494-3-broonie@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220325153121.1598494-1-broonie@kernel.org> References: <20220325153121.1598494-1-broonie@kernel.org> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=3799; h=from:subject; bh=6Bi9GTvPd1v1a+BxZ0BqQppBlQg1pcrXvlQDy4BF64s=; b=owEBbQGS/pANAwAKASTWi3JdVIfQAcsmYgBiPeBE8klygmbF0KySqMYEMAYuLPfqZjSbiA998jUV TJ087WaJATMEAAEKAB0WIQSt5miqZ1cYtZ/in+ok1otyXVSH0AUCYj3gRAAKCRAk1otyXVSH0IOoB/ 97fIJ/2LRaVGSA7DxO/mO/r0SasB4f/BXAVwow6qewp17ZYlmqvH7rPZUcyLJBJCu4R9XG7fnJCwjl TeA5gFCt+GUPlZHCeOhqlszH5rlJwEne6fZmVyMYYKp3GMH3UbC2uOU6rWLfMq6dkpHu2NL/tLyLP7 39aB+pnf+OkiHGPB0LOEGJv6NSv7Nqpes1iED+NWb3r69Hq0sP5TEKYsHSQoVICWfK9Yz/bOvmpL9t SN6ERtva/XFdM+UCXbY23QDsR1Mu5RLc6WzIJMpFmfYWgQkt6i6MxOiTUzT9KiWQOyDUZOPAOLI7dO y0wnD7k3IYajgSDLHMTkIjRQw3iizj X-Developer-Key: i=broonie@kernel.org; a=openpgp; fpr=3F2568AAC26998F9E813A1C5C3F436CA30F5D8EB Cc: patches@opensource.cirrus.com, alsa-devel@alsa-project.org, Mark Brown X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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" Both the I2C and SPI bus code register the component immediately after they call wm8731_hw_init(), factor the code out into the the common function and rename it to just be plain wm8731_init() while we're at it since it's not just for hardware init any more. This refactoring means we need to move the function after the declaration of the component driver. Signed-off-by: Mark Brown Acked-by: Charles Keepax --- sound/soc/codecs/wm8731.c | 67 ++++++++++++++++----------------------- 1 file changed, 27 insertions(+), 40 deletions(-) diff --git a/sound/soc/codecs/wm8731.c b/sound/soc/codecs/wm8731.c index 5b399c631faf..b2ec03b1afed 100644 --- a/sound/soc/codecs/wm8731.c +++ b/sound/soc/codecs/wm8731.c @@ -594,7 +594,22 @@ static int wm8731_request_supplies(struct device *dev, return 0; } -static int wm8731_hw_init(struct device *dev, struct wm8731_priv *wm8731) +static const struct snd_soc_component_driver soc_component_dev_wm8731 = { + .set_bias_level = wm8731_set_bias_level, + .controls = wm8731_snd_controls, + .num_controls = ARRAY_SIZE(wm8731_snd_controls), + .dapm_widgets = wm8731_dapm_widgets, + .num_dapm_widgets = ARRAY_SIZE(wm8731_dapm_widgets), + .dapm_routes = wm8731_intercon, + .num_dapm_routes = ARRAY_SIZE(wm8731_intercon), + .suspend_bias_off = 1, + .idle_bias_on = 1, + .use_pmdown_time = 1, + .endianness = 1, + .non_legacy_dai_naming = 1, +}; + +static int wm8731_init(struct device *dev, struct wm8731_priv *wm8731) { int ret = 0; @@ -618,6 +633,15 @@ static int wm8731_hw_init(struct device *dev, struct wm8731_priv *wm8731) regcache_mark_dirty(wm8731->regmap); + ret = devm_snd_soc_register_component(dev, + &soc_component_dev_wm8731, &wm8731_dai, 1); + if (ret != 0) { + dev_err(dev, "Failed to register CODEC: %d\n", ret); + goto err_regulator_enable; + } + + return 0; + err_regulator_enable: /* Regulators will be enabled by bias management */ regulator_bulk_disable(ARRAY_SIZE(wm8731->supplies), wm8731->supplies); @@ -625,21 +649,6 @@ static int wm8731_hw_init(struct device *dev, struct wm8731_priv *wm8731) return ret; } -static const struct snd_soc_component_driver soc_component_dev_wm8731 = { - .set_bias_level = wm8731_set_bias_level, - .controls = wm8731_snd_controls, - .num_controls = ARRAY_SIZE(wm8731_snd_controls), - .dapm_widgets = wm8731_dapm_widgets, - .num_dapm_widgets = ARRAY_SIZE(wm8731_dapm_widgets), - .dapm_routes = wm8731_intercon, - .num_dapm_routes = ARRAY_SIZE(wm8731_intercon), - .suspend_bias_off = 1, - .idle_bias_on = 1, - .use_pmdown_time = 1, - .endianness = 1, - .non_legacy_dai_naming = 1, -}; - static const struct of_device_id wm8731_of_match[] = { { .compatible = "wlf,wm8731", }, { } @@ -698,18 +707,7 @@ static int wm8731_spi_probe(struct spi_device *spi) return ret; } - ret = wm8731_hw_init(&spi->dev, wm8731); - if (ret != 0) - return ret; - - ret = devm_snd_soc_register_component(&spi->dev, - &soc_component_dev_wm8731, &wm8731_dai, 1); - if (ret != 0) { - dev_err(&spi->dev, "Failed to register CODEC: %d\n", ret); - return ret; - } - - return 0; + return wm8731_init(&spi->dev, wm8731); } static struct spi_driver wm8731_spi_driver = { @@ -762,18 +760,7 @@ static int wm8731_i2c_probe(struct i2c_client *i2c, return ret; } - ret = wm8731_hw_init(&i2c->dev, wm8731); - if (ret != 0) - return ret; - - ret = devm_snd_soc_register_component(&i2c->dev, - &soc_component_dev_wm8731, &wm8731_dai, 1); - if (ret != 0) { - dev_err(&i2c->dev, "Failed to register CODEC: %d\n", ret); - return ret; - } - - return 0; + return wm8731_init(&i2c->dev, wm8731); } static const struct i2c_device_id wm8731_i2c_id[] = { From patchwork Fri Mar 25 15:31:17 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 554398 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 54AC5C433F5 for ; Fri, 25 Mar 2022 15:35:00 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 3EEB51707; Fri, 25 Mar 2022 16:34:08 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 3EEB51707 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1648222498; bh=NqxcaBnxEjJ53GoQmFpvgu/LQKHpupq2rGbZFe+Xfhs=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=ivi+dYV0OOr+PSqZ2KExLZxL8LlmRJXNrqbMQsTyzwoiRBPRJ7JcJB4zLHzR8TwkU wmuO6jCxpk+h89PU1nikXIOgOVhf2sevgtVYt/3WOpMxV9PhRdU5SWuYI+l1o9is35 /n9XDyy9anik+z59UKdhBkUXU6/Vz1KYnVauMBbI= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 6589FF8051F; Fri, 25 Mar 2022 16:33:18 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id CEBF2F800AA; Fri, 25 Mar 2022 16:33:13 +0100 (CET) Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 6CF1DF80115 for ; Fri, 25 Mar 2022 16:33:10 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 6CF1DF80115 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="p/uxxp9v" Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id EB2FF60A76; Fri, 25 Mar 2022 15:33:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D2213C340EE; Fri, 25 Mar 2022 15:33:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1648222388; bh=NqxcaBnxEjJ53GoQmFpvgu/LQKHpupq2rGbZFe+Xfhs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=p/uxxp9vcPACyhy+NmG8+0xgytj21LxQJLJhTorvg5YT81H/ThIueBXOwVS/vRbMU tIQs45PmrolDgiIGyagZOvqCVYv3juJETLK9ZsB9cpvb7trXM04a0nLPd6tzaUUvGp ONRQ+7V+/ZhLFDrFMox+VMo69YrGNeWgMr+HGTY+avFNqe4dA9c0zWhBy5tb6ejEuw m8RBc165INMEhAh65vcC5FQ53NlfqKSHaRszJGrfxdF2EIZM2ct3MeN/595k9lkk3q /rxm3MjRBxmP3k/x7eZjzReyjM8qL+4dTQzi0CSoillgJVX6Ek1k4Ighej8eOVRNF7 ZZ8gusDlRaAog== From: Mark Brown To: Liam Girdwood Subject: [PATCH v1 3/7] ASoC: wm8731: Move regulator request into wm8731_init() Date: Fri, 25 Mar 2022 15:31:17 +0000 Message-Id: <20220325153121.1598494-4-broonie@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220325153121.1598494-1-broonie@kernel.org> References: <20220325153121.1598494-1-broonie@kernel.org> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2903; h=from:subject; bh=NqxcaBnxEjJ53GoQmFpvgu/LQKHpupq2rGbZFe+Xfhs=; b=owEBbQGS/pANAwAKASTWi3JdVIfQAcsmYgBiPeBF3SU/fe2mm2mwn8h3A1k3PvEbwELJWzyvXrDc mZ/ORQKJATMEAAEKAB0WIQSt5miqZ1cYtZ/in+ok1otyXVSH0AUCYj3gRQAKCRAk1otyXVSH0JlQB/ 97neGBUydMC/MHDnO/AQGc0ED46I/a0czkEFK3uhW7J47wREQvTpB+vbY6VybnyPihvChrABBKaSYf wQ5aCgmQNUxSwcVNbMP7fqdC1CcAlLWz6dKzSFZeuaYljPQ8u6vhMYfLoAua6+P6DJ7auxhJXIenIP Xk0/p+S9H+PPEMyxv4SW4b5Ea2QMmHOPCwFHdcQKJO/IbzQHxHbzD80kK0zIxTTP9FZK9EbD9ggV1b J3tkaIw3XewgO7vKfDuYeOnbjYSkluhcGoJeDSwR64G9Ku/vV2QmUTDw+u6ARTeJ/w8g3xElVW7Ujx Af/XfB+zjtRYrAi4+JeZeldwk3osFa X-Developer-Key: i=broonie@kernel.org; a=openpgp; fpr=3F2568AAC26998F9E813A1C5C3F436CA30F5D8EB Cc: patches@opensource.cirrus.com, alsa-devel@alsa-project.org, Mark Brown X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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" The supplies used by the wm8731 do not depend on the bus and there is no need to do anything with the supplies prior to instantiating the regmap so move the request into wm8731_init(). Signed-off-by: Mark Brown Acked-by: Charles Keepax --- sound/soc/codecs/wm8731.c | 48 +++++++++++++-------------------------- 1 file changed, 16 insertions(+), 32 deletions(-) diff --git a/sound/soc/codecs/wm8731.c b/sound/soc/codecs/wm8731.c index b2ec03b1afed..334332bb5f22 100644 --- a/sound/soc/codecs/wm8731.c +++ b/sound/soc/codecs/wm8731.c @@ -569,8 +569,22 @@ static struct snd_soc_dai_driver wm8731_dai = { .symmetric_rate = 1, }; -static int wm8731_request_supplies(struct device *dev, - struct wm8731_priv *wm8731) +static const struct snd_soc_component_driver soc_component_dev_wm8731 = { + .set_bias_level = wm8731_set_bias_level, + .controls = wm8731_snd_controls, + .num_controls = ARRAY_SIZE(wm8731_snd_controls), + .dapm_widgets = wm8731_dapm_widgets, + .num_dapm_widgets = ARRAY_SIZE(wm8731_dapm_widgets), + .dapm_routes = wm8731_intercon, + .num_dapm_routes = ARRAY_SIZE(wm8731_intercon), + .suspend_bias_off = 1, + .idle_bias_on = 1, + .use_pmdown_time = 1, + .endianness = 1, + .non_legacy_dai_naming = 1, +}; + +static int wm8731_init(struct device *dev, struct wm8731_priv *wm8731) { int ret = 0, i; @@ -591,28 +605,6 @@ static int wm8731_request_supplies(struct device *dev, return ret; } - return 0; -} - -static const struct snd_soc_component_driver soc_component_dev_wm8731 = { - .set_bias_level = wm8731_set_bias_level, - .controls = wm8731_snd_controls, - .num_controls = ARRAY_SIZE(wm8731_snd_controls), - .dapm_widgets = wm8731_dapm_widgets, - .num_dapm_widgets = ARRAY_SIZE(wm8731_dapm_widgets), - .dapm_routes = wm8731_intercon, - .num_dapm_routes = ARRAY_SIZE(wm8731_intercon), - .suspend_bias_off = 1, - .idle_bias_on = 1, - .use_pmdown_time = 1, - .endianness = 1, - .non_legacy_dai_naming = 1, -}; - -static int wm8731_init(struct device *dev, struct wm8731_priv *wm8731) -{ - int ret = 0; - ret = wm8731_reset(wm8731->regmap); if (ret < 0) { dev_err(dev, "Failed to issue reset: %d\n", ret); @@ -695,10 +687,6 @@ static int wm8731_spi_probe(struct spi_device *spi) spi_set_drvdata(spi, wm8731); - ret = wm8731_request_supplies(&spi->dev, wm8731); - if (ret != 0) - return ret; - wm8731->regmap = devm_regmap_init_spi(spi, &wm8731_regmap); if (IS_ERR(wm8731->regmap)) { ret = PTR_ERR(wm8731->regmap); @@ -748,10 +736,6 @@ static int wm8731_i2c_probe(struct i2c_client *i2c, i2c_set_clientdata(i2c, wm8731); - ret = wm8731_request_supplies(&i2c->dev, wm8731); - if (ret != 0) - return ret; - wm8731->regmap = devm_regmap_init_i2c(i2c, &wm8731_regmap); if (IS_ERR(wm8731->regmap)) { ret = PTR_ERR(wm8731->regmap); From patchwork Fri Mar 25 15:31:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 554050 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1A689C433EF for ; Fri, 25 Mar 2022 15:35:28 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 21B4F16C7; Fri, 25 Mar 2022 16:34:36 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 21B4F16C7 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1648222526; bh=YToyrpeXD0X+5VW3zfjTO/Ikw5RTRTAfwe1YXrozb3w=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=L2Jdw5pWkYJlPFERSQqkLkcZtgRwJAFLLJq6eLvOYLwDx/m+bBzy3ZgURiV5tJu9M RrmWkd8FwKoTsRYcTn/grSFDiYbuhsWK4jPX9gKWnrxqmRmg0iQh7f9r+h+uRH0TCR Abk6XsIBfbTXVOQuOaAssOcV3m5wnz2V/xiP6LuM= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 1C76EF80526; Fri, 25 Mar 2022 16:33:19 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 62745F8051A; Fri, 25 Mar 2022 16:33:15 +0100 (CET) Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 866DAF8051B for ; Fri, 25 Mar 2022 16:33:12 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 866DAF8051B Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="p8nTFWt1" Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 1AD93616B2; Fri, 25 Mar 2022 15:33:11 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 14FA7C340E9; Fri, 25 Mar 2022 15:33:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1648222390; bh=YToyrpeXD0X+5VW3zfjTO/Ikw5RTRTAfwe1YXrozb3w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=p8nTFWt1A1few/CV92DoH7g5kim6CTLK8pjzQYr0BypQURGohGrX40F1X6SOX6DEO bvNmttDUmXYJ0dK/1ySJZOxOOY2QGZGzGgMsFxrCEC25aeLBHMVREwhMAS4gXLWKit 2UvD//SQddu0gvJi6f7EpTBF19P1xIPe252N2XNJtZU0kHeAALPYKgRjUty/yaIU1e FpGxS4WNrO98tuQkCz+G52oS+XTSRCixwk5Ck/Ly/Hve9mUCsdt8MgML5T0IrthBav c2DC6Fx32xGxxXvCtmRmmzKjP3RSusVxx9CJsc5PYGvXJxkw4riGOG8FGBZ9SK4jW9 Q0wYTTeDU4V5Q== From: Mark Brown To: Liam Girdwood Subject: [PATCH v1 4/7] ASoC: wm8731: Factor our MCLK and mutex initialisation Date: Fri, 25 Mar 2022 15:31:18 +0000 Message-Id: <20220325153121.1598494-5-broonie@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220325153121.1598494-1-broonie@kernel.org> References: <20220325153121.1598494-1-broonie@kernel.org> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2237; h=from:subject; bh=YToyrpeXD0X+5VW3zfjTO/Ikw5RTRTAfwe1YXrozb3w=; b=owEBbQGS/pANAwAKASTWi3JdVIfQAcsmYgBiPeBG+XjR1VdDxA3ZwbxNzcof2mD/wEhd8n6vaAIF Siy4cdaJATMEAAEKAB0WIQSt5miqZ1cYtZ/in+ok1otyXVSH0AUCYj3gRgAKCRAk1otyXVSH0LcDB/ 9Iy0vL3Vmf/95jZi7O5DgE/TZRoOlx/KR1weJZ4J60Y6Mk5JKMcR9UZ7Bz2cd4J0eAf6XjmRI/b8cK +M710Pjqo8Fh8CYxW8V+OjtkV+w+qdLJdL4VYOdzcyqhjhQfxtAk1RQPrQryqBIxcSrUvNsEFxtcWO pYiyMkmd0hysLMb4eEI/BrmjozsAo2aYqTXA0UJeKxf37Inz+nBvla5vSTaPyh+OlnQbFIjf0oL62m 51ijzxUBEYAdqkskr0oJ+dgBXL+GrzWD6T0IHUgVJRP4yzPDQEGhJP6IkEmJK3hOatnA1rq1bSAphw TNpu90W/IIW0Gnb7vYr6fgSwg5beMh X-Developer-Key: i=broonie@kernel.org; a=openpgp; fpr=3F2568AAC26998F9E813A1C5C3F436CA30F5D8EB Cc: patches@opensource.cirrus.com, alsa-devel@alsa-project.org, Mark Brown X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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" The code for initialising the MCLK and mutex is identical in the I2C and SPI probe functions so just move this out into wm8731_init(). Signed-off-by: Mark Brown Acked-by: Charles Keepax --- sound/soc/codecs/wm8731.c | 44 +++++++++++++-------------------------- 1 file changed, 14 insertions(+), 30 deletions(-) diff --git a/sound/soc/codecs/wm8731.c b/sound/soc/codecs/wm8731.c index 334332bb5f22..43730aba11fe 100644 --- a/sound/soc/codecs/wm8731.c +++ b/sound/soc/codecs/wm8731.c @@ -588,6 +588,20 @@ static int wm8731_init(struct device *dev, struct wm8731_priv *wm8731) { int ret = 0, i; + wm8731->mclk = devm_clk_get(dev, "mclk"); + if (IS_ERR(wm8731->mclk)) { + ret = PTR_ERR(wm8731->mclk); + if (ret == -ENOENT) { + wm8731->mclk = NULL; + dev_warn(dev, "Assuming static MCLK\n"); + } else { + dev_err(dev, "Failed to get MCLK: %d\n", ret); + return ret; + } + } + + mutex_init(&wm8731->lock); + for (i = 0; i < ARRAY_SIZE(wm8731->supplies); i++) wm8731->supplies[i].supply = wm8731_supply_names[i]; @@ -670,21 +684,6 @@ static int wm8731_spi_probe(struct spi_device *spi) if (wm8731 == NULL) return -ENOMEM; - wm8731->mclk = devm_clk_get(&spi->dev, "mclk"); - if (IS_ERR(wm8731->mclk)) { - ret = PTR_ERR(wm8731->mclk); - if (ret == -ENOENT) { - wm8731->mclk = NULL; - dev_warn(&spi->dev, "Assuming static MCLK\n"); - } else { - dev_err(&spi->dev, "Failed to get MCLK: %d\n", - ret); - return ret; - } - } - - mutex_init(&wm8731->lock); - spi_set_drvdata(spi, wm8731); wm8731->regmap = devm_regmap_init_spi(spi, &wm8731_regmap); @@ -719,21 +718,6 @@ static int wm8731_i2c_probe(struct i2c_client *i2c, if (wm8731 == NULL) return -ENOMEM; - wm8731->mclk = devm_clk_get(&i2c->dev, "mclk"); - if (IS_ERR(wm8731->mclk)) { - ret = PTR_ERR(wm8731->mclk); - if (ret == -ENOENT) { - wm8731->mclk = NULL; - dev_warn(&i2c->dev, "Assuming static MCLK\n"); - } else { - dev_err(&i2c->dev, "Failed to get MCLK: %d\n", - ret); - return ret; - } - } - - mutex_init(&wm8731->lock); - i2c_set_clientdata(i2c, wm8731); wm8731->regmap = devm_regmap_init_i2c(i2c, &wm8731_regmap); From patchwork Fri Mar 25 15:31:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 554397 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 68519C433F5 for ; Fri, 25 Mar 2022 15:35:46 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 86B84171C; Fri, 25 Mar 2022 16:34:54 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 86B84171C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1648222544; bh=i9QLZ3B7gJ4qAVHeME/RCl9b9yur4KnXHtV057ilAaI=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=eQwcJLc2to4oy8VIFbMbfEf0phharcfSUb9FQO0WpbOndTRglakxff5g44oS5/AZq 7kfWQy5NKwQvov5GQrflK+138NVRda/fMFoVLeHZ0nvFzW3acwNUtnOvvhOPH5nnyV CoJUhOfta7UwKvbulDR+GvAg0jyWSjW7rLZqvvbI= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id B2977F8052D; Fri, 25 Mar 2022 16:33:23 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 95F0EF80518; Fri, 25 Mar 2022 16:33:20 +0100 (CET) Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 5CB3FF80518 for ; Fri, 25 Mar 2022 16:33:14 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 5CB3FF80518 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="AUVugSLe" Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 0831E60A76; Fri, 25 Mar 2022 15:33:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 177FAC340F4; Fri, 25 Mar 2022 15:33:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1648222392; bh=i9QLZ3B7gJ4qAVHeME/RCl9b9yur4KnXHtV057ilAaI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AUVugSLe0K2q5YDWL97jWR4B+gUBACy64Q/bd+x8TLPPY1Z5ceehci/3w9pa3OtCS KfKTBLYmjHKvvF09vTdIEjzsPY0wRsSBP44OiX07uYpkjwYYYBbUORtio7WTFA/W0c nkSYfyrmOzi8iV8RO93hPRHc6NkeDrEWBO0BGqXCsSybynlb9xpcdkIspfzj6dMzdD Fji6wLnXWfMXsf3xMsvKj30smk6r/l8nhHwiklSNepl+4xdOnTiUjCaV0t5HQ2ZZRQ JWo6EYrMWlOapWHQ+6xxO44k60P9TtSCNJXA9qZKsyfcIkuWDRv0NsgA/XWS8ecFXb yQADmtSnAsn3Q== From: Mark Brown To: Liam Girdwood Subject: [PATCH v1 5/7] ASoC: wm8731: Factor out the I2C and SPI bus code into separate modules Date: Fri, 25 Mar 2022 15:31:19 +0000 Message-Id: <20220325153121.1598494-6-broonie@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220325153121.1598494-1-broonie@kernel.org> References: <20220325153121.1598494-1-broonie@kernel.org> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=14152; h=from:subject; bh=i9QLZ3B7gJ4qAVHeME/RCl9b9yur4KnXHtV057ilAaI=; b=owEBbQGS/pANAwAKASTWi3JdVIfQAcsmYgBiPeBHjVWrs2MBVuHwq1IRZV8eps5sHKyhwO+Oh3nI 1S9FuKyJATMEAAEKAB0WIQSt5miqZ1cYtZ/in+ok1otyXVSH0AUCYj3gRwAKCRAk1otyXVSH0IkJB/ oCDIb6v5PrtPVlgdyJMj6481VD6dNp7iKcC1YCWntlUjzNuOipjINutSFIu20YGWA9oFbXA6c35x9e KSDMOGcDVr3vsNvfEa3wy5ZMgpnPWtY7AKo6yeewlhPARLaZwr8DpVVbM4M05ncz5EuPev+7q+0OMK vjPmJmPzos/9RXfhj2xLHxOqCC+2wPhnArQTRwOEe/Kj+9urxrY3kE46Hcn7oSYHeNjET0wmdwjdvs rHmJa663mwSIuXT9UtsKdf6PFKleYUP8ClnOFGDjb78qHkPWkBi2vrxhIppK02XviuA3es2yyzFTTk BQdjVZVIgXMEXz6fRh9VIIyMZww4Ln X-Developer-Key: i=broonie@kernel.org; a=openpgp; fpr=3F2568AAC26998F9E813A1C5C3F436CA30F5D8EB Cc: patches@opensource.cirrus.com, alsa-devel@alsa-project.org, Mark Brown X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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" Placing both the I2C and SPI code in the same module causes problems with mixes of modular and non-modular builds of the buses so it's generally bad practice. As with other drivers split the bus code out of the WM8731 driver into separate modules. Signed-off-by: Mark Brown Acked-by: Charles Keepax Acked-by: Charles Keepax --- sound/soc/atmel/Kconfig | 4 +- sound/soc/au1x/Kconfig | 2 +- sound/soc/codecs/Kconfig | 18 ++++- sound/soc/codecs/Makefile | 4 + sound/soc/codecs/wm8731-i2c.c | 69 +++++++++++++++++ sound/soc/codecs/wm8731-spi.c | 59 +++++++++++++++ sound/soc/codecs/wm8731.c | 138 +--------------------------------- sound/soc/codecs/wm8731.h | 27 +++++++ sound/soc/pxa/Kconfig | 4 +- 9 files changed, 183 insertions(+), 142 deletions(-) create mode 100644 sound/soc/codecs/wm8731-i2c.c create mode 100644 sound/soc/codecs/wm8731-spi.c diff --git a/sound/soc/atmel/Kconfig b/sound/soc/atmel/Kconfig index 8617793ed955..2a3ade9e56ec 100644 --- a/sound/soc/atmel/Kconfig +++ b/sound/soc/atmel/Kconfig @@ -42,9 +42,9 @@ config SND_ATMEL_SOC_SSC_DMA config SND_AT91_SOC_SAM9G20_WM8731 tristate "SoC Audio support for WM8731-based At91sam9g20 evaluation board" depends on ARCH_AT91 || COMPILE_TEST - depends on ATMEL_SSC && SND_SOC_I2C_AND_SPI + depends on ATMEL_SSC && I2C select SND_ATMEL_SOC_SSC_PDC - select SND_SOC_WM8731 + select SND_SOC_WM8731_I2C help Say Y if you want to add support for SoC audio on WM8731-based AT91sam9g20 evaluation board. diff --git a/sound/soc/au1x/Kconfig b/sound/soc/au1x/Kconfig index 38de7c0efbc7..8a78809e8754 100644 --- a/sound/soc/au1x/Kconfig +++ b/sound/soc/au1x/Kconfig @@ -58,7 +58,7 @@ config SND_SOC_DB1200 select SND_SOC_AC97_CODEC select SND_SOC_WM9712 select SND_SOC_AU1XPSC_I2S - select SND_SOC_WM8731 + select SND_SOC_WM8731_I2C help Select this option to enable audio (AC97 and I2S) on the Alchemy/AMD/RMI/NetLogic Db1200, Db1550 and Db1300 evaluation boards. diff --git a/sound/soc/codecs/Kconfig b/sound/soc/codecs/Kconfig index c2627f7489a4..ab4e5b5e827a 100644 --- a/sound/soc/codecs/Kconfig +++ b/sound/soc/codecs/Kconfig @@ -263,7 +263,8 @@ config SND_SOC_ALL_CODECS imply SND_SOC_WM8711 imply SND_SOC_WM8727 imply SND_SOC_WM8728 - imply SND_SOC_WM8731 + imply SND_SOC_WM8731_I2C + imply SND_SOC_WM8731_SPI imply SND_SOC_WM8737 imply SND_SOC_WM8741 imply SND_SOC_WM8750 @@ -1742,8 +1743,19 @@ config SND_SOC_WM8728 depends on SND_SOC_I2C_AND_SPI config SND_SOC_WM8731 - tristate "Wolfson Microelectronics WM8731 CODEC" - depends on SND_SOC_I2C_AND_SPI + tristate + +config SND_SOC_WM8731_I2C + tristate "Wolfson Microelectronics WM8731 CODEC with I2C" + depends on I2C + select REGMAP + select SND_SOC_WM8731 + +config SND_SOC_WM8731_SPI + tristate "Wolfson Microelectronics WM8731 CODEC with SPI" + depends on SPI + select REGMAP + select SND_SOC_WM8731 config SND_SOC_WM8737 tristate "Wolfson Microelectronics WM8737 ADC" diff --git a/sound/soc/codecs/Makefile b/sound/soc/codecs/Makefile index b4e11c3e4a08..d98a22c54a4e 100644 --- a/sound/soc/codecs/Makefile +++ b/sound/soc/codecs/Makefile @@ -288,6 +288,8 @@ snd-soc-wm8711-objs := wm8711.o snd-soc-wm8727-objs := wm8727.o snd-soc-wm8728-objs := wm8728.o snd-soc-wm8731-objs := wm8731.o +snd-soc-wm8731-i2c-objs := wm8731-i2c.o +snd-soc-wm8731-spi-objs := wm8731-spi.o snd-soc-wm8737-objs := wm8737.o snd-soc-wm8741-objs := wm8741.o snd-soc-wm8750-objs := wm8750.o @@ -629,6 +631,8 @@ obj-$(CONFIG_SND_SOC_WM8711) += snd-soc-wm8711.o obj-$(CONFIG_SND_SOC_WM8727) += snd-soc-wm8727.o obj-$(CONFIG_SND_SOC_WM8728) += snd-soc-wm8728.o obj-$(CONFIG_SND_SOC_WM8731) += snd-soc-wm8731.o +obj-$(CONFIG_SND_SOC_WM8731_I2C) += snd-soc-wm8731-i2c.o +obj-$(CONFIG_SND_SOC_WM8731_SPI) += snd-soc-wm8731-spi.o obj-$(CONFIG_SND_SOC_WM8737) += snd-soc-wm8737.o obj-$(CONFIG_SND_SOC_WM8741) += snd-soc-wm8741.o obj-$(CONFIG_SND_SOC_WM8750) += snd-soc-wm8750.o diff --git a/sound/soc/codecs/wm8731-i2c.c b/sound/soc/codecs/wm8731-i2c.c new file mode 100644 index 000000000000..c70f5db891e7 --- /dev/null +++ b/sound/soc/codecs/wm8731-i2c.c @@ -0,0 +1,69 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * wm8731-i2c.c -- WM8731 ALSA SoC Audio driver I2C code + * + * Copyright 2005 Openedhand Ltd. + * Copyright 2006-12 Wolfson Microelectronics, plc + * + * Author: Richard Purdie + * + * Based on wm8753.c by Liam Girdwood + */ + +#include +#include +#include + +#include "wm8731.h" + + +static const struct of_device_id wm8731_of_match[] = { + { .compatible = "wlf,wm8731", }, + { } +}; +MODULE_DEVICE_TABLE(of, wm8731_of_match); + +static int wm8731_i2c_probe(struct i2c_client *i2c, + const struct i2c_device_id *id) +{ + struct wm8731_priv *wm8731; + int ret; + + wm8731 = devm_kzalloc(&i2c->dev, sizeof(struct wm8731_priv), + GFP_KERNEL); + if (wm8731 == NULL) + return -ENOMEM; + + i2c_set_clientdata(i2c, wm8731); + + wm8731->regmap = devm_regmap_init_i2c(i2c, &wm8731_regmap); + if (IS_ERR(wm8731->regmap)) { + ret = PTR_ERR(wm8731->regmap); + dev_err(&i2c->dev, "Failed to allocate register map: %d\n", + ret); + return ret; + } + + return wm8731_init(&i2c->dev, wm8731); +} + +static const struct i2c_device_id wm8731_i2c_id[] = { + { "wm8731", 0 }, + { } +}; +MODULE_DEVICE_TABLE(i2c, wm8731_i2c_id); + +static struct i2c_driver wm8731_i2c_driver = { + .driver = { + .name = "wm8731", + .of_match_table = wm8731_of_match, + }, + .probe = wm8731_i2c_probe, + .id_table = wm8731_i2c_id, +}; + +module_i2c_driver(wm8731_i2c_driver); + +MODULE_DESCRIPTION("ASoC WM8731 driver - I2C"); +MODULE_AUTHOR("Richard Purdie"); +MODULE_LICENSE("GPL"); diff --git a/sound/soc/codecs/wm8731-spi.c b/sound/soc/codecs/wm8731-spi.c new file mode 100644 index 000000000000..542ed097d89a --- /dev/null +++ b/sound/soc/codecs/wm8731-spi.c @@ -0,0 +1,59 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * wm8731.c -- WM8731 ALSA SoC Audio driver + * + * Copyright 2005 Openedhand Ltd. + * Copyright 2006-12 Wolfson Microelectronics, plc + * + * Author: Richard Purdie + * + * Based on wm8753.c by Liam Girdwood + */ + +#include +#include +#include + +#include "wm8731.h" + +static const struct of_device_id wm8731_of_match[] = { + { .compatible = "wlf,wm8731", }, + { } +}; +MODULE_DEVICE_TABLE(of, wm8731_of_match); + +static int wm8731_spi_probe(struct spi_device *spi) +{ + struct wm8731_priv *wm8731; + int ret; + + wm8731 = devm_kzalloc(&spi->dev, sizeof(*wm8731), GFP_KERNEL); + if (wm8731 == NULL) + return -ENOMEM; + + spi_set_drvdata(spi, wm8731); + + wm8731->regmap = devm_regmap_init_spi(spi, &wm8731_regmap); + if (IS_ERR(wm8731->regmap)) { + ret = PTR_ERR(wm8731->regmap); + dev_err(&spi->dev, "Failed to allocate register map: %d\n", + ret); + return ret; + } + + return wm8731_init(&spi->dev, wm8731); +} + +static struct spi_driver wm8731_spi_driver = { + .driver = { + .name = "wm8731", + .of_match_table = wm8731_of_match, + }, + .probe = wm8731_spi_probe, +}; + +module_spi_driver(wm8731_spi_driver); + +MODULE_DESCRIPTION("ASoC WM8731 driver - SPI"); +MODULE_AUTHOR("Richard Purdie"); +MODULE_LICENSE("GPL"); diff --git a/sound/soc/codecs/wm8731.c b/sound/soc/codecs/wm8731.c index 43730aba11fe..2408c4a591d5 100644 --- a/sound/soc/codecs/wm8731.c +++ b/sound/soc/codecs/wm8731.c @@ -15,13 +15,9 @@ #include #include #include -#include #include #include #include -#include -#include -#include #include #include #include @@ -32,7 +28,6 @@ #include "wm8731.h" -#define WM8731_NUM_SUPPLIES 4 static const char *wm8731_supply_names[WM8731_NUM_SUPPLIES] = { "AVDD", "HPVDD", @@ -40,21 +35,6 @@ static const char *wm8731_supply_names[WM8731_NUM_SUPPLIES] = { "DBVDD", }; -/* codec private data */ -struct wm8731_priv { - struct regmap *regmap; - struct clk *mclk; - struct regulator_bulk_data supplies[WM8731_NUM_SUPPLIES]; - const struct snd_pcm_hw_constraint_list *constraints; - unsigned int sysclk; - int sysclk_type; - int playback_fs; - bool deemph; - - struct mutex lock; -}; - - /* * wm8731 register cache */ @@ -584,7 +564,7 @@ static const struct snd_soc_component_driver soc_component_dev_wm8731 = { .non_legacy_dai_naming = 1, }; -static int wm8731_init(struct device *dev, struct wm8731_priv *wm8731) +int wm8731_init(struct device *dev, struct wm8731_priv *wm8731) { int ret = 0, i; @@ -654,15 +634,9 @@ static int wm8731_init(struct device *dev, struct wm8731_priv *wm8731) return ret; } +EXPORT_SYMBOL_GPL(wm8731_init); -static const struct of_device_id wm8731_of_match[] = { - { .compatible = "wlf,wm8731", }, - { } -}; - -MODULE_DEVICE_TABLE(of, wm8731_of_match); - -static const struct regmap_config wm8731_regmap = { +const struct regmap_config wm8731_regmap = { .reg_bits = 7, .val_bits = 9, @@ -673,111 +647,7 @@ static const struct regmap_config wm8731_regmap = { .reg_defaults = wm8731_reg_defaults, .num_reg_defaults = ARRAY_SIZE(wm8731_reg_defaults), }; - -#if defined(CONFIG_SPI_MASTER) -static int wm8731_spi_probe(struct spi_device *spi) -{ - struct wm8731_priv *wm8731; - int ret; - - wm8731 = devm_kzalloc(&spi->dev, sizeof(*wm8731), GFP_KERNEL); - if (wm8731 == NULL) - return -ENOMEM; - - spi_set_drvdata(spi, wm8731); - - wm8731->regmap = devm_regmap_init_spi(spi, &wm8731_regmap); - if (IS_ERR(wm8731->regmap)) { - ret = PTR_ERR(wm8731->regmap); - dev_err(&spi->dev, "Failed to allocate register map: %d\n", - ret); - return ret; - } - - return wm8731_init(&spi->dev, wm8731); -} - -static struct spi_driver wm8731_spi_driver = { - .driver = { - .name = "wm8731", - .of_match_table = wm8731_of_match, - }, - .probe = wm8731_spi_probe, -}; -#endif /* CONFIG_SPI_MASTER */ - -#if IS_ENABLED(CONFIG_I2C) -static int wm8731_i2c_probe(struct i2c_client *i2c, - const struct i2c_device_id *id) -{ - struct wm8731_priv *wm8731; - int ret; - - wm8731 = devm_kzalloc(&i2c->dev, sizeof(struct wm8731_priv), - GFP_KERNEL); - if (wm8731 == NULL) - return -ENOMEM; - - i2c_set_clientdata(i2c, wm8731); - - wm8731->regmap = devm_regmap_init_i2c(i2c, &wm8731_regmap); - if (IS_ERR(wm8731->regmap)) { - ret = PTR_ERR(wm8731->regmap); - dev_err(&i2c->dev, "Failed to allocate register map: %d\n", - ret); - return ret; - } - - return wm8731_init(&i2c->dev, wm8731); -} - -static const struct i2c_device_id wm8731_i2c_id[] = { - { "wm8731", 0 }, - { } -}; -MODULE_DEVICE_TABLE(i2c, wm8731_i2c_id); - -static struct i2c_driver wm8731_i2c_driver = { - .driver = { - .name = "wm8731", - .of_match_table = wm8731_of_match, - }, - .probe = wm8731_i2c_probe, - .id_table = wm8731_i2c_id, -}; -#endif - -static int __init wm8731_modinit(void) -{ - int ret = 0; -#if IS_ENABLED(CONFIG_I2C) - ret = i2c_add_driver(&wm8731_i2c_driver); - if (ret != 0) { - printk(KERN_ERR "Failed to register WM8731 I2C driver: %d\n", - ret); - } -#endif -#if defined(CONFIG_SPI_MASTER) - ret = spi_register_driver(&wm8731_spi_driver); - if (ret != 0) { - printk(KERN_ERR "Failed to register WM8731 SPI driver: %d\n", - ret); - } -#endif - return ret; -} -module_init(wm8731_modinit); - -static void __exit wm8731_exit(void) -{ -#if IS_ENABLED(CONFIG_I2C) - i2c_del_driver(&wm8731_i2c_driver); -#endif -#if defined(CONFIG_SPI_MASTER) - spi_unregister_driver(&wm8731_spi_driver); -#endif -} -module_exit(wm8731_exit); +EXPORT_SYMBOL_GPL(wm8731_regmap); MODULE_DESCRIPTION("ASoC WM8731 driver"); MODULE_AUTHOR("Richard Purdie"); diff --git a/sound/soc/codecs/wm8731.h b/sound/soc/codecs/wm8731.h index 4fcf1226d7c2..8d5a7a9ca6b2 100644 --- a/sound/soc/codecs/wm8731.h +++ b/sound/soc/codecs/wm8731.h @@ -12,6 +12,13 @@ #ifndef _WM8731_H #define _WM8731_H +#include +#include +#include + +struct clk; +struct snd_pcm_hw_constraint_list; + /* WM8731 register space */ #define WM8731_LINVOL 0x00 @@ -33,4 +40,24 @@ #define WM8731_DAI 0 +#define WM8731_NUM_SUPPLIES 4 + +/* codec private data */ +struct wm8731_priv { + struct regmap *regmap; + struct clk *mclk; + struct regulator_bulk_data supplies[WM8731_NUM_SUPPLIES]; + const struct snd_pcm_hw_constraint_list *constraints; + unsigned int sysclk; + int sysclk_type; + int playback_fs; + bool deemph; + + struct mutex lock; +}; + +extern const struct regmap_config wm8731_regmap; + +int wm8731_init(struct device *dev, struct wm8731_priv *wm8731); + #endif diff --git a/sound/soc/pxa/Kconfig b/sound/soc/pxa/Kconfig index 9d40e8a206d1..c51e1961ca20 100644 --- a/sound/soc/pxa/Kconfig +++ b/sound/soc/pxa/Kconfig @@ -45,7 +45,7 @@ config SND_PXA2XX_SOC_CORGI tristate "SoC Audio support for Sharp Zaurus SL-C7x0" depends on SND_PXA2XX_SOC && PXA_SHARP_C7xx && I2C select SND_PXA2XX_SOC_I2S - select SND_SOC_WM8731 + select SND_SOC_WM8731_I2C help Say Y if you want to add support for SoC audio on Sharp Zaurus SL-C7x0 models (Corgi, Shepherd, Husky). @@ -71,7 +71,7 @@ config SND_PXA2XX_SOC_POODLE tristate "SoC Audio support for Poodle" depends on SND_PXA2XX_SOC && MACH_POODLE && I2C select SND_PXA2XX_SOC_I2S - select SND_SOC_WM8731 + select SND_SOC_WM8731_I2C help Say Y if you want to add support for SoC audio on Sharp Zaurus SL-5600 model (Poodle). From patchwork Fri Mar 25 15:31:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 554396 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 21AFBC433EF for ; Fri, 25 Mar 2022 15:36:19 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 401BF16BD; Fri, 25 Mar 2022 16:35:27 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 401BF16BD DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1648222577; bh=2n8SZxW/c+uKNScbsLPpkBSsbkkXDn51crnHh0yts1w=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=vY9RYBXns/XBDuMx1tP0J8w7lLCCvPlb86qW6lmYyU44r4t80OIgMK7X6HJwX78t/ trQ+W8biqE/1D3Yc1X29FvzCmdr+njKW8mGd0b+dzKr7tSmSwfTRThxb0zJloTt4Al p1nmUTr96cH9q4cu/OVSDcGVERUmXjdLMqBcixsA= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id AB0E4F8053C; Fri, 25 Mar 2022 16:33:29 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id A046EF80536; Fri, 25 Mar 2022 16:33:26 +0100 (CET) Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id B4D81F80527 for ; Fri, 25 Mar 2022 16:33:16 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz B4D81F80527 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="F26rIHzt" Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id A1D0FB828FA; Fri, 25 Mar 2022 15:33:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E1895C340F3; Fri, 25 Mar 2022 15:33:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1648222394; bh=2n8SZxW/c+uKNScbsLPpkBSsbkkXDn51crnHh0yts1w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=F26rIHztqZl9eGZku9QIjKCIILKpD+fw6vTwrZ7eNUVjwrYnavFhOqv/3coM+4Yc3 /797kFY7Qg+DJJY+V1fluQZkS4xHGG2eSJNo9VPN20FJ/OMNu8Aldb3FciJ9WsDqVZ RGtPG8Te4VDMRbsWQr3Cqzuh6UTxlAnaR2tCw3Bb34hdEZyflqNdqGuaUAwn4jybkd ipumTHsCKzJz51MiA8cbEwndU1Tb8oyiTCDZANPYl3OmpK0gwkrbbe1fAmohaRqNkB q2PjBCgcCatgV+WGniGSZFFzzDTJyLoW4vlYLbsXkOTvdtuqWPQ52YmaJ5z1D9dRjF F6zuohaxwd+nQ== From: Mark Brown To: Liam Girdwood Subject: [PATCH v1 6/7] ASoC: wm8731: Convert DT bindings to YAML format Date: Fri, 25 Mar 2022 15:31:20 +0000 Message-Id: <20220325153121.1598494-7-broonie@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220325153121.1598494-1-broonie@kernel.org> References: <20220325153121.1598494-1-broonie@kernel.org> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=4272; h=from:subject; bh=2n8SZxW/c+uKNScbsLPpkBSsbkkXDn51crnHh0yts1w=; b=owEBbQGS/pANAwAKASTWi3JdVIfQAcsmYgBiPeBHO9ZXU/9OFKM3UQF17aC9qjtZqidSyQ+uGa4a /kxT82uJATMEAAEKAB0WIQSt5miqZ1cYtZ/in+ok1otyXVSH0AUCYj3gRwAKCRAk1otyXVSH0NzSCA CDv94myW3KiuJnWu2P+bkOK3LKLY+xHrIVubeIzbMFzM8690rO0XC0AmGSE/DqwGrXeIQgAyN7+SU5 vvXcfXJaX0PZRVoSyyYxKwvYmwYGbgdAL/0imsXfLGNK6UMzOsICZOb6L63EymfcREY5dSllHu+AOf LrIYmeWQLHDWK2Q2IgNOZQYQvpiyFYf2r4jWO6T1vtyuGGP3pELVl9fUso9mijJcww3DlR/5MW74mN Rj0D3BgkbaDT7SjHt6jwAM77/9RIXmkJuLkqlBMiQrUqMAWkp02TxGkFyTRBlfK2bSV49wpTqLUPN0 C8GjXYaAxTQEUl2EKcnha3IKDx0IRl X-Developer-Key: i=broonie@kernel.org; a=openpgp; fpr=3F2568AAC26998F9E813A1C5C3F436CA30F5D8EB Cc: patches@opensource.cirrus.com, alsa-devel@alsa-project.org, Mark Brown , Rob Herring , devicetree@vger.kernel.org X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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" Convert the WM8731 DT bindings to YAML format, including addition of documentation for the regulator and clock bindings which the driver has had for some time but which were not covered in the bindings document. Signed-off-by: Mark Brown Cc: Rob Herring Cc: devicetree@vger.kernel.org Acked-by: Charles Keepax Reviewed-by: Rob Herring --- .../devicetree/bindings/sound/wlf,wm8731.yaml | 97 +++++++++++++++++++ .../devicetree/bindings/sound/wm8731.txt | 27 ------ 2 files changed, 97 insertions(+), 27 deletions(-) create mode 100644 Documentation/devicetree/bindings/sound/wlf,wm8731.yaml delete mode 100644 Documentation/devicetree/bindings/sound/wm8731.txt diff --git a/Documentation/devicetree/bindings/sound/wlf,wm8731.yaml b/Documentation/devicetree/bindings/sound/wlf,wm8731.yaml new file mode 100644 index 000000000000..e7220e8b49f0 --- /dev/null +++ b/Documentation/devicetree/bindings/sound/wlf,wm8731.yaml @@ -0,0 +1,97 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/sound/wlf,wm8731.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Wolfson Microelectromics WM8731 audio CODEC + +maintainers: + - patches@opensource.cirrus.com + +description: | + Wolfson Microelectronics WM8731 audio CODEC + + Pins on the device (for linking into audio routes): + * LOUT: Left Channel Line Output + * ROUT: Right Channel Line Output + * LHPOUT: Left Channel Headphone Output + * RHPOUT: Right Channel Headphone Output + * LLINEIN: Left Channel Line Input + * RLINEIN: Right Channel Line Input + * MICIN: Microphone Input + +properties: + compatible: + enum: + - wlf,wm8731 + + reg: + maxItems: 1 + + "#sound-dai-cells": + const: 0 + + clocks: + description: Clock provider for MCLK pin. + maxItems: 1 + + clock-names: + items: + - const: mclk + + AVDD-supply: + description: Analog power supply regulator on the AVDD pin. + + HPVDD-supply: + description: Headphone power supply regulator on the HPVDD pin. + + DBVDD-supply: + description: Digital buffer supply regulator for the DBVDD pin. + + DCVDD-supply: + description: Digital core supply regulator for the DCVDD pin. + + spi-max-frequency: true + +additionalProperties: false + +required: + - reg + - compatible + - AVDD-supply + - HPVDD-supply + - DBVDD-supply + - DCVDD-supply + +examples: + - | + spi { + #address-cells = <1>; + #size-cells = <0>; + wm8731_i2c: codec@0 { + compatible = "wlf,wm8731"; + reg = <0>; + spi-max-frequency = <12500000>; + + AVDD-supply = <&avdd_reg>; + HPVDD-supply = <&hpvdd_reg>; + DCVDD-supply = <&dcvdd_reg>; + DBVDD-supply = <&dbvdd_reg>; + }; + }; + - | + + i2c { + #address-cells = <1>; + #size-cells = <0>; + wm8731_spi: codec@1b { + compatible = "wlf,wm8731"; + reg = <0x1b>; + + AVDD-supply = <&avdd_reg>; + HPVDD-supply = <&hpvdd_reg>; + DCVDD-supply = <&dcvdd_reg>; + DBVDD-supply = <&dbvdd_reg>; + }; + }; diff --git a/Documentation/devicetree/bindings/sound/wm8731.txt b/Documentation/devicetree/bindings/sound/wm8731.txt deleted file mode 100644 index f660d9bb0e69..000000000000 --- a/Documentation/devicetree/bindings/sound/wm8731.txt +++ /dev/null @@ -1,27 +0,0 @@ -WM8731 audio CODEC - -This device supports both I2C and SPI (configured with pin strapping -on the board). - -Required properties: - - - compatible : "wlf,wm8731" - - - reg : the I2C address of the device for I2C, the chip select - number for SPI. - -Example: - -wm8731: codec@1a { - compatible = "wlf,wm8731"; - reg = <0x1a>; -}; - -Available audio endpoints for an audio-routing table: - * LOUT: Left Channel Line Output - * ROUT: Right Channel Line Output - * LHPOUT: Left Channel Headphone Output - * RHPOUT: Right Channel Headphone Output - * LLINEIN: Left Channel Line Input - * RLINEIN: Right Channel Line Input - * MICIN: Microphone Input From patchwork Fri Mar 25 15:31:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 554049 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 32307C433EF for ; Fri, 25 Mar 2022 15:36:02 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 5BDEF16FF; Fri, 25 Mar 2022 16:35:10 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 5BDEF16FF DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1648222560; bh=AWBxOhZ8G2NcA+v3xSDS7tuQrOljT8MnfBJLg2MRTcs=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=JjK5RyDjI1khn536wzBn3jeFqFjKByZl7+ozhWptRAO2DZTPl/tjmwOC3fZPg8hnn D4f01mFNcBEOB0EesMw7c9OtTImONxAcI5Crt7yvyIhYIAhTSCA+u0vTmG0DsYfGs9 GfNbcOqSfa0FTsUgfzhFmSZOcv/3NSXhBdK328GI= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 28A30F80536; Fri, 25 Mar 2022 16:33:27 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 8DB9BF8053A; Fri, 25 Mar 2022 16:33:25 +0100 (CET) Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 15F41F80533 for ; Fri, 25 Mar 2022 16:33:18 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 15F41F80533 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="TrdKuMTG" Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 3B9BCB827B7; Fri, 25 Mar 2022 15:33:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C0807C36AE2; Fri, 25 Mar 2022 15:33:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1648222396; bh=AWBxOhZ8G2NcA+v3xSDS7tuQrOljT8MnfBJLg2MRTcs=; h=From:To:List-Id:Cc:Subject:Date:In-Reply-To:References:From; b=TrdKuMTGGXC/AnERBlShWugWcen941XwgSuzwIG8e9/FXbR/GUqtGCRvWTRShZBRw SLMIZozJtcJZKhCA4YPusHkhPvzxVLL6m+udinED10CeGVqNkS765Gqy9LJmbsB+5Y /fY3FOEQrCXBLXLHF43BpX0/uvKTiI18lPnXlfkcJQaDbbrELrj+N5ctdpnEUhVTBm 3K8xRQgsQbQa05z17dVK/AI7VtxY8S6heranoTKqVFSivApCNa54nZDwCo31Q1agOg B8FDSuPbTmrHVUM6SRT1cg0QAVpk3iaCQA4GDNCkMAlz8yQor7EPK6foFFfHBH43Zo iqQYnbAirL/uw== From: Mark Brown To: Liam Girdwood Subject: [PATCH v1 7/7] ARM: configs: Update multi_v5_defconfig for WM8731 bus refactoring Date: Fri, 25 Mar 2022 15:31:21 +0000 Message-Id: <20220325153121.1598494-8-broonie@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220325153121.1598494-1-broonie@kernel.org> References: <20220325153121.1598494-1-broonie@kernel.org> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=840; h=from:subject; bh=AWBxOhZ8G2NcA+v3xSDS7tuQrOljT8MnfBJLg2MRTcs=; b=owEBbQGS/pANAwAKASTWi3JdVIfQAcsmYgBiPeBI+8hhUyrAB9konZFbE6QBpOXwo19/k9GOEAKZ McW27kaJATMEAAEKAB0WIQSt5miqZ1cYtZ/in+ok1otyXVSH0AUCYj3gSAAKCRAk1otyXVSH0OP5B/ 4k9hwaZDR+RXEc4lZMqfglkGk0309vFUPvwfdse81h2AyWYu/A9c/Z++ZQAQMYtCcu9TRlWi6tBVKC ynvtz6b+BVbGkjXW9InYfj++TBaH5jaGMFBEnSMRC71/r+RVns51m+l6Dj4G2RI0LklCQtTzuNBTx2 sS623vYQG9wpECfbKRLfnGTMBDguVEj7aVQXThGYHrbqqNatHcQcT93UWvZt6go6G/YuS/xDyIUfa8 rIzpavR4xGVTPgRgu5L+p/bDznWLgyqdDfm9ZDm97MeDBOp59EBNFD8GoV59fHGpnvYb5Um3xaensU IZG40FZugKgMJlzTKdtw16CJS10r5Q X-Developer-Key: i=broonie@kernel.org; a=openpgp; fpr=3F2568AAC26998F9E813A1C5C3F436CA30F5D8EB Cc: patches@opensource.cirrus.com, alsa-devel@alsa-project.org, Mark Brown , soc@kernel.org X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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" The WM8731 driver has been refactored so the I2C and SPI bus code is separate modules. Refresh multi_v5_defconfig to reflect this. Signed-off-by: Mark Brown Cc: soc@kernel.org Reviewed-by: Charles Keepax Acked-by: Arnd Bergmann --- arch/arm/configs/multi_v5_defconfig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/arm/configs/multi_v5_defconfig b/arch/arm/configs/multi_v5_defconfig index fe8d760256a4..38a939d91a32 100644 --- a/arch/arm/configs/multi_v5_defconfig +++ b/arch/arm/configs/multi_v5_defconfig @@ -208,7 +208,8 @@ CONFIG_SND_ATMEL_SOC_WM8904=m CONFIG_SND_AT91_SOC_SAM9X5_WM8731=m CONFIG_SND_KIRKWOOD_SOC=y CONFIG_SND_SOC_ALC5623=y -CONFIG_SND_SOC_WM8731=y +CONFIG_SND_SOC_WM8731_I2C=y +CONFIG_SND_SOC_WM8731_SPI=y CONFIG_SND_SIMPLE_CARD=y CONFIG_HID_DRAGONRISE=y CONFIG_HID_GYRATION=y