Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp387717ybb; Wed, 1 Apr 2020 01:55:07 -0700 (PDT) X-Google-Smtp-Source: APiQypIcKGYrPdWld3Yx02va1ff25U4it9C6VULlFiToHjgG/etprFG1BAJFhhK73HUQUC+19/JE X-Received: by 2002:aca:3110:: with SMTP id x16mr2111884oix.47.1585731307871; Wed, 01 Apr 2020 01:55:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585731307; cv=none; d=google.com; s=arc-20160816; b=Ax7z4E2kI24ew9KFnMA0BvGjf9hMan9NRzm+Zy9ifyziBSKbCkqCIo4fdihtv3wjHv 9VB575dEHecxJeAjVbFUdfJ95wrTGXzKzdRlXpXrOb3MsUxazqlQFhU9V+6/6E12g0ma yCwBDT2petoIjLvzljz1fAPAeD1DNZX5OGMSlrY2SUqFoyug2MU95fzvNPKVP8Q2da1w spH+VuGArG7YKL2ctULVteoXC5JDN/XDMJdpOAFfitDTacp+pg3KBbs52mwaVquNDU9R qUVBMxOZ0WGAgX68IK5k+QPN+uo0aXrc5OZe9ZpdvkXhb/J4SfMSSSAVQ7cMr7PUoUEP uGyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from; bh=FwZji/T0h6qmmhFHb6qq7z8MnrG4uCpONoEPTf8ELlI=; b=wt8AVDBmBGK/wJQqQJJD3teQvLEkMdA/MxKMc5Yu2Z5jb4V7gdLYHa9PLhdrL94wUh stmfN7HSSYZB2NuVW6a7DzdCKfoBFExioHVdzbPCI79dLpAA8lkh8lRvoY34gfblaSfl HOwqQ3TR2MwNzA1hsAl0bpXBwwbEkSSh9OvXRdCuZOUHIXnDQJaoLZEY/O3bhkYmvYy4 n8b4fSCS4yGFJjH6PYNBEYY7x6MJWI7QHjL83i+U8LpUNPJ1R+S9bxgO5lb5wPTY2LTp KPcwBytKcuhYDbIGCfBDllHrz/1C9h03alSHragQ5zS2fUOtf9oGu/dtJaA2YklGG0K+ nFTQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v18si633037oth.1.2020.04.01.01.54.55; Wed, 01 Apr 2020 01:55:07 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732119AbgDAIxX (ORCPT + 99 others); Wed, 1 Apr 2020 04:53:23 -0400 Received: from inva020.nxp.com ([92.121.34.13]:38162 "EHLO inva020.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732067AbgDAIxX (ORCPT ); Wed, 1 Apr 2020 04:53:23 -0400 Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 47BAB1A0D50; Wed, 1 Apr 2020 10:53:21 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 27CD11A0D44; Wed, 1 Apr 2020 10:53:14 +0200 (CEST) Received: from localhost.localdomain (shlinux2.ap.freescale.net [10.192.224.44]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 58100402D0; Wed, 1 Apr 2020 16:53:05 +0800 (SGT) From: Shengjiu Wang To: timur@kernel.org, nicoleotsuka@gmail.com, Xiubo.Lee@gmail.com, festevam@gmail.com, broonie@kernel.org, alsa-devel@alsa-project.org, lgirdwood@gmail.com, perex@perex.cz, tiwai@suse.com, robh+dt@kernel.org, mark.rutland@arm.com, devicetree@vger.kernel.org Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: [PATCH v6 3/7] ASoC: fsl-asoc-card: Support new property fsl,asrc-format Date: Wed, 1 Apr 2020 16:45:36 +0800 Message-Id: X-Mailer: git-send-email 2.7.4 In-Reply-To: References: In-Reply-To: References: X-Virus-Scanned: ClamAV using ClamSMTP Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In order to align with new ESARC, we add new property fsl,asrc-format. The fsl,asrc-format can replace the fsl,asrc-width, driver can accept format from devicetree, don't need to convert it to format through width. Signed-off-by: Shengjiu Wang --- sound/soc/fsl/fsl-asoc-card.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/sound/soc/fsl/fsl-asoc-card.c b/sound/soc/fsl/fsl-asoc-card.c index bb33601fab84..a0f5eb27d61a 100644 --- a/sound/soc/fsl/fsl-asoc-card.c +++ b/sound/soc/fsl/fsl-asoc-card.c @@ -680,17 +680,20 @@ static int fsl_asoc_card_probe(struct platform_device *pdev) goto asrc_fail; } - ret = of_property_read_u32(asrc_np, "fsl,asrc-width", &width); + ret = of_property_read_u32(asrc_np, "fsl,asrc-format", &priv->asrc_format); if (ret) { - dev_err(&pdev->dev, "failed to get output rate\n"); - ret = -EINVAL; - goto asrc_fail; - } + /* Fallback to old binding; translate to asrc_format */ + ret = of_property_read_u32(asrc_np, "fsl,asrc-width", &width); + if (ret) { + dev_err(&pdev->dev, "failed to get output width\n"); + return ret; + } - if (width == 24) - priv->asrc_format = SNDRV_PCM_FORMAT_S24_LE; - else - priv->asrc_format = SNDRV_PCM_FORMAT_S16_LE; + if (width == 24) + priv->asrc_format = SNDRV_PCM_FORMAT_S24_LE; + else + priv->asrc_format = SNDRV_PCM_FORMAT_S16_LE; + } } /* Finish card registering */ -- 2.21.0