From patchwork Wed May 15 13:18:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Brunet X-Patchwork-Id: 164299 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp750028ili; Wed, 15 May 2019 06:19:13 -0700 (PDT) X-Google-Smtp-Source: APXvYqyIhoOK6fi88JzJi7+b27fmUEzTr3B6U5ySFbDG6VLiF0sy3V46rlDMYyLL1bcIYgHQSWYA X-Received: by 2002:a65:6282:: with SMTP id f2mr43925568pgv.152.1557926353363; Wed, 15 May 2019 06:19:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557926353; cv=none; d=google.com; s=arc-20160816; b=ZXmqoCL3T/sbfBTiFJOuuqEEU3k5TkP3A8hi0x48QMcP0BSrJRvHhEri+XoPN9nYBQ T4n5Hp0CqeUA7ZXEjxVNzjllOOUK5Gfp7OU6FOiA+MilX8oCfTfqFu7fYrO+EvVPN5GJ uRRl2U2+1X5yT4U+G+Yx9rvxVKha4G4PzzFQeBU3UmVi/f2mrtW5bjfnN/l8TY5yqeId 4+p+/K5eED5/yaOrbUzpnXJoKqdgXqEe+4vdvDsu3YnMyabCxAFa5Nq1OZVq7W8Yok3d YY6qEMC/zGaWfIzwb3+6tdjYhEHbq9S5JWPZaEUcugKWD1LxVdm0xnaH9KLHES0Too6y 6nWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=bgxe1GRX/w2wrtefgULdeMfRiILdFJq82pUWP1dCMsw=; b=ssjCrMBJ4h26FQatNl+g5tAeYdB5PoAaVT7gafnp8+zhUUaBsdEbyiarl+JhCz8dhA v06pRipH6yPbaSV+Z33FzEQZfNKLVRZLyBSdq4UNmTGX69ZhxzRri77cmXS4aH4c7DEf awzaEk2QfmSsSn+odQ/3joKn8pG45Zdz9GTjpYxlnCnnTuZ3eW6Smfcnvey6TBLNIO2x oTj0Ic+jyYk2nJP+wWrPs/JOXHuHFVOv6/hB//OHLA+1rvT1RIi1lZCNVMAuXAXgUKX3 jkv+4ANcRSoxF9ra4yOV6utJPihfXKRgCHoPUpkw/XpWF2PG7isWxagWJn2Kv8TwCPkh XGBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=yMl0eoA6; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j10si1909969pgj.87.2019.05.15.06.19.13; Wed, 15 May 2019 06:19:13 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of devicetree-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=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=yMl0eoA6; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728057AbfEONTM (ORCPT + 7 others); Wed, 15 May 2019 09:19:12 -0400 Received: from mail-wm1-f67.google.com ([209.85.128.67]:39608 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728006AbfEONTJ (ORCPT ); Wed, 15 May 2019 09:19:09 -0400 Received: by mail-wm1-f67.google.com with SMTP id n25so2443952wmk.4 for ; Wed, 15 May 2019 06:19:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=bgxe1GRX/w2wrtefgULdeMfRiILdFJq82pUWP1dCMsw=; b=yMl0eoA65BOO2y5I3UtLa9IGCL5g/V97Lh8F7pAYnMofU0OqB+DIOWkgA2URKybltp H7qbZR+c/pQ5kg8Jh64jQWDo3qjvnPG5gXyHa1RJQEKTLZfVemrF0Ar/ngXN5HpkQa6X 5KOSaON+QtfoQeSlXGJyzu0XWA3OzS1TPtloWRjxcSGfHYcOeaOhjxuJxfjypNfj0Qdb ycBdmXHDROw1d4BPZCaRserlLAhGbSb+L1o3j1Ky7n9KyiOytriN3Pj+KsBu2u03vCX4 0Lyf6UnNjgpbUvuHwezCqrLu9sFkfWKa0YzOGa1HjNyARC0N3+KMc6ai62nlzhSuD9uR Pbrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=bgxe1GRX/w2wrtefgULdeMfRiILdFJq82pUWP1dCMsw=; b=IQPQP7B4Ubp7PiW0dtw04jkSJtc03BagHnQBL9fI+SWBWT7plfaUqlurtXI/CoJ7OW kirqq/7JjPD0q+8rmFUyl1CQPv/XNu2rfA2jYsiEIPmZn5dLTQD5XQmFU9Mapq9MTTdg /68VstZYvHFz12u36cyG2QetbDSGnC7DDBgpvcpoXU8GjBrnqyYfLZ9g01dBxHkbYKjb MLWcRiybcTC05iXSKXP5XxegApLyyGIIYtKAp2fzQscCS1dDYMt60c9XEocVleNJUJbA pEXYFDCz02ESWC6P1kgfwd7D6DTyjaJOfrW6jg7yGPHyXEd77z1J6QRCI3aMT/AmTgtf g5UA== X-Gm-Message-State: APjAAAXrfQKesQW1/by9FG6knYMz9SIsTF/DQRMykB8PpXudY64CmcOT CG2jdc/2PSNE5337biK2J8E92g== X-Received: by 2002:a7b:c549:: with SMTP id j9mr722446wmk.122.1557926347157; Wed, 15 May 2019 06:19:07 -0700 (PDT) Received: from boomer.local (lmontsouris-657-1-212-31.w90-63.abo.wanadoo.fr. [90.63.244.31]) by smtp.googlemail.com with ESMTPSA id b206sm2789848wmd.28.2019.05.15.06.19.06 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 15 May 2019 06:19:06 -0700 (PDT) From: Jerome Brunet To: Mark Brown , Liam Girdwood , Kevin Hilman Cc: Jerome Brunet , alsa-devel@alsa-project.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-amlogic@lists.infradead.org Subject: [PATCH 4/5] ASoC: meson: axg-card: add basic codec-to-codec link support Date: Wed, 15 May 2019 15:18:57 +0200 Message-Id: <20190515131858.32130-5-jbrunet@baylibre.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190515131858.32130-1-jbrunet@baylibre.com> References: <20190515131858.32130-1-jbrunet@baylibre.com> MIME-Version: 1.0 X-Patchwork-Bot: notify Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Add basic support for codec-to-codec link in the axg sound card. The cpu side of these links is expected to properly set the hw_params and format of the link. ATM, only the tohdmitx glue is supported but others (like the internal DAC glue) should follow. Signed-off-by: Jerome Brunet --- sound/soc/meson/axg-card.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) -- 2.20.1 diff --git a/sound/soc/meson/axg-card.c b/sound/soc/meson/axg-card.c index 5c8deee8d512..db0a7fc18928 100644 --- a/sound/soc/meson/axg-card.c +++ b/sound/soc/meson/axg-card.c @@ -29,6 +29,18 @@ struct axg_dai_link_tdm_data { struct axg_dai_link_tdm_mask *codec_masks; }; +/* + * Base params for the codec to codec links + * Those will be over-written by the CPU side of the link + */ +static const struct snd_soc_pcm_stream codec_params = { + .formats = SNDRV_PCM_FMTBIT_S24_LE, + .rate_min = 5525, + .rate_max = 192000, + .channels_min = 1, + .channels_max = 8, +}; + #define PREFIX "amlogic," static int axg_card_reallocate_links(struct axg_card *priv, @@ -517,6 +529,11 @@ static int axg_card_cpu_is_tdm_iface(struct device_node *np) return of_device_is_compatible(np, PREFIX "axg-tdm-iface"); } +static int axg_card_cpu_is_codec(struct device_node *np) +{ + return of_device_is_compatible(np, PREFIX "g12a-tohdmitx"); +} + static int axg_card_add_link(struct snd_soc_card *card, struct device_node *np, int *index) { @@ -540,6 +557,8 @@ static int axg_card_add_link(struct snd_soc_card *card, struct device_node *np, if (axg_card_cpu_is_tdm_iface(dai_link->cpu_of_node)) ret = axg_card_parse_tdm(card, np, index); + else if (axg_card_cpu_is_codec(dai_link->cpu_of_node)) + dai_link->params = &codec_params; return ret; }