Message ID | 1431682707-26452-1-git-send-email-srinivas.kandagatla@linaro.org |
---|---|
State | New |
Headers | show
Return-Path: <patchwork-forward+bncBC27VH7PV4DBBNH522VAKGQELDIYZWA@linaro.org> X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f71.google.com (mail-wg0-f71.google.com [74.125.82.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id C06B321411 for <linaro@patches.linaro.org>; Fri, 15 May 2015 09:39:01 +0000 (UTC) Received: by wgin8 with SMTP id n8sf27945643wgi.0 for <linaro@patches.linaro.org>; Fri, 15 May 2015 02:39:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:delivered-to:from:to:date :message-id:cc:subject:precedence:list-id:list-unsubscribe :list-archive:list-post:list-help:list-subscribe:mime-version :content-type:content-transfer-encoding:errors-to:sender :x-original-sender:x-original-authentication-results:mailing-list; bh=CwvWhdiBbKzrCChCeMpLMh2L/hzMYgS4+L0SRtCEvyI=; b=Y1sZALWcbGV6HFDsw/L6PLgq531igcacqboKOLBBbh3kjmoRvI0zNQK685zSTXNAlz HlhL1ZL07zEjgVzyceSPksXY91LFQWDFd2JlUsfI7oEj+LjVDPJgPpE91S4qdJ0lu5eV O0J/dO1lT+RyqKZsEFGRcnnlQsWz5djAoK/IOkd7Ei5425qu+bhv643GrB01FV8BzAth gXjybfiBpwOVrxi34lznJSnrOsEWxfOSD4mO14Bn5zS48AugUl9FMBMxpwo3lpUmZzu3 9MbV87q3graC+f9M8dzMzgZYv4c/u/jiGvn0h2REH3hBvE+1hi1qztMszoMeh2yEymme U8xg== X-Gm-Message-State: ALoCoQk3ivB1AqeVuB+sQ3gJmin9yu5ybZ85iqIPzNmAgDZ1o3Xiw5sth8OnpZ8FZ+w6sTaO8QDj X-Received: by 10.180.105.226 with SMTP id gp2mr21762525wib.1.1431682741116; Fri, 15 May 2015 02:39:01 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.206.98 with SMTP id ln2ls512126lac.61.gmail; Fri, 15 May 2015 02:39:00 -0700 (PDT) X-Received: by 10.153.6.6 with SMTP id cq6mr6600316lad.13.1431682740886; Fri, 15 May 2015 02:39:00 -0700 (PDT) Received: from mail-la0-f41.google.com (mail-la0-f41.google.com. [209.85.215.41]) by mx.google.com with ESMTPS id zz9si696680lbb.157.2015.05.15.02.39.00 for <patchwork-forward@linaro.org> (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 15 May 2015 02:39:00 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.41 as permitted sender) client-ip=209.85.215.41; Received: by laat2 with SMTP id t2so110648636laa.1 for <patchwork-forward@linaro.org>; Fri, 15 May 2015 02:39:00 -0700 (PDT) X-Received: by 10.152.2.227 with SMTP id 3mr6505968lax.73.1431682740462; Fri, 15 May 2015 02:39:00 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.108.230 with SMTP id hn6csp1883270lbb; Fri, 15 May 2015 02:38:59 -0700 (PDT) X-Received: by 10.180.91.77 with SMTP id cc13mr31959874wib.88.1431682739814; Fri, 15 May 2015 02:38:59 -0700 (PDT) Received: from alsa0.perex.cz (alsa0.perex.cz. [77.48.224.243]) by mx.google.com with ESMTP id cb3si1865429wjc.44.2015.05.15.02.38.59; Fri, 15 May 2015 02:38:59 -0700 (PDT) Received-SPF: neutral (google.com: 77.48.224.243 is neither permitted nor denied by best guess record for domain of alsa-devel-bounces@alsa-project.org) client-ip=77.48.224.243; Received: by alsa0.perex.cz (Postfix, from userid 1000) id F16DE26645C; Fri, 15 May 2015 11:38:57 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.2.4 (2008-01-01) on mail1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.2.4 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id DE0C926600E; Fri, 15 May 2015 11:38:49 +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 C0E6626606B; Fri, 15 May 2015 11:38:48 +0200 (CEST) Received: from mail-wi0-f171.google.com (mail-wi0-f171.google.com [209.85.212.171]) by alsa0.perex.cz (Postfix) with ESMTP id 91E382608C7 for <alsa-devel@alsa-project.org>; Fri, 15 May 2015 11:38:38 +0200 (CEST) Received: by wicmx19 with SMTP id mx19so54551964wic.0 for <alsa-devel@alsa-project.org>; Fri, 15 May 2015 02:38:38 -0700 (PDT) X-Received: by 10.180.207.67 with SMTP id lu3mr5341763wic.10.1431682718316; Fri, 15 May 2015 02:38:38 -0700 (PDT) Received: from srini-ThinkPad-X1-Carbon-2nd.dlink.com (host-78-144-121-184.as13285.net. [78.144.121.184]) by mx.google.com with ESMTPSA id lh8sm1602923wjc.23.2015.05.15.02.38.36 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 15 May 2015 02:38:37 -0700 (PDT) From: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> To: alsa-devel@alsa-project.org Date: Fri, 15 May 2015 10:38:27 +0100 Message-Id: <1431682707-26452-1-git-send-email-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 1.9.1 Cc: Takashi Iwai <tiwai@suse.de>, linux-kernel@vger.kernel.org, Liam Girdwood <lgirdwood@gmail.com>, Mark Brown <broonie@kernel.org>, Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Subject: [alsa-devel] [PATCH] ASoC: skip legacy dai naming if dai driver has all the information X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: <patchwork-forward.linaro.org> List-Unsubscribe: <mailto:googlegroups-manage+836684582541+unsubscribe@googlegroups.com>, <http://groups.google.com/a/linaro.org/group/patchwork-forward/subscribe> List-Archive: <http://groups.google.com/a/linaro.org/group/patchwork-forward/> List-Post: <http://groups.google.com/a/linaro.org/group/patchwork-forward/post>, <mailto:patchwork-forward@linaro.org> List-Help: <http://support.google.com/a/linaro.org/bin/topic.py?topic=25838>, <mailto:patchwork-forward+help@linaro.org> List-Subscribe: <http://mailman.alsa-project.org/mailman/listinfo/alsa-devel>, <mailto:alsa-devel-request@alsa-project.org?subject=subscribe> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: srinivas.kandagatla@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.41 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 |
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 2373252..7d028e8 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -2599,7 +2599,8 @@ static int snd_soc_register_dais(struct snd_soc_component *component, * the same naming style even though those DAIs are not * component-less anymore. */ - if (count == 1 && legacy_dai_naming) { + if (count == 1 && legacy_dai_naming && + (dai_drv[i].id == 0 || dai_drv[i].name == NULL)) { dai->name = fmt_single_name(dev, &dai->id); } else { dai->name = fmt_multiple_name(dev, &dai_drv[i]);
Original issue is that the id field in the dai is not same as the id in dai_driver when dai driver count == 1. This is due to the legacy dai naming check, which could possibly cause issues if the audio drivers written in assumption that dai->id would be always equal to dai_driver->id. This assumption is true only if the dai driver count is greater than 1, and false if dai driver count is 1. On Qcom Lpass driver we hit such issue while adding support to apq8016. The code path which falls back to legacy naming for cases where num_dai == 1 does not check if there is any valid information in the dai_driver. This patch fixes that by checking if the dai_driver has valid id and name before falling back to legacy dai naming Although the drivers can work around this issue by only using dai->driver->id, but this patch attempts to fix the actual issue. Suggested-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> --- sound/soc/soc-core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)