From patchwork Fri May 15 09:38:27 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 6413101 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 3BE369F1CC for ; Fri, 15 May 2015 09:39:02 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2F4B420444 for ; Fri, 15 May 2015 09:39:01 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id D5BD62041E for ; Fri, 15 May 2015 09:38:59 +0000 (UTC) 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.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,NO_DNS_FOR_FROM, UNPARSEABLE_RELAY autolearn=no version=3.3.1 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 ; Fri, 15 May 2015 11:38:38 +0200 (CEST) Received: by wicmx19 with SMTP id mx19so54551964wic.0 for ; Fri, 15 May 2015 02:38:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=H+7wtNdPGLc3lxL8I7XcLWaN6hnGREMIulw/3IR5lZI=; b=hNIEFF3buboFh0tiThYZCXOSZy9c1J8WWQwYhTBK397sgN9ZL7SxgucXQEjTsma+4v nFd97on+ZFe9u11Z4v9uo61a7ctWoJt3bvPQ6M9Ex1v9G6iFaQT6g6Grdl72iI0n7WEV jUXvOCmEDDkGoq0RZ2M456yHOOs7Kuo8DXAfVsn94SLIq3kjAX3UOgoPPqIirIyTPrnM 7yh3EZFWJq1yr9kDBG5jME2kcHsPuWRr6kkOJFVp5wxQWxWXRKHbHPKekNBBUII25GvB E9d1ipsyIp/vBgorOrBVcxx8tQXEi/FQyw2aPQlboc4ducROXM4BcsXumUwa5LjMc71E U/Ng== X-Gm-Message-State: ALoCoQmop2vqps6sy9t9TVXix6fiNeyru2GKffwNnZjZSr5lI3SI6Ox57ML0OUzkA2pSHoQOec+W 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 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 , linux-kernel@vger.kernel.org, Liam Girdwood , Mark Brown , Srinivas Kandagatla 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: "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 X-Virus-Scanned: ClamAV using ClamSMTP 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 Signed-off-by: Srinivas Kandagatla Acked-by: Kenneth Westfield --- sound/soc/soc-core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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]);