Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp2843229ybh; Mon, 9 Mar 2020 14:19:00 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtRC3scwuB4QQSAMGQpj7JU1Al2bm4EZ8kqu15rODa/LcIT1mweL80D1tWjgcnCjJsqLZGK X-Received: by 2002:aca:3544:: with SMTP id c65mr833870oia.160.1583788740764; Mon, 09 Mar 2020 14:19:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1583788740; cv=none; d=google.com; s=arc-20160816; b=SUrWglTL4c65GwO69+P9rZRe2GqkiOdPROMF0tCA3skIVn14WyCgp3DBEn2/KAk0ed wTXEbr3+rKtwPHPuDB7Z/G9hXKgJsbALvpCt22VcKr5Cc/GXEQ+rZwf3XwLS+YdQB09+ +8hJjAC+ulcz3YxbIs/C3+28PRLpR5bs/sJ54Ch3vGFX7BJLLdwM1yej4Dgb1uhtetvf XKctb9WE+G9fSaoPMtptIw2Y8u7YYbJZxYm0aExsBSQ0p7C4V5cDSzRL12di/wt+Gg9k 7WAjgCMANzeh4/LC/76Xq8ZioLGvhYpeqyWkD6ojWRSm+ywOzRldyv7PHQGqh9GYT3Vs a5OQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=75BMaXcAmO4F5Wh+UkrqpyAJEuiai75tQOLAGLzUruc=; b=j62UZT35ODbSE7ITO8nmhguqWnT/rfsZmPx4In77q7uq/QvMiiPTdzvKtNQR0SmZrB IoMbkyzkhP5xese7uax0akTMQTXayVLWf5CvrJH/9ZkUoGaD6tCBQpInSu8OOvSl22vW L3k890pkFv9SohSiqNrdEMuibPfuslrawLLn1fpjRKASWGTmrfugJNoCgjFMEB57FcV1 z9saV9mEBFfmrTGSs6uucpftcIYNkcry4OP4yXONDQxS4LbzoMtRXVlgzEI3yBM8br58 hs9u+Yh14kmdE0w3ZiW7nBjnuc/uABDouiRpNmIHHS2VWAINC6a7BSy6x7+4DlmrbgxG 1i6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Mc3f2TGu; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t18si6614633otc.192.2020.03.09.14.18.44; Mon, 09 Mar 2020 14:19:00 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Mc3f2TGu; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726508AbgCIVS0 (ORCPT + 99 others); Mon, 9 Mar 2020 17:18:26 -0400 Received: from mail-pl1-f195.google.com ([209.85.214.195]:38435 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726157AbgCIVS0 (ORCPT ); Mon, 9 Mar 2020 17:18:26 -0400 Received: by mail-pl1-f195.google.com with SMTP id w3so4520021plz.5; Mon, 09 Mar 2020 14:18:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=75BMaXcAmO4F5Wh+UkrqpyAJEuiai75tQOLAGLzUruc=; b=Mc3f2TGua+mzWZqhqcBFy8xGR4f62bMfkZ533/dtz8uiLUdJhj/KUeALKn1cfWNrgL fIQti2Sr9jF85Y+rnxx4+60P16SUP3noRF2AljLUI1D2TFMmP1bonRiTwzjx4xNJ9Qwe 5ZwVhdVsIL82iYY0GFFZP9ck6Ccro9zA/NCVMYqPyiZzOtN5c7Gv+TLxZguS9lB7Xon4 hDadFff6ReYzd5WneH3sHbliE6rYSdrwuC0imPmRhArAKnt1MskwGQAGVLXRnAlhKQtL kwBImHlUMMDcum7ZL8MZBJ/YPV3RAGp0y3mQHGzC9a7UWHTJnrktv2CJw6iWWZrfotr5 SlVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=75BMaXcAmO4F5Wh+UkrqpyAJEuiai75tQOLAGLzUruc=; b=es/4Wbht8DaJxxvMiMaa35I1G40wlVuWeZavxp9DNxEds2cFBV+F70eJtjTuEv+Ct2 i/i6jYnfO6Y4eONLgCmGFOliLUVI52U1muyHEaU/+9gEeGmAMxQ4ggVqNOVM+AtSqhVA pAh1pmbcA15Zg9kTtRzCqfKME4u2GIvchg8+hvJJ2Cw0iBWWXvS2Y4fzU8wvBxhK5CPG wJLhOF/aMnliY2tEraLZB1g4sPMUN3N1BDwOGAikwjFaQqCqzDj2Sup/DNZndcbms1Ho yXEbOOkHz9VzkWeW5eumZcQRuGfg+hiINPM1h35sCo9PuA7CEaXMynjBYMd4JPb5lvX1 pnvA== X-Gm-Message-State: ANhLgQ2fY0+KSU9ELtKJ2eHE22yub4lKCBGBTJhaRWXByKTovFU+GBdj tIy4UC4B7BjcF9RaEoGgcNg= X-Received: by 2002:a17:902:864a:: with SMTP id y10mr17943042plt.2.1583788704865; Mon, 09 Mar 2020 14:18:24 -0700 (PDT) Received: from Asurada-Nvidia.nvidia.com (thunderhill.nvidia.com. [216.228.112.22]) by smtp.gmail.com with ESMTPSA id u24sm44614851pgo.83.2020.03.09.14.18.23 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 09 Mar 2020 14:18:24 -0700 (PDT) Date: Mon, 9 Mar 2020 14:18:32 -0700 From: Nicolin Chen To: Shengjiu Wang Cc: timur@kernel.org, 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, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v5 2/7] ASoC: fsl-asoc-card: Support new property fsl,asrc-format Message-ID: <20200309211831.GA11333@Asurada-Nvidia.nvidia.com> References: <266dccc836c11165ad91a301f24fe4f7ad2557be.1583725533.git.shengjiu.wang@nxp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <266dccc836c11165ad91a301f24fe4f7ad2557be.1583725533.git.shengjiu.wang@nxp.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Mar 09, 2020 at 11:58:29AM +0800, Shengjiu Wang wrote: > 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 | 20 +++++++++++--------- > 1 file changed, 11 insertions(+), 9 deletions(-) > > diff --git a/sound/soc/fsl/fsl-asoc-card.c b/sound/soc/fsl/fsl-asoc-card.c > index 9ce55feaac22..32101b9a37b9 100644 > --- a/sound/soc/fsl/fsl-asoc-card.c > +++ b/sound/soc/fsl/fsl-asoc-card.c > @@ -680,17 +680,19 @@ 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"); Nice that your patch fixed my copy-n-paste typo here :) > - ret = -EINVAL; > - goto asrc_fail; > - } It'd be nicer to have a line of comments: /* 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; > + }