From patchwork Wed Nov 1 09:02:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: wangweidong.a@awinic.com X-Patchwork-Id: 13442615 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5B8D1C4332F for ; Wed, 1 Nov 2023 09:02:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234237AbjKAJCa (ORCPT ); Wed, 1 Nov 2023 05:02:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43712 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231570AbjKAJC3 (ORCPT ); Wed, 1 Nov 2023 05:02:29 -0400 Received: from out28-171.mail.aliyun.com (out28-171.mail.aliyun.com [115.124.28.171]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4B622F1; Wed, 1 Nov 2023 02:02:26 -0700 (PDT) X-Alimail-AntiSpam: AC=CONTINUE;BC=0.1985962|-1;CH=green;DM=|CONTINUE|false|;DS=CONTINUE|ham_system_inform|0.0107958-0.00031274-0.988891;FP=0|0|0|0|0|-1|-1|-1;HT=ay29a033018047211;MF=wangweidong.a@awinic.com;NM=1;PH=DS;RN=11;RT=11;SR=0;TI=SMTPD_---.VCeegnI_1698829339; Received: from ubuntu-VirtualBox..(mailfrom:wangweidong.a@awinic.com fp:SMTPD_---.VCeegnI_1698829339) by smtp.aliyun-inc.com; Wed, 01 Nov 2023 17:02:22 +0800 From: wangweidong.a@awinic.com To: lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com, wangweidong.a@awinic.com, liweilei@awinic.com, u.kleine-koenig@pengutronix.de, yang.lee@linux.alibaba.com, nathan@kernel.org, linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH V2 1/3] ASoC: codecs: Modify the maximum value of calib Date: Wed, 1 Nov 2023 17:02:08 +0800 Message-ID: <20231101090211.177125-2-wangweidong.a@awinic.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231101090211.177125-1-wangweidong.a@awinic.com> References: <20231101090211.177125-1-wangweidong.a@awinic.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-sound@vger.kernel.org From: Weidong Wang The maximum value that calib can set should be consistent with the maximum value of re. Signed-off-by: Weidong Wang --- sound/soc/codecs/aw88395/aw88395.c | 2 +- sound/soc/codecs/aw88399.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/soc/codecs/aw88395/aw88395.c b/sound/soc/codecs/aw88395/aw88395.c index 77227c8f01f6..3c459a67ad0c 100644 --- a/sound/soc/codecs/aw88395/aw88395.c +++ b/sound/soc/codecs/aw88395/aw88395.c @@ -356,7 +356,7 @@ static const struct snd_kcontrol_new aw88395_controls[] = { aw88395_get_fade_in_time, aw88395_set_fade_in_time), SOC_SINGLE_EXT("Volume Ramp Down Step", 0, 0, FADE_TIME_MAX, FADE_TIME_MIN, aw88395_get_fade_out_time, aw88395_set_fade_out_time), - SOC_SINGLE_EXT("Calib", 0, 0, 100, 0, + SOC_SINGLE_EXT("Calib", 0, 0, AW88395_CALI_RE_MAX, 0, aw88395_re_get, aw88395_re_set), AW88395_PROFILE_EXT("Profile Set", aw88395_profile_info, aw88395_profile_get, aw88395_profile_set), diff --git a/sound/soc/codecs/aw88399.c b/sound/soc/codecs/aw88399.c index 47fe38d0def5..1d6228cb1cc2 100644 --- a/sound/soc/codecs/aw88399.c +++ b/sound/soc/codecs/aw88399.c @@ -1710,7 +1710,7 @@ static const struct snd_kcontrol_new aw88399_controls[] = { aw88399_get_fade_in_time, aw88399_set_fade_in_time), SOC_SINGLE_EXT("Volume Ramp Down Step", 0, 0, FADE_TIME_MAX, FADE_TIME_MIN, aw88399_get_fade_out_time, aw88399_set_fade_out_time), - SOC_SINGLE_EXT("Calib", 0, 0, 100, 0, + SOC_SINGLE_EXT("Calib", 0, 0, AW88399_CALI_RE_MAX, 0, aw88399_re_get, aw88399_re_set), AW88399_PROFILE_EXT("AW88399 Profile Set", aw88399_profile_info, aw88399_profile_get, aw88399_profile_set), From patchwork Wed Nov 1 09:02:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: wangweidong.a@awinic.com X-Patchwork-Id: 13442616 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2246AC4332F for ; Wed, 1 Nov 2023 09:02:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234434AbjKAJCg (ORCPT ); Wed, 1 Nov 2023 05:02:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43740 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234424AbjKAJCe (ORCPT ); Wed, 1 Nov 2023 05:02:34 -0400 Received: from out28-4.mail.aliyun.com (out28-4.mail.aliyun.com [115.124.28.4]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B0C88F7; Wed, 1 Nov 2023 02:02:30 -0700 (PDT) X-Alimail-AntiSpam: AC=CONTINUE;BC=0.1092362|-1;CH=green;DM=|CONTINUE|false|;DS=CONTINUE|ham_system_inform|0.00441527-0.000454537-0.99513;FP=0|0|0|0|0|-1|-1|-1;HT=ay29a033018047206;MF=wangweidong.a@awinic.com;NM=1;PH=DS;RN=11;RT=11;SR=0;TI=SMTPD_---.VCeegrp_1698829343; Received: from ubuntu-VirtualBox..(mailfrom:wangweidong.a@awinic.com fp:SMTPD_---.VCeegrp_1698829343) by smtp.aliyun-inc.com; Wed, 01 Nov 2023 17:02:26 +0800 From: wangweidong.a@awinic.com To: lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com, wangweidong.a@awinic.com, liweilei@awinic.com, u.kleine-koenig@pengutronix.de, yang.lee@linux.alibaba.com, nathan@kernel.org, linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH V2 2/3] ASoC: codecs: Modify the wrong judgment of re value Date: Wed, 1 Nov 2023 17:02:09 +0800 Message-ID: <20231101090211.177125-3-wangweidong.a@awinic.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231101090211.177125-1-wangweidong.a@awinic.com> References: <20231101090211.177125-1-wangweidong.a@awinic.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-sound@vger.kernel.org From: Weidong Wang An error code should be return when the re is greater than the maximum value or less than the minimum value Signed-off-by: Weidong Wang --- sound/soc/codecs/aw88399.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/soc/codecs/aw88399.c b/sound/soc/codecs/aw88399.c index 1d6228cb1cc2..54f8457e8497 100644 --- a/sound/soc/codecs/aw88399.c +++ b/sound/soc/codecs/aw88399.c @@ -486,8 +486,8 @@ static int aw_dev_update_cali_re(struct aw_cali_desc *cali_desc) u32 cali_re; int ret; - if ((aw_dev->cali_desc.cali_re <= AW88399_CALI_RE_MAX) || - (aw_dev->cali_desc.cali_re >= AW88399_CALI_RE_MIN)) + if ((aw_dev->cali_desc.cali_re >= AW88399_CALI_RE_MAX) || + (aw_dev->cali_desc.cali_re <= AW88399_CALI_RE_MIN)) return -EINVAL; cali_re = AW88399_SHOW_RE_TO_DSP_RE((aw_dev->cali_desc.cali_re + From patchwork Wed Nov 1 09:02:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: wangweidong.a@awinic.com X-Patchwork-Id: 13442617 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 926FFC4332F for ; Wed, 1 Nov 2023 09:02:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234778AbjKAJCr (ORCPT ); Wed, 1 Nov 2023 05:02:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54424 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234684AbjKAJCn (ORCPT ); Wed, 1 Nov 2023 05:02:43 -0400 Received: from out28-196.mail.aliyun.com (out28-196.mail.aliyun.com [115.124.28.196]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4F869F3; Wed, 1 Nov 2023 02:02:34 -0700 (PDT) X-Alimail-AntiSpam: AC=CONTINUE;BC=0.2838174|-1;CH=green;DM=|CONTINUE|false|;DS=CONTINUE|ham_system_inform|0.0377807-0.000735089-0.961484;FP=12384614467520510894|1|1|6|0|-1|-1|-1;HT=ay29a033018047203;MF=wangweidong.a@awinic.com;NM=1;PH=DS;RN=11;RT=11;SR=0;TI=SMTPD_---.VCeegvs_1698829346; Received: from ubuntu-VirtualBox..(mailfrom:wangweidong.a@awinic.com fp:SMTPD_---.VCeegvs_1698829346) by smtp.aliyun-inc.com; Wed, 01 Nov 2023 17:02:29 +0800 From: wangweidong.a@awinic.com To: lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com, wangweidong.a@awinic.com, liweilei@awinic.com, u.kleine-koenig@pengutronix.de, yang.lee@linux.alibaba.com, nathan@kernel.org, linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH V2 3/3] ASoC: codecs: Modify macro value error Date: Wed, 1 Nov 2023 17:02:10 +0800 Message-ID: <20231101090211.177125-4-wangweidong.a@awinic.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231101090211.177125-1-wangweidong.a@awinic.com> References: <20231101090211.177125-1-wangweidong.a@awinic.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-sound@vger.kernel.org From: Weidong Wang The value of vsense_select should be either 32 or 0 in both cases, so modify the AW88399_DEV_VDSEL_VSENSE macro to 32. Signed-off-by: Weidong Wang --- sound/soc/codecs/aw88399.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/codecs/aw88399.h b/sound/soc/codecs/aw88399.h index 8b3f1e101985..4f391099d0f2 100644 --- a/sound/soc/codecs/aw88399.h +++ b/sound/soc/codecs/aw88399.h @@ -522,7 +522,7 @@ enum { enum { AW88399_DEV_VDSEL_DAC = 0, - AW88399_DEV_VDSEL_VSENSE = 1, + AW88399_DEV_VDSEL_VSENSE = 32, }; enum {