Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp939182pxb; Wed, 6 Apr 2022 04:52:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwPMaLKdYA6fj+D2WunujMgyvMyI2ovlwUrI5CAJEo5GHQrC0SS1jA/guhWd+xjvIPwcnHk X-Received: by 2002:a05:6a00:298c:b0:4fa:8e7b:349d with SMTP id cj12-20020a056a00298c00b004fa8e7b349dmr8672014pfb.26.1649245977001; Wed, 06 Apr 2022 04:52:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649245976; cv=none; d=google.com; s=arc-20160816; b=YJuVE+aR8ncbUdzUgYkdjXUmCmVDcMJork65gdRbD4vyi7YbjNJvJv1WjYcXuJpEU+ lBT6/jqxLEJB4ZRm1+kYdiFsAyqmraPJghTCJDckOTamL7mEZ5VG3r5pFd4K2RS4OtfX UhWxi3lkwYiDvsKgfhbhYN0/WwmJQf+Mude9Wq3pN2xrc2I73/kqvD2jJxV/ruRxNSgq Ab1XpJiF8dV1xZxwCJrKn563S1BfEP7R8X+OzIRVORE3TxdNY8QcNu58jMsWxBfB4jCi htqvzowL02utbA3gJOknf5nW+WBAYcY1xzLNcLsCQUsI916fkz5rv9gOnrDUDct7lc+e SjUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=5KxfxexJhWC4vWGQNUjRXoYfkRHmpxHukeLACsq+XlQ=; b=Eyd3yi69mu/Mdl+V9cG4JLzrMhkq2z+8GVZkdHQvKrAVJ+qtl3mv4GJD2LYePyPhi6 4BYSnywhJW+JQC0eCtKL1h5QkxK/uhh0tDu+2HkE+2598oEFnayxU7Ro0aaUkuoxasCx jFpGLMvCkT1PwiqxgLkzdq4aYih+FJSCbrBzQDjb5wARODTNKFlkaYtk1I1FMZo8SRbY 4ikItvR/XwGQkQbzvulA23Tji2g5i2INmesfEfHzZEMOEWu2s0AhpbP+c4rqxN6uhgGx jIugCk58qnLertJja9uQ3EAkSNM1LcQEYg5EWx+RRwUOOj/l+JJE3aTm8fU39D8obC01 ajRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Pnyqe848; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id b11-20020a170902d88b00b00153b2d165a5si14486776plz.429.2022.04.06.04.52.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 04:52:56 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Pnyqe848; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 3590C63FF77; Wed, 6 Apr 2022 03:13:56 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1389938AbiDEP2c (ORCPT + 99 others); Tue, 5 Apr 2022 11:28:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43366 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347713AbiDEJqm (ORCPT ); Tue, 5 Apr 2022 05:46:42 -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 39B5EDFD67; Tue, 5 Apr 2022 02:33:00 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id A941D616AE; Tue, 5 Apr 2022 09:32:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B1884C385A3; Tue, 5 Apr 2022 09:32:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649151179; bh=Kby6M02Ko1M617/lfRgRpIE2CJqOpMZxo0TaBVxMgLM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Pnyqe848SNDlmxfkX+K4g4hI5xMM9rq/ET6I6vQnVX26E1Xw662KEmo5yyIo5m3Ea 1+Ga69Gkik1Uws5T7jjoLOv6uDuaeEDj9J0E3tjMUeq2HyXKQPtshqVtIy/l8xwGoU qGNVVyLPteS92Hyzo/q/ju2+OmX76W9AX5Rrr+jQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Srinivas Kandagatla , Mark Brown , Sasha Levin Subject: [PATCH 5.15 321/913] ASoC: codecs: wcd938x: fix kcontrol max values Date: Tue, 5 Apr 2022 09:23:03 +0200 Message-Id: <20220405070349.472386499@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070339.801210740@linuxfoundation.org> References: <20220405070339.801210740@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 From: Srinivas Kandagatla [ Upstream commit b0217519236924f77a8382b4004e43ef8fd0dcbb ] set "HPH Type" Kcontrol max value of WCD_MBHC_HPH_STEREO instead of UINT_MAX. set "HPHL/R Impedance" Kcontrols max value to INT_MAX instead of UINT_MAX as max field is integer type. Without this patch amixer for these controls will show -1 as max value to userspace. Fixes: bcee7ed09b8e ("ASoC: codecs: wcd938x: add Multi Button Headset Control support") Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20220222183212.11580-8-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- 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 54671bbf7471..4480c118ed5d 100644 --- a/sound/soc/codecs/wcd938x.c +++ b/sound/soc/codecs/wcd938x.c @@ -3577,14 +3577,14 @@ static int wcd938x_hph_impedance_get(struct snd_kcontrol *kcontrol, } static const struct snd_kcontrol_new hph_type_detect_controls[] = { - SOC_SINGLE_EXT("HPH Type", 0, 0, UINT_MAX, 0, + SOC_SINGLE_EXT("HPH Type", 0, 0, WCD_MBHC_HPH_STEREO, 0, wcd938x_get_hph_type, NULL), }; static const struct snd_kcontrol_new impedance_detect_controls[] = { - SOC_SINGLE_EXT("HPHL Impedance", 0, 0, UINT_MAX, 0, + SOC_SINGLE_EXT("HPHL Impedance", 0, 0, INT_MAX, 0, wcd938x_hph_impedance_get, NULL), - SOC_SINGLE_EXT("HPHR Impedance", 0, 1, UINT_MAX, 0, + SOC_SINGLE_EXT("HPHR Impedance", 0, 1, INT_MAX, 0, wcd938x_hph_impedance_get, NULL), }; -- 2.34.1