Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp35048110rwd; Mon, 10 Jul 2023 01:36:37 -0700 (PDT) X-Google-Smtp-Source: APBJJlG2DYzO4nL4xV4d/8Ljht0zIn3NW7ppThUPM6mn7HwfXXw+sqqt/5Swn0dpsAoEIHsoEXkM X-Received: by 2002:a17:906:f147:b0:965:d18b:f03a with SMTP id gw7-20020a170906f14700b00965d18bf03amr12002331ejb.58.1688978197638; Mon, 10 Jul 2023 01:36:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688978197; cv=none; d=google.com; s=arc-20160816; b=Nzttco3EIvdbAUMW+G0Grxs3PCFjx5RakFdNwSd7I76ob09V8r/pjdA89+AdMDNzOX 3rP1tFf6XoaB7JdFr594Pf2MhJQtsy0Kmco5nuGkDVHfhOyxGueajl+dJ/eJUeABBFxL 9vFY0/BzqoAv+V+aVy5yL+bsGHLzwJdhYSVCsrt+QnUxWaAhatYUkEk603gTs+fJ9FLz EnMDu5RKd0VktLnAiBBu2T3mouBEQG2kq+43ObhWaATgOfHJWyN2+cB3fe9m02Zu4QYt ME1l757uGiAQYqiQieYulxPQX9B8J2q4EmTLZ4mauDlaPMAVN0xHgUY63mnNrjie4l9b AfyA== 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=9c1Hyfa0qbZcmFBIiXA4YT0W5pWsuJ23T868Rm8ntrE=; fh=Yqko018jUEw9jnqU5DI/BaLBZAp121dEiJYy9+jqAlM=; b=yroQg7kf0spp+emHNo5CZRCzmKKtUkO0oiXN/DurkKasZayZ0lsjxG0L1JyweWnBvr 1cCfJjzkZXGWMl1KZHcfJlE0vfplptJmdTm2Ij17RmzaSR7hd7xky1X3l5KFx2aDfm4p iJpMgeH2OIBJTl0atjuJRrP4qyGS7qGn67vYWLnjIaCKxk8nMKd8itkxCirn/eF3aR1b 7PBW2iUzH5t2GlAdXC4WUtj0sZTOUFYze31o0DzmDyikoSMPuy9cOT6m7XMRB3bPCQ01 DNL4wLZvPE/2m7+Ta0WZqBCyqfNmI1mgoVocOmT/354wfbk+yoCX5gki0P8tFQLgFrYV 2yBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=G4vEUbok; dkim=neutral (no key) header.i=@suse.de header.b=mO+ukF0y; 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 qw16-20020a170906fcb000b009930d4e327dsi7973992ejb.880.2023.07.10.01.36.14; Mon, 10 Jul 2023 01:36:37 -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=G4vEUbok; dkim=neutral (no key) header.i=@suse.de header.b=mO+ukF0y; 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 S232797AbjGJIU1 (ORCPT + 99 others); Mon, 10 Jul 2023 04:20:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42242 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232814AbjGJIUH (ORCPT ); Mon, 10 Jul 2023 04:20:07 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DD15E13D for ; Mon, 10 Jul 2023 01:19:51 -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 8D6351F38D; Mon, 10 Jul 2023 08:19:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1688977190; 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=9c1Hyfa0qbZcmFBIiXA4YT0W5pWsuJ23T868Rm8ntrE=; b=G4vEUbokaMCTFfE3zvzK8FXiJOo6Bty0CkY3QoHJtalaNhvolPfJ/smYBe8loijQaYuk4l dxbvCGQf//pQSVG0Wb4M7C7NVBcIK8Iu4Md7WBrlACDtQ2rUL49kGUbF7T5t2XkM8BHBcX b45sI7ICema9q6Q38HvlV+bSbYCWhvY= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1688977190; 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=9c1Hyfa0qbZcmFBIiXA4YT0W5pWsuJ23T868Rm8ntrE=; b=mO+ukF0yxY4sZwLLdtFPXTD9hMZaME+nplule9TTUrRr8UQqt7ARS0rYr5T3Tc8FGA2DOt F74+13edVJnoIZBw== 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 4CD4313A05; Mon, 10 Jul 2023 08:19:50 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id NijtESa/q2SjCgAAMHmgww (envelope-from ); Mon, 10 Jul 2023 08:19:50 +0000 Date: Mon, 10 Jul 2023 10:19:49 +0200 Message-ID: <87jzv8i3fe.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: <56aecc8d-2f6c-42c0-a13a-89c84cf53773@sirena.org.uk> 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> <87v8evkf3w.wl-tiwai@suse.de> <56aecc8d-2f6c-42c0-a13a-89c84cf53773@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=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, 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 Fri, 07 Jul 2023 17:06:24 +0200, Mark Brown wrote: > > On Fri, Jul 07, 2023 at 03:47:47PM +0200, Takashi Iwai wrote: > > Mark Brown wrote: > > > > 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? > > Yes, the dB scale presented to userspace is reversed relative to the > ordering in the registers. Right, the TLV min/max corresponds to the control values, and they don't mean the raw register values. BTW, this thread made me wonder whether it makes sense to give some sanity checks (maybe with CONFIG_SND_DEBUG) in ALSA core. e.g. read_tlv_buf() in sound/core/control.c can perform some tests before actually passing to user-space. Takashi