Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp3786032ybb; Mon, 6 Apr 2020 16:00:35 -0700 (PDT) X-Google-Smtp-Source: APiQypJrMi6DbY5T1OIi9fZIlmCxdtzKMnkxsNAOS9Rl2tTsmyoR8r6f7Jbu5KJErp/9HwOhQ1+Y X-Received: by 2002:aca:3101:: with SMTP id x1mr1252288oix.15.1586214035065; Mon, 06 Apr 2020 16:00:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586214035; cv=none; d=google.com; s=arc-20160816; b=ykowMtszMPYRhM5+mrWxcbHy1s62zoa+R7g/9RLTlv0ZZZIehifcyBWFAQlHtpIzuG L+xQKt+bOnzBtARMRJptP3c91r8+o9q+f1cZAyIFNlXCX2OFLOLiYyrBBVT8eCJ+zHNJ 9wqIYx/kVGcOPpfWRzphNT2LPOsz72MADjJcoSYfhJGkA7/tBE0O+/zCKwgST/xs8Hym fd3xvWN2fUX+kRsj+6jmZcpLFDY39wUq6TiSkHVMfcgg49BQlDP3C32kbilDOKBqkQL2 0Q1yzmeRkDyrlEnMqObI5Xrmb5Oi9ge7f3uQK3YJP37aWlVJqvdxjjvFAwriNDm0zKRJ ZClQ== 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=QabBQhlHvDhp4mCqAg3c+5phsRTL1odJr+vofj/Jd6U=; b=MHL7gYkah5Us1y8lxvlLIKfeUohJqYgtTfTdKGGc7HVB3GWHt02xXVPqhKB8uhLNA1 7h7Gv0KisCnhW5eXI27v1Ezuyr67BYIlW1ISUjvsmdfKQTENdOoLCJpW+Jk5+OMbDQVE CwJdqQBGgcmij7TtiDVU9V2uTP2I66EiVf+3B+cOju1cLBK2xhF46vy3vm0yM9AKucK4 8P4Z/IginLoxTgUDn6u2bTQf26XLrzmdPp082LV9J1OUtisGpLyrrLjnAO9wXWDgKfMY dLCv/EwNHOehyUS8LF5aDGwojmIjr3ZTpG7w9IilPmxPQAcVP4LbPuD+7/nR+K3Wq/1u lQpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=N0jnGpAQ; 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 184si8293891oif.56.2020.04.06.16.00.23; Mon, 06 Apr 2020 16:00:35 -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=N0jnGpAQ; 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 S1726416AbgDFW7q (ORCPT + 99 others); Mon, 6 Apr 2020 18:59:46 -0400 Received: from mail-pl1-f193.google.com ([209.85.214.193]:44594 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726230AbgDFW7q (ORCPT ); Mon, 6 Apr 2020 18:59:46 -0400 Received: by mail-pl1-f193.google.com with SMTP id h11so458167plr.11; Mon, 06 Apr 2020 15:59:45 -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=QabBQhlHvDhp4mCqAg3c+5phsRTL1odJr+vofj/Jd6U=; b=N0jnGpAQZkHqM2qyCjOqgHLclBH0mnCHDoPt2hEx5cT4hQMCCfS7llAe9nHscseUpJ M36pwwnl+ap0A9KQ8nuvLFxWLtV9TZRXoNVMF6PLUPb8g90jUoFcpxfghOXwdwslq99v DY9sdaA2//pFIAFXL4OXhjlf4fx9Nk2vmjOOX05h4V/vB9WaZPNmHQL7uukQCasVjF9s f5Tt7K93PUsZ/BEZaB9B+nydUbQVtYFZAFIaqn92j4FsYNs6UnVHT1qnk8q8+kAYRvI3 7/dPM94KZRoOcVwKkd0mkF+XEQm3LgglgAgeSeMlUpD/JfZ4P1cDu+b/49TQI5C6QGQB vtJg== 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=QabBQhlHvDhp4mCqAg3c+5phsRTL1odJr+vofj/Jd6U=; b=Bq5rQRcYf2fq8lqc2ktHrd2rLnWNNssFMYSz3SGZv4EQTx5bvE6/urYokh6TrDyOsK BNhhtpO5CemlERU8ZopR6mMDPv/eL2WctQXqWlCbAhVabuxT0i0g1Vju1kxaoOcmRGqX BfPYD6gH3JNZMo7o/HLhHMT3i/+t+3n4YQlS0kbKdCs9xpv7x7sBBaNjkPUehSTQ03g/ sKp26qNTR69cm/MGM9KcpqIvZYgY2ASGbVDil8Bth3mT1qqAYVJR8RQOd/aBYmLZlwFl ti+YztrMPfRW4GyaxocIlqbpo70LOv3/0W4HK7puP/5lVcPeE2V7QouPLmn9E1xB8Mh6 pCCA== X-Gm-Message-State: AGi0PubpYo2Y1nUM0v+LaeiUmbT7NnwoNr7xHodb5imtMeYPrpAxu3j1 sp3nmmtEIELi2yg56DABJ34= X-Received: by 2002:a17:90b:3c4:: with SMTP id go4mr1656393pjb.162.1586213985103; Mon, 06 Apr 2020 15:59:45 -0700 (PDT) Received: from Asurada-Nvidia.nvidia.com (thunderhill.nvidia.com. [216.228.112.22]) by smtp.gmail.com with ESMTPSA id 66sm12650177pfb.150.2020.04.06.15.59.44 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 06 Apr 2020 15:59:44 -0700 (PDT) Date: Mon, 6 Apr 2020 15:59:49 -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 v6 3/7] ASoC: fsl-asoc-card: Support new property fsl,asrc-format Message-ID: <20200406225949.GB20891@Asurada-Nvidia.nvidia.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 Wed, Apr 01, 2020 at 04:45:36PM +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 Acked-by: Nicolin Chen > --- > 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"); Should warn 'format' over 'width', since it's preferable. > + return ret; Should goto asrc_fail as we did prior to the change. And some of lines are over 80 characters. Let's try this: ret = of_property_read_u32(asrc_np, "fsl,asrc-format", &priv->asrc_format); if (ret) { /* 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 decide output format\n"); goto asrc_fail; } if (width == 24) priv->asrc_format = SNDRV_PCM_FORMAT_S24_LE; else priv->asrc_format = SNDRV_PCM_FORMAT_S16_LE; }