From patchwork Wed Jul 24 16:23:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Brunet X-Patchwork-Id: 169613 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp10464656ilk; Wed, 24 Jul 2019 09:24:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqxh1L5HIZhBOZglTXRXujTFVQjgAd3+Lx0dmvkncLzJF+Qvoy2c7zSKxsPN1JZhQKtVQaxJ X-Received: by 2002:a63:211c:: with SMTP id h28mr81989446pgh.438.1563985452795; Wed, 24 Jul 2019 09:24:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563985452; cv=none; d=google.com; s=arc-20160816; b=gAZ/VJH5+hs8vtX0axbFhK/bJwayndYYQoicwQLbjNNoCro/DrqRHQawR8v3NESavZ Ekf0X/zsTJcEG+40wKyHkgbhakkrjm9uQEZPzBEP5tRb5Ja4HS1fC8TQacRtYJM99gFr N6RgZp4UHg9/yyz9N6eULPqJrkfxiBv72HppIQt456Nc27P64gv0JnHqmWZtRlyq+oBe UYYehYNgn0FA1haVt1KZbySIRTwCqlYol2jLfSqPmXKuPflGvo0XaCdounJqzsQmgdQ4 EJNxAHLow0iJInhvKgJGpCxOXilU52uWJ3fxlCowburhmh5eoM/SFXMhwHUMhLHw6CXA OC/w== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=rscQz3KUGOpkCDKHMcXdQe7Cl/GoBVV86V2E9kxxK1s=; b=v5GxHirzSRTnl4S7tUMnfu1qzDRQP1TBVKjwLgPC8lOHDMfJZCYQY9Bg51Nurz26sU cAuT58tDnPKQ5+xp7/n1IETLfhaxU1FWB8k87yvJUIt33KC7Sn1Vjgke+rRkuAuEy2F/ xsfSy2vnYHwcEwVe9h6MU0NmETFNKooZ6ZSxCJQFVSg/EWxoyu9A69ZcAYrjEBoQU0fh GYB2FW9PRfCLduHNt/UOMw4Nx9pgLK/OG5xtp0Y1kPh+JxP7VjdzmI1jz+qFOLRidOf0 DtWSMKVeU5UDnJNllfTAv+W8TeeJUEyph10UpmOuaAqi3TTbB+m2Ri7/ISeCk5o6roSc xw4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b="jITz/uDE"; 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 f4si14879767pgg.334.2019.07.24.09.24.12; Wed, 24 Jul 2019 09:24:12 -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="jITz/uDE"; 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 S1728752AbfGXQYM (ORCPT + 8 others); Wed, 24 Jul 2019 12:24:12 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:46543 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726004AbfGXQYL (ORCPT ); Wed, 24 Jul 2019 12:24:11 -0400 Received: by mail-wr1-f66.google.com with SMTP id z1so47622379wru.13 for ; Wed, 24 Jul 2019 09:24:10 -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:mime-version :content-transfer-encoding; bh=rscQz3KUGOpkCDKHMcXdQe7Cl/GoBVV86V2E9kxxK1s=; b=jITz/uDE43k3A8NB1nlk3u+xzG/Y0MTElmt4Smge4Q7/p2i4AQP+Ot+lzFSbs47nGs nn730d5rJ1NTniNhwvL69qjT1i8otT5IErkH1IiOMTNxW24JI06varqHToVixQg9jubW apzUCJPFyUzn7NKyoVzr34ZHbOSBLFFqurZhsZcz1QT5CYE5yCVjRWij5XwCt1SsMLH6 gO3Jx9ohRvjRTh/gNM246+tC38Ty8u7M+KUP7nIZiB3NUacjKhIFZsBmuWhWZ1skiHep HHskYmreyeF6CvNKUjIf88ehFvrMJu1k0LGqCrX+Itgq1xAhb/3oczCVjg1ktXi2w5x3 +efA== 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:mime-version :content-transfer-encoding; bh=rscQz3KUGOpkCDKHMcXdQe7Cl/GoBVV86V2E9kxxK1s=; b=MEW2PH7iAktwOgCVsmrOoeXTUupKglS6S9pTOqc/H/YW7esYssoEQYlMTysNJOsPuV +42oTQv15Lscn0r1OTCEoJlmFEhtqZvFrONpXeE+EPV03ZhS3NH8W7MePxrZwGquitvi hnZSpwenP/IY4mKkFUdY3p/jpbGbrsaapykS82k0d2wo3QpELIRi+FN7V6V0TI6LrH0s DGou2J0HK3WpUNFhIv809oi8eKxJ9bbihemK9vpapAU9MrmfDBcFG1MwZYiMj460/zUw lXZ9270ERqb7QaA5YzfdTxhn5WuV+VzbAdN/6rXN5wKYHIi+2lGORIRPn1JhHZjXs5sc 3LZQ== X-Gm-Message-State: APjAAAWfPjg8XZRhuUaEungoWLUFqoeKgQlI/w4Oulyk4o/nnfQuU6Do asYr1cFOSH8iC27gAimfwEziRA== X-Received: by 2002:adf:8bc2:: with SMTP id w2mr5964754wra.7.1563985449460; Wed, 24 Jul 2019 09:24:09 -0700 (PDT) Received: from starbuck.baylibre.local (lmontsouris-657-1-212-31.w90-63.abo.wanadoo.fr. [90.63.244.31]) by smtp.googlemail.com with ESMTPSA id f70sm55688960wme.22.2019.07.24.09.24.08 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 24 Jul 2019 09:24:08 -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 0/6] ASoC: improve codec to codec link support Date: Wed, 24 Jul 2019 18:23:59 +0200 Message-Id: <20190724162405.6574-1-jbrunet@baylibre.com> X-Mailer: git-send-email 2.21.0 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 As explained in this previous series [0], on Amlogic, we are using codec to codec links to deal with the glue which is between the i2s backends and the synopsys hdmi controller. This worked well until I tried to .get_eld() support in the dw-hdmi-i2s driver. Doing so adds channel mapping controls to the codec. This shown several problem 1) .pcm_new() is not called on codec to codec links. struct snd_soc_pcm_runtime do not even have a valid .pcm 2) struct snd_pcm_substream and struct snd_pcm_runtime are ephemeral This is a problem if a control needs to access them The goal of this patchset is to resolve the above issues and improve the codec to codec link support enough to correctly handle the hdmi-codec The support of these codec to codec links could probably be improved in the future to behave like any other link and use soc_pcm_open(), soc_pcm_hw_params(), etc... The challenge lies in the dapm mutex. The soc_pcm call dapm function locking this mutex but the dapm mutex is already held in snd_soc_dai_link_event() [0]: https://lkml.kernel.org/r/20190515131858.32130-1-jbrunet@baylibre.com Jerome Brunet (6): ASoC: codec2codec: run callbacks in order ASoC: codec2codec: name link using stream direction ASoC: codec2codec: deal with params when necessary ASoC: create pcm for codec2codec links as well ASoC: codec2codec: remove ephemeral variables ASoC: codec2codec: fill some of the runtime stream parameters sound/soc/soc-core.c | 42 +++------- sound/soc/soc-dapm.c | 186 +++++++++++++++++++++++++++---------------- sound/soc/soc-pcm.c | 35 +++++++- 3 files changed, 162 insertions(+), 101 deletions(-) -- 2.21.0