From patchwork Fri Jul 13 15:10:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 141959 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp915212ljj; Sat, 14 Jul 2018 15:44:39 -0700 (PDT) X-Google-Smtp-Source: AAOMgpe2X/rLUA5FE2w/tFhBf0rUSqaYYAmEy6jb5EimZYBb4k5iqkybSnDG/kcVWRHxP5oaArpC X-Received: by 2002:adf:c44c:: with SMTP id a12-v6mr8843346wrg.20.1531608279112; Sat, 14 Jul 2018 15:44:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531608279; cv=none; d=google.com; s=arc-20160816; b=qdclgPAsYIO1lHKMrJC6EoEt55Pg37kZFFVcC2xOzeuFK8HDOcEb4L/fa77LzoQfU6 fxk1RyQb9rNYiHXf3pyvLVQzzIEBtxuGp3NvFKcnRsUojKjCC7ziI2M5bJwzHBy+iqib xTEvAE68NcUpUflYtOmO5hVrId7dQsQsXMvd4INhzQXP2BMWh2O1TAA8t3yKWZ1YvgGF o+s3x5XNvaTKdOgPTAuCEQkIgThr1Z5iM1RkoJ1VmfsV0uzOoDWlqDkqanvFxkV3uPvc AYI2GaXFi0GPLXw2pKO9CeU/8ooRIdjGAKKBIQSYXvJoTzNzWgGwGTB8YKvgXfWzPrxo tV6w== 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=KyB73dXsMnjzP/N+PKyg764ntoId4puzP+nZvVd0GJ4=; b=VMW6Lbg0RDdMHCMyXvMo/b3CWFSq8uzjkQ+upPPxAAzk97uSEP4ul9K0PhgKpRLSCU LH3SF64bJxtZAeYTWAvLydh6N/HNhXuOznLaf6xyswdrc708bPg+w55FnPq++/L9Iv+d OgWfJya90BOr9xXGk21c78G0St2NexIteIkag9bCck0UfdhxM4j+y55TTGOEIsQvob67 uWs9YqXqbqL8FCsqBhfDsnT20XHnDq6Hlmv6o7oRPNvyZIyiGcw8sxrxDO8ldf1ab7j1 aRZEXAYZFp/x6kxeolFrmgC9PVmGdP7v2wI763Q21ueTgZ07CQN2zXpMpH9M6J/p3TsZ M8cg== 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=nQboSrkT; 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 a202-v6si7356031wmd.181.2018.07.14.15.44.38; Sat, 14 Jul 2018 15:44:39 -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=nQboSrkT; 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 D3F9B26773B; Sun, 15 Jul 2018 00:44:30 +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 CF386267738; Sun, 15 Jul 2018 00:44:26 +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.7 required=5.0 tests=DATE_IN_PAST_24_48, 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 0AEB9267730 for ; Sun, 15 Jul 2018 00:44:23 +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=0Sf9t4YY0VqOgGXdaUjSUOgSbMk2kJdVGofyxxH9aDI=; b=nQboSrkTJY4g t4rIatoDCQF4fJgbZ8VIvUrtjTAn8xTYgK1V7JVIrNtCJkk6We6Tgx8WKk9fm9Iwy5ww65bAc3EKF jmY1D1AYjPTZEuFBX4Wq22LhOUezuPWv0Wjl1nkT/Gzrv/DNAhmgXf/eFeWodPcNQT6M5G1qRQC2L sNrUE=; Received: from host86-174-189-173.range86-174.btcentralplus.com ([86.174.189.173] helo=finisterre.ee.mobilebroadband) by heliosphere.sirena.org.uk with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1feTH5-0006hr-6P; Sat, 14 Jul 2018 22:44:23 +0000 Received: by finisterre.ee.mobilebroadband (Postfix, from userid 1000) id 162C444007A; Fri, 13 Jul 2018 16:10:12 +0100 (BST) From: Mark Brown To: Jerome Brunet In-Reply-To: <20180713125043.13242-3-jbrunet@baylibre.com> Message-Id: <20180713151012.162C444007A@finisterre.ee.mobilebroadband> Date: Fri, 13 Jul 2018 16:10:12 +0100 (BST) Cc: devicetree@vger.kernel.org, alsa-devel@alsa-project.org, Mark Brown , Liam Girdwood , linux-kernel@vger.kernel.org Subject: [alsa-devel] Applied "ASoC: allow soc-core to pick up name prefixes from component nodes" 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: allow soc-core to pick up name prefixes from component nodes 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 aefba45539bc4868c1fae336410aec907ee0882a Mon Sep 17 00:00:00 2001 From: Jerome Brunet Date: Fri, 13 Jul 2018 14:50:43 +0200 Subject: [PATCH] ASoC: allow soc-core to pick up name prefixes from component nodes When the component does not match the configuration table provided by the card, let soc-core check the component node for a name prefix Signed-off-by: Jerome Brunet Signed-off-by: Mark Brown --- sound/soc/soc-core.c | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) -- 2.18.0 _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 00bd58d167dd..3be0310d5c81 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -1193,15 +1193,27 @@ void snd_soc_remove_dai_link(struct snd_soc_card *card, } EXPORT_SYMBOL_GPL(snd_soc_remove_dai_link); +static void soc_set_of_name_prefix(struct snd_soc_component *component) +{ + struct device_node *component_of_node = component->dev->of_node; + const char *str; + int ret; + + if (!component_of_node && component->dev->parent) + component_of_node = component->dev->parent->of_node; + + ret = of_property_read_string(component_of_node, "sound-name-prefix", + &str); + if (!ret) + component->name_prefix = str; +} + static void soc_set_name_prefix(struct snd_soc_card *card, struct snd_soc_component *component) { int i; - if (card->codec_conf == NULL) - return; - - for (i = 0; i < card->num_configs; i++) { + for (i = 0; i < card->num_configs && card->codec_conf; i++) { struct snd_soc_codec_conf *map = &card->codec_conf[i]; struct device_node *component_of_node = component->dev->of_node; @@ -1213,8 +1225,14 @@ static void soc_set_name_prefix(struct snd_soc_card *card, if (map->dev_name && strcmp(component->name, map->dev_name)) continue; component->name_prefix = map->name_prefix; - break; + return; } + + /* + * If there is no configuration table or no match in the table, + * check if a prefix is provided in the node + */ + soc_set_of_name_prefix(component); } static int soc_probe_component(struct snd_soc_card *card,