From patchwork Mon Nov 30 03:57:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shengjiu Wang X-Patchwork-Id: 334680 Delivered-To: patch@linaro.org Received: by 2002:a92:5e16:0:0:0:0:0 with SMTP id s22csp4309512ilb; Sun, 29 Nov 2020 20:07:35 -0800 (PST) X-Google-Smtp-Source: ABdhPJxFHgt7uWBQUQa1ZYp6lKkYq+NhSVYc2njqWJGZpzBEUEdlunYkpk3WBcIfgeh/nrjFamnQ X-Received: by 2002:a17:906:e18:: with SMTP id l24mr17385882eji.434.1606709255378; Sun, 29 Nov 2020 20:07:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606709255; cv=none; d=google.com; s=arc-20160816; b=rQm4JdKF/fpi3bsHoUlklo/W7pNNXUlw08HjdStbmgn0b+rKHr+IYxrsCd4ottfR8u 0z74qoDCeoOn4kVsjRryeK+s40mVxlOJx7pNjHhLEUf+nALH69+BKF8RvC3X6rV223ho Nr8JAars334XOHDi+36FWxNhR6kC8/s1U/B1MaAkNgKYB4jy/6es2Whag9PvqU9anX9z 8036MSDFGa+6qLIUZiGcwC4A/2McwGKWxrqMc2cPQKmJ/M3re1BaCWvxvnBTQbyzL7Ua TrxWIJmRJOiRFvKtzCsonymXI4KPrzUZCElWx3ZpI0ScVGsSeQ5RYtiPW5iD1kKY4Qhl Gx/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:to:from; bh=c2b8F171wi0JoVIKZ7NVUuDlBPiGU4poBv19UAkkYto=; b=FJQp6gEGIwYQfd19d/HupLRTDUkmKK+yfZhCTXQ4rVJWSQnu7RYh+GhD6VJCGededf 1pZ3o0UVwhvzotX5rWQuDWNn5uncp3uFwY83/XYXk2eZIiVBsnjnUuMJWklFcH3KxeLq Kb2WfdymGNkfllVwD4MqDOFsw/ky3HnokPbNMMChB6Cauu1hRjE27jqtw2efXa7//c2j WtP7yBK+r/U7fRqDL9gkDD4rvAp7PeP726ENIC70NfpDJxVL49p5yjZn1VDlcalHVIhT vSpN5rs0rrnjyCOhs9bxxbareJokjXc9siXScQQzjFvN7o9LhtcacFpsWM6TRjlxRHX9 /b7g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-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 h24si8845031ejt.452.2020.11.29.20.07.35; Sun, 29 Nov 2020 20:07:35 -0800 (PST) Received-SPF: pass (google.com: domain of devicetree-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 devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-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 S1726312AbgK3EGD (ORCPT + 6 others); Sun, 29 Nov 2020 23:06:03 -0500 Received: from inva021.nxp.com ([92.121.34.21]:39886 "EHLO inva021.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726000AbgK3EGD (ORCPT ); Sun, 29 Nov 2020 23:06:03 -0500 Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 2473C20074A; Mon, 30 Nov 2020 05:05:16 +0100 (CET) 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 0922320073E; Mon, 30 Nov 2020 05:05:11 +0100 (CET) Received: from localhost.localdomain (shlinux2.ap.freescale.net [10.192.224.44]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id C89D540326; Mon, 30 Nov 2020 05:05:04 +0100 (CET) From: Shengjiu Wang To: timur@kernel.org, nicoleotsuka@gmail.com, Xiubo.Lee@gmail.com, festevam@gmail.com, lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com, alsa-devel@alsa-project.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, robh+dt@kernel.org, devicetree@vger.kernel.org Subject: [PATCH 1/2] ASoC: fsl-asoc-card: Add support for si476x codec Date: Mon, 30 Nov 2020 11:57:47 +0800 Message-Id: <1606708668-28786-1-git-send-email-shengjiu.wang@nxp.com> X-Mailer: git-send-email 2.7.4 X-Virus-Scanned: ClamAV using ClamSMTP Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org The si476x codec is used for FM radio function on i.MX6 auto board, it only supports recording function. Signed-off-by: Shengjiu Wang --- sound/soc/fsl/fsl-asoc-card.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) -- 2.27.0 Acked-by: Nicolin Chen diff --git a/sound/soc/fsl/fsl-asoc-card.c b/sound/soc/fsl/fsl-asoc-card.c index a2dd3b6b7fec..f62f81ceab0d 100644 --- a/sound/soc/fsl/fsl-asoc-card.c +++ b/sound/soc/fsl/fsl-asoc-card.c @@ -131,6 +131,13 @@ static const struct snd_soc_dapm_route audio_map_tx[] = { {"CPU-Playback", NULL, "ASRC-Playback"}, }; +static const struct snd_soc_dapm_route audio_map_rx[] = { + /* 1st half -- Normal DAPM routes */ + {"CPU-Capture", NULL, "Capture"}, + /* 2nd half -- ASRC DAPM routes */ + {"ASRC-Capture", NULL, "CPU-Capture"}, +}; + /* Add all possible widgets into here without being redundant */ static const struct snd_soc_dapm_widget fsl_asoc_card_dapm_widgets[] = { SND_SOC_DAPM_LINE("Line Out Jack", NULL), @@ -653,6 +660,11 @@ static int fsl_asoc_card_probe(struct platform_device *pdev) priv->cpu_priv.slot_width = 32; priv->card.dapm_routes = audio_map_tx; priv->card.num_dapm_routes = ARRAY_SIZE(audio_map_tx); + } else if (of_device_is_compatible(np, "fsl,imx-audio-si476x")) { + codec_dai_name = "si476x-codec"; + priv->dai_fmt |= SND_SOC_DAIFMT_CBS_CFS; + priv->card.dapm_routes = audio_map_rx; + priv->card.num_dapm_routes = ARRAY_SIZE(audio_map_rx); } else { dev_err(&pdev->dev, "unknown Device Tree compatible\n"); ret = -EINVAL; @@ -869,6 +881,7 @@ static const struct of_device_id fsl_asoc_card_dt_ids[] = { { .compatible = "fsl,imx-audio-wm8960", }, { .compatible = "fsl,imx-audio-mqs", }, { .compatible = "fsl,imx-audio-wm8524", }, + { .compatible = "fsl,imx-audio-si476x", }, {} }; MODULE_DEVICE_TABLE(of, fsl_asoc_card_dt_ids);