Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp418051ybz; Wed, 15 Apr 2020 11:12:11 -0700 (PDT) X-Google-Smtp-Source: APiQypIChLmRgu49UuMyqvBuo5pBk5vj72Kg0PMugdmlybiDH3Ydke1Ic6+f66QbtULb0xUUhKEZ X-Received: by 2002:a50:9f2a:: with SMTP id b39mr26674516edf.228.1586974331416; Wed, 15 Apr 2020 11:12:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586974331; cv=none; d=google.com; s=arc-20160816; b=M9sgyyiPvVI7FgaQkD57yHyvr3alI/WDkmwaYmvZFHRa7BUZKOkPjNldo+GuHw7Vuh eogTu/yaYqKTId315sjClXWdYLOdxcKJfctH47FFcmayeUN6m4J5AmGWpGbqT2aJW35k teDIrdIVkcVa6dGM7aHSEUNsxy+jeqJX3yWTXBw7KSsaRhGZEHVuYgEjdJBUAwJUvEHH zOw8hbyS40eUOVhm1jKf2ek534vm1jrRRgHsl6iiSn+8hAMxRH77pkoHHklZ8zIM4x8R VQSUVAiw/efs2lQ/Hxit08SzhXcVTfHFBjHFtbWiVBphRiIhsMz4uaMtP1DyBjFqJUMB D47g== 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=va7+xrdc8DgZjXB+uxZ9OqnrqrghamoHTpWt3EWPAFbkRwcl5zV2f2RLoOFeB8OxAl 8nTvET2XQqxn+sU1jTxN/Y2vaxY6saxPF19wHmqY4x5XjhcpPQuZ3kGncGr/aQEIe1LI P4EadUmkGmORnZhndnni4Jrm+D6LQHVZ5TuuJfLkz2A2FWNZKQCpx8WK3lxCtSWOvl/n XhGzsgjeMLuftrOZK11l6cmxDdRm6bOyiVr5DtpdINvRMN5xLWPVzI29LLrvFqQsYiwk 8NKtp+9X+MeosVM7Urn5nuXzYB335rHzumnsxgRL4tZ3ozMaPectBCKgrfee2aCFFUKw 8Vag== 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 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 bi10si12432734edb.465.2020.04.15.11.11.46; Wed, 15 Apr 2020 11:12:11 -0700 (PDT) Received-SPF: pass (google.com: best guess record for 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: best guess record for 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 S2406384AbgDNHFC (ORCPT + 99 others); Tue, 14 Apr 2020 03:05:02 -0400 Received: from inva020.nxp.com ([92.121.34.13]:57340 "EHLO inva020.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2406330AbgDNHEf (ORCPT ); Tue, 14 Apr 2020 03:04:35 -0400 Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id A45721A0315; Tue, 14 Apr 2020 09:04:33 +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 0858C1A031C; Tue, 14 Apr 2020 09:04:28 +0200 (CEST) Received: from localhost.localdomain (shlinux2.ap.freescale.net [10.192.224.44]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 1690D402FC; Tue, 14 Apr 2020 15:04:17 +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 v8 3/7] ASoC: fsl-asoc-card: Support new property fsl,asrc-format Date: Tue, 14 Apr 2020 14:56:03 +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 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