From patchwork Mon Jul 16 14:30:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 142026 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp2496150ljj; Mon, 16 Jul 2018 07:31:01 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdSly9yd76e56S3w5yK9uJ9UllVK7kHLbxpwOArIGPCiuZUht38vvKZ9ULrLXRyTCTkR8Gf X-Received: by 2002:a1c:b756:: with SMTP id h83-v6mr10746721wmf.8.1531751461856; Mon, 16 Jul 2018 07:31:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531751461; cv=none; d=google.com; s=arc-20160816; b=QTcB0ot+TgmIEoka+0kPfsBKBITypt6rg5GPn1kVCHwDpjYldF4I/Tq39d2U9rD4R0 QehRJ8ck0t9jGwbTqXJAiQ3FGzlC5bvSzwEURzT6llkBNv7EbcFOP4ZCPCEBNH1HhFi8 NAuGF85noNDabI1RmQfwkO/aLy+S0DlWaban+aHWr409EgN3q5RtO7K76R+XdjpvADe6 IQ0iGGBF0SfWyft27l9l2+l/6U0eoPaeDDASo4gmvucsDG0pWkgsgAHsmwnEs4iLYgEf qG9+TaA4djuVCiEVIIvPeVYAsk4ZVUQEhWCFyWBFsN6Uz/j35mZJDNFAAzVEpLXUi9hE p5yw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:date:message-id:in-reply-to:to:from :dkim-signature:delivered-to:arc-authentication-results; bh=rEaGFLo07JneC6a1yhhyrvkylhk4IP0azjC8b0yXgJ4=; b=BufYrgptH9fx3pMvNF+gy4w/2Z7HkNe4Xdl2+WVolNp1vcbIZNDgPE/7rIstA4nWjJ iVctmd92s1H9SdJliy/GbJ+/sXmdYK7vfj4PUHVvvoNs5HexfLdfZuQK8PRrurI1RQV7 0RjClx9U9MAbN03pJ1bnFDZjjRY7g6jh6L1PRptzKPied6ax/Dvmm7qWoW8Xk7L1H7hx VRCtaldgqoFjrUUfjpMEYNwtOM+HG7VgbIIjZmf6eF9pG5/eJm8cnJpXeNxPDXJ0SxCn 22QmI9y95u2iKaRSHh3GflWiRW4yRXBmmUk2TbkbNDPIPZLgvnShCscNsZ2/gft0vPC5 0OUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=XNlBQPqt; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from alsa0.perex.cz (alsa0.perex.cz. [77.48.224.243]) by mx.google.com with ESMTP id c14-v6si28067442wrn.202.2018.07.16.07.31.01; Mon, 16 Jul 2018 07:31:01 -0700 (PDT) Received-SPF: pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) client-ip=77.48.224.243; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=XNlBQPqt; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id AAFA1267766; Mon, 16 Jul 2018 16:31:00 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 8FA7F267762; Mon, 16 Jul 2018 16:30:57 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=disabled version=3.4.0 Received: from heliosphere.sirena.org.uk (heliosphere.sirena.org.uk [172.104.155.198]) by alsa0.perex.cz (Postfix) with ESMTP id 916B4267750 for ; Mon, 16 Jul 2018 16:30:54 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sirena.org.uk; s=20170815-heliosphere; h=Date:Message-Id:In-Reply-To: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:References: List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner: List-Archive; bh=K7G0gVwv93ISqbHJHVs3vfsWy7UExkeTCvHMCXz70kQ=; b=XNlBQPqt5+Vl DB8PvCKWqM8i+gu80oWHsnkejDw7840relWcYstdr/fuTjNF4J2RbGzAg+rIbFPyRhsqEAI1UA8D2 r4Zn2Yu7qKhuhkTkA/tFEuxlOPFww8zYkW3XH9P2vXfPbnijtFsjtzwZcXEOmxYwdTFBSBHYOKogW fpUr4=; Received: from debutante.sirena.org.uk ([2001:470:1f1d:6b5::3] helo=debutante) by heliosphere.sirena.org.uk with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1ff4Wa-0000OQ-Bo; Mon, 16 Jul 2018 14:30:52 +0000 Received: from broonie by debutante with local (Exim 4.91) (envelope-from ) id 1ff4WZ-0005Wb-U6; Mon, 16 Jul 2018 15:30:51 +0100 From: Mark Brown To: Russell King In-Reply-To: Message-Id: Date: Mon, 16 Jul 2018 15:30:51 +0100 Cc: alsa-devel@alsa-project.org, Mark Brown Subject: [alsa-devel] Applied "ASoC: hdmi-codec: fix routing" to the asoc tree X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org The patch ASoC: hdmi-codec: fix routing has been applied to the asoc tree at https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted. You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed. If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced. Please add any relevant lists and maintainers to the CCs when replying to this mail. Thanks, Mark >From d30e23d69981a4b665f5ce8711335df986576389 Mon Sep 17 00:00:00 2001 From: Russell King Date: Sat, 14 Jul 2018 16:01:06 +0100 Subject: [PATCH] ASoC: hdmi-codec: fix routing Commit 943fa0228252 ("ASoC: hdmi-codec: Use different name for playback streams") broke hdmi-codec's routing between it's output "TX" widget and the S/PDIF or I2S streams by renaming the streams. Whether an error occurs or not is dependent on whether there is another widget called "Playback" registered by some other component - if there is, that widget will be (incorrectly) bound to the HDMI codec's "TX" output widget. If we end up connecting "TX" incorrectly, it can result in components not being started, causing no audio output. Since the I2S and S/PDIF streams now have different names, we can't use a static route at component level to describe the relationship, so arrange to dynamically create the route when the DAI driver is probed. Fixes: 943fa0228252 ("ASoC: hdmi-codec: Use different name for playback streams") Signed-off-by: Russell King Signed-off-by: Mark Brown --- sound/soc/codecs/hdmi-codec.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) -- 2.18.0.rc2 _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel diff --git a/sound/soc/codecs/hdmi-codec.c b/sound/soc/codecs/hdmi-codec.c index 6fa11888672d..3e5b12de71bb 100644 --- a/sound/soc/codecs/hdmi-codec.c +++ b/sound/soc/codecs/hdmi-codec.c @@ -291,10 +291,6 @@ static const struct snd_soc_dapm_widget hdmi_widgets[] = { SND_SOC_DAPM_OUTPUT("TX"), }; -static const struct snd_soc_dapm_route hdmi_routes[] = { - { "TX", NULL, "Playback" }, -}; - enum { DAI_ID_I2S = 0, DAI_ID_SPDIF, @@ -689,9 +685,23 @@ static int hdmi_codec_pcm_new(struct snd_soc_pcm_runtime *rtd, return snd_ctl_add(rtd->card->snd_card, kctl); } +static int hdmi_dai_probe(struct snd_soc_dai *dai) +{ + struct snd_soc_dapm_context *dapm; + struct snd_soc_dapm_route route = { + .sink = "TX", + .source = dai->driver->playback.stream_name, + }; + + dapm = snd_soc_component_get_dapm(dai->component); + + return snd_soc_dapm_add_routes(dapm, &route, 1); +} + static const struct snd_soc_dai_driver hdmi_i2s_dai = { .name = "i2s-hifi", .id = DAI_ID_I2S, + .probe = hdmi_dai_probe, .playback = { .stream_name = "I2S Playback", .channels_min = 2, @@ -707,6 +717,7 @@ static const struct snd_soc_dai_driver hdmi_i2s_dai = { static const struct snd_soc_dai_driver hdmi_spdif_dai = { .name = "spdif-hifi", .id = DAI_ID_SPDIF, + .probe = hdmi_dai_probe, .playback = { .stream_name = "SPDIF Playback", .channels_min = 2, @@ -733,8 +744,6 @@ static int hdmi_of_xlate_dai_id(struct snd_soc_component *component, static const struct snd_soc_component_driver hdmi_driver = { .dapm_widgets = hdmi_widgets, .num_dapm_widgets = ARRAY_SIZE(hdmi_widgets), - .dapm_routes = hdmi_routes, - .num_dapm_routes = ARRAY_SIZE(hdmi_routes), .of_xlate_dai_id = hdmi_of_xlate_dai_id, .idle_bias_on = 1, .use_pmdown_time = 1,