Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp701256pxb; Tue, 5 Apr 2022 19:23:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxq+gv5DwlASrAEnXPtqnTIwo2wbDYduNq2jIVnyW+Aqk67lrDGRuTr8vjGDBJ21JhTq/ty X-Received: by 2002:a63:447:0:b0:399:58c5:2cc2 with SMTP id 68-20020a630447000000b0039958c52cc2mr5319298pge.592.1649211819816; Tue, 05 Apr 2022 19:23:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649211819; cv=none; d=google.com; s=arc-20160816; b=FNubGTyIa2oenmAskwcJxSW/pbMjvTQVD38gPwNEGcR2UKnyibrXNNOiB9t8GDEecr Eq3Xb0vwUu/aNVrGq/5Jeo6q9+ruLr3u5zWd4up3EexWGUEhg17k6lYOlBzanfZIcCWG xJJrf8yfKZ3RSpXXLq8qXaUNGcpFRrp/+Qr4rE01rbdsz5IhF3nhcTLMK0W6iYj/kV2Y jAVIudaVxwM9hH2iAAz059MeixNasn6ob7hkmLGWsifVpMVgOYKPIk8e3msUOXg1J1nX kDChyUsBF+KA4MFuEGIdzlpeIKgzrL+H18ist5iDgvpnVZgZLQAbDApS/oKmEW7nYYjf VkiA== 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=4SNd1PdWokP5YreUMuZemcLa+RmhciHm8eT1qURiRjQ=; b=kgFKc1O4ZJcwQUuQeI0WjpM8rfri1v3twK84u78qAWg57wKY3jqUzkFjEgxiIKi6VL VvUSC/Fp2evFXkUIzflSucGZ/5BjaDibRAKKqwzQ8NP34UWgIueOm75BnzWWLuhalEzY GXkxlDhwzanYJ87xv0IlazGBHR6pQQIu64zLCj/5tqiC2dj30iuiVLqJhN9EGdxvY0Ui R4w0dQRD+9Vq0oUfyeKkjaewUiIr8ctCRbm5Pjte+CDrkohbojueWIi/uz9lso+kPH+I 4zciXlPBOYJSofwhcnMgEfbD0geDtoXyuerze+YVP3ImcOWnoExwfxjqHXpsDFWT7dgA BC3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="fl0dC/Iy"; 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=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lr8-20020a17090b4b8800b001ca93cea6b0si3986605pjb.45.2022.04.05.19.23.23; Tue, 05 Apr 2022 19:23:39 -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=@linuxfoundation.org header.s=korg header.b="fl0dC/Iy"; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1359699AbiDEL5K (ORCPT + 99 others); Tue, 5 Apr 2022 07:57:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50874 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244998AbiDEIxA (ORCPT ); Tue, 5 Apr 2022 04:53:00 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C4839BE3F; Tue, 5 Apr 2022 01:49: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 sin.source.kernel.org (Postfix) with ESMTPS id 0D140CE1C2B; Tue, 5 Apr 2022 08:48:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 246FEC385A1; Tue, 5 Apr 2022 08:48:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649148537; bh=dUPMWY3No3ZtlmW5feTBsUwdpyUR2ssd5bqEdS1TjXY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fl0dC/Iy96KmL0TKHoU1eg7Io/rjcAIzPrzy529NxlewwRXP02E9z065klMH6XceV 1uQ3D5Acq+tXL6X5zhVsxHgkrrVeW3P5B8BuWLwvoPCbH8YmQp5kfgKTzL8iegs30v H7+Zgo3rPMdevAdzwe2bPckaWtkFOKrC8Lnvvd9U= 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.16 0343/1017] ASoC: codecs: wcd934x: fix kcontrol max values Date: Tue, 5 Apr 2022 09:20:56 +0200 Message-Id: <20220405070404.464710729@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070354.155796697@linuxfoundation.org> References: <20220405070354.155796697@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=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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 From: Srinivas Kandagatla [ Upstream commit 61163c3e7480106804269182e24db05244866493 ] 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: 9fb9b1690f0b ("ASoC: codecs: wcd934x: add mbhc support") Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20220222183212.11580-9-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/codecs/wcd934x.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sound/soc/codecs/wcd934x.c b/sound/soc/codecs/wcd934x.c index e63c6b723d76..68c9d694d379 100644 --- a/sound/soc/codecs/wcd934x.c +++ b/sound/soc/codecs/wcd934x.c @@ -3023,14 +3023,14 @@ static int wcd934x_hph_impedance_get(struct snd_kcontrol *kcontrol, return 0; } 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, wcd934x_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, wcd934x_hph_impedance_get, NULL), - SOC_SINGLE_EXT("HPHR Impedance", 0, 1, UINT_MAX, 0, + SOC_SINGLE_EXT("HPHR Impedance", 0, 1, INT_MAX, 0, wcd934x_hph_impedance_get, NULL), }; -- 2.34.1