From patchwork Wed Jan 4 14:04:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Francesco Dolcini X-Patchwork-Id: 13088616 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 15D93C46467 for ; Wed, 4 Jan 2023 14:06:05 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 95891B1BF; Wed, 4 Jan 2023 15:05:13 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 95891B1BF DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1672841163; bh=u8FK9CPIvJPseM0rmgjjenWelwK6ei1bF0xBEbbYaB8=; h=From:To:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=VgLOfaQhYdjObNoU3dkC9xWdQssdQBHDElCfmnJrIZpHbkGnOac/J/fTMP4uT4dXf +aBgB00ZYkbv4IPR2ToML2FkEFqY1lv5cZ/YroR2pBh8CaXcSr08ULLvKiq4L42RaU /6XLGVcmgQnF1y3LzHGExmy1Hz4kPwTRMadt9XVQ= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id D8595F8032D; Wed, 4 Jan 2023 15:04:49 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id AE0C1F803DC; Wed, 4 Jan 2023 15:04:48 +0100 (CET) Received: from smtp-out-08.comm2000.it (smtp-out-08.comm2000.it [212.97.32.78]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id D3D67F8023B for ; Wed, 4 Jan 2023 15:04:46 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz D3D67F8023B Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=mailserver.it header.i=@mailserver.it header.a=rsa-sha256 header.s=mailsrv header.b=EehzkHgv Received: from francesco-nb.toradex.int (31-10-206-125.static.upc.ch [31.10.206.125]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: francesco@dolcini.it) by smtp-out-08.comm2000.it (Postfix) with ESMTPSA id CED02421F19; Wed, 4 Jan 2023 15:04:34 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=mailserver.it; s=mailsrv; t=1672841081; bh=u8FK9CPIvJPseM0rmgjjenWelwK6ei1bF0xBEbbYaB8=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=EehzkHgvQTszRTilSND2IPObvhaqsIB6v1Uk1rmQVcH3nMRARMSgG6Tjjsn8BZmZN f7GgfwS+44zoRTprtNj0wpUYlt3oQRbue8ja7g9N7oexvBVVsNOfnenacM6VMdRwwT S3F3LBjV0YMpKYFLZ3WopcekcvyYemHF+g64wNJPo68GuHMdVmL9ioxUF9FjfIOvp7 Ma4pEllSd+4TEBZQouI0vOfbQtGvDEn2P/B/SDmpPcgxxQWnaw4OtYxFdh4wHm/VqJ PYYDNqBQJWFmM4+1ZyGmNiBWMvF4I9FNYhKLfkQD7HvU1k6Nf/nvviMUMJGVFr/80d x0U2wabqxtU/w== From: Francesco Dolcini To: alsa-devel@alsa-project.org, devicetree@vger.kernel.org Subject: [PATCH v2 1/3] ASoC: dt-bindings: nau8822: convert to the dtschema Date: Wed, 4 Jan 2023 15:04:10 +0100 Message-Id: <20230104140412.35575-2-francesco@dolcini.it> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230104140412.35575-1-francesco@dolcini.it> References: <20230104140412.35575-1-francesco@dolcini.it> MIME-Version: 1.0 X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.29 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: , Cc: wtli@nuvoton.com, Takashi Iwai , kchsu0@nuvoton.com, Liam Girdwood , Rob Herring , Benjamin Marty , Krzysztof Kozlowski , Mark Brown , David Lin , Krzysztof Kozlowski , Francesco Dolcini , Emanuele Ghidoli Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" From: Emanuele Ghidoli Convert nau8822 devicetree binding to dtschema. Change file name to match dtschema naming. Cc: David Lin Signed-off-by: Emanuele Ghidoli Signed-off-by: Francesco Dolcini Reviewed-by: Krzysztof Kozlowski --- v2: - added Reviewed-by: Krzysztof - removed sentence on SPI being not supported --- .../devicetree/bindings/sound/nau8822.txt | 16 -------- .../bindings/sound/nuvoton,nau8822.yaml | 40 +++++++++++++++++++ 2 files changed, 40 insertions(+), 16 deletions(-) delete mode 100644 Documentation/devicetree/bindings/sound/nau8822.txt create mode 100644 Documentation/devicetree/bindings/sound/nuvoton,nau8822.yaml diff --git a/Documentation/devicetree/bindings/sound/nau8822.txt b/Documentation/devicetree/bindings/sound/nau8822.txt deleted file mode 100644 index a471d162d4e5..000000000000 --- a/Documentation/devicetree/bindings/sound/nau8822.txt +++ /dev/null @@ -1,16 +0,0 @@ -NAU8822 audio CODEC - -This device supports I2C only. - -Required properties: - - - compatible : "nuvoton,nau8822" - - - reg : the I2C address of the device. - -Example: - -codec: nau8822@1a { - compatible = "nuvoton,nau8822"; - reg = <0x1a>; -}; diff --git a/Documentation/devicetree/bindings/sound/nuvoton,nau8822.yaml b/Documentation/devicetree/bindings/sound/nuvoton,nau8822.yaml new file mode 100644 index 000000000000..2810924e3a47 --- /dev/null +++ b/Documentation/devicetree/bindings/sound/nuvoton,nau8822.yaml @@ -0,0 +1,40 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/sound/nuvoton,nau8822.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: NAU8822 audio CODEC + +description: | + 24 bit stereo audio codec with speaker driver. + This device supports I2C/SPI. + +maintainers: + - David Lin + +properties: + compatible: + enum: + - nuvoton,nau8822 + + reg: + maxItems: 1 + +required: + - compatible + - reg + +additionalProperties: false + +examples: + - | + i2c { + #address-cells = <1>; + #size-cells = <0>; + + codec@1a { + compatible = "nuvoton,nau8822"; + reg = <0x1a>; + }; + }; From patchwork Wed Jan 4 19:53:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Francesco Dolcini X-Patchwork-Id: 13088885 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 600E9C4332F for ; Wed, 4 Jan 2023 19:55:17 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 8FFE0C764; Wed, 4 Jan 2023 20:54:25 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 8FFE0C764 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1672862115; bh=sFXZRSOGgAsCXhxHpKiih4SIl20fwijDGosnd3EEM6c=; h=From:To:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=IDH/8iEmyRGb5ipLiXZdxliIUAxKVy2aCUOmlqmC7mDp9nncUdDVtHy6FsMg0xQgr /PY3w1S/NRkmYNjxkxwFPtmsVzIjiZJXBkhirgSKVv69XsNTX9bhkPsvZBVH93bBtP bSndiiYvJYZac7yCor5TZ3X1ZSZcpuQ/99e1xPuk= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 4AF92F8023B; Wed, 4 Jan 2023 20:54:25 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 29AEEF80240; Wed, 4 Jan 2023 20:54:24 +0100 (CET) Received: from smtp-out-03.comm2000.it (smtp-out-03.comm2000.it [212.97.32.66]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 26AB0F800C0 for ; Wed, 4 Jan 2023 20:54:21 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 26AB0F800C0 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=mailserver.it header.i=@mailserver.it header.a=rsa-sha256 header.s=mailsrv header.b=F4W1Hk7s Received: from francesco-nb.toradex.int (31-10-206-125.static.upc.ch [31.10.206.125]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: francesco@dolcini.it) by smtp-out-03.comm2000.it (Postfix) with ESMTPSA id 5F922B446B0; Wed, 4 Jan 2023 20:53:55 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=mailserver.it; s=mailsrv; t=1672862053; bh=sFXZRSOGgAsCXhxHpKiih4SIl20fwijDGosnd3EEM6c=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=F4W1Hk7sdGLoukyjWsdzgB38yhBiCGFxt1Vpi8clhtpu1vZ3BRRHjwneUwYc/dFZA ciNl+m9eYFBh7jdNaZzgnv1wBM/NSWV6+DMdW7hT0fduLYdiu+Ma5gqdfzCGCpznDy hYdscCZj/PlvX8UDzFFDcNGCJ3JkDgPaxcAjLER9g/tiM9nuUz3bRu++NJvXTtu70q icco4RwBYibmtNgjbDOgbbIZl8Q1l+TP8E/xEpr6p02sDL5cMgza5dtKaNjN1c+mc2 GAv44NlKVdRoRd0P9ZKFT447GdDg9WbRwMwowNObJwx6pxpr/C4jnZxMTP6/aKor3S WG7hCQDVkQlpQ== From: Francesco Dolcini To: alsa-devel@alsa-project.org, devicetree@vger.kernel.org Subject: [PATCH v2 2/3] ASoC: dt-bindings: nau8822: add nuvoton, spk-btl property to dtschema Date: Wed, 4 Jan 2023 20:53:50 +0100 Message-Id: <20230104195350.149300-1-francesco@dolcini.it> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230104140412.35575-1-francesco@dolcini.it> References: <20230104140412.35575-1-francesco@dolcini.it> MIME-Version: 1.0 X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.29 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: , Cc: wtli@nuvoton.com, Takashi Iwai , kchsu0@nuvoton.com, Liam Girdwood , Rob Herring , Benjamin Marty , Krzysztof Kozlowski , Mark Brown , David Lin , Krzysztof Kozlowski , Francesco Dolcini , Emanuele Ghidoli Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" From: Emanuele Ghidoli Add nuvoton,spk-btl to configure the two loudspeaker outputs as Bridge Tied Load Cc: David Lin Signed-off-by: Emanuele Ghidoli Signed-off-by: Francesco Dolcini Acked-by: Krzysztof Kozlowski --- v2: Added Acked-by: Krzysztof --- .../devicetree/bindings/sound/nuvoton,nau8822.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Documentation/devicetree/bindings/sound/nuvoton,nau8822.yaml b/Documentation/devicetree/bindings/sound/nuvoton,nau8822.yaml index 2810924e3a47..65105402a53d 100644 --- a/Documentation/devicetree/bindings/sound/nuvoton,nau8822.yaml +++ b/Documentation/devicetree/bindings/sound/nuvoton,nau8822.yaml @@ -21,6 +21,12 @@ properties: reg: maxItems: 1 + nuvoton,spk-btl: + description: + If set, configure the two loudspeaker outputs as a Bridge Tied Load output + to drive a high power external loudspeaker. + $ref: /schemas/types.yaml#/definitions/flag + required: - compatible - reg From patchwork Wed Jan 4 14:04:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Francesco Dolcini X-Patchwork-Id: 13088628 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 50146C4332F for ; Wed, 4 Jan 2023 14:06:29 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 21525B1C1; Wed, 4 Jan 2023 15:05:36 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 21525B1C1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1672841186; bh=fkw4KQkZxEXxi05Y7BnBvucOJZ3tO3pncymAHY/a7qo=; h=From:To:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=I/n/wZuY3SAaZ+DT9aAddOubUcS5S3sPtInGrrqas1bR464/4l1tfYimJL84P4FmH jy1v6vFmRxlt5mhkFw59JkdEhrZdOQzCR5Z64pIrn4OMRiszS0jQzW1DTV6BF+d7/c zqqAp5Y86A/dmKHBDZyxwt8kEVKa0FFhms90WwPw= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 7A481F80539; Wed, 4 Jan 2023 15:04:52 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 99B98F80539; Wed, 4 Jan 2023 15:04:51 +0100 (CET) Received: from smtp-out-08.comm2000.it (smtp-out-08.comm2000.it [212.97.32.78]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id B5D7CF8050F for ; Wed, 4 Jan 2023 15:04:49 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz B5D7CF8050F Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=mailserver.it header.i=@mailserver.it header.a=rsa-sha256 header.s=mailsrv header.b=KIPeWVv+ Received: from francesco-nb.toradex.int (31-10-206-125.static.upc.ch [31.10.206.125]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: francesco@dolcini.it) by smtp-out-08.comm2000.it (Postfix) with ESMTPSA id CD750423666; Wed, 4 Jan 2023 15:04:41 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=mailserver.it; s=mailsrv; t=1672841082; bh=fkw4KQkZxEXxi05Y7BnBvucOJZ3tO3pncymAHY/a7qo=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=KIPeWVv+VUIRRpSGxzx+xXoCZoyACdz8qifrnsA4lmMUs+hXjn7mX9sIX9CCaXBHS YnrFikS6o0cneTMRM1sMiLlgGAyZ4L05p5y/rMJGF7x5rwZe37K6GYNUhksdNxIvlR e6UNDyI/frYhjVFefePXQEGsEfzZxDpKo/DRV37gcBgJaxajiWe9g9ORyvYKB7ysX7 Hp9O/Era1/kx3hBiroaAIQOrF+OyPdGbzMrGbF67524WMTQ81a4bz2Dbhtsd5Ny6ot 7nqnC/zC9BuLda91YRfU+Lr6oFyAt2FMH3s8YyAkjd/wBcqeUzKqNa90g0cjUIMpZ5 9tw2lHK93aEkg== From: Francesco Dolcini To: alsa-devel@alsa-project.org, devicetree@vger.kernel.org Subject: [PATCH v2 3/3] ASoC: nau8822: add speaker Bridge Tied Output configuration Date: Wed, 4 Jan 2023 15:04:12 +0100 Message-Id: <20230104140412.35575-4-francesco@dolcini.it> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230104140412.35575-1-francesco@dolcini.it> References: <20230104140412.35575-1-francesco@dolcini.it> MIME-Version: 1.0 X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.29 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: , Cc: wtli@nuvoton.com, Takashi Iwai , kchsu0@nuvoton.com, Liam Girdwood , Rob Herring , Benjamin Marty , Mark Brown , Krzysztof Kozlowski , Francesco Dolcini , Emanuele Ghidoli Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" From: Emanuele Ghidoli Allow configuring the two loudspeaker outputs as a single Bridge Tied Load output getting higher output power. Signed-off-by: Emanuele Ghidoli Signed-off-by: Francesco Dolcini --- v2: no changes --- sound/soc/codecs/nau8822.c | 9 +++++++++ sound/soc/codecs/nau8822.h | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/sound/soc/codecs/nau8822.c b/sound/soc/codecs/nau8822.c index 1aef281a9972..d5006d8de639 100644 --- a/sound/soc/codecs/nau8822.c +++ b/sound/soc/codecs/nau8822.c @@ -1056,6 +1056,7 @@ static const int update_reg[] = { static int nau8822_probe(struct snd_soc_component *component) { int i; + struct device_node *of_node = component->dev->of_node; /* * Set the update bit in all registers, that have one. This way all @@ -1066,6 +1067,14 @@ static int nau8822_probe(struct snd_soc_component *component) snd_soc_component_update_bits(component, update_reg[i], 0x100, 0x100); + /* Check property to configure the two loudspeaker outputs as + * a single Bridge Tied Load output + */ + if (of_property_read_bool(of_node, "nuvoton,spk-btl")) + snd_soc_component_update_bits(component, + NAU8822_REG_RIGHT_SPEAKER_CONTROL, + NAU8822_RSUBBYP, NAU8822_RSUBBYP); + return 0; } diff --git a/sound/soc/codecs/nau8822.h b/sound/soc/codecs/nau8822.h index 547ec057f853..646f6bb64bc5 100644 --- a/sound/soc/codecs/nau8822.h +++ b/sound/soc/codecs/nau8822.h @@ -187,6 +187,15 @@ /* NAU8822_REG_PLL_K3 (0x27) */ #define NAU8822_PLLK3_MASK 0x1FF +/* NAU8822_REG_RIGHT_SPEAKER_CONTROL (0x2B) */ +#define NAU8822_RMIXMUT 0x20 +#define NAU8822_RSUBBYP 0x10 + +#define NAU8822_RAUXRSUBG_SFT 1 +#define NAU8822_RAUXRSUBG_MASK 0x0E + +#define NAU8822_RAUXSMUT 0x01 + /* System Clock Source */ enum { NAU8822_CLK_MCLK,