Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp2069817ybh; Sun, 8 Mar 2020 21:14:33 -0700 (PDT) X-Google-Smtp-Source: ADFU+vstK9gTDtF7OZ33E5iQvWCA6AtbLgOxbdpGOdfGz2X2hgIedzWtTCsO8GjNymNAGY99Ow13 X-Received: by 2002:aca:ebc5:: with SMTP id j188mr10504124oih.65.1583727273704; Sun, 08 Mar 2020 21:14:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1583727273; cv=none; d=google.com; s=arc-20160816; b=Zuk2l4eQNaaZJerMC5+slQpP3gjfmP4xyzjCqODs4OBZKsy7oQYx5gp0uXwAAeYeaV y9Uy+sW/lkyFaluGEiurr+Yjlh1dVF6KEutTkcVC11X5TJK/xwZo2vB12t3NgPcQz9bT E0L20YouH5Hr5W8ybCFKxOV5n+N6it6abMeX2uF+zleJqPI9o7BMA1A359aiCNKwTOT7 ROIr1DCCy6tvNpzbSWM4RKnutbcUWAzd5gk1pcrnMJJoriIHwE9uDiQnFbxTbOqvKXSF sZnqxc0lhdZW8azrJofBj6h92Ze207BjVwtpoAaiHDjo8vvkyNPTWQOXkpPpR7Or2OLs 0rZw== 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=wCot0H4jQ7Mkbg0AnwxyRaq7nCB4gtM+kSp3xxOXVYY=; b=vt4MVXc1ZDtLt97S0px1FM2NMPDMMB34kWF5DVst9DybBctGtszzPbfyZQxVgf/qb7 hJJbFI8xedjJg4/fiONOnS44/Tm7Mx+ebLWKlv7SEVFTOJfdhyHI8PIkUFIuI1Owv5FV LZujaiea1a/ppgUKECJkQntvw053MMFs1qLgSv91IRlauz7HGjROzWDZI8PrLZFFDYkI AdUaGDuwXzx68J2z0Vw73l5wgj5Ir8z98APcaOZ+DiC+yX4WOo3zp+7M8rquNUHxjnjG NvwZ+JO/FDOMYvAMfrClnV/AhAUJovotqR1THg2lHQZDZx491hdDKdiedbop5h8CKJbe yQfg== 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 r12si5183728otp.98.2020.03.08.21.14.18; Sun, 08 Mar 2020 21:14:33 -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 S1726641AbgCIEFc (ORCPT + 99 others); Mon, 9 Mar 2020 00:05:32 -0400 Received: from inva020.nxp.com ([92.121.34.13]:35004 "EHLO inva020.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726495AbgCIEFb (ORCPT ); Mon, 9 Mar 2020 00:05:31 -0400 Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 0282E1A16FB; Mon, 9 Mar 2020 05:05:30 +0100 (CET) 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 E64F21A1738; Mon, 9 Mar 2020 05:05:22 +0100 (CET) Received: from localhost.localdomain (shlinux2.ap.freescale.net [10.192.224.44]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 52801402A5; Mon, 9 Mar 2020 12:05:14 +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 v5 2/7] ASoC: fsl-asoc-card: Support new property fsl,asrc-format Date: Mon, 9 Mar 2020 11:58:29 +0800 Message-Id: <266dccc836c11165ad91a301f24fe4f7ad2557be.1583725533.git.shengjiu.wang@nxp.com> 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 | 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"); - ret = -EINVAL; - goto asrc_fail; - } + 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