From patchwork Mon Oct 10 18:54:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Siarhei Volkau X-Patchwork-Id: 614790 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 60B6AC433FE for ; Tue, 11 Oct 2022 06:05:42 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id A5B6C3690; Tue, 11 Oct 2022 08:04:50 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz A5B6C3690 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1665468340; bh=AS/Fc++BernZRPv2MU5PFD+QfxQDwYCVSkRIovU5cSs=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=pid+WYpK9UEwLzTX+gFkzUTE/0ZUmoOe+W8e/KhOU5jUQ7Ko9qxMj2vjTZt6ZpS+T t2cYzbEcpIuN6gT8vxxRvfCYJizdK9P0j1RAbWGH9T9JrU40RtGpMqRw/45HxEvD6a RzzhTs8U6cdwi1Sz46EmzB4tfgECYWIYE0q3jx/8= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 44088F8057A; Tue, 11 Oct 2022 08:02:27 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 84CC7F801D5; Mon, 10 Oct 2022 20:54:56 +0200 (CEST) Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 0BE7CF80107 for ; Mon, 10 Oct 2022 20:54:52 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 0BE7CF80107 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="DjPiYRx1" Received: by mail-wm1-x32b.google.com with SMTP id 84-20020a1c0257000000b003c6c154d528so203158wmc.4 for ; Mon, 10 Oct 2022 11:54:52 -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=DjPiYRx1jqF9zOBa71/gdoTtdLEdU7glIyyTjeakCGpkWNkuc4wy94WyWUGh/q8FoD ui9Hg6+XbKtxxDIsh5NBQBup/GzI1kW+UXe+ADWJamL4odQbQa6Igp5uZv5QclzqQpt1 oxCywDlpFuU49l9HcYomPOIqn/HFNPPMNYJpnwdUcnjlMrl4iA9RIo58NVpuYsSFiMtv dR9Fl1Rl+6JqWmVamRWyJ+TeSaRygYLeEOTDGK25z+4SdO8SzNWi1MwNfthDCNGNiGFK 29lh63UZeEMCoiJ8czejuo6sfz5H7DczHdudVhpNGuw+8LC9c+vfJvPQZe+D7Gcr/cKQ l+tQ== 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=BSeMnenjP7r20vXMncZ3S60Ntt+1NKIHCT+a8yzU70GZPpcp5cpfIwoYjT381IZyXV rIr9b4lYOj5M1/43Xev6fWfVmF3mpuGk0A45ozOOPsMLxR9qkDeaa/QWmLQs672HiRmd XQgQxbR0eRz2dJDhty96Wi9nkv+8B3CVWpAAODoF017fkWQpe6Ax+p/+KUrvi0wTZkhY KS9T3PCp0KV8z/aNDbDXU37cUnXAdj7mm88gU3yOZUx930goH4gxZhzJgC93bpYXomol 7YFr0O7hf3wdF1h5VTs7pBayybMAjbzp+yWUrSl6Re9QJmes9hRd1XvObY43XN4Q/aLN 8mjA== X-Gm-Message-State: ACrzQf0xeTJYIop4g98xs9DYXSYbb3eCnYtXPjnCdSBUCs9Ok//vOjEY Odk321uLwZrSviHtd+yFTLzuq/ABzszuQA== X-Google-Smtp-Source: AMsMyM7l142bKzQq12LOkJeEgnf2eLCqUiQks1Hj80BdQCSYahgVajaEYVsJK2OXu8L+YWEetQQpsQ== X-Received: by 2002:a05:600c:1c22:b0:3b4:b2bc:15e4 with SMTP id j34-20020a05600c1c2200b003b4b2bc15e4mr14092275wms.69.1665428090962; Mon, 10 Oct 2022 11:54:50 -0700 (PDT) Received: from hp-power-15.localdomain (mm-126-34-212-37.vitebsk.dynamic.pppoe.byfly.by. [37.212.34.126]) by smtp.gmail.com with ESMTPSA id y2-20020a5d6142000000b00230c9d427f9sm2082272wrt.53.2022.10.10.11.54.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Oct 2022 11:54:50 -0700 (PDT) From: Siarhei Volkau To: Subject: [PATCH v2 1/6] ASoC: codecs: jz4725b: add missed Line In power control bit Date: Mon, 10 Oct 2022 21:54:18 +0300 Message-Id: <20221010185423.3167208-2-lis8215@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20221010185423.3167208-1-lis8215@gmail.com> References: <20221010185423.3167208-1-lis8215@gmail.com> MIME-Version: 1.0 X-Mailman-Approved-At: Tue, 11 Oct 2022 08:02:21 +0200 Cc: alsa-devel@alsa-project.org, linux-mips@vger.kernel.org, Takashi Iwai , Liam Girdwood , Paul Cercueil , Siarhei Volkau , Mark Brown , linux-kernel@vger.kernel.org X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" 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 Mon Oct 10 18:54:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Siarhei Volkau X-Patchwork-Id: 614226 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 5728AC433F5 for ; Tue, 11 Oct 2022 06:05:53 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 84A8636C2; Tue, 11 Oct 2022 08:05:01 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 84A8636C2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1665468351; bh=xMWR5+J01xpRRN/VYdoVF9ZJ1/tLH1hznGXJwjP4VQI=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=d9lhIzkRgjJU5RUAH6ZMUiHwuw92Y7Y7jA2LDlZ3PQsBwH+kJjUQMXPFnGZQ9F0a1 OPYzgiy/Mujn8XlDIJ89FfM9t9yx1d0bZiY/fAdsdpTvvFvkaMUoTpTUxnacbH0Bmk pPGqdl+7X5QL8SzAdxbWARnDL5PwUzX8TRcLKxQs= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id E65D1F8057E; Tue, 11 Oct 2022 08:02:27 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id D1608F8032B; Mon, 10 Oct 2022 20:54:56 +0200 (CEST) Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [IPv6:2a00:1450:4864:20::32f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 69C36F80256 for ; Mon, 10 Oct 2022 20:54:54 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 69C36F80256 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="M2lcS4W4" Received: by mail-wm1-x32f.google.com with SMTP id n16-20020a05600c4f9000b003c17bf8ddecso4556wmq.0 for ; Mon, 10 Oct 2022 11:54:54 -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=M2lcS4W4Ayc82LkYpVaSwvYZAZi4M6rTJJir8n6eoqpzupOocFLYVDUD1+L0ZNjzoL 3RaYcedtmQWxAw3etNibpFWoaJAfni9QKplGvxrNSU54eNMWhNH5/Hk00IMZrH11PiVx Ma+cwMrvKB17NMjncuJAS41vALYCHn1tNFZv/OiRZEQZOOscv+emg2zdVSaoX7aP8fh7 rCifucpvsvhVDmj2NiTDS3almzXQjtL1+/0KwMK3HNggsor/nI91u9ox13yXi0BDNkyM fXKmKprd1vU2mGDt6aT0mC+G5743ZVnChUpcnWN8I4iKt+ObhOQKO3p7rr6lA0qF1euF mqdQ== 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=fz17NZqgNw6kfMq8DhXD1tdLty/TB0inQEhfk1v5Nh/wx0KQ/Sno4yO00fjGouFpgY nWpMrS1EfM3DH0RQt8bTLQGkvI9R61eGURQcsClgmYHAjj7OcbktuV/iewCUKTKo0OyI +Hnbz3ZQH1U178laoj+4tPuXU1sdAZ4DS7DPMk0Qi7fH+K2W7u6fqMgZcuSXPY8e0oHR Sp8YbODKnhB9y2/axHLM1jZ8cmBgH91SwhWMs9cSh0zBBVFuw8gGesAnHBIg0Wp3ONEZ eu+hq8m4PpvIPdAPCkTuMjhctN+txCdsDGidIC0ijyqY/v94WPMaIfCv6VnRgWm2Clrt Oj7A== X-Gm-Message-State: ACrzQf1ZRoMQlejarCnde6yZDyYzh623qFzo+h+JiAno5YuIr/m32FN1 d7cElDmPoxk9Wz54h1oNziw= X-Google-Smtp-Source: AMsMyM4Eg+rIBg02ermXJ7veLFiSgPsQEYs79TtnhGmlvLP0QxQURlSFQ0aB1Mc26GrwiCcF8pcuIA== X-Received: by 2002:a05:600c:a18b:b0:3c5:22c0:d0bd with SMTP id id11-20020a05600ca18b00b003c522c0d0bdmr8226941wmb.74.1665428092537; Mon, 10 Oct 2022 11:54:52 -0700 (PDT) Received: from hp-power-15.localdomain (mm-126-34-212-37.vitebsk.dynamic.pppoe.byfly.by. [37.212.34.126]) by smtp.gmail.com with ESMTPSA id y2-20020a5d6142000000b00230c9d427f9sm2082272wrt.53.2022.10.10.11.54.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Oct 2022 11:54:52 -0700 (PDT) From: Siarhei Volkau To: Subject: [PATCH v2 2/6] ASoC: codecs: jz4725b: fix reported volume for Master ctl Date: Mon, 10 Oct 2022 21:54:19 +0300 Message-Id: <20221010185423.3167208-3-lis8215@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20221010185423.3167208-1-lis8215@gmail.com> References: <20221010185423.3167208-1-lis8215@gmail.com> MIME-Version: 1.0 X-Mailman-Approved-At: Tue, 11 Oct 2022 08:02:21 +0200 Cc: alsa-devel@alsa-project.org, linux-mips@vger.kernel.org, Takashi Iwai , Liam Girdwood , Paul Cercueil , Siarhei Volkau , Mark Brown , linux-kernel@vger.kernel.org X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" 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 Mon Oct 10 18:54:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Siarhei Volkau X-Patchwork-Id: 614789 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 6647AC433F5 for ; Tue, 11 Oct 2022 06:06:11 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 94101365E; Tue, 11 Oct 2022 08:05:19 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 94101365E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1665468369; bh=Emg3BuV38LiQAQFzFNf88vHHf1Z8YGOQ2YMEASX1DCg=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=l3ciWJLt33t9RcFPdqhBMPKmQrOjecHyZciKtHkCwe3KXfjEYQWBBBkbbEAal2FvL zdPolRAc61QaOX2gBD0USb2Dl3EDKHRfJ0GUKBYmgnA5cjoJZ+zC1AaMoOiPQPCG4c 16jerkmSng3sIqIeTbPEcMdOkmWZQpMfV5PYesZY= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 708B4F80588; Tue, 11 Oct 2022 08:02:28 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 21ED2F8032B; Mon, 10 Oct 2022 20:54:58 +0200 (CEST) Received: from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com [IPv6:2a00:1450:4864:20::32e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 91F76F800B8 for ; Mon, 10 Oct 2022 20:54:55 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 91F76F800B8 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="C7MpUAIQ" Received: by mail-wm1-x32e.google.com with SMTP id l16-20020a05600c4f1000b003c6c0d2a445so870376wmq.4 for ; Mon, 10 Oct 2022 11:54:55 -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=C7MpUAIQctHk+ifGp0VzsVKX9t/MFfnULTgkEAuStRRakWYK8Mw1BVeuL7cqSfmaB6 QhyOsa3zziXnR6IClSM2oJkLcKpZxa9236I/u3+ZKUj1ydS8QmJEYFrfBsEClD7pazBq 73JjufZlIqQ1gY17ITztN/8b23ZWoIzJ24qUyi0FHef7vb/1GPh2PFObQfDuu2XXu0UF bJSDs+YIbONzJ29E/mboAu2amkTRdH17o+6bcKyx47oNpKoZ0YfhHwG4HEr/VCz08EeZ TMLrrJzHhGb+XROQl1NLDHGNnlRKjcJ0UCNBTvKZhLzSYShpoZo2NLxZwVaLEBQxk9xG mmAQ== 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=hyLklj9AMRH2jOnfdHGuoF3YCn60Xkcotwfghj3U5OQKpLvtlsaEvoeiU1z3O6qfRC 1vMpdVN0hUbHYjpDLmFlB8TvXEm4rIXHggzUlDTxeN8C5JxrV2Z6hI9aQML7XF1R4oYk nCMdtYJTBqb+k1/o23642A9Iy/T1FK6rRtiCh+WvCj6yz1e4I8aaLEbTbPYNl7PVrDnj gabXCecfa5fdExWGdZGmturS3isbtUMhHwJcBpXF6bMjh35IWdjvbV+1TaqzLMNmZGLz LmOGCfElFZ0Vb5pTOso8sULC7WKnrUJSMQdu9uEQfdXCX5e4bem2F6745pWMBw7q+aBL dVvA== X-Gm-Message-State: ACrzQf1hDVXvLHwYOkAbZEKFqPuuntfuYLN7YHOpKPJW8tqM58B23y7Q gzBn4JiyEps1ylH0dbmOUrQ= X-Google-Smtp-Source: AMsMyM5B6Kt13iU+echB0LPxg4MSMh3BueR2p/vnvZZ3+hx+pr/e4iXGHwklRKON1cMMW5NVrprGfg== X-Received: by 2002:a05:600c:474c:b0:3bd:e9d7:f793 with SMTP id w12-20020a05600c474c00b003bde9d7f793mr13790967wmo.30.1665428094129; Mon, 10 Oct 2022 11:54:54 -0700 (PDT) Received: from hp-power-15.localdomain (mm-126-34-212-37.vitebsk.dynamic.pppoe.byfly.by. [37.212.34.126]) by smtp.gmail.com with ESMTPSA id y2-20020a5d6142000000b00230c9d427f9sm2082272wrt.53.2022.10.10.11.54.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Oct 2022 11:54:53 -0700 (PDT) From: Siarhei Volkau To: Subject: [PATCH v2 3/6] ASoC: codecs: jz4725b: use right control for Capture Volume Date: Mon, 10 Oct 2022 21:54:20 +0300 Message-Id: <20221010185423.3167208-4-lis8215@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20221010185423.3167208-1-lis8215@gmail.com> References: <20221010185423.3167208-1-lis8215@gmail.com> MIME-Version: 1.0 X-Mailman-Approved-At: Tue, 11 Oct 2022 08:02:21 +0200 Cc: alsa-devel@alsa-project.org, linux-mips@vger.kernel.org, Takashi Iwai , Liam Girdwood , Paul Cercueil , Siarhei Volkau , Mark Brown , linux-kernel@vger.kernel.org X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" 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 Mon Oct 10 18:54:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Siarhei Volkau X-Patchwork-Id: 614225 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 B80BBC433FE for ; Tue, 11 Oct 2022 06:06:24 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 2FE56361F; Tue, 11 Oct 2022 08:05:32 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 2FE56361F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1665468382; bh=LbbkAGbzGwbg60h2drK5ZywC2KEjQ5OtWmAC2bjMnws=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=LZHJDjFreywKcnugwMG2ctLhqtZ4ruz+sZrvr2d2wT3qE76XijOXm7tknnhGNbRrz X32yS851hNpXiTOJOg+bzMsxkXgiuSxpKHmjrcOV9GHN70PjeoZLqSTuHWTV+z7P4I s2JtATS6Qaxx1Tb8Ibz6iToTqmDy/GQaWcQ/5Hfw= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 1732BF80589; Tue, 11 Oct 2022 08:02:29 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id E096AF804D8; Mon, 10 Oct 2022 20:55:00 +0200 (CEST) Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 57EB4F80256 for ; Mon, 10 Oct 2022 20:54:58 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 57EB4F80256 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="onG0G8qP" Received: by mail-wr1-x429.google.com with SMTP id a10so18274454wrm.12 for ; Mon, 10 Oct 2022 11:54: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=5KOQIYlbblLHHRIPNNVIX9zOac26R/P9cPlWZ+KbLOU=; b=onG0G8qPaIbhvuYeakoEpmZHsfPvkKuL9BZEMMFTdcP43O1NME8Fsb3POluz3fZAhy Lwbs300R2iesaLWumkxsJL5uE8kBY4xjuHhl0V3S2yq7Nr1b2moiF+asMXIv+hS04InD F3a9I8ivWJfHcsXqo3J6HupLIFSYlylCcyMRFSKBDtOwSIPJLwNPOMYPz6ugQawWaQWh uVZmOXHlLlh6itxn33mXSbIRkKosG9Ntei/KKh3JsTi2u4vV1wF3BdkwWGCL8jfiLn1u NRGJ2HPMKGAKLaQwOt9T015Ea71JKf5GGsoHF5K3sAetsg8Z44agAM/OFdD1qeXrSrqF AAlw== 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=5KOQIYlbblLHHRIPNNVIX9zOac26R/P9cPlWZ+KbLOU=; b=lmDBePUWSYmKiI1yUVibaxfraoULKQW15ppo0e0srPxrcY7i2MT40GQbRgHpPy7Vjf Xqi5nLxz9PVLcFIvTl5McBDxInpfgaGA9vfG0jqJH/GOjUiLYC4r2lZAmo9a2lwpTy/e tf8sB9FLobCjhTkHAUea8BeXLWSCJGCON9WpB3oqzq8pHXJ7YP8Dq7N+3PCRAJP6F22P SA8ryLRsiGGow6IinK48zwpOOxFbAlTMEdK+qS+RR8I7F5RX4QsWzYe6XpuxSz+r7zXa sRRgt0aka0V8gSh8/V2v0GNk4cUUgT8/TuGmaFqk/7tCPqWT2E0Xst5zoFP/y01Pa8V0 SFTQ== X-Gm-Message-State: ACrzQf1GO/x/TxzWWe3pVFqv2BHqtjUv9PKCIjQFLxXsEX6uKDtto4g+ pSaXRAIte+OI+0Yc7kXXdbE= X-Google-Smtp-Source: AMsMyM5//7B1JOa0HJE0sfOI/B5b30P3bn4Cwu1SQ317PoD6E8TMN+PaK3ZV1wOCrhSvOLjVjRmz+Q== X-Received: by 2002:adf:f883:0:b0:22e:5610:79fe with SMTP id u3-20020adff883000000b0022e561079femr12637080wrp.351.1665428096495; Mon, 10 Oct 2022 11:54:56 -0700 (PDT) Received: from hp-power-15.localdomain (mm-126-34-212-37.vitebsk.dynamic.pppoe.byfly.by. [37.212.34.126]) by smtp.gmail.com with ESMTPSA id y2-20020a5d6142000000b00230c9d427f9sm2082272wrt.53.2022.10.10.11.54.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Oct 2022 11:54:55 -0700 (PDT) From: Siarhei Volkau To: Subject: [PATCH v2 4/6] ASoC: codecs: jz4725b: fix capture selector naming Date: Mon, 10 Oct 2022 21:54:21 +0300 Message-Id: <20221010185423.3167208-5-lis8215@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20221010185423.3167208-1-lis8215@gmail.com> References: <20221010185423.3167208-1-lis8215@gmail.com> MIME-Version: 1.0 X-Mailman-Approved-At: Tue, 11 Oct 2022 08:02:21 +0200 Cc: alsa-devel@alsa-project.org, linux-mips@vger.kernel.org, Takashi Iwai , Liam Girdwood , Paul Cercueil , Siarhei Volkau , Mark Brown , linux-kernel@vger.kernel.org X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/codecs/jz4725b.c b/sound/soc/codecs/jz4725b.c index 4363d898a..3f9bbd79d 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, From patchwork Mon Oct 10 18:54:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Siarhei Volkau X-Patchwork-Id: 614788 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 7D8E3C433F5 for ; Tue, 11 Oct 2022 06:06:41 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id E29103688; Tue, 11 Oct 2022 08:05:48 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz E29103688 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1665468399; bh=NlhJ6okbqsCGo8TIxByw29mDvnFR5SIrRBUphDo94OI=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=gpGylflEXy496wcjUl3D4gQqvL7gGFz7DPj+TqzDurkrI2OeDw2IXa/mEMiRU0kKj rhFblI1BrUXFodFUkn4pGlTJ9NeyuyQYUPzpTA9NrxJtTgHIgDBNT1x1d/ywMVk/0r juaATA0WMvn+3gQ2MK1wBrGqWJB3pgzqzgnNfEwE= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id BC776F805AA; Tue, 11 Oct 2022 08:02:29 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 20646F8032B; Mon, 10 Oct 2022 20:55:03 +0200 (CEST) Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com [IPv6:2a00:1450:4864:20::42e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 3AA17F800B8 for ; Mon, 10 Oct 2022 20:54:59 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 3AA17F800B8 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="SXLeDxlZ" Received: by mail-wr1-x42e.google.com with SMTP id j16so18312554wrh.5 for ; Mon, 10 Oct 2022 11:54:59 -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=lgjnL3yJFZCJQlhIdQSv+6Wq7/0/ChyARgbD78LiZt8=; b=SXLeDxlZKzSU20+a1UbGy9WlYL5HM66nyKdRI3rS8adCzdjWbQjdfSM6pFIjOKxC3K Hw3SOxN6gkB4nN8G3h64shQfIxCmFuICQPh23XefWS0K81lMRqK4TAHi47C9XXM17/lo nSvEuS8q8yx+Hx6SGD34zXeoy/rRI/NsEA2u1TvUDvV8DbhV8RaMIUlaCa6UJUoA3lVw 5ukssilKa8N5j3Jt+rFFtDlap8le9+q/wjJsS8aKw9gyHLLTgTDBRKz8ecS3FOfj5kPK 4TO358e85so4OdepYeEqlmgKrEk245q1BpAfRzqLcQVvSbAva59OA/mu1Zg3WQEblfnq JZDw== 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=lgjnL3yJFZCJQlhIdQSv+6Wq7/0/ChyARgbD78LiZt8=; b=n9Bcyi5QsMFi+FvVfE774ztvpGCSltxntPBc4FHbMzG9KpPc8h1vQ9rbDbRCirXllP 6QlACTnR9nZrCBBGuvIoezUyf6IgC5GKV8IGaA7tayW2svJRbKvBdZd7o6ydhoVV2ouf Nc4LNvMzrO48hyI0I7j/PyaIstOefuafC2RnHvPHiiFJ/u5kZPr9yvP+WhDqmK9pcVmO PGbzqhv0CJr0xaRjvbLe1yTOEg05UQ3zyEKAF3WuevS9I5qjMwU+dC/CUaZ+9l7CFPu+ FWwibBNzrVe/8Lz347Rs05V//K0hwGs8yjvnI5Kex1vU45CX/ruRcrM7wiyYN06hhdQg qshw== X-Gm-Message-State: ACrzQf3XYBIw+WujA5jBXIzp1DzAugYa7d45L6tNsPoPwJrU1AROpITa LQOwXNXZh5PlW8VUpCqdMUU= X-Google-Smtp-Source: AMsMyM5WpCK09mLrSkdRSBj2tSAXxmmJ0WSK7QFNuuMenex8WRursQD9ixHa29Ngvj2NqkAWQBju3A== X-Received: by 2002:a5d:588f:0:b0:22a:fe0c:afb8 with SMTP id n15-20020a5d588f000000b0022afe0cafb8mr13243806wrf.431.1665428098355; Mon, 10 Oct 2022 11:54:58 -0700 (PDT) Received: from hp-power-15.localdomain (mm-126-34-212-37.vitebsk.dynamic.pppoe.byfly.by. [37.212.34.126]) by smtp.gmail.com with ESMTPSA id y2-20020a5d6142000000b00230c9d427f9sm2082272wrt.53.2022.10.10.11.54.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Oct 2022 11:54:57 -0700 (PDT) From: Siarhei Volkau To: Subject: [PATCH v2 5/6] ASoC: codecs: jz4725b: use right control for Master Playback Date: Mon, 10 Oct 2022 21:54:22 +0300 Message-Id: <20221010185423.3167208-6-lis8215@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20221010185423.3167208-1-lis8215@gmail.com> References: <20221010185423.3167208-1-lis8215@gmail.com> MIME-Version: 1.0 X-Mailman-Approved-At: Tue, 11 Oct 2022 08:02:21 +0200 Cc: alsa-devel@alsa-project.org, linux-mips@vger.kernel.org, Takashi Iwai , Liam Girdwood , Paul Cercueil , Siarhei Volkau , Mark Brown , linux-kernel@vger.kernel.org X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" 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 3f9bbd79d..6614c5e37 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 Mon Oct 10 18:54:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Siarhei Volkau X-Patchwork-Id: 614224 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 B1D8FC433FE for ; Tue, 11 Oct 2022 06:06:57 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id D9A2F36B6; Tue, 11 Oct 2022 08:06:05 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz D9A2F36B6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1665468415; bh=hvfQhmtYqXaeeZxq8vaiJnom1BgHW5coa18GsjyV0AI=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=IYynpT43LIEhReFxPx9m+XRaz1AB/F9fcuPWGNzVhXSAZnw6j0kPUz5/TK8XyN04e FLHLXl6oxb3AhEl5m1J6Mao+QLbjyVVLayOqp/GQSn1vp0jmTv0aSt0uw0pu/S/7rY BUgZwtFoHAR+XvBXvktW4JkuAYv2oOw8uByCJ90E= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 5B949F805AC; Tue, 11 Oct 2022 08:02:30 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 5563CF80256; Mon, 10 Oct 2022 20:55:04 +0200 (CEST) Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 9C35DF804AE for ; Mon, 10 Oct 2022 20:55:01 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 9C35DF804AE Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="g6GYJi+i" Received: by mail-wr1-x435.google.com with SMTP id j7so18329544wrr.3 for ; Mon, 10 Oct 2022 11:55:01 -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=a0HKAhNdOKF1crgdkmfV9uw0DtKONIzdjDGfK2eaD40=; b=g6GYJi+i1RYgpcsc2FaPpiuxZz2OwbN4bkiNrA3qiCo061dhszzksEbCyV8xT2iRXg V0JoehCp9TO8iUWzX/yS1peMDKGQ++SyIFfYyZj7rvwD8afHP/2DSSwo9b1VIg8KxQqu MXzKq14gqz+zmaOouTfag3SRrcKDZiND9OfgnTRammxj6vrm6bg+pxT4UY+ZaCTV1J7a Bx1bgPe1cXG3dgK+hPOj9caNLrvWT3V3JnIGv9BmTBngK+zQLAYisVE7Fr2gskPH0sOh xvRwOoPkrYNl4oWcWjSQf85y+WGi1mLAaU76Tv/2oXNfX+QNP8wOtzooRkvKlkAa1hyJ 0DHg== 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=a0HKAhNdOKF1crgdkmfV9uw0DtKONIzdjDGfK2eaD40=; b=mdbZcKz8CQD+qTco0fRWD2dtcY/hHQruxc+VyROl231qljSEmbfMakn1tp5uxrtBrV Q7M8AX3zPg6/g4n1GCBFkVhKhBdR9gKSXelxt6+ZKRF0nxao02apKGQwnmmRpyp6Zt0j 8FwJ5xtmPzr3A3sKnzFWYr6QcoI/WgHfYuXrg1ZW2TfUm7c8lI5xUnZgL1pvfdNtidxF 4KFWxLG2iZ7Y9zL9ev7In4URrSQ7hEt2EykNqRnb+1rlboqm4J/MIfJoFwrkoSr90Jdf LRagq8AvxhWHWqg1XsMVcwzcgNLGvEBNP5L4X4wtqHXC/XsLHTI87omy3ebd/Lhw/xvi MIlg== X-Gm-Message-State: ACrzQf2KzevqsjiVQo0nPh9xPXmDb3/l8ulheKtKhFGyPmxmBW2ehJCF aORYYTMeQfMmUT3NaJSSwiA= X-Google-Smtp-Source: AMsMyM7M6A5MM0GdcXezHZYlOJYNlypNddtCR4gt9oyL9mZKAIqhFKcbNCwVzt0j7ZDFVe7Wky4s3g== X-Received: by 2002:a5d:64af:0:b0:230:1aca:634 with SMTP id m15-20020a5d64af000000b002301aca0634mr5920199wrp.74.1665428099994; Mon, 10 Oct 2022 11:54:59 -0700 (PDT) Received: from hp-power-15.localdomain (mm-126-34-212-37.vitebsk.dynamic.pppoe.byfly.by. [37.212.34.126]) by smtp.gmail.com with ESMTPSA id y2-20020a5d6142000000b00230c9d427f9sm2082272wrt.53.2022.10.10.11.54.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Oct 2022 11:54:59 -0700 (PDT) From: Siarhei Volkau To: Subject: [PATCH v2 6/6] ASoC: codecs: jz4725b: add missed Mixer inputs Date: Mon, 10 Oct 2022 21:54:23 +0300 Message-Id: <20221010185423.3167208-7-lis8215@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20221010185423.3167208-1-lis8215@gmail.com> References: <20221010185423.3167208-1-lis8215@gmail.com> MIME-Version: 1.0 X-Mailman-Approved-At: Tue, 11 Oct 2022 08:02:21 +0200 Cc: alsa-devel@alsa-project.org, linux-mips@vger.kernel.org, Takashi Iwai , Liam Girdwood , Paul Cercueil , Siarhei Volkau , Mark Brown , linux-kernel@vger.kernel.org X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" 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 6614c5e37..22763bb1e 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"},