Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp31946944rwd; Fri, 7 Jul 2023 06:44:12 -0700 (PDT) X-Google-Smtp-Source: APBJJlF1P3QKVAoprZr8qPa1UedYRLRf/DYaShRj7mF7+QEd/cC7EGv1VsqR9nWkpOCIo+9Me3nT X-Received: by 2002:a17:903:32ce:b0:1b8:b4e5:15c2 with SMTP id i14-20020a17090332ce00b001b8b4e515c2mr5134928plr.22.1688737452371; Fri, 07 Jul 2023 06:44:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688737452; cv=none; d=google.com; s=arc-20160816; b=mwqiHNgAXWWPZk3UgqV+9Ps9T+YwAtDMT46JpAJlqdbXuQNQEFvrmCxHaqVY4zQUnn VELX9rAodyTEbY/71Wbgo0ol14rC2v5zBxq4zD+AFykvpMBQ5lVBZQJ0uaLG27WCtjWg W/GpzuVZ3Z+RZSBG+kr2/M958ruCxeSU4PhaDsmv6TzHKlzwniAgqcPHhubxvn7wFv4C uVLF9TlOtND/4eYPknJWHMr5Rc55SnEYz2Qcyz1rlDLYidJZjmxiPY22h1+VWdHzLKMg 6RPvduzDaaBZ3hbVMR2WQJkbJ8OIXT/R7DnW9pvd6q/SqhOQw4mIwLxNtfdxwbBT4GzD 8jhg== 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=dML+Bci7dvwejb6fUN7elzw5DqVmGNwoDlI56jXp5jo=; fh=Yqko018jUEw9jnqU5DI/BaLBZAp121dEiJYy9+jqAlM=; b=qwwvDE5kHFpTw8CB1ODpv7tzcB0OE30seDqrA+E4nLe8Jc06BuDReDXoWsCeehIbNT HwJd4r8KNx8EDjPB6xWc1ZwwUK3PjsVDwGRa3cP02BdZktuiW0mR3iGP46bEWDAOBtrI fHQpvbohqn+pdTFm3z9H3pJw+ytg09Q76ZJ4K1/r3oGDlMtXzBbczpPkfjAPpe23C4/W PLvVPqBw8tggwG6JvaETBnlifw0NNvOOIFdT1TrMh4vA3o7RIBfj8gpe5ixle5HoX7Ki q8bfbOmX+PvZtHjwvR5eTRM8lygXJYR45oHnP2l63ADHh55x9kzsyU/bPr1wL++7BSll jfLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=OfKupCDL; dkim=neutral (no key) header.i=@suse.de header.b=VPllrIwj; 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 kl16-20020a170903075000b001b80394179esi3465660plb.89.2023.07.07.06.43.58; Fri, 07 Jul 2023 06:44:12 -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=OfKupCDL; dkim=neutral (no key) header.i=@suse.de header.b=VPllrIwj; 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 S232396AbjGGNa4 (ORCPT + 99 others); Fri, 7 Jul 2023 09:30:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49550 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232196AbjGGNaz (ORCPT ); Fri, 7 Jul 2023 09:30:55 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 847451FEC for ; Fri, 7 Jul 2023 06:30:50 -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 E7C1F22695; Fri, 7 Jul 2023 13:30:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1688736648; 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=dML+Bci7dvwejb6fUN7elzw5DqVmGNwoDlI56jXp5jo=; b=OfKupCDLFLkgEOE1Gv6MCWiNkK7+GW6YUeLeaUAOcWOc9SFKx4HPAJ4fBbSuQPNMe9J7rl Glj83gAjHi7uHvlsmhLpkqgkXY2HMBMSMkUYZzYDnCPDa7cP5wK14AxxNkbhdRf73RslgL j8kKcs6TP8gXFbxN8MydDSZNJM9TPBI= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1688736648; 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=dML+Bci7dvwejb6fUN7elzw5DqVmGNwoDlI56jXp5jo=; b=VPllrIwjpS28/Oy40IrMqdng/0BqwT/L23bu9CyaTHtRoWcVsnu6tNlmyJsv1E2uX8oZdw nfLc5Tzn6sMsbfDg== 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 9FB6F1346D; Fri, 7 Jul 2023 13:30:48 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id Vd3gJYgTqGQIWgAAMHmgww (envelope-from ); Fri, 07 Jul 2023 13:30:48 +0000 Date: Fri, 07 Jul 2023 15:30:48 +0200 Message-ID: <87wmzbkfw7.wl-tiwai@suse.de> From: Takashi Iwai To: Mark Brown Cc: Srinivas Kandagatla , Johan Hovold , 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: <3450ef1e-cb20-4242-b482-41d3d34c4564@sirena.org.uk> References: <20230705125723.40464-1-srinivas.kandagatla@linaro.org> <87y1jrkgdx.wl-tiwai@suse.de> <3450ef1e-cb20-4242-b482-41d3d34c4564@sirena.org.uk> 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 15:22:45 +0200, Mark Brown wrote: > > On Fri, Jul 07, 2023 at 03:20:10PM +0200, Takashi Iwai wrote: > > Srinivas Kandagatla wrote: > > > > yes, the highest value corresponds to lowest dB which is why its inverted. > > > Ouch, that's a bad design choice... > > It's moderately common - typically in these cases the control is > described in the datasheet as an attenuation control rather than a gain, > and this usually corresponds to the physical implementation being only > able to make signals smaller relative to the reference. Yeah, I see the use case. The problem is, however, that we're using the very same dB info for both gain and attenuation. That means, application has no idea how to interpret those dB values -- to be added or to be subtracted. We should have defined a new TLV type for attenuation to differentiate, and define the TLV macro to give proper min/max. Takashi