From patchwork Fri Dec 23 17:04:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Francesco Dolcini X-Patchwork-Id: 13081032 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 74858C3DA79 for ; Fri, 23 Dec 2022 17:06:09 +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 42E9384E7; Fri, 23 Dec 2022 18:05:12 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 42E9384E7 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1671815162; bh=mtp3kFQMzjrZNFJkDe3sRbLgEXGBt1RMFInWW5P6osI=; h=From:To:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=uFWf1xaIIIU1cq1goqse4/0WGNPwdp3jDkT2jXS37S0QUBPxtZct7+14k94Qqq/KL x1MfyoLqqOxder6nPu4+UpdRVSxeZSOazYpwxdOg3mNLcVeviMot3vjbgZCo4SVE0n Pl7hZyttnIJAUMI/t+7PMa6IukdyYp4kb4HShq6Q= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 69BE7F803DC; Fri, 23 Dec 2022 18:04:58 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 16817F804CB; Fri, 23 Dec 2022 18:04:57 +0100 (CET) Received: from smtp-out-12.comm2000.it (smtp-out-12.comm2000.it [212.97.32.82]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 967B5F804B1 for ; Fri, 23 Dec 2022 18:04:55 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 967B5F804B1 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=qDAbNUyD Received: from francesco-nb.pivistrello.it (93-49-2-63.ip317.fastwebnet.it [93.49.2.63]) (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-12.comm2000.it (Postfix) with ESMTPSA id 64BD1BA1295; Fri, 23 Dec 2022 18:04:40 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=mailserver.it; s=mailsrv; t=1671815087; bh=mtp3kFQMzjrZNFJkDe3sRbLgEXGBt1RMFInWW5P6osI=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=qDAbNUyDxcYU5wOqczo2w5eKhMdepAGvIRDVtIOvc9IFqzAZiX8+NBYNSsj3+fyBC fzTsK3XcSDQ0hEELcIvZnaVWTph1+FTfMcTIqgrE54xRSn5c16srPUI3M+CB4d6386 B9EEHE+m3r4rt/dNOuX+YtT/CyH370BcP7yrK3vG29tBl/yqGrw4/v95ehYwdvUO4P t+EOo8g0AMNmJRm9Qjw/NmGyzRvHgm4rONWa2SAr9BywOVsyhmM1aqzXWjGqUEmqys PjjBA4Za6qxNlo1rgrRwMf6C0DmTFi90N4QQ8utuxqOt+LN0FAU+iNSzC2/1AFjApl 0A1n7dHpPYk6Q== From: Francesco Dolcini To: alsa-devel@alsa-project.org, devicetree@vger.kernel.org Subject: [PATCH v1 1/3] ASoC: dt-bindings: nau8822: convert to the dtschema Date: Fri, 23 Dec 2022 18:04:02 +0100 Message-Id: <20221223170404.210603-2-francesco@dolcini.it> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221223170404.210603-1-francesco@dolcini.it> References: <20221223170404.210603-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 , 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 --- .../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..10464170a98f --- /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. Currently, only I2C bus is supported. + +maintainers: + - David Lin + +properties: + compatible: + enum: + - nuvoton,nau8822 + + reg: + maxItems: 1 + +additionalProperties: false + +required: + - compatible + - reg + +examples: + - | + i2c { + #address-cells = <1>; + #size-cells = <0>; + + codec@1a { + compatible = "nuvoton,nau8822"; + reg = <0x1a>; + }; + }; From patchwork Fri Dec 23 17:04:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Francesco Dolcini X-Patchwork-Id: 13081033 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 96D8AC4332F for ; Fri, 23 Dec 2022 17:06:20 +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 B6BD484EF; Fri, 23 Dec 2022 18:05:28 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz B6BD484EF DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1671815178; bh=/v0ZzyeLbg7Wkvx4I0D+61INQZAwyhfMUVclgVe+PYA=; h=From:To:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=BCst1sEJaq12IYf2DpHkMqtOsT2Fg6adgaQfUe+lR+l0iyeIWJ5AYau+PTmynADgB ZVUTflhzBRr8gTY7qSvdT44Blx1muXfmgIAx1Oxg3n7p/cBvJUT2vZRIBJXfl9BMkx J7phKoC+9qkqj1PW6jNIKNTGf2a5KsoTKgjTzRY8= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 5B419F804B1; Fri, 23 Dec 2022 18:05:28 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 73F39F80535; Fri, 23 Dec 2022 18:05:07 +0100 (CET) Received: from smtp-out-12.comm2000.it (smtp-out-12.comm2000.it [212.97.32.82]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id D1FD1F804B2 for ; Fri, 23 Dec 2022 18:05:05 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz D1FD1F804B2 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=N9gGz1k+ Received: from francesco-nb.pivistrello.it (93-49-2-63.ip317.fastwebnet.it [93.49.2.63]) (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-12.comm2000.it (Postfix) with ESMTPSA id 5B87EBA1B6F; Fri, 23 Dec 2022 18:04:47 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=mailserver.it; s=mailsrv; t=1671815096; bh=/v0ZzyeLbg7Wkvx4I0D+61INQZAwyhfMUVclgVe+PYA=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=N9gGz1k+BzKiJrKgHd4u2DYniK1Pnu2rRQLot0EoWxY3785omL/voOcQuSgRaisvt 7GPq/VSNlypVbqJyY384kkbgzCuYyDbj0eF7KY1X7i3VMI2/Qu7L+2BGbBgQNiPy5v nj/Ds5ibWBp0joXvfGGx6cipUusu1AhOE5ZymWBiyAfy0dW956nrLePuzh6knIw3IM albX3XbnW2K+EHSVk9rPu23AOhTpsaE78idoV+kowIMKXn3MAmSVO1nLnzlKaAopDM xy+ubljDfo8MbNV9R2VNJq4Xi8bXi+38Fa/XkssCd9A6e3sXm2BdpVDfdhB02jicuj YprxvQzhqZO4w== From: Francesco Dolcini To: alsa-devel@alsa-project.org, devicetree@vger.kernel.org Subject: [PATCH v1 2/3] ASoC: dt-bindings: nau8822: add nuvoton, spk-btl property to dtschema Date: Fri, 23 Dec 2022 18:04:03 +0100 Message-Id: <20221223170404.210603-3-francesco@dolcini.it> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221223170404.210603-1-francesco@dolcini.it> References: <20221223170404.210603-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 , 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 --- .../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 10464170a98f..700c57698133 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 + additionalProperties: false required: From patchwork Fri Dec 23 17:04:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Francesco Dolcini X-Patchwork-Id: 13081034 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 2F489C4332F for ; Fri, 23 Dec 2022 17:06:28 +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 3FFB184F6; Fri, 23 Dec 2022 18:05:36 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 3FFB184F6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1671815186; bh=fFMm4Z9Jn9GmTLFlEO5rpMTYF/7g0DE4+G2N/Ha2nEs=; h=From:To:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=k8E2Si/bWpJANSeDAhUoT/1VYpiIeA7SOvVAc6EPw89+rSTi4IR0nrC67uEC5PR63 lYHtCEtatvamcW5ogCfFjAMdF3zeCHUuK9LA0cdLyNiEWL+C6OJH404/7nuHuOhcbj S6B1P6MJVB8gXtr8OdV1gn1p8qghHNsnrtKYbwhw= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 3930EF80534; Fri, 23 Dec 2022 18:05:29 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id AEF11F80423; Fri, 23 Dec 2022 18:05:15 +0100 (CET) Received: from smtp-out-12.comm2000.it (smtp-out-12.comm2000.it [212.97.32.82]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 3E1CCF80423 for ; Fri, 23 Dec 2022 18:05:13 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 3E1CCF80423 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=eBNdMukw Received: from francesco-nb.pivistrello.it (93-49-2-63.ip317.fastwebnet.it [93.49.2.63]) (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-12.comm2000.it (Postfix) with ESMTPSA id 8A379BA3234; Fri, 23 Dec 2022 18:04:56 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=mailserver.it; s=mailsrv; t=1671815107; bh=fFMm4Z9Jn9GmTLFlEO5rpMTYF/7g0DE4+G2N/Ha2nEs=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=eBNdMukwTGGCj16Ui9T+1ZhPjGYqMZQ8BNhmbhAi5q3cqwZyCSwTEnxk3DMf01blG XCeoYNgrsC3QAHEFNA+N2CNkQf4a0E5SL/uPkJjG90++c1dHohvrnoFjCrT5zP7r7n F+F7QLcefFpz9W3CKo1LEhOwdMg/cNdaApmbU6nWdJEIOn1ziLxbEiKkABVNwBZ1I1 9pAVR4zEdNzqov4ndrJ6+CwORd90zfzSbNO1ezs0u4AuOez3fCeRhhS6hJ8p//HYZK 6NablPAqb15DaqnXSRoycU1sRrZ+VLYpzXLbQHpKnWhrayJTb/8hZBbq73EbxeFLA9 fohBhg9+G59ww== From: Francesco Dolcini To: alsa-devel@alsa-project.org, devicetree@vger.kernel.org Subject: [PATCH v1 3/3] ASoC: nau8822: add speaker Bridge Tied Output configuration Date: Fri, 23 Dec 2022 18:04:04 +0100 Message-Id: <20221223170404.210603-4-francesco@dolcini.it> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221223170404.210603-1-francesco@dolcini.it> References: <20221223170404.210603-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 --- 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,