Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp31942777rwd; Fri, 7 Jul 2023 06:40:29 -0700 (PDT) X-Google-Smtp-Source: APBJJlHXLjtFhnJ+eC4uId6yW5KMq6L7Y9tTexHhITwGdkFc9bk8fYBG50LrIgteUw+SYD42tZ/e X-Received: by 2002:a05:6a20:550:b0:127:aaf:59a6 with SMTP id 16-20020a056a20055000b001270aaf59a6mr3982396pzq.36.1688737229056; Fri, 07 Jul 2023 06:40:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688737229; cv=none; d=google.com; s=arc-20160816; b=sPWYTkwvNrAQLb2Z+1wTzKW+BETfiwFl4V5c+ZESheAlrQuXMiFjgG+l6/GYUhBE65 uyrx/N6PFOxE9LCV7fv5QoEgsEADrvlWETrakymPjGwvgJclJureFs1F8NhPv0/EqoS4 6Ci0PqTdoTnQOB2Z2cuv8u+Vxl8OE1dx4qQgJNoS3WlmvegLmTfs/eJUDcqo+saoDyKb oO9W7oD/lK9VOfWVbevsxlrLWtfqlMIULXUgrmavAxgUHUm+Q/YZ9+b5XlXNSK4Y532M I636zDbVE9Tqg4oKEcZhvdZaGxq5pjelpfk5AvmE7cXiaqhwUM229YxDAODrOdMOq2BF BEeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:in-reply-to :subject:cc:to:from:message-id:date:dkim-signature:dkim-signature; bh=QNyk8rEvT/WeKKmpb7nlokLV1tikUvvvzyU4QMCSflU=; fh=THt6nBvbx8MxqJwynuXjaLyrveX50ld4n54vLZAsnxQ=; b=mckSYM6E/4fqeYzNlMzS6rttL9GP+oF6AUuTLOB+enACrsXZGotygX+tARCOY+/0+g wC6iTSbHGVx6bxmM5Gg3cDNjubzVYG0fv+1z6t+Xr77YgwGTyE3qBkZNlIBg/aqnEY1B lxjlevsTPEmVFoRC1Xb3VAj9b2lEzOsWYPtx7xM+NEtTrFWubgcTWoT+3JS4Cofp+Lov fdGpInd9RTFXQWFk3AspDy/KXGtvCGoj3oPdW0IyTnF1OeZcOxv+G8lePTZz/ZrtcPgW 4s2dbpFLCOAg80wJTUWRag/+P+bRvGbkrf1/zdSiSA3Q59cVh87VokapobzUWtSV2/7y zUJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=TZlYlRRU; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=+a+gdlqQ; 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=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l9-20020a170903244900b001b864e1a02asi4144134pls.393.2023.07.07.06.40.15; Fri, 07 Jul 2023 06:40:29 -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=pass header.i=@suse.de header.s=susede2_rsa header.b=TZlYlRRU; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=+a+gdlqQ; 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=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229963AbjGGNUP (ORCPT + 99 others); Fri, 7 Jul 2023 09:20:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46278 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229661AbjGGNUN (ORCPT ); Fri, 7 Jul 2023 09:20:13 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CB1591FC9 for ; Fri, 7 Jul 2023 06:20:12 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 75F25225EC; Fri, 7 Jul 2023 13:20:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1688736011; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=QNyk8rEvT/WeKKmpb7nlokLV1tikUvvvzyU4QMCSflU=; b=TZlYlRRU41HI1fYx2xJpMb5oVokM0T+eDNotH7caV1igxRTdfcMEUYtJQKv4PignIssLyB I6QecqaWmvS0G4RHOfbf7gEAa9hBY0Y+Vv1TxYiugjQyXKPho2HcUxxM8Ii8rum6/Cn47B UKt+4XSNMLR+bpXQtwAlqAeShqkyXtE= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1688736011; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=QNyk8rEvT/WeKKmpb7nlokLV1tikUvvvzyU4QMCSflU=; b=+a+gdlqQXQKCIJXRHWKJXxe5EnLeB26FiwAmJrLuY1dWao2/shy5wl1phTzwGq59gaVrIJ CnqgXUb3xM0EEsCg== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 33A761346D; Fri, 7 Jul 2023 13:20:11 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 6SNVCwsRqGQ9VAAAMHmgww (envelope-from ); Fri, 07 Jul 2023 13:20:11 +0000 Date: Fri, 07 Jul 2023 15:20:10 +0200 Message-ID: <87y1jrkgdx.wl-tiwai@suse.de> From: Takashi Iwai To: Srinivas Kandagatla Cc: Johan Hovold , broonie@kernel.org, perex@perex.cz, tiwai@suse.com, lgirdwood@gmail.com, ckeepax@opensource.cirrus.com, kuninori.morimoto.gx@renesas.com, linux-kernel@vger.kernel.org, pierre-louis.bossart@linux.intel.com, alsa-devel@alsa-project.org Subject: Re: [PATCH] ASoC: codecs: wcd938x: fix dB range for HPHL and HPHR In-Reply-To: References: <20230705125723.40464-1-srinivas.kandagatla@linaro.org> User-Agent: Wanderlust/2.15.9 (Almost Unreal) Emacs/27.2 Mule/6.0 MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 07 Jul 2023 14:54:31 +0200, Srinivas Kandagatla wrote: > > On 07/07/2023 08:35, Johan Hovold wrote: > > On Wed, Jul 05, 2023 at 01:57:23PM +0100, Srinivas Kandagatla wrote: > >> dB range for HPHL and HPHR gains are from +6dB to -30dB in steps of > >> 1.5dB with register values range from 0 to 24. > >> > >> Current code maps these dB ranges incorrectly, fix them to allow proper > >> volume setting. > >> > >> Fixes: e8ba1e05bdc0("ASoC: codecs: wcd938x: add basic controls") > >> Signed-off-by: Srinivas Kandagatla > >> --- > >> sound/soc/codecs/wcd938x.c | 6 +++--- > >> 1 file changed, 3 insertions(+), 3 deletions(-) > >> > >> diff --git a/sound/soc/codecs/wcd938x.c b/sound/soc/codecs/wcd938x.c > >> index faa15a5ed2c8..3a3360711f8f 100644 > >> --- a/sound/soc/codecs/wcd938x.c > >> +++ b/sound/soc/codecs/wcd938x.c > >> @@ -210,7 +210,7 @@ struct wcd938x_priv { > >> }; > >> static const SNDRV_CTL_TLVD_DECLARE_DB_MINMAX(ear_pa_gain, 600, > >> -1800); > >> -static const SNDRV_CTL_TLVD_DECLARE_DB_MINMAX(line_gain, 600, -3000); > >> +static const DECLARE_TLV_DB_SCALE(line_gain, -3000, 150, -3000); > > > > This looks wrong, and indeed that forth argument appears to be a mute > > flag. I guess that one should have been 0 (false) here? > > yes, this should be true instead of a mute dB value. > > > > > Headphone output also appears to be way too loud by default with this > > patch (alone) applied. Perhaps it's just the default mixer settings need > > to be updated to match? > > > > It looks like you're inverting the scale above. Perhaps that's intended, > > yes, the highest value corresponds to lowest dB which is why its inverted. Ouch, that's a bad design choice... Takashi