Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp592957iog; Fri, 17 Jun 2022 09:18:12 -0700 (PDT) X-Google-Smtp-Source: AGRyM1v9TVVUcRdiem8rVhePn3dhju6aloQcr4JtDgdpkpfrqFSwkufAgx9vmGws/NrFTCEzrUaZ X-Received: by 2002:a17:907:d90:b0:711:d151:51aa with SMTP id go16-20020a1709070d9000b00711d15151aamr10384965ejc.452.1655482692514; Fri, 17 Jun 2022 09:18:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655482692; cv=none; d=google.com; s=arc-20160816; b=m30NZeQyM1SsVv5O9AtMy7NXHX45OtUvL07rI/A+/rbmtpWVfcxIxDLfAvVAyLONmq JpKYqr4rc/OyHfZt03Pi1BN9ywAJpD4hd0MvteMSOTP2Fl8w9XuBH5u/7G2If0U7lpqq Xz4xKNpAbQP082unzySH3lxgfbase4rAMv6HgwgWDQZjNgOXLxDaHy+zT3+kwASa6a77 kXwlL6vnFr/jUXU0GbguoXzRMJluUDFg86pNsNtuFH0MHHEeIj7r6P+seEUC1YlvvqnE yx/LnW7DMkj5FWCme3692XPaLm/cgscvqIO80EZ6lMJVSpwY4V1E0MbvwCNP6ndgdkQo SPkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=Ahdx8sBoxSV39mhILpNiLucN5DgFPfJrpifEXjQFb5c=; b=AwEyj/cqJUM+gPbkyWHFwksif1StGgWF08MGCR8oNhCSTnOZOn9hKccRgTP9LS7EDD 53sUyji+/3hUcb7Zdl0/ms45ExcUjZIFVPE3K6ClIwCK8VeH8T7Fc8dh71qSBRyLndoC QfCTOaQA0UN1q0PlP4vBP4z4a85MtKG7FbES1+1PTnuXSHS6UsNJBMlIJMJQpQ8J3Kah vAnCMa5iXCrXecgAYruPXrpI5gOlHy8toB07ab8bk2vmlKBNhprloQMM7oT+/XxGTrzT ndYicRgO6VdhOOdiGPIJ98JPrVVEDoWd0exV4RS00V4hdN2QHzawDq4lQ7GICg0f4MPw RSGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cirrus.com header.s=PODMain02222019 header.b=llf4ZdqG; 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=REJECT sp=REJECT dis=NONE) header.from=cirrus.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e23-20020a50ec97000000b0042acba0b85bsi5338849edr.200.2022.06.17.09.17.44; Fri, 17 Jun 2022 09:18: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=@cirrus.com header.s=PODMain02222019 header.b=llf4ZdqG; 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=REJECT sp=REJECT dis=NONE) header.from=cirrus.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1382536AbiFQPuh (ORCPT + 99 others); Fri, 17 Jun 2022 11:50:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43534 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234143AbiFQPug (ORCPT ); Fri, 17 Jun 2022 11:50:36 -0400 Received: from mx0b-001ae601.pphosted.com (mx0b-001ae601.pphosted.com [67.231.152.168]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D5951237DF for ; Fri, 17 Jun 2022 08:50:35 -0700 (PDT) Received: from pps.filterd (m0077474.ppops.net [127.0.0.1]) by mx0b-001ae601.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 25H3eJxo019085; Fri, 17 Jun 2022 10:50:29 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cirrus.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=PODMain02222019; bh=Ahdx8sBoxSV39mhILpNiLucN5DgFPfJrpifEXjQFb5c=; b=llf4ZdqGNcKfhg9Pn3WEVdHkpS8YZ9snRyfeGtLSYu4lDBwll/0pi83nXYwpGgWKaTvI 3WS/q7CY1X48Kmi7hKQoEzEctAmQQwoo4XS0ngJB1ZqtN7Yz19z8wfAlRKcEQBza6jjd a3pZxfhdahX+UNezO3WvwjF1QYlXmq8PdvUBr+zUb1BJ+SNOWg2thye8/4DcPlnrSuFe cUok9y/1F+v14F/KYW5ev9KKb7qZ+IRqE+3MaCeCRCXsQ4IToiAzbWEc2zevdowrJ4KV 8hwJ/zdLXHloBLWGt+aTjLJ+35xomMW8iG8/MjzUD1xFaDHyXyQuCG90DD4VuBJDLaHY iA== Received: from ediex01.ad.cirrus.com ([84.19.233.68]) by mx0b-001ae601.pphosted.com (PPS) with ESMTPS id 3gmqfq79r8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Fri, 17 Jun 2022 10:50:29 -0500 Received: from EDIEX01.ad.cirrus.com (198.61.84.80) by EDIEX01.ad.cirrus.com (198.61.84.80) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Fri, 17 Jun 2022 16:50:28 +0100 Received: from ediswmail.ad.cirrus.com (198.61.86.93) by EDIEX01.ad.cirrus.com (198.61.84.80) with Microsoft SMTP Server id 15.1.2375.28 via Frontend Transport; Fri, 17 Jun 2022 16:50:28 +0100 Received: from ediswmail.ad.cirrus.com (ediswmail.ad.cirrus.com [198.61.86.93]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id 3D454468; Fri, 17 Jun 2022 15:50:17 +0000 (UTC) Date: Fri, 17 Jun 2022 15:50:17 +0000 From: Charles Keepax To: Stefan Binding CC: Mark Brown , Liam Girdwood , , , Subject: Re: [PATCH v1] ASoC: ops: Fix integer detection for when max possible values > 1 Message-ID: <20220617155017.GF38351@ediswmail.ad.cirrus.com> References: <20220617153606.2619457-1-sbinding@opensource.cirrus.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20220617153606.2619457-1-sbinding@opensource.cirrus.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Proofpoint-ORIG-GUID: UpVMj3PBZs9Q-zpD-1y79KJr-yYNuJjg X-Proofpoint-GUID: UpVMj3PBZs9Q-zpD-1y79KJr-yYNuJjg X-Proofpoint-Spam-Reason: safe X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,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, Jun 17, 2022 at 04:36:06PM +0100, Stefan Binding wrote: > The standard snd_soc_info_volsw() allows a two value control to be > defined as an integer control only if the control name ends in > "Volume". It achieves this by creating a substring if it contains > " Volume", and ensuring this exists at the end of the name. The > volume substring is then used to decide whether the type is a > SNDRV_CTL_ELEM_TYPE_INTEGER or SNDRV_CTL_ELEM_TYPE_BOOLEAN. > However this volume substring is only computed for a two value > control. > This means for controls where there are more than two possible > values, the substring is never created, so in this case the > substring remains NULL, and the condition yields > SNDRV_CTL_ELEM_TYPE_BOOLEAN, even though there are more than 2 > possible values. > If there are more than 2 possible values for the control, > then it should always be an integer control. > > Fixes: aa2a4b897132 ("ASoC: ops: Fix boolean/integer detection for simple controls") > > Signed-off-by: Stefan Binding > --- Reviewed-by: Charles Keepax Thanks, Charles