Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp31981678rwd; Fri, 7 Jul 2023 07:09:44 -0700 (PDT) X-Google-Smtp-Source: APBJJlFtaFhPHoFDiwG8lHK7Dx6Ig/NZE0vOGbAAwbauoSnkz+7Q5IhA8Qbjv7QfjxaNJ81MO1pX X-Received: by 2002:a05:6a00:84a:b0:67b:a681:4ab2 with SMTP id q10-20020a056a00084a00b0067ba6814ab2mr5456499pfk.25.1688738983355; Fri, 07 Jul 2023 07:09:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688738983; cv=none; d=google.com; s=arc-20160816; b=lNwMI1OIPUCRsQeZVrF+kpLsjmGKRaf4to7IcoMdmircROQ+Iw7fJ+u5vvW6u0j0ty c1sfMmYkHbSlx+fDZA24k1dqnfaLJPkx9IvErpdG9fLkSDC+JUBzhAtt8tNXwhVNU0Ij hheqhX99LV9/c2eoLRRydFeAppAWFJ0KhO+1YD6t8ALpJhSEQ+L3J8gkvov53d2k5lmO cRL4rwwyYnYf61NwNQTkl20qhhkV88m0JSTy3SnqM6W2+jvUONbcq/UJaZGfhUojKOKO rqZMxzE/cGFx/YXvW5Z1WQyY/zyJf/wOOuo4RpM7qVOYBm9pGxmCZ2fUZT1zIc+AgHNk cl3w== 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=9ETpM6o6K3HAUc8/fEUMdngpEDYf73Gw3CZHJcQEwIE=; fh=Yqko018jUEw9jnqU5DI/BaLBZAp121dEiJYy9+jqAlM=; b=iguXPkS1Q1dNrljo2K0Rf7RViO37oLE9cDMDXQTStoxXYSa0uZbc6jfh51uRSnZcfz I7M9ArCzh7RPTvrffqhyusLW/x1kh0eeuYe0WSqfShhCEm0lD4b02g8kE7+/R9Ca8EYW Wdcde2zNyIcoXOXJetGeqHEUgu3pmYUYrEDys8OkLRX5fTZO5RXBXs4wt4mDk0vLaTkW V1LS5Wqfz6Xy+qkfaeXeNDXVGHxVOvg6Wc5w2SCJSP67i8lfVv8RQqAl2DZYGYoxmJTd eigV8xGaap5ZfQ10Y3kzBTXYUivzbOKv2F+9MOMZtKW4kTI7CYBMdgoTv9/bOtKshXlH mLpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=1Rvu2ZI3; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; 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 br6-20020a056a00440600b0065bbe39e1b3si3772159pfb.146.2023.07.07.07.09.30; Fri, 07 Jul 2023 07:09:43 -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=1Rvu2ZI3; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; 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 S232589AbjGGNsB (ORCPT + 99 others); Fri, 7 Jul 2023 09:48:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59638 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232736AbjGGNrz (ORCPT ); Fri, 7 Jul 2023 09:47:55 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D1E611FE8 for ; Fri, 7 Jul 2023 06:47:49 -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-out2.suse.de (Postfix) with ESMTPS id 8783D1FDB4; Fri, 7 Jul 2023 13:47:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1688737668; 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=9ETpM6o6K3HAUc8/fEUMdngpEDYf73Gw3CZHJcQEwIE=; b=1Rvu2ZI3LCC2U75nKNYFIbH1685AZPBZgMhIhXg1JsXZ5hchph7KyuRJLwu10H514uE4cS Fw84dJMAjDd450a7CdXDUeoBg/7zi7CHxKLvJGTo3tHoq/2DxJ/wk5abn7M8hIQUfTmX41 Go9UkGZ7M8IUuFfDZjdqTcEDc8zyuXY= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1688737668; 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=9ETpM6o6K3HAUc8/fEUMdngpEDYf73Gw3CZHJcQEwIE=; b=rbbizk1mlChErDAs5iKWukmT8SiygTtVQyL5+BgIc4oLm0xvCKpa/BGmfIBYLCwjfRFReM Pznr7h+BGhzALjAg== 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 443501346D; Fri, 7 Jul 2023 13:47:48 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id LrDjD4QXqGQGYgAAMHmgww (envelope-from ); Fri, 07 Jul 2023 13:47:48 +0000 Date: Fri, 07 Jul 2023 15:47:47 +0200 Message-ID: <87v8evkf3w.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: References: <20230705125723.40464-1-srinivas.kandagatla@linaro.org> <87y1jrkgdx.wl-tiwai@suse.de> <3450ef1e-cb20-4242-b482-41d3d34c4564@sirena.org.uk> <87wmzbkfw7.wl-tiwai@suse.de> 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:35:29 +0200, Mark Brown wrote: > > On Fri, Jul 07, 2023 at 03:30:48PM +0200, Takashi Iwai wrote: > > Mark Brown wrote: > > > > 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. > > The ASoC generic control stuff supports inverting the value prior to > presentation to userspace so it's masked there (instead of writing the > number userspace sees to the register we subtract the number from the > maximum value and write that to the register), pulling that up further > to the ALSA core might be nice I guess? I believe yes. Though, I'm still not sure how we can improve the mismatch of dB min/max. The dB values of those inverted controls reflect the result of subtraction, no? Takashi