Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp31569528rwd; Fri, 7 Jul 2023 00:59:56 -0700 (PDT) X-Google-Smtp-Source: APBJJlF32ozIWkOfgTW0EWewyRiGlj+Vz8kXXUzdd0dsEA54lu/FQM5kD3xl/0kC+934KX5Jpy6f X-Received: by 2002:a05:6a00:10c4:b0:66f:7076:a5b4 with SMTP id d4-20020a056a0010c400b0066f7076a5b4mr6522090pfu.7.1688716796263; Fri, 07 Jul 2023 00:59:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688716796; cv=none; d=google.com; s=arc-20160816; b=n7zUCQ8vdBoImBELS/iFxhaJKGBzh0SI911cphnGNje+bn85R4vNkqbdGdWVWmvnTk b72FtrrhkUPgWb6hLOBsVl9yT52ZRy5pu3jjlBx0V/Dbt405yZis8qEEAntwRDqLBBVg qRimg5T3m6v871Vnf0AAzeTXsRcKb0CNTe+PvNfEBtZy2SnboqW8SOGaNISw7VBn0SN8 //yNjAs/wCLMmxfhcOnRk6rJvXzYt+AsDjElMyzOYGP1yhFyaRpgbj/dD12yDqRguU3u iMEvFwNYbwfVr2LHOdAc8o9KNSFaFGNBRp1vy4Y6lHpfFemNMVL3fA79E0HQ4Ecrinl3 tmvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=iKgqD/ilwzirkGpslyzUbOyaurpMrKRVEhaSim6lfoc=; fh=K7wr8jhXIMprY5x6OC/gjgXwWegbICGie0zN7+LpfMY=; b=eAgbtFj9mocRxmU8uOSdB+STj7GEqO4440Szfl90DqS8wKVM0FvANCv9LffwOqvoA8 jjVYYRg0W0FV02ecatwzzMcdFMxxS9N3Vcm607wz4OBjc3vp8CvI15ROCeg66cLLtT64 kM43XBJYzX7IL3DT5pLH7g5G2eibLEN1l9h2ISgCPUJsKp+c5w/Pciq3ctTf6Rpb/Cjg 4vd+xtS/LZJPvkicX93VfU5xKq4itfafNHIwcuqjBq2tUQcdm1QTL4TLrf4SUGl0xgup Pmyxa6wgOV+1NTPf12cc+5INGH7lKks+RWU9Tp4E7jipJHzeBc9zBY0sAdekmbep0aOU kElA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=oxeXnpDh; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ca21-20020a056a00419500b006815bf78633si3173727pfb.315.2023.07.07.00.59.42; Fri, 07 Jul 2023 00:59:56 -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=@kernel.org header.s=k20201202 header.b=oxeXnpDh; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232066AbjGGHfV (ORCPT + 99 others); Fri, 7 Jul 2023 03:35:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34144 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229684AbjGGHfU (ORCPT ); Fri, 7 Jul 2023 03:35:20 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 57F401FCE for ; Fri, 7 Jul 2023 00:35:20 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id E3916617BB for ; Fri, 7 Jul 2023 07:35:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3787EC433CA; Fri, 7 Jul 2023 07:35:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688715319; bh=ngiEgkYK7ySolai9wW68canKG3JxLVmENycSOl9PzLU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=oxeXnpDhClySaU6OWlU7dZSI5c6p79N+YHy2XZfHg/VpD5U+Pobs5W0IuRX0k8T5+ pyptW7rPvsuoFeW37J0fSXj6SI4Hc6f4Z0cPAsmyVaiwPgOHZguLFjvt7dbEaBNVKx h0nGy+NdQ1HYAZCcCUg7vT3PNbOqNb2dqbN7Qj4mGyoNe/uj9Mx5K2WqWeHgaNRfSk IepdqSYaVm0+1BVdpNt79mJkoMDmbjZyfhU4/8meJ2bzCTNy9axKdKgtzkq+5Y/7Wn Unhi+g4vqzVlhbaKS33h/CBfkh7vyxtnrvNQmxhuRL+Hx11jkl8xdNh/MXvsdtD6uc ix61AaZSTc05A== Received: from johan by xi.lan with local (Exim 4.96) (envelope-from ) id 1qHg0G-0004Mn-1k; Fri, 07 Jul 2023 09:35:44 +0200 Date: Fri, 7 Jul 2023 09:35:44 +0200 From: Johan Hovold To: Srinivas Kandagatla Cc: 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 Message-ID: References: <20230705125723.40464-1-srinivas.kandagatla@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230705125723.40464-1-srinivas.kandagatla@linaro.org> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 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? 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, but some more details in the commit message as to what was wrong and what you intended to do would have been good. Johan