From patchwork Sun Oct 16 13:26:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Siarhei Volkau X-Patchwork-Id: 3013 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp1015995wrs; Sun, 16 Oct 2022 06:28:34 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5Llc/ITf5w5G3654VmiHt/TVb+7wTxBo84NATDOm5uGmR6+8W3dXPJD4BA9sGHf8IO++Bz X-Received: by 2002:a17:906:ef8c:b0:78d:96b9:a0ad with SMTP id ze12-20020a170906ef8c00b0078d96b9a0admr5186283ejb.529.1665926913939; Sun, 16 Oct 2022 06:28:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665926913; cv=none; d=google.com; s=arc-20160816; b=C+mroMnCvyBkl+kI4Ss7r6fDnhU7NChLO+jXuxPjllycars/NvKksxbwQHlo04nthY Y2l2McUFAS4f7JAAxyXgDYuIEhwWyKmrumbqkfQegs1huE8ehQTYBK8ueBUqjwBV7N9T GtzCr2fHutwGJvDHWZVTQIach8mZL3uAa0Pn45F2STqcO+bZ//KFnRx1KCEN7lkQTjI5 2y7l9SF+FGrn+nKwN03meUBWkJiByW3Re/CHvtIg4wsj6/45Yv7GdkRH7AEvaiAPWzwP DOlxlrqSVx68cSXi2psxzKRM+opzuT18thUkUwznu3KhZHtgAfvQsSE/rBIHBo1z1JUu 2AWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:from :dkim-signature; bh=c4lAtcWLfky+loGkaKS25dVBzZnDMU5TT8sW9dTlDsw=; b=hyu46cRIQ+DmFfNOeBAPHSH0s/A1p5OL27GuSIauAdArQniMBq2eKQwvEKcJeUwoSe rdCRk/DAi5cMfHC54TXtKf6yMOUg9zW7Ct/0k6A6byGcYaatirfIlHvHBEacQjoYicY4 cLiIZ+GKYh4V/AzJr3lB8oidOzmE/VPMkHhgc4aKzb12B4wNsX8uCQVieFAH9B5kKR3R 6lVI7KecPVy+BUC2MvfpGkRcFFtjn6NMDWSy2wnMHurZtwRY4zCWbmTiOPn5mXp0jHDM EtWw4mQIyocYdIWW90A10MCMdJhRPMKOBJ1KL7Zy8XEh8lwWMCF9Uc0Wb96Ei2z+T5tD ppww== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20210112 header.b=niUCUg05; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dn16-20020a17090794d000b00730870cb4b6si5104163ejc.621.2022.10.16.06.28.09; Sun, 16 Oct 2022 06:28:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20210112 header.b=niUCUg05; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229608AbiJPN1w (ORCPT + 99 others); Sun, 16 Oct 2022 09:27:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55696 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229579AbiJPN1r (ORCPT ); Sun, 16 Oct 2022 09:27:47 -0400 Received: from mail-ed1-x534.google.com (mail-ed1-x534.google.com [IPv6:2a00:1450:4864:20::534]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 45C577654; Sun, 16 Oct 2022 06:27:46 -0700 (PDT) Received: by mail-ed1-x534.google.com with SMTP id q19so12638347edd.10; Sun, 16 Oct 2022 06:27:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=c4lAtcWLfky+loGkaKS25dVBzZnDMU5TT8sW9dTlDsw=; b=niUCUg052VYXiWOHFjdQZ5sJJ4MktbIJOqHDhc//ExUZsYJCWATv5g0cUCpcRddUFx r99ae361bpw48kxj10mQS4I40GFhDQ1OONdzTIODgj1/YmP8aoTFAJroCRPozPvZRNhn VW/EuAhnTrQ/A9VTzHwqZegJu+uLfZiG0vnAdg/LLy3NJXOXhsE5byfMjFafSEk2Y9lL 1fAO4U/pOLupTdD7Z2bpskOBp7RxogyW0HPf7X04LtjzlSly38ZKrv4ByBSlykCe+JY/ 2MiC80GxqxV7B5EMagddK/sZpnOQeWmQ5+6gW3tC4cAXtW+1P069RwevO6KtyUC4nGyL MyzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=c4lAtcWLfky+loGkaKS25dVBzZnDMU5TT8sW9dTlDsw=; b=J0LhiXvHy4viq9GEZi6vmmTYyt3QgX2jsv71hyvn0WTXdkA0UVcvWp4T+U0Sjip7LD m1UW3J45u0HYkRO0H3/jWsnlYPyshv1DqBHtxN1xek+eGAbPaXqT1/tmsAy1W84g5QwJ MxWE93KavXXmHPt6Yb5m86VeYd6Q2UaR6Hbi4OpJRpUuGBOv+Jv2lAG2jC3/x48g/gpZ 6TuSOEfwI/II79uJ5OGH2bhfoFgc51QRfeiaHT1WfUKIAcaO8zHmwpcpowB/xsTtHdyQ v4atFXVcXTsvh3MAfKVtx1MvvYg1ZlKdl8oQlgagMKVpCAeLokslrj1nfWh9DMAysA+n ++Gg== X-Gm-Message-State: ACrzQf3QWn2yxZAKP82AoCNra1mkYbSi40yOQPjPV5rOqbw4FvnfvcEs iRM7dgZP5bbuC98HwlPHx8E= X-Received: by 2002:a05:6402:5406:b0:452:1560:f9d4 with SMTP id ev6-20020a056402540600b004521560f9d4mr6185254edb.333.1665926864759; Sun, 16 Oct 2022 06:27:44 -0700 (PDT) Received: from hp-power-15.localdomain (mm-39-7-212-37.vitebsk.dynamic.pppoe.byfly.by. [37.212.7.39]) by smtp.gmail.com with ESMTPSA id y5-20020aa7ce85000000b0045c72bba0bfsm5572057edv.4.2022.10.16.06.27.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 16 Oct 2022 06:27:44 -0700 (PDT) From: Siarhei Volkau Cc: Siarhei Volkau , Paul Cercueil , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , linux-mips@vger.kernel.org, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 1/7] ASoC: codecs: jz4725b: add missed Line In power control bit Date: Sun, 16 Oct 2022 16:26:42 +0300 Message-Id: <20221016132648.3011729-2-lis8215@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20221016132648.3011729-1-lis8215@gmail.com> References: <20221016132648.3011729-1-lis8215@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1746850979694018363?= X-GMAIL-MSGID: =?utf-8?q?1746850979694018363?= Line In path stayed powered off during capturing or bypass to mixer. Signed-off-by: Siarhei Volkau --- sound/soc/codecs/jz4725b.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sound/soc/codecs/jz4725b.c b/sound/soc/codecs/jz4725b.c index 5201a8f6d..cc7a48c96 100644 --- a/sound/soc/codecs/jz4725b.c +++ b/sound/soc/codecs/jz4725b.c @@ -236,7 +236,8 @@ static const struct snd_soc_dapm_widget jz4725b_codec_dapm_widgets[] = { SND_SOC_DAPM_MIXER("DAC to Mixer", JZ4725B_CODEC_REG_CR1, REG_CR1_DACSEL_OFFSET, 0, NULL, 0), - SND_SOC_DAPM_MIXER("Line In", SND_SOC_NOPM, 0, 0, NULL, 0), + SND_SOC_DAPM_MIXER("Line In", JZ4725B_CODEC_REG_PMR1, + REG_PMR1_SB_LIN_OFFSET, 1, NULL, 0), SND_SOC_DAPM_MIXER("HP Out", JZ4725B_CODEC_REG_CR1, REG_CR1_HP_DIS_OFFSET, 1, NULL, 0), From patchwork Sun Oct 16 13:26:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Siarhei Volkau X-Patchwork-Id: 3014 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp1016016wrs; Sun, 16 Oct 2022 06:28:40 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5hGAHqsNT7BodUx87O7bEYWcuWE4LT9c09Q3BhMsArUDJgnur6n+NAHWiEic5vx9/dOerC X-Received: by 2002:a17:907:25cd:b0:77b:9672:38e7 with SMTP id ae13-20020a17090725cd00b0077b967238e7mr5479201ejc.10.1665926920640; Sun, 16 Oct 2022 06:28:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665926920; cv=none; d=google.com; s=arc-20160816; b=q3FKynyc98rOxxWfDS5cZhoFpZvbcf92S9I7miN9bRakMeERAbEUCHS6k2sUxCrzbV /8NC4UXrM/e+olJ614G7OEk5/0Qk91K4ZHlezAg3TPUMnmcOVuujcsJC0Ec5m7rH1bwZ 3q9e9gSjjFF2C5+Hwd5TmzxZTjAWReybed34rCeNsKDXhzWcMhuthsqhoq1FjoTV/Hlt driUGQXNaFb9OrCthUi/co03OGtTtLaquSo+pNQ2r5Bd5uWlmZXJIabA2YHZP5WW+9W+ q8NfPJFv3md6F1nIMv1UV4N0GD3ifLLk07u8WzUpqZNnZqpMH25myHFtWXbst/XBaNfk AcPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:from :dkim-signature; bh=IQsANxIEHACjEO789UfrDxMr8VcVkScq/x+QZ4UQMEA=; b=vM0t3Bw6F+ZNVFL6gav7FsWwfm6XpIwrwJuWh1vgOB3nznfpNsg/MmqxjcbSNE09lA PsCumQJqDm/vhPneNyCArCEM7d6DUjbeHzvs4Ojd00XAGUkAujtt1xp5GztDI7iHaDD8 v2pfwBrwV7i4n6wHVsKQ+X5y7Y5VXehwEXfpGjMYsbX/wIKSguV/fNzwG6cV3WtWuPQO enYCbjNhQTj7T+7b3OwOxfKUSH8XsD5j/zqxp4vUAeb+aZ+0Lhm8b2hGF6DSgGfj4EU0 ukB7byqHZC7qnnqhuPh++Lnkxi80twDLBbYfup7kSTl6rE8Ebv4HwU3RNWQsoQ2CxwLZ iJ3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20210112 header.b=kJ4NshSV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id jg16-20020a170907971000b00782686da1d1si6373735ejc.761.2022.10.16.06.28.16; Sun, 16 Oct 2022 06:28:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20210112 header.b=kJ4NshSV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229699AbiJPN14 (ORCPT + 99 others); Sun, 16 Oct 2022 09:27:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55708 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229616AbiJPN1s (ORCPT ); Sun, 16 Oct 2022 09:27:48 -0400 Received: from mail-ed1-x530.google.com (mail-ed1-x530.google.com [IPv6:2a00:1450:4864:20::530]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C8EEF7654; Sun, 16 Oct 2022 06:27:47 -0700 (PDT) Received: by mail-ed1-x530.google.com with SMTP id s30so12681075eds.1; Sun, 16 Oct 2022 06:27:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=IQsANxIEHACjEO789UfrDxMr8VcVkScq/x+QZ4UQMEA=; b=kJ4NshSVOAuSzJGz7Jj9SJ0xMOEi4H/WlYotPjjJejZwXBfKwe4D3mFeklshKLJi8L 6lKCCypWJrFHTNrH127vr77kV0vifbz2zlgt2b37KKhI0PzdAGn5VLNDFaaTuqmbrX5e x+7riGpjdchVyrlR2P8JgHKB0T87pb/xCaiV4GPgAN5uxNwNs6njn9Rqhjo+We4mBKgv W2dof6GFySiw0JHaFysHlrhWFeVydnAUY5zHs+yAv9wvzIcc68Z4E5f3RXBPgf/jWPe2 Sp3tXYuXlgzwm497Zx/EzipZu3TjEOLazm4vW3m24a6k6nQ3RUrR8WeLrThXidy9tvtJ nOQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=IQsANxIEHACjEO789UfrDxMr8VcVkScq/x+QZ4UQMEA=; b=7OgaTrBQZ9LpHEdOMfDWsmiMajqh1S6WMylI1zI8y3BgCtF7990G8B7jLH9w2kBz5j SBQGJnR3cNQfHHPIYdNZ15J5X8IyrB2s8gvT5sYh+evXz9nvwOUywoFUoCR5zCC/SfNN zK6KlaUN+F8LThYokTFE3y4WO9zWbdNOZh54QkOwUVbQ5dilG6PsSntqmNlryZFsaJtw C3ekAWTCWXfBVePyDm8qIwmt4LPTQ+ySZXBP/Fo8pyUOHq48OFA22AmalNhP7OWhx7DT NHGzwywGmJa6cS7ewBTJFWhAfNfZqhTSQBTDTxAvmpHVZLI+COhfVb5YE6DdSvYMLVlk fgDA== X-Gm-Message-State: ACrzQf00N76fVy3fxBx45v6ZQBPKMsXgo04lRoOvjhNifLI+XK2n+ddN /v08OD44xdoxyYGxmZPNhFQ= X-Received: by 2002:a05:6402:35c9:b0:45c:de2e:ae1c with SMTP id z9-20020a05640235c900b0045cde2eae1cmr6163562edc.393.1665926866448; Sun, 16 Oct 2022 06:27:46 -0700 (PDT) Received: from hp-power-15.localdomain (mm-39-7-212-37.vitebsk.dynamic.pppoe.byfly.by. [37.212.7.39]) by smtp.gmail.com with ESMTPSA id y5-20020aa7ce85000000b0045c72bba0bfsm5572057edv.4.2022.10.16.06.27.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 16 Oct 2022 06:27:45 -0700 (PDT) From: Siarhei Volkau Cc: Siarhei Volkau , Paul Cercueil , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , linux-mips@vger.kernel.org, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 2/7] ASoC: codecs: jz4725b: fix reported volume for Master ctl Date: Sun, 16 Oct 2022 16:26:43 +0300 Message-Id: <20221016132648.3011729-3-lis8215@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20221016132648.3011729-1-lis8215@gmail.com> References: <20221016132648.3011729-1-lis8215@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1746850986689537576?= X-GMAIL-MSGID: =?utf-8?q?1746850986689537576?= DAC volume control is the Master Playback Volume at the moment and it reports wrong levels in alsamixer and other alsa apps. The patch fixes that, as stated in manual on the jz4725b SoC (16.6.3.4 Programmable attenuation: GOD) the ctl range varies from -22.5dB to 0dB with 1.5dB step. Signed-off-by: Siarhei Volkau --- sound/soc/codecs/jz4725b.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/codecs/jz4725b.c b/sound/soc/codecs/jz4725b.c index cc7a48c96..72549ee2e 100644 --- a/sound/soc/codecs/jz4725b.c +++ b/sound/soc/codecs/jz4725b.c @@ -142,8 +142,8 @@ struct jz_icdc { struct clk *clk; }; -static const SNDRV_CTL_TLVD_DECLARE_DB_LINEAR(jz4725b_dac_tlv, -2250, 0); static const SNDRV_CTL_TLVD_DECLARE_DB_LINEAR(jz4725b_line_tlv, -1500, 600); +static const SNDRV_CTL_TLVD_DECLARE_DB_SCALE(jz4725b_dac_tlv, -2250, 150, 0); static const struct snd_kcontrol_new jz4725b_codec_controls[] = { SOC_DOUBLE_TLV("Master Playback Volume", From patchwork Sun Oct 16 13:26:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Siarhei Volkau X-Patchwork-Id: 3015 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp1016078wrs; Sun, 16 Oct 2022 06:28:54 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7E46Y4hzdwFnKA4IYxCame+DxsmMvxz5xEl1RU2Lg1w5XKnIITwSzE3kHqgLj3FVc9ACcN X-Received: by 2002:a17:907:2cf5:b0:78d:f9cc:794a with SMTP id hz21-20020a1709072cf500b0078df9cc794amr4987149ejc.577.1665926934393; Sun, 16 Oct 2022 06:28:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665926934; cv=none; d=google.com; s=arc-20160816; b=TdQS9gNT4QDehji4vMBmlBtNPi+MlAFseWd9st+V+twpVx1nt8o8QlUGuCHvq2x1gA 3mKvy0Ap8PKg8XiGG9wsKVdDYYCjaw75Mhk+mhhhhBeyHXe7Vp0eVImRwpQ7ppE27hjA kAQEPIYjzOYyk8GORHZtoCUmVYihtIzOFYnhjNURx1GbA5s2C7JB+pM6uU13acykLrFM pN3ZvUHy56bwf78p9fReDV5Ar2HbRGVNPiVx8QfH/KBbPFKskoAfPcTsx45KvDJBYQ/g UDYHWxacS52r2+hw+XKVIzAAU4MLCH1jw8vTia5D1Xsa90Sf/a/MaBoPWRIMpXTedD42 kaEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:from :dkim-signature; bh=L39wW3Ty3Fj+0JLtrs7YSIDPOeSCl+TCC41j4zAWphE=; b=xK2Yv6ELVI+aqXpkSPkq9j/lQ4AYjvB6tptKrDsSZkBEDjAZwp2T6wjWb3qX7eLTfr J7jzLNhuM40cdqYBbmpGdOycazcv9zKoV9uDoTthqYQ3qQ+/GI3VYISaWsZQB4+S777n dwoTzyZtNo89wZ/WfvGVPO5hYPIC/IAYotdGm61dqvg0ck76Q6AwZTVN31ZbAnnZwYm6 nIpIrUESHjcMF4HZjtSxvUc+2c3Mym83zE0e0QYPOu2e5HT9qolGilsym/DDiT1gJD3x h3uWn+6UNCB7w30n57cqczIRXa+v4BCgWc8FWkB+DeoYMmmorMs9b2zJGfFCzsDh0e4W XRVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20210112 header.b="UbYHy/nX"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n14-20020aa7c78e000000b00458ee128628si5792250eds.470.2022.10.16.06.28.29; Sun, 16 Oct 2022 06:28:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20210112 header.b="UbYHy/nX"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229735AbiJPN2F (ORCPT + 99 others); Sun, 16 Oct 2022 09:28:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55738 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229655AbiJPN1u (ORCPT ); Sun, 16 Oct 2022 09:27:50 -0400 Received: from mail-ej1-x62d.google.com (mail-ej1-x62d.google.com [IPv6:2a00:1450:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A12FC2AC4; Sun, 16 Oct 2022 06:27:49 -0700 (PDT) Received: by mail-ej1-x62d.google.com with SMTP id ot12so19656393ejb.1; Sun, 16 Oct 2022 06:27:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=L39wW3Ty3Fj+0JLtrs7YSIDPOeSCl+TCC41j4zAWphE=; b=UbYHy/nX1Hbr3bCvUqAAtrbIHZ3vBejD2D7anTDSYRhHg8ljKzyf5t1oyeRScnEwYx 5U/lzKQ7sZdR4ZF1fWMWL1iraSVU5nUKfyEiGYP7dCXc6ywqFWFzhJxwjuzSvqVLY4Kn 3choB2XDXwSuWZthpBlk6N8xkz+iRqkS1PkKyNT6niCYPUF7kCuGKX9QFMfKCymlwm6f vM8e6NowPsXsujD1xhH3avFQQwzIQftlgKkYQg3MTz1uw80N7Ux0WDgm89aKuY0mJcpD PgkbAvm1ClCUUxX9NZrrkX5cZiPmNOQJkkzTdA9bRIl1xDw8wBkzZgAHiSx6A/qkxUmS WdHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=L39wW3Ty3Fj+0JLtrs7YSIDPOeSCl+TCC41j4zAWphE=; b=We+IvE9UZMfvKp1GE4FiYvKdCnSVfUnQdygGzL+0OnLmn1I3l4qz/X9D1cqvQkHDpS yarRg1uawA6vl4AUisSGwGPFwqm8RW+JR2kJCZLSXrFZ/BN5riu6YHO6Zkm3QnqxzU10 X1Vl38FxsdKVr9OoM/WiM4imS9my/44hv/rXDlR3xzX9Kgkc30AbT+ndq4cL2jOsu70a a7MzjaBkGg+qzB9r020jYOxV0tsof3f/V2d++d39bRt/daIn502pUbLOYgI5+FzQopFv MwXVR52LMsUexdb0YhNiU8IQwOnevGYFqUtIqG08aIMCYFC4xqZEeIKc9ricXQIW4FLX nj9A== X-Gm-Message-State: ACrzQf1vWxtZE8DAgdH0rRXlcE08OzSFH6E5SrODizE2pBtLbklfg2Ij Lgo5N9vzjauBEu88mMU4yUQ= X-Received: by 2002:a17:907:845:b0:731:2f6c:6dbd with SMTP id ww5-20020a170907084500b007312f6c6dbdmr5069253ejb.551.1665926868234; Sun, 16 Oct 2022 06:27:48 -0700 (PDT) Received: from hp-power-15.localdomain (mm-39-7-212-37.vitebsk.dynamic.pppoe.byfly.by. [37.212.7.39]) by smtp.gmail.com with ESMTPSA id y5-20020aa7ce85000000b0045c72bba0bfsm5572057edv.4.2022.10.16.06.27.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 16 Oct 2022 06:27:47 -0700 (PDT) From: Siarhei Volkau Cc: Siarhei Volkau , Paul Cercueil , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , linux-mips@vger.kernel.org, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 3/7] ASoC: codecs: jz4725b: use right control for Capture Volume Date: Sun, 16 Oct 2022 16:26:44 +0300 Message-Id: <20221016132648.3011729-4-lis8215@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20221016132648.3011729-1-lis8215@gmail.com> References: <20221016132648.3011729-1-lis8215@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1746851000956957817?= X-GMAIL-MSGID: =?utf-8?q?1746851000956957817?= Line In Bypass control is used as Master Capture at the moment this is completely incorrect. Current control routed to Mixer instead of ADC, thus can't affect Capture path. ADC control shall be used instead. ADC volume control parameters are different, so the patch fixes that as well. Manual says (16.6.3.2 Programmable input attenuation amplifier: PGATM) that gain varies in range 0dB..22.5dB with 1.5dB step. Signed-off-by: Siarhei Volkau --- sound/soc/codecs/jz4725b.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/sound/soc/codecs/jz4725b.c b/sound/soc/codecs/jz4725b.c index 72549ee2e..4363d898a 100644 --- a/sound/soc/codecs/jz4725b.c +++ b/sound/soc/codecs/jz4725b.c @@ -136,13 +136,16 @@ enum { #define REG_CGR3_GO1L_OFFSET 0 #define REG_CGR3_GO1L_MASK (0x1f << REG_CGR3_GO1L_OFFSET) +#define REG_CGR10_GIL_OFFSET 0 +#define REG_CGR10_GIR_OFFSET 4 + struct jz_icdc { struct regmap *regmap; void __iomem *base; struct clk *clk; }; -static const SNDRV_CTL_TLVD_DECLARE_DB_LINEAR(jz4725b_line_tlv, -1500, 600); +static const SNDRV_CTL_TLVD_DECLARE_DB_SCALE(jz4725b_adc_tlv, 0, 150, 0); static const SNDRV_CTL_TLVD_DECLARE_DB_SCALE(jz4725b_dac_tlv, -2250, 150, 0); static const struct snd_kcontrol_new jz4725b_codec_controls[] = { @@ -151,11 +154,11 @@ static const struct snd_kcontrol_new jz4725b_codec_controls[] = { REG_CGR1_GODL_OFFSET, REG_CGR1_GODR_OFFSET, 0xf, 1, jz4725b_dac_tlv), - SOC_DOUBLE_R_TLV("Master Capture Volume", - JZ4725B_CODEC_REG_CGR3, - JZ4725B_CODEC_REG_CGR2, - REG_CGR2_GO1R_OFFSET, - 0x1f, 1, jz4725b_line_tlv), + SOC_DOUBLE_TLV("Master Capture Volume", + JZ4725B_CODEC_REG_CGR10, + REG_CGR10_GIL_OFFSET, + REG_CGR10_GIR_OFFSET, + 0xf, 0, jz4725b_adc_tlv), SOC_SINGLE("Master Playback Switch", JZ4725B_CODEC_REG_CR1, REG_CR1_DAC_MUTE_OFFSET, 1, 1), From patchwork Sun Oct 16 13:26:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Siarhei Volkau X-Patchwork-Id: 3016 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp1016097wrs; Sun, 16 Oct 2022 06:28:59 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7SVrogZzmUy2wGRw3Qect5uTCLomUtWuKelWNSBOA2oeEAdg6ZwH6bpQrMJaxcBRcI51bm X-Received: by 2002:a17:906:5a6c:b0:78d:a075:ea22 with SMTP id my44-20020a1709065a6c00b0078da075ea22mr5220856ejc.671.1665926939629; Sun, 16 Oct 2022 06:28:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665926939; cv=none; d=google.com; s=arc-20160816; b=Ha4guuOIgV4Qe44a6QBvuWcuy6IsvzLj4AVkjqc6aPl82R7lC5+YfpMspmYdKCxwoT n5v3MCauH5k9roOY2NvEcYSUHR2/8whGnN0Gs6LVALtWEjHzy1po860E6N7NHgmhZguw vQpdcCRpn9LAe8v9dJeIMVs2EtLHJXB0dDwWi3OxfaZufPDbLG5m1tfX11GPRh4041II LMxgCqat+l0nQqzVTlfcYzqRXtHqhss7Sxdb58yp6SaOGxMwjzeUuF6NzrHp5SP8W0rB apcfaC7rZ+KHMSEGJ/9U8InupNLcLGQC1+lZtV/Bq+4ugWIEM/IY1tp1QzB1C6TOswxY u9GA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:from :dkim-signature; bh=ZA0KpJu28BqLozBBPuBVAqokT3cgceSjy1up9PTHuYA=; b=vhVejyF5wfM7MGe3Rzy/btj+/IUdVie5iMl+ClHaUsbtdePuh9ocSenVf/Jes9Qg0r W1QhoHSFOWi3Hc/AnZdTOeM6bop8OzvH5J6m7JUwBOd+UZ0bjHaNyKyveHN534bVveP/ Aa7VYQaF+jBSn91UEvjZhOGbRsqDrbNpwT27SD6MlISPLS1iAk4ibEWJW1CAEOleeGos FSetG2v4Pa1u9LakicZCIwrJzw7PBwOUSN0ih4TtTgL4H9MTy6/918l2HSoSI1eBYZVO BM1ENVnK29wvP1nGyTUdqLEKTiQbxWpSqL/de0i2a5kwHqD7eWzGDlzh8nwbLHEuJbLm CXNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20210112 header.b=d0F1c3o0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l5-20020a170906794500b0078e1d213831si8034011ejo.122.2022.10.16.06.28.34; Sun, 16 Oct 2022 06:28:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20210112 header.b=d0F1c3o0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229739AbiJPN2J (ORCPT + 99 others); Sun, 16 Oct 2022 09:28:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55780 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229635AbiJPN1x (ORCPT ); Sun, 16 Oct 2022 09:27:53 -0400 Received: from mail-ej1-x62d.google.com (mail-ej1-x62d.google.com [IPv6:2a00:1450:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9A62B11828; Sun, 16 Oct 2022 06:27:51 -0700 (PDT) Received: by mail-ej1-x62d.google.com with SMTP id b2so19604728eja.6; Sun, 16 Oct 2022 06:27:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ZA0KpJu28BqLozBBPuBVAqokT3cgceSjy1up9PTHuYA=; b=d0F1c3o0/2IEmFhVt8sfandi2JGjbMImQOINE1wpmbolCoo4w8vESRTGwbFuJV6AT6 8g9gz+S9ghdI+OxN6um0jK6bEClWqsHuYTIY/ACG69nrQdne7FtFoiD9zFHUqNQEaFET DHSUjKLf5t9dvWjCPCcLSRXUn15x0BVMOHEkFEab/kZdaQVT0jZNVD08WpCKveZSfwd0 KrWg1qhLMHptUJc9FfQVq9hazG4ojzqqj6t7eq27vQNic0hvIPMEkJC3N3Tos7X8KG6H Po909OSaYnkM64TwwkjY2vJ7rFaYMFA3fhO0qyWXTfLud2EMuSOHEeiHL+PjdNcC9e7P ya8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ZA0KpJu28BqLozBBPuBVAqokT3cgceSjy1up9PTHuYA=; b=aG/NbpKZLcEmcagVJJYkc2qp3hifh/SSrphN0Da61waBgXtdj4Bj4nmuv2fz3tlJbg S/QY4aIUmf2OSZa9+9IxU6f4uj7wIK5SEYhxtAT7jeJJSQX+PKsPOury2w83xZmd0P0o pLCajLHpNREEU/Cg+X+mK1Uc6YR8y+AUoDMiahhXIjjvfc/nsG0v3jdamHB6KoR/f2w9 pLLawLTMEn7qR47xkzIrJ9AwYlYsgUko8ehzVgsyBeDrIUTK1fFm3FskBQG7NIVqDb6C hJ2zj1E+Ukhjha1grTnP7YY64DUX+Q9U7nO62inixh0+X8EkE32raekecOZ4Ry0hkT82 uEBA== X-Gm-Message-State: ACrzQf0zC8WmrffvH2GmF30b4IBMfa1ZRfJwlu1rT5SY1MZxDfwm9ZZM OLhZjGeMNKkx9Zdh3A4bIFdFuOa58939zA== X-Received: by 2002:a17:906:591:b0:73d:c3ef:84ae with SMTP id 17-20020a170906059100b0073dc3ef84aemr5202358ejn.155.1665926870045; Sun, 16 Oct 2022 06:27:50 -0700 (PDT) Received: from hp-power-15.localdomain (mm-39-7-212-37.vitebsk.dynamic.pppoe.byfly.by. [37.212.7.39]) by smtp.gmail.com with ESMTPSA id y5-20020aa7ce85000000b0045c72bba0bfsm5572057edv.4.2022.10.16.06.27.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 16 Oct 2022 06:27:49 -0700 (PDT) From: Siarhei Volkau Cc: Siarhei Volkau , Paul Cercueil , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , linux-mips@vger.kernel.org, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 4/7] ASoC: codecs: jz4725b: fix capture selector naming Date: Sun, 16 Oct 2022 16:26:45 +0300 Message-Id: <20221016132648.3011729-5-lis8215@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20221016132648.3011729-1-lis8215@gmail.com> References: <20221016132648.3011729-1-lis8215@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1746851006649027429?= X-GMAIL-MSGID: =?utf-8?q?1746851006649027429?= At the moment Capture source selector appears on Playback tab in the alsamixer and has a senseless name. Let's fix that. Signed-off-by: Siarhei Volkau --- sound/soc/codecs/jz4725b.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/sound/soc/codecs/jz4725b.c b/sound/soc/codecs/jz4725b.c index 4363d898a..d57c2c6a3 100644 --- a/sound/soc/codecs/jz4725b.c +++ b/sound/soc/codecs/jz4725b.c @@ -183,7 +183,7 @@ static SOC_VALUE_ENUM_SINGLE_DECL(jz4725b_codec_adc_src_enum, jz4725b_codec_adc_src_texts, jz4725b_codec_adc_src_values); static const struct snd_kcontrol_new jz4725b_codec_adc_src_ctrl = - SOC_DAPM_ENUM("Route", jz4725b_codec_adc_src_enum); + SOC_DAPM_ENUM("ADC Source Capture Route", jz4725b_codec_adc_src_enum); static const struct snd_kcontrol_new jz4725b_codec_mixer_controls[] = { SOC_DAPM_SINGLE("Line In Bypass", JZ4725B_CODEC_REG_CR1, @@ -228,7 +228,7 @@ static const struct snd_soc_dapm_widget jz4725b_codec_dapm_widgets[] = { SND_SOC_DAPM_ADC("ADC", "Capture", JZ4725B_CODEC_REG_PMR1, REG_PMR1_SB_ADC_OFFSET, 1), - SND_SOC_DAPM_MUX("ADC Source", SND_SOC_NOPM, 0, 0, + SND_SOC_DAPM_MUX("ADC Source Capture Route", SND_SOC_NOPM, 0, 0, &jz4725b_codec_adc_src_ctrl), /* Mixer */ @@ -287,11 +287,11 @@ static const struct snd_soc_dapm_route jz4725b_codec_dapm_routes[] = { {"Mixer", NULL, "DAC to Mixer"}, {"Mixer to ADC", NULL, "Mixer"}, - {"ADC Source", "Mixer", "Mixer to ADC"}, - {"ADC Source", "Line In", "Line In"}, - {"ADC Source", "Mic 1", "Mic 1"}, - {"ADC Source", "Mic 2", "Mic 2"}, - {"ADC", NULL, "ADC Source"}, + {"ADC Source Capture Route", "Mixer", "Mixer to ADC"}, + {"ADC Sourc Capture Routee", "Line In", "Line In"}, + {"ADC Source Capture Route", "Mic 1", "Mic 1"}, + {"ADC Source Capture Route", "Mic 2", "Mic 2"}, + {"ADC", NULL, "ADC Source Capture Route"}, {"Out Stage", NULL, "Mixer"}, {"HP Out", NULL, "Out Stage"}, From patchwork Sun Oct 16 13:26:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Siarhei Volkau X-Patchwork-Id: 3019 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp1041345wrs; Sun, 16 Oct 2022 07:35:20 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6ujnhylDLzjqOCe+lywMNWq5x8gGWSuhs6OFrKKwNi8QhcfJ2i3stjHh6UaELW8LXMXLxK X-Received: by 2002:a65:6bd4:0:b0:443:94a1:429c with SMTP id e20-20020a656bd4000000b0044394a1429cmr6749554pgw.606.1665930920358; Sun, 16 Oct 2022 07:35:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665930920; cv=none; d=google.com; s=arc-20160816; b=FcaBuZn4MeUViCx9GwFESpttvjSPHf6le8RXuR7lbg4IzZRUoj6xYywBhZHexErjNS +yd0sEvLFKhUnvGvc7RzGCW98aUQq5w+z5YaZhO7I7Nvq+LM4elMu4z6Ai91YvdXQSlc 1iVZbzf8Ya8iI9KYMCyTeNovXYq8mpdDD4upCzLy9A7txXJTjnj2d0oYkQ+M6CGp8oNQ rz+LfZc6WreOQpz7d1s6AiWbSfDBEsA0jOP38a/xqjM7c+BESUYZlSm/YDjv3fL6M+pQ dMrBUu8lxLDWEYqKbSsF4pqyu0rUh3SGb0kMHiN4YyZ7E1KviT3ZmX8ICQdqhsvfplpn zY0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:from :dkim-signature; bh=CqjTgeUd6gWhUWYVrTKOj3mTSf21kU7OjGiHvk8JsVI=; b=QQqSbBAq3AOJmpLYoZhgudn1bMJ3dzh+XT4CENuMwcfdUFw/iQ2YRHbRqKmrqq6Gg1 fyEPAdJgJHn4SJWgJP/kGsfooRS9M5DDZS/Lpl6cBUHEI1r7ooyo0OHK6UcZcN98wsfF qVOebcuO/jJM1qCHnSCciqlY8B28BPQJies4M3taunX5Cjdq99PmPVoc0Er/0OMjuMrf W7W/D06AklaeNiBKXeq9YczhbTQGmqQ9YqG87+vDmG6vkn1r5KLZEgFSkb+wYckAFko0 QPViSnae0XLxmPmQKRYy4fLBJAnlB26zAjv6b2lb26TmIRpIFzLygjjiO266cPXCYsT8 zwow== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20210112 header.b=nnhEubGW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k18-20020a170902c41200b00172e069021dsi10317475plk.469.2022.10.16.07.35.07; Sun, 16 Oct 2022 07:35:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20210112 header.b=nnhEubGW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229755AbiJPN2N (ORCPT + 99 others); Sun, 16 Oct 2022 09:28:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55858 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229687AbiJPN1z (ORCPT ); Sun, 16 Oct 2022 09:27:55 -0400 Received: from mail-ed1-x536.google.com (mail-ed1-x536.google.com [IPv6:2a00:1450:4864:20::536]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 09E3F1A813; Sun, 16 Oct 2022 06:27:54 -0700 (PDT) Received: by mail-ed1-x536.google.com with SMTP id s2so12694169edd.2; Sun, 16 Oct 2022 06:27:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=CqjTgeUd6gWhUWYVrTKOj3mTSf21kU7OjGiHvk8JsVI=; b=nnhEubGWYhDFWbs8jnu2ZsbffdvT/gOCsYhx0i17+WGLo3+P9CsnAUUN4ByFGjBKum IsSgxTK4Jbh+Z75eNSWa9BzjNX6rm/m27aECTaRsq4f6S2xTUFPfglDV6P0xpqeMfLAr 36KldilDoSeXXtLnCnCeKMTs7GLMCGGqvDFFgkTJLB2MAF62ku9mwJLovpo5/56xuGco ShSuoxhuXM2bmiVldaRdh+7VNdncdQid8v/pqoIZymz3JVSt7LMfGHAjEEcVrdUKQpSq R3HGEx3ZGGEeLlBtCThUy31hZT0sCZ6sPCSSxsxRnomIa2Kxs0uYwVCMaENHNV99U4U6 1YJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=CqjTgeUd6gWhUWYVrTKOj3mTSf21kU7OjGiHvk8JsVI=; b=LV/CA6TI4cqCWlUcQuGQJmL++ise6nGB354r3LKEk4R74YrO6BWDfaldrsb4WKpeC4 Uz/mODoRF57ZO1+KH+sjB6yaB8j8GmstT7+G28CU9k6OjubpXRy0lqnQDILEKgsDTKdZ KJZcmdd+qxIdryfN5W3r2CtnX5yJ/za+bdPs9A9DOG9w8+/1213NI5paKADRmYgMNfAU 43u3tymHhhAk6+OutPM8GNhGHrzT1gIoIHvCNZtowMABqD+ggg8KWUGhgvNFRCVhy/kr iMaqMDwrf2dDcr5jX6HgfXLU0yad1SjsZyA4k9baTwvV0/FpRCDM4WkKrzwxhTGIhgUD VYHg== X-Gm-Message-State: ACrzQf3LVOKYFelPpKQpEoLKs6RvMj8VbBiFEKPVvxswijCTUe328L2k jpUAJkQPN3EfWZGI+QmlNDA= X-Received: by 2002:a05:6402:40c4:b0:45c:c718:54d1 with SMTP id z4-20020a05640240c400b0045cc71854d1mr6213755edb.319.1665926872430; Sun, 16 Oct 2022 06:27:52 -0700 (PDT) Received: from hp-power-15.localdomain (mm-39-7-212-37.vitebsk.dynamic.pppoe.byfly.by. [37.212.7.39]) by smtp.gmail.com with ESMTPSA id y5-20020aa7ce85000000b0045c72bba0bfsm5572057edv.4.2022.10.16.06.27.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 16 Oct 2022 06:27:51 -0700 (PDT) From: Siarhei Volkau Cc: Siarhei Volkau , Paul Cercueil , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , linux-mips@vger.kernel.org, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 5/7] ASoC: codecs: jz4725b: use right control for Master Playback Date: Sun, 16 Oct 2022 16:26:46 +0300 Message-Id: <20221016132648.3011729-6-lis8215@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20221016132648.3011729-1-lis8215@gmail.com> References: <20221016132648.3011729-1-lis8215@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1746855180409724901?= X-GMAIL-MSGID: =?utf-8?q?1746855180409724901?= At the moment DAC control is used as Master Playback control, this is incorrect as DAC's output goes to a Mixer. The Mixer couples analog input from 4 sources (DAC, Line In, Mic 1, Mic 2) each input has its own gain & mute controls. Output of the Mixer goes to Output Stage control which is the best suite for the new Playback Master. However, it doesn't have mute capability. The patch implements Output Stage control as a new master and renames old Master to DAC. Rest of mixer inputs will be implemented in the next patch in the series. Manual states that Output stage control (16.6.3.5 Programmable output amplifier: PGAT) gain varies from -33.5dB to +4.5dB, gain step isn't fixed and has 3 opts. Signed-off-by: Siarhei Volkau --- sound/soc/codecs/jz4725b.c | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/sound/soc/codecs/jz4725b.c b/sound/soc/codecs/jz4725b.c index d57c2c6a3..c39398e0a 100644 --- a/sound/soc/codecs/jz4725b.c +++ b/sound/soc/codecs/jz4725b.c @@ -136,6 +136,12 @@ enum { #define REG_CGR3_GO1L_OFFSET 0 #define REG_CGR3_GO1L_MASK (0x1f << REG_CGR3_GO1L_OFFSET) +#define REG_CGR8_GOR_OFFSET 0 +#define REG_CGR8_GOR_MASK (0x1f << REG_CGR8_GOR_OFFSET) + +#define REG_CGR9_GOL_OFFSET 0 +#define REG_CGR9_GOL_MASK (0x1f << REG_CGR9_GOL_OFFSET) + #define REG_CGR10_GIL_OFFSET 0 #define REG_CGR10_GIR_OFFSET 4 @@ -147,9 +153,14 @@ struct jz_icdc { static const SNDRV_CTL_TLVD_DECLARE_DB_SCALE(jz4725b_adc_tlv, 0, 150, 0); static const SNDRV_CTL_TLVD_DECLARE_DB_SCALE(jz4725b_dac_tlv, -2250, 150, 0); +static const SNDRV_CTL_TLVD_DECLARE_DB_RANGE(jz4725b_out_tlv, + 0, 11, TLV_DB_SCALE_ITEM(-3350, 200, 0), + 12, 23, TLV_DB_SCALE_ITEM(-1050, 100, 0), + 24, 31, TLV_DB_SCALE_ITEM( 100, 50, 0), +); static const struct snd_kcontrol_new jz4725b_codec_controls[] = { - SOC_DOUBLE_TLV("Master Playback Volume", + SOC_DOUBLE_TLV("DAC Playback Volume", JZ4725B_CODEC_REG_CGR1, REG_CGR1_GODL_OFFSET, REG_CGR1_GODR_OFFSET, @@ -160,7 +171,13 @@ static const struct snd_kcontrol_new jz4725b_codec_controls[] = { REG_CGR10_GIR_OFFSET, 0xf, 0, jz4725b_adc_tlv), - SOC_SINGLE("Master Playback Switch", JZ4725B_CODEC_REG_CR1, + SOC_DOUBLE_R_TLV("Master Playback Volume", + JZ4725B_CODEC_REG_CGR9, + JZ4725B_CODEC_REG_CGR8, + REG_CGR8_GOR_OFFSET, + 0x1f, 1, jz4725b_out_tlv), + + SOC_SINGLE("DAC Playback Switch", JZ4725B_CODEC_REG_CR1, REG_CR1_DAC_MUTE_OFFSET, 1, 1), SOC_SINGLE("Deemphasize Filter Playback Switch", From patchwork Sun Oct 16 13:26:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Siarhei Volkau X-Patchwork-Id: 3018 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp1017464wrs; Sun, 16 Oct 2022 06:32:38 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5hxNEMmqIyeK/qbapis0MuUxCY323s2RUKp4pVQMY5PLW9EsowTAragiuNmOMJ5xkW0rIo X-Received: by 2002:a05:6402:847:b0:453:943b:bf4 with SMTP id b7-20020a056402084700b00453943b0bf4mr6093543edz.301.1665927157988; Sun, 16 Oct 2022 06:32:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665927157; cv=none; d=google.com; s=arc-20160816; b=R6d6l4fRe5mq7lqgXlVrfvfIVWOQI4iWyxCUJB4UeuRZZanCMcgm/2DcjZe4qvn//x s7sVcU8ZAas3oLaJWQ5BMAYntJNPOHBFuqjgnC19gs1GTAAe4E9qJ7MWls35i9r9cu3r lpDJvx/seV3eVOgs1OCsusar11PWna33UeUEsvTruJCl3tVA1HrOmj/poc9TVY+shHWA u0LcJ8teImsy24xCCIbe6CEmHUILtkmKklj5O+s4Fiu7erUiZkVafCntZze4TcABEKvf HTHQ8mBV5fVHvhwoHsc0Md28cy0IrSvzT/OOnz7nmzFq0Qksjqf82PScIRYadz/8Usfr rq/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:from :dkim-signature; bh=J+d4zYZ2OcrExgu67AwFyCEVw5ZLbwcKQnaxEzIUbSA=; b=JNzFrs1IKcClZiysHxdWy9xW90WUZT3Nq+gvBo19iQUaNT/bBfhtVaRZwJlptP2pLL JqjIrQnTVyvYkntspyR3XZTRY5Ioq/G5Ac5jPPNoLcZU18+Hm7JWtabAVo4Oe2tLMQtr /T7hOi8BARRAUE+xthkBFhOmK2l6T4rHSX+55/0aOL5hmC4N4curfR/30TLdAlbzDiTc yaPjG3mTG8vPX0TaTBRm1l57FTlLxkGRN8K+0i+SJnto6ZWA0V+bnYahn+leDc0dUfPr Y3KhJj7ol6lccK6DFjOvdMsV2rTQJalZeGrPzKF6teNXH5yf/S32DcCDxpqRYw5dK+/G 0eWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20210112 header.b=mMrjWmGO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f15-20020a056402354f00b0045d74aa4730si2073239edd.297.2022.10.16.06.32.12; Sun, 16 Oct 2022 06:32:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20210112 header.b=mMrjWmGO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229769AbiJPN2X (ORCPT + 99 others); Sun, 16 Oct 2022 09:28:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56088 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229734AbiJPN2F (ORCPT ); Sun, 16 Oct 2022 09:28:05 -0400 Received: from mail-ej1-x62e.google.com (mail-ej1-x62e.google.com [IPv6:2a00:1450:4864:20::62e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 875BB17898; Sun, 16 Oct 2022 06:27:56 -0700 (PDT) Received: by mail-ej1-x62e.google.com with SMTP id y14so19563028ejd.9; Sun, 16 Oct 2022 06:27:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=J+d4zYZ2OcrExgu67AwFyCEVw5ZLbwcKQnaxEzIUbSA=; b=mMrjWmGOWPj+C9rRMvyoO46WUEnlfRtEdLgPUR+JGPnHwMPR8SDTdC/OMHqnsvlbsO uAwIB6Dii987acRt1fXMF5i0TMU353WzTrDYcnBf1Qy61/5fTgyC8ZS8q1Hmwna9zEgw nSx2+QuChjF4E/rqYhj+nfwQ4DnUPgSrjHvw5J0li9Xq4Pk8Ki+MDQU4fkddJfQQBRGN sMj6I/x54DLEW1hPsx03ZHWgDNs1SMxzWIZ7iOc/RFOv0ZhVw3EdwsHqdVzXP+4Hh6Kx Ikr4iJKaEMbWgE/CeGhUWMVACdvtHreTDJOj+9pdQ5Uq29sHodsIf3dVM08LZqBjQtQk ho6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=J+d4zYZ2OcrExgu67AwFyCEVw5ZLbwcKQnaxEzIUbSA=; b=nRDj5lvZWKQnzdJj79gBwcgVxXt/l2/ql7x5NsA6aL3j7WYHvmdN9bU+QDHlochlSF +R/hXj/EpaRtR2HGaBhSl7tFQF90h535Oj7VIFlB6z6WZWDTMpDp9nPM3l1jcR+4jSmz EXRa3fiEix/N7JezGxvjhx3WF6D+jh2ZMJv70h7sLX2qMKkgXJTtkwvQh7nVFNe0nAD0 Gsd9Xd0w3Gg+jZYxPr7lHYA+GAytoFLvvxdzYiv6yVuHdgEslhIyKW8YgdMr6+e96GaA aw4nFVJ+MgO7uUPuM2yrhwPBLY/pNgpwFTMuWceOBT0r/n0Arljx97sPPO2R3+VtlgEn jMwg== X-Gm-Message-State: ACrzQf0CtGMSjEpukQKBZ5A6qu+OCbOxg+LM23iUBP+5hm3J+MGfEy7n UvARD1Jjyly0ILpqnfufuf4= X-Received: by 2002:a17:906:8479:b0:78d:cf17:2d70 with SMTP id hx25-20020a170906847900b0078dcf172d70mr5129252ejc.319.1665926874773; Sun, 16 Oct 2022 06:27:54 -0700 (PDT) Received: from hp-power-15.localdomain (mm-39-7-212-37.vitebsk.dynamic.pppoe.byfly.by. [37.212.7.39]) by smtp.gmail.com with ESMTPSA id y5-20020aa7ce85000000b0045c72bba0bfsm5572057edv.4.2022.10.16.06.27.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 16 Oct 2022 06:27:54 -0700 (PDT) From: Siarhei Volkau Cc: Siarhei Volkau , Paul Cercueil , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , linux-mips@vger.kernel.org, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 6/7] ASoC: codecs: jz4725b: add missed Mixer inputs Date: Sun, 16 Oct 2022 16:26:47 +0300 Message-Id: <20221016132648.3011729-7-lis8215@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20221016132648.3011729-1-lis8215@gmail.com> References: <20221016132648.3011729-1-lis8215@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1746851235522774257?= X-GMAIL-MSGID: =?utf-8?q?1746851235522774257?= The Mixer couples analog input from 4 sources (DAC, Line In, Mic 1, Mic 2) each input has its own gain & mute controls. At the moment only DAC is implemented fully and Line In path can be switched on/off. The patch implements Mic 1 and Mic 2 paths and fully implements Line In path. Manual states that these controls (16.6.3.3 Programmable attenuation: GOi) gain varies from -22.5dB to +6.0dB with 1.5dB step. Also there's extra values below the minimum, but they behave the same as the minimum value. Signed-off-by: Siarhei Volkau --- sound/soc/codecs/jz4725b.c | 42 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 40 insertions(+), 2 deletions(-) diff --git a/sound/soc/codecs/jz4725b.c b/sound/soc/codecs/jz4725b.c index c39398e0a..52b2bb95b 100644 --- a/sound/soc/codecs/jz4725b.c +++ b/sound/soc/codecs/jz4725b.c @@ -136,6 +136,18 @@ enum { #define REG_CGR3_GO1L_OFFSET 0 #define REG_CGR3_GO1L_MASK (0x1f << REG_CGR3_GO1L_OFFSET) +#define REG_CGR4_GO2R_OFFSET 0 +#define REG_CGR4_GO2R_MASK (0x1f << REG_CGR4_GO2R_OFFSET) + +#define REG_CGR5_GO2L_OFFSET 0 +#define REG_CGR5_GO2L_MASK (0x1f << REG_CGR5_GO2L_OFFSET) + +#define REG_CGR6_GO3R_OFFSET 0 +#define REG_CGR6_GO3R_MASK (0x1f << REG_CGR6_GO3R_OFFSET) + +#define REG_CGR7_GO3L_OFFSET 0 +#define REG_CGR7_GO3L_MASK (0x1f << REG_CGR7_GO3L_OFFSET) + #define REG_CGR8_GOR_OFFSET 0 #define REG_CGR8_GOR_MASK (0x1f << REG_CGR8_GOR_OFFSET) @@ -153,6 +165,11 @@ struct jz_icdc { static const SNDRV_CTL_TLVD_DECLARE_DB_SCALE(jz4725b_adc_tlv, 0, 150, 0); static const SNDRV_CTL_TLVD_DECLARE_DB_SCALE(jz4725b_dac_tlv, -2250, 150, 0); +static const SNDRV_CTL_TLVD_DECLARE_DB_RANGE(jz4725b_mix_tlv, + 0, 11, TLV_DB_SCALE_ITEM(-2250, 0, 0), + 12, 31, TLV_DB_SCALE_ITEM(-2250, 150, 0), +); + static const SNDRV_CTL_TLVD_DECLARE_DB_RANGE(jz4725b_out_tlv, 0, 11, TLV_DB_SCALE_ITEM(-3350, 200, 0), 12, 23, TLV_DB_SCALE_ITEM(-1050, 100, 0), @@ -170,6 +187,21 @@ static const struct snd_kcontrol_new jz4725b_codec_controls[] = { REG_CGR10_GIL_OFFSET, REG_CGR10_GIR_OFFSET, 0xf, 0, jz4725b_adc_tlv), + SOC_DOUBLE_R_TLV("Mixer Line In Bypass Playback Volume", + JZ4725B_CODEC_REG_CGR3, + JZ4725B_CODEC_REG_CGR2, + REG_CGR2_GO1R_OFFSET, + 0x1f, 1, jz4725b_mix_tlv), + SOC_DOUBLE_R_TLV("Mixer Mic 1 Bypass Playback Volume", + JZ4725B_CODEC_REG_CGR5, + JZ4725B_CODEC_REG_CGR4, + REG_CGR4_GO2R_OFFSET, + 0x1f, 1, jz4725b_mix_tlv), + SOC_DOUBLE_R_TLV("Mixer Mic 2 Bypass Playback Volume", + JZ4725B_CODEC_REG_CGR7, + JZ4725B_CODEC_REG_CGR6, + REG_CGR6_GO3R_OFFSET, + 0x1f, 1, jz4725b_mix_tlv), SOC_DOUBLE_R_TLV("Master Playback Volume", JZ4725B_CODEC_REG_CGR9, @@ -203,8 +235,12 @@ static const struct snd_kcontrol_new jz4725b_codec_adc_src_ctrl = SOC_DAPM_ENUM("ADC Source Capture Route", jz4725b_codec_adc_src_enum); static const struct snd_kcontrol_new jz4725b_codec_mixer_controls[] = { - SOC_DAPM_SINGLE("Line In Bypass", JZ4725B_CODEC_REG_CR1, + SOC_DAPM_SINGLE("Line In Bypass Playback Switch", JZ4725B_CODEC_REG_CR1, REG_CR1_BYPASS_OFFSET, 1, 0), + SOC_DAPM_SINGLE("Mic 1 Bypass Playback Switch", JZ4725B_CODEC_REG_CR3, + REG_CR3_SIDETONE1_OFFSET, 1, 0), + SOC_DAPM_SINGLE("Mic 2 Bypass Playback Switch", JZ4725B_CODEC_REG_CR3, + REG_CR3_SIDETONE2_OFFSET, 1, 0), }; static int jz4725b_out_stage_enable(struct snd_soc_dapm_widget *w, @@ -299,7 +335,9 @@ static const struct snd_soc_dapm_route jz4725b_codec_dapm_routes[] = { {"Line In", NULL, "LLINEIN"}, {"Line In", NULL, "RLINEIN"}, - {"Mixer", "Line In Bypass", "Line In"}, + {"Mixer", "Mic 1 Bypass Playback Switch", "Mic 1"}, + {"Mixer", "Mic 2 Bypass Playback Switch", "Mic 2"}, + {"Mixer", "Line In Bypass Playback Switch", "Line In"}, {"DAC to Mixer", NULL, "DAC"}, {"Mixer", NULL, "DAC to Mixer"}, From patchwork Sun Oct 16 13:26:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Siarhei Volkau X-Patchwork-Id: 3017 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp1017462wrs; Sun, 16 Oct 2022 06:32:37 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6sfVCHELxtgJ0nwPbjRwUrObv2SaU9FwoC/xTGHJYdf8tqwDfV8U7taiE/yAPlcn66XV5P X-Received: by 2002:a17:907:62a1:b0:781:b320:90c0 with SMTP id nd33-20020a17090762a100b00781b32090c0mr4915328ejc.255.1665927157622; Sun, 16 Oct 2022 06:32:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665927157; cv=none; d=google.com; s=arc-20160816; b=mfEOSx5702/wHxQig1SpIc12hlSuCYcxhgpI9SttUGqeMRWsiXgyJahs2TNDtDvPm4 ER4JL35ILTkh+funx1iK6BPos25/vmkcs/cQC/nE3RH18uKq3px2qLyX26k1IvmWSd1a qW4yuSLtQs8pmRp2520N05P6q2vXtlUf0lM2RPjAaZrs4Hp6wqAF4stqIBEwEr9nB+Fr e7SqD0pHWOX6Ac83mSBwq/GnrnIMYd8L7EdPqemHG57UdJQkHrL3lYKDes8GI58LWvkD 6F5gnuyak4zMxIyB+FcPpL9sWamGZjG2Vx0ifMEoVqAHyZDBhTWtzRJiOtmZNumnuGUf kXGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:from :dkim-signature; bh=R19Q50f+4lJZEQStb2xYnMd/U/8/rdyoHM9BaeMxvps=; b=SGo6oeqpuUXhHG45zRhHxQ6maYxJnESyOBK/NpICDlUMisN1nfU42yw42rxYIiR8Qf dSnwzaZ7hS5F2hEqRLptuLxEE1y69/EG04SqMeSTOfxkin3NbXlnamhp/NgQP6pocrbI iohUnMZysMZTuIOeOAj8FXpEqMGX5NiPyO28NtGX7wKXFtdwOyj/ge5CoC6Pd1JMFSSc PVLKPDM5gPgzNgZvL+xtfvDsTU7EDRGJwO0FpLuE5llKJaQM14IorwLIkejYbMKI6Ega 0z9fLyZYH2I6Sil9WZWFUjgURV1/Lhub/zoymWfazWkQsEmlg/RkqGhjAN6mbLHLSnrd zUSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20210112 header.b=gbkTAWWF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id wu13-20020a170906eecd00b0078db6f56d51si7495371ejb.808.2022.10.16.06.32.12; Sun, 16 Oct 2022 06:32:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20210112 header.b=gbkTAWWF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229790AbiJPN23 (ORCPT + 99 others); Sun, 16 Oct 2022 09:28:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56304 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229745AbiJPN2M (ORCPT ); Sun, 16 Oct 2022 09:28:12 -0400 Received: from mail-ed1-x52e.google.com (mail-ed1-x52e.google.com [IPv6:2a00:1450:4864:20::52e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C70083D593; Sun, 16 Oct 2022 06:27:58 -0700 (PDT) Received: by mail-ed1-x52e.google.com with SMTP id l22so12652277edj.5; Sun, 16 Oct 2022 06:27:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=R19Q50f+4lJZEQStb2xYnMd/U/8/rdyoHM9BaeMxvps=; b=gbkTAWWF6YY0ZHs9zxW1q9aUl6tCSvP9p4r8o3h1d5cTHJFV3BITvz6EgkHXD12VPF r45o4jjfXEVXaDE/HgXGhGzJtcVV2tdAG/hD8z35OgMVtzXvqc0uJhza7xWHJyBjphM5 KN/0vaIoXgSILYv9JTWA/uVS6KYRY7P5dD5U9VIfjQ0RjJWD4XYLgl2+UftSL18DV1WT EHX+vVJpBDNvGUneUs+D1qh5G3Yam3mNSxnkhS8egoHtqPFC+yuNa9afL/DT2fBD/U4R vZlRwQPnZoOKFbfVmWMDHxNYmyY8P9UmCCc85qLYSYUpayfKCee0JP+vG0mhZYggG3AY uSiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=R19Q50f+4lJZEQStb2xYnMd/U/8/rdyoHM9BaeMxvps=; b=qx6LRE2ruSALtGJU+MH9CW0tIdp9+lRO7k1Vmg+pijtUbpFT7+Yb79LEvNHctXJa2d h5+VBZRK8zbjZY08P7XCBZCUOrCICWjUE+3fMc61aEsnLApz2qifhl8lVya8gPPRvinI zrGu13oRKVjuBTRbqg/nA27NgafKsTu2vJriLEH7p0WaWM7bL7NhD/pMJtj+3npLJA07 GOEDKMU7iqVPVJTHAymTsJWCUrv9RyqMfP+bdRhnuvIHUIOr2jmREsAY+vQyKKx0lmaz UdTGiNrCJc80oM0v30C+OjnJWTRwnuSiGl3e9Bt5m+OtP5KlyJYjrFV7G4V4ZWDaJFMA 33ig== X-Gm-Message-State: ACrzQf3903FDiEBkBYKFoQS56kJJn5Amopti1MtYuw+7ejDHpQ/o4F7Y El2elJowjBBEfGu9SdEtf8g= X-Received: by 2002:a05:6402:5190:b0:45c:fca7:e07b with SMTP id q16-20020a056402519000b0045cfca7e07bmr6145825edd.327.1665926876937; Sun, 16 Oct 2022 06:27:56 -0700 (PDT) Received: from hp-power-15.localdomain (mm-39-7-212-37.vitebsk.dynamic.pppoe.byfly.by. [37.212.7.39]) by smtp.gmail.com with ESMTPSA id y5-20020aa7ce85000000b0045c72bba0bfsm5572057edv.4.2022.10.16.06.27.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 16 Oct 2022 06:27:56 -0700 (PDT) From: Siarhei Volkau Cc: Siarhei Volkau , Paul Cercueil , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , linux-mips@vger.kernel.org, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 7/7] ASoC: codecs: jz4725b: add missed microphone widgets Date: Sun, 16 Oct 2022 16:26:48 +0300 Message-Id: <20221016132648.3011729-8-lis8215@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20221016132648.3011729-1-lis8215@gmail.com> References: <20221016132648.3011729-1-lis8215@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1746851235265813498?= X-GMAIL-MSGID: =?utf-8?q?1746851235265813498?= Microphone input can be single ended or differential, although known SoCs with that codec expose MIC1P only. Also there is 20dB mic boost in the Mic1 path. Signed-off-by: Siarhei Volkau --- sound/soc/codecs/jz4725b.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/sound/soc/codecs/jz4725b.c b/sound/soc/codecs/jz4725b.c index 52b2bb95b..685ba1d3a 100644 --- a/sound/soc/codecs/jz4725b.c +++ b/sound/soc/codecs/jz4725b.c @@ -175,6 +175,15 @@ static const SNDRV_CTL_TLVD_DECLARE_DB_RANGE(jz4725b_out_tlv, 12, 23, TLV_DB_SCALE_ITEM(-1050, 100, 0), 24, 31, TLV_DB_SCALE_ITEM( 100, 50, 0), ); +static const SNDRV_CTL_TLVD_DECLARE_DB_SCALE(jz4725b_mic_boost_tlv, 0, 2000, 0); + +static const char * const jz4725b_mic_mode_texts[] = { + "Single Ended", "Differential", +}; + +static const struct soc_enum jz4725b_mic_mode_enum = + SOC_ENUM_SINGLE(JZ4725B_CODEC_REG_CR3, REG_CR3_MICDIFF_OFFSET, + 2, jz4725b_mic_mode_texts); static const struct snd_kcontrol_new jz4725b_codec_controls[] = { SOC_DOUBLE_TLV("DAC Playback Volume", @@ -219,6 +228,13 @@ static const struct snd_kcontrol_new jz4725b_codec_controls[] = { SOC_SINGLE("High-Pass Filter Capture Switch", JZ4725B_CODEC_REG_CR2, REG_CR2_ADC_HPF_OFFSET, 1, 0), + + SOC_ENUM("Mic Mode Capture Switch", jz4725b_mic_mode_enum), + + SOC_SINGLE_TLV("Mic1 Boost Capture Volume", + JZ4725B_CODEC_REG_PMR2, + REG_PMR2_GIM_OFFSET, + 1, 0, jz4725b_mic_boost_tlv), }; static const char * const jz4725b_codec_adc_src_texts[] = {