Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1529652ybz; Thu, 16 Apr 2020 10:46:28 -0700 (PDT) X-Google-Smtp-Source: APiQypJFrk44JoQosCp7r6UmR/MEXBevzthnimOgwVxR6iBWf3wJZAQfJMWNNtdlopTEsVh9b3DJ X-Received: by 2002:a50:f699:: with SMTP id d25mr30906471edn.244.1587059187928; Thu, 16 Apr 2020 10:46:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587059187; cv=none; d=google.com; s=arc-20160816; b=W/u4w2s65Ghg4QrKy+MBg+kbOe9/6zAee2wdFFzFqZi0BtvvvcgKC+nWLPQG3klTyo vxK8nm78FyIH8dEPH3LNdrrndy9yJlwajWnRHDYPcKGTUXtoxsx71VGtIlBBOUt4tM/n AHIrFClpV/5r92rZuKi1gEFjIUMT9Jktsa08upAwCsFE9Jv6J78DtsxZVVeSziyjZjdn Wn3nnwvxpQAk51fYxMzeQ5oLSN2O9ldQSbEZm1ksYlX0acnOdTRXKRNDaRMbAOCHga2X 4APUR7pnN71vU95T7UEKeNvy2UoRCZFtrr2WQflyYe+jsaegvYyDC5wxBeB4tbE66k3Q u/dg== 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=1Q6141cD4lWCFNr6ymrSLhyjSjYB+4+6M6LoHD5vTmQ=; b=qGwOT8tafVi6jBDGYbyATx29QiQxMcA9DBUyLLrri/BkmhdooI33ce8yV4SmpoFM3j Kae8WDwDHVVDUR1GKZK6eeHad81xaauWXuN0utUpCDLlxR7Nhe35RzPA8qSiyrqyfGDo RuRiHxN94jzTa27FY3zzPrOysd6ern1jjGKUYCgdveLglbpF0qnuEZH37ixrPrvgZkJk WNhRioY2orqse/VqXlAiA/ZgMK5lnx5qHKVQjfOaFgmWPL6sJA4PCLhNPMdUyBKEFWcV E8Xi8/0xlxySpnMrrIpRcfenCu/Ot3KsNq5ap6GO8e5KzpKf617+OAQ4tlb27ug9Yc/O UWwQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id d10si6135533edq.344.2020.04.16.10.46.05; Thu, 16 Apr 2020 10:46:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S2635743AbgDPMei (ORCPT + 99 others); Thu, 16 Apr 2020 08:34:38 -0400 Received: from inva021.nxp.com ([92.121.34.21]:49834 "EHLO inva021.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2635625AbgDPMeA (ORCPT ); Thu, 16 Apr 2020 08:34:00 -0400 Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 2EA2E200CED; Thu, 16 Apr 2020 14:33:58 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 871BB200CDD; Thu, 16 Apr 2020 14:33:52 +0200 (CEST) Received: from localhost.localdomain (shlinux2.ap.freescale.net [10.192.224.44]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 79EF540307; Thu, 16 Apr 2020 20:33:45 +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 v9 3/7] ASoC: fsl-asoc-card: Support new property fsl,asrc-format Date: Thu, 16 Apr 2020 20:25:33 +0800 Message-Id: <02f53d5512b9acd3492e2acdd5e0ba3113f18009.1587038908.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 Acked-by: Nicolin Chen --- sound/soc/fsl/fsl-asoc-card.c | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/sound/soc/fsl/fsl-asoc-card.c b/sound/soc/fsl/fsl-asoc-card.c index bb33601fab84..cf4feb835743 100644 --- a/sound/soc/fsl/fsl-asoc-card.c +++ b/sound/soc/fsl/fsl-asoc-card.c @@ -680,17 +680,23 @@ 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 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; + 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