From nobody Thu Oct 31 00:23:20 2024 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 CE79FCD54AF for ; Tue, 19 Sep 2023 11:06:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232156AbjISLGK (ORCPT ); Tue, 19 Sep 2023 07:06:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53824 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232183AbjISLFq (ORCPT ); Tue, 19 Sep 2023 07:05:46 -0400 Received: from out28-169.mail.aliyun.com (out28-169.mail.aliyun.com [115.124.28.169]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6BFC7CD3; Tue, 19 Sep 2023 03:58:16 -0700 (PDT) X-Alimail-AntiSpam: AC=CONTINUE;BC=0.08387548|-1;CH=green;DM=|CONTINUE|false|;DS=CONTINUE|ham_system_inform|0.0174443-0.000300907-0.982255;FP=0|0|0|0|0|-1|-1|-1;HT=ay29a033018047194;MF=wangweidong.a@awinic.com;NM=1;PH=DS;RN=27;RT=27;SR=0;TI=SMTPD_---.Uj4ESJm_1695121085; Received: from ubuntu-VirtualBox..(mailfrom:wangweidong.a@awinic.com fp:SMTPD_---.Uj4ESJm_1695121085) by smtp.aliyun-inc.com; Tue, 19 Sep 2023 18:58:12 +0800 From: wangweidong.a@awinic.com To: lgirdwood@gmail.com, broonie@kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, perex@perex.cz, tiwai@suse.com, wangweidong.a@awinic.com, rf@opensource.cirrus.com, herve.codina@bootlin.com, shumingf@realtek.com, ryans.lee@analog.com, 13916275206@139.com, linus.walleij@linaro.org, ckeepax@opensource.cirrus.com, povik+lin@cutebit.org, harshit.m.mogalapalli@oracle.com, arnd@arndb.de, yijiangtao@awinic.com, yang.lee@linux.alibaba.com, liweilei@awinic.com, u.kleine-koenig@pengutronix.de, colin.i.king@gmail.com, trix@redhat.com, alsa-devel@alsa-project.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH V4 5/7] ASoC: codecs: Modify i2c name and parameter transmission methodls Date: Tue, 19 Sep 2023 18:57:22 +0800 Message-ID: <20230919105724.105624-6-wangweidong.a@awinic.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230919105724.105624-1-wangweidong.a@awinic.com> References: <20230919105724.105624-1-wangweidong.a@awinic.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Weidong Wang Modify aw888395_smartpa to aw88395 in order to align with the awinic,aw88395.yaml file Modify the transmission method of parameters. Signed-off-by: Weidong Wang --- sound/soc/codecs/aw88395/aw88395.c | 9 ++++----- sound/soc/codecs/aw88395/aw88395.h | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/sound/soc/codecs/aw88395/aw88395.c b/sound/soc/codecs/aw88395/= aw88395.c index 9dcd75dd799a..77227c8f01f6 100644 --- a/sound/soc/codecs/aw88395/aw88395.c +++ b/sound/soc/codecs/aw88395/aw88395.c @@ -175,9 +175,8 @@ static int aw88395_profile_info(struct snd_kcontrol *kc= ontrol, { struct snd_soc_component *codec =3D snd_soc_kcontrol_component(kcontrol); struct aw88395 *aw88395 =3D snd_soc_component_get_drvdata(codec); - const char *prof_name; - char *name; - int count; + char *prof_name, *name; + int count, ret; =20 uinfo->type =3D SNDRV_CTL_ELEM_TYPE_ENUMERATED; uinfo->count =3D 1; @@ -196,8 +195,8 @@ static int aw88395_profile_info(struct snd_kcontrol *kc= ontrol, name =3D uinfo->value.enumerated.name; count =3D uinfo->value.enumerated.item; =20 - prof_name =3D aw88395_dev_get_prof_name(aw88395->aw_pa, count); - if (!prof_name) { + ret =3D aw88395_dev_get_prof_name(aw88395->aw_pa, count, &prof_name); + if (ret) { strscpy(uinfo->value.enumerated.name, "null", strlen("null") + 1); return 0; diff --git a/sound/soc/codecs/aw88395/aw88395.h b/sound/soc/codecs/aw88395/= aw88395.h index 8036ba27f68d..c2a4f0cb8cd5 100644 --- a/sound/soc/codecs/aw88395/aw88395.h +++ b/sound/soc/codecs/aw88395/aw88395.h @@ -16,7 +16,7 @@ =20 #define AW88395_DSP_16_DATA_MASK (0x0000ffff) =20 -#define AW88395_I2C_NAME "aw88395_smartpa" +#define AW88395_I2C_NAME "aw88395" =20 #define AW88395_RATES (SNDRV_PCM_RATE_8000_48000 | \ SNDRV_PCM_RATE_96000) --=20 2.41.0