From patchwork Fri Nov 15 16:08:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marco Felsch X-Patchwork-Id: 11246665 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B3A9913BD for ; Fri, 15 Nov 2019 16:09:26 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id BC77C2073C for ; Fri, 15 Nov 2019 16:09:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="WJFCNBHq" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BC77C2073C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org 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 4F7A215F9; Fri, 15 Nov 2019 17:08:33 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 4F7A215F9 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1573834163; bh=/l2Okw1h6hLK81LmThdyizDkEULTqZ/tpfv/97iT1C0=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=WJFCNBHqA2tkH7o4o38IndeTrJbTfle4ItECCnVMRBP3yyF/OngIEV+yh16OhoWG7 YK+bYvMzx9I9zn+NWEfiyeZhIfqUP5FbJ+aD7DIc3A5xstx97e4Lz2y5T0Ru4BsZqV ui31VDlJlitziysA43mna00+wfnpiVG/cp/HlVjc= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 7A05CF8007E; Fri, 15 Nov 2019 17:08:32 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 97FA1F80106; Fri, 15 Nov 2019 17:08:30 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=SPF_HELO_NONE,SPF_PASS autolearn=disabled version=3.4.0 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id F0023F8007E for ; Fri, 15 Nov 2019 17:08:27 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz F0023F8007E Received: from dude02.hi.pengutronix.de ([2001:67c:670:100:1d::28] helo=dude02.lab.pengutronix.de) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1iVe90-0002S5-MC; Fri, 15 Nov 2019 17:08:22 +0100 Received: from mfe by dude02.lab.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1iVe8y-00047D-6K; Fri, 15 Nov 2019 17:08:20 +0100 From: Marco Felsch To: robh+dt@kernel.org, KCHSU0@nuvoton.com, broonie@kernel.org, thomas.fehrenbacher@siedle.de Date: Fri, 15 Nov 2019 17:08:17 +0100 Message-Id: <20191115160819.15557-2-m.felsch@pengutronix.de> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191115160819.15557-1-m.felsch@pengutronix.de> References: <20191115160819.15557-1-m.felsch@pengutronix.de> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::28 X-SA-Exim-Mail-From: mfe@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: alsa-devel@alsa-project.org Cc: devicetree@vger.kernel.org, alsa-devel@alsa-project.org, kernel@pengutronix.de Subject: [alsa-devel] [PATCH 1/3] dt-bindings: ASoC: add nau8812 documentation 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" Add dt-bindings for the nau8812 device. Signed-off-by: Marco Felsch Acked-by: Rob Herring --- Documentation/devicetree/bindings/sound/nau8810.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/sound/nau8810.txt b/Documentation/devicetree/bindings/sound/nau8810.txt index 05830e477acd..ddb007a43e68 100644 --- a/Documentation/devicetree/bindings/sound/nau8810.txt +++ b/Documentation/devicetree/bindings/sound/nau8810.txt @@ -4,7 +4,7 @@ This device supports I2C only. Required properties: - - compatible : "nuvoton,nau8810" + - compatible : "nuvoton,nau8810" or "nuvoton,nau8812" - reg : the I2C address of the device. From patchwork Fri Nov 15 16:08:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marco Felsch X-Patchwork-Id: 11246667 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4B4756C1 for ; Fri, 15 Nov 2019 16:10:21 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id D089D2073B for ; Fri, 15 Nov 2019 16:10:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="iUobni9t" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D089D2073B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org 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 DB339165F; Fri, 15 Nov 2019 17:09:27 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz DB339165F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1573834218; bh=nxDAPW585FBOW1EoVvgXVagr8upDl7cbuVzJNwlWOGA=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=iUobni9tuIglYl1VK4EMhJZLdiVm8JgbQhUEzs/YZ2oPAw9RI2W6bGY0XWNiSuUGP s/nN83rbRad92IHyU3DM1XEPToB4HUr7m49NCVH3rAsHLDlCe+96zm7x5sq0/BAhs2 qJ4JNmettRk6pTPdnXqcUG9Z1xG9x8ykZTIsvJZY= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 55D05F80108; Fri, 15 Nov 2019 17:08:34 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id E468EF80105; Fri, 15 Nov 2019 17:08:30 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=SPF_HELO_NONE,SPF_PASS, SURBL_BLOCKED autolearn=disabled version=3.4.0 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 45615F800CC for ; Fri, 15 Nov 2019 17:08:27 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 45615F800CC Received: from dude02.hi.pengutronix.de ([2001:67c:670:100:1d::28] helo=dude02.lab.pengutronix.de) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1iVe90-0002S6-MC; Fri, 15 Nov 2019 17:08:22 +0100 Received: from mfe by dude02.lab.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1iVe8y-00047G-6i; Fri, 15 Nov 2019 17:08:20 +0100 From: Marco Felsch To: robh+dt@kernel.org, KCHSU0@nuvoton.com, broonie@kernel.org, thomas.fehrenbacher@siedle.de Date: Fri, 15 Nov 2019 17:08:18 +0100 Message-Id: <20191115160819.15557-3-m.felsch@pengutronix.de> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191115160819.15557-1-m.felsch@pengutronix.de> References: <20191115160819.15557-1-m.felsch@pengutronix.de> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::28 X-SA-Exim-Mail-From: mfe@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: alsa-devel@alsa-project.org Cc: devicetree@vger.kernel.org, alsa-devel@alsa-project.org, kernel@pengutronix.de Subject: [alsa-devel] [PATCH 2/3] ASoC: nau8810: add support for nau8812 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 nau8812 device [1] uses exactly the same register layout as the nau8810 so there is no need to differentiate those. The only difference is the output power and an additional aux-port input on the nau8812. The registers related to the aux-port don't affect the nau8810 in a negative way. They are just ignored (set to '0'). [1] http://www.nuvoton.com/resource-files/NAU8812DatasheetRev2.7.pdf Signed-off-by: Marco Felsch --- sound/soc/codecs/Kconfig | 2 +- sound/soc/codecs/nau8810.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/sound/soc/codecs/Kconfig b/sound/soc/codecs/Kconfig index 229cc89f8c5a..d13a2e5d0afb 100644 --- a/sound/soc/codecs/Kconfig +++ b/sound/soc/codecs/Kconfig @@ -1470,7 +1470,7 @@ config SND_SOC_NAU8540 depends on I2C config SND_SOC_NAU8810 - tristate "Nuvoton Technology Corporation NAU88C10 CODEC" + tristate "Nuvoton Technology Corporation NAU88C10/12 CODEC" depends on I2C config SND_SOC_NAU8822 diff --git a/sound/soc/codecs/nau8810.c b/sound/soc/codecs/nau8810.c index de26758c30a8..a32a4a8d5f50 100644 --- a/sound/soc/codecs/nau8810.c +++ b/sound/soc/codecs/nau8810.c @@ -862,6 +862,7 @@ static int nau8810_i2c_probe(struct i2c_client *i2c, static const struct i2c_device_id nau8810_i2c_id[] = { { "nau8810", 0 }, + { "nau8812", 0 }, { } }; MODULE_DEVICE_TABLE(i2c, nau8810_i2c_id); @@ -869,6 +870,7 @@ MODULE_DEVICE_TABLE(i2c, nau8810_i2c_id); #ifdef CONFIG_OF static const struct of_device_id nau8810_of_match[] = { { .compatible = "nuvoton,nau8810", }, + { .compatible = "nuvoton,nau8812", }, { } }; MODULE_DEVICE_TABLE(of, nau8810_of_match); From patchwork Fri Nov 15 16:08:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marco Felsch X-Patchwork-Id: 11246669 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 244D7138C for ; Fri, 15 Nov 2019 16:11:14 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id AA6C52073A for ; Fri, 15 Nov 2019 16:11:13 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="lwHjM7iK" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AA6C52073A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org 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 D611B166C; Fri, 15 Nov 2019 17:10:21 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz D611B166C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1573834271; bh=6YKwDdzvvt2haVNB2Ieyh2fNP+rFyvUBtkKGe3DIg3k=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=lwHjM7iKdE7dWD54k0dMrWfdzHP5D1vYagkZqRa4H3JWtemnS8wygwByiCvcuN95E QqEm77BCYimiG89/d5SIrmbI1/Nkuj2zWqIKyXH8boWGa79vGG6+0pHzOSMFrsrxY6 qehcb9UqYlmWaKjdsRlhz2RsVSRNezbvoHEIuShA= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id C9A56F80117; Fri, 15 Nov 2019 17:08:35 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 50549F80105; Fri, 15 Nov 2019 17:08:32 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=SPF_HELO_NONE,SPF_PASS, SURBL_BLOCKED autolearn=disabled version=3.4.0 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id C2FE0F80103 for ; Fri, 15 Nov 2019 17:08:28 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz C2FE0F80103 Received: from dude02.hi.pengutronix.de ([2001:67c:670:100:1d::28] helo=dude02.lab.pengutronix.de) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1iVe90-0002S7-MC; Fri, 15 Nov 2019 17:08:22 +0100 Received: from mfe by dude02.lab.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1iVe8y-00047J-7C; Fri, 15 Nov 2019 17:08:20 +0100 From: Marco Felsch To: robh+dt@kernel.org, KCHSU0@nuvoton.com, broonie@kernel.org, thomas.fehrenbacher@siedle.de Date: Fri, 15 Nov 2019 17:08:19 +0100 Message-Id: <20191115160819.15557-4-m.felsch@pengutronix.de> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191115160819.15557-1-m.felsch@pengutronix.de> References: <20191115160819.15557-1-m.felsch@pengutronix.de> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::28 X-SA-Exim-Mail-From: mfe@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: alsa-devel@alsa-project.org Cc: devicetree@vger.kernel.org, alsa-devel@alsa-project.org, kernel@pengutronix.de Subject: [alsa-devel] [PATCH 3/3] ASoC: nau8810: add aux input control, available on NAU8812 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" From: Thomas Fehrenbacher This commit adds the support to control the aux-port on the nau8812 devices. We don't need to differentiate the aux-port registers since those bitfields are set to '0' on the nau8810 devices [1,2]. [1] http://www.nuvoton.com/resource-files/NAU8810_Datasheet_Rev_2.8.pdf [2] http://www.nuvoton.com/resource-files/NAU8812DatasheetRev2.7.pdf Signed-off-by: Thomas Fehrenbacher [m.felsch@pengutronix.de: add commit message] Signed-off-by: Marco Felsch --- sound/soc/codecs/nau8810.c | 7 +++++++ sound/soc/codecs/nau8810.h | 2 ++ 2 files changed, 9 insertions(+) diff --git a/sound/soc/codecs/nau8810.c b/sound/soc/codecs/nau8810.c index a32a4a8d5f50..b1024d24d413 100644 --- a/sound/soc/codecs/nau8810.c +++ b/sound/soc/codecs/nau8810.c @@ -351,6 +351,9 @@ static const struct snd_kcontrol_new nau8810_snd_controls[] = { NAU8810_DACOS_SFT, 1, 0), SOC_SINGLE("ADC Oversampling Rate(128x) Switch", NAU8810_REG_ADC, NAU8810_ADCOS_SFT, 1, 0), + + SOC_SINGLE("AUX Input Enable Switch", NAU8810_REG_POWER1, + NAU8810_AUX_EN_SFT, 1, 0), }; /* Speaker Output Mixer */ @@ -383,6 +386,8 @@ static const struct snd_kcontrol_new nau8810_inpga[] = { NAU8810_NMICPGA_SFT, 1, 0), SOC_DAPM_SINGLE("MicP Switch", NAU8810_REG_INPUT_SIGNAL, NAU8810_PMICPGA_SFT, 1, 0), + SOC_DAPM_SINGLE("AUX Switch", NAU8810_REG_INPUT_SIGNAL, + NAU8810_AUXPGA_SFT, 1, 0), }; /* Loopback Switch */ @@ -436,6 +441,7 @@ static const struct snd_soc_dapm_widget nau8810_dapm_widgets[] = { SND_SOC_DAPM_INPUT("MICN"), SND_SOC_DAPM_INPUT("MICP"), + SND_SOC_DAPM_INPUT("AUX"), SND_SOC_DAPM_OUTPUT("MONOOUT"), SND_SOC_DAPM_OUTPUT("SPKOUTP"), SND_SOC_DAPM_OUTPUT("SPKOUTN"), @@ -470,6 +476,7 @@ static const struct snd_soc_dapm_route nau8810_dapm_routes[] = { {"Input PGA", NULL, "Mic Bias"}, {"Input PGA", "MicN Switch", "MICN"}, {"Input PGA", "MicP Switch", "MICP"}, + {"Input PGA", "AUX Switch", "AUX"}, /* Digital Looptack */ {"Digital Loopback", "Switch", "ADC"}, diff --git a/sound/soc/codecs/nau8810.h b/sound/soc/codecs/nau8810.h index 1ada31883dc6..7b5ecad173d3 100644 --- a/sound/soc/codecs/nau8810.h +++ b/sound/soc/codecs/nau8810.h @@ -69,6 +69,7 @@ /* NAU8810_REG_POWER1 (0x1) */ #define NAU8810_DCBUF_EN (0x1 << 8) +#define NAU8810_AUX_EN_SFT 6 #define NAU8810_PLL_EN_SFT 5 #define NAU8810_MICBIAS_EN_SFT 4 #define NAU8810_ABIAS_EN (0x1 << 3) @@ -229,6 +230,7 @@ /* NAU8810_REG_INPUT_SIGNAL (0x2C) */ #define NAU8810_PMICPGA_SFT 0 #define NAU8810_NMICPGA_SFT 1 +#define NAU8810_AUXPGA_SFT 2 /* NAU8810_REG_PGAGAIN (0x2D) */ #define NAU8810_PGAGAIN_SFT 0