From patchwork Fri Sep 6 05:55:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Ujfalusi X-Patchwork-Id: 173198 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:ce:0:0:0:0 with SMTP id r14csp274886ilq; Thu, 5 Sep 2019 22:56:04 -0700 (PDT) X-Google-Smtp-Source: APXvYqxnwKxKbpUEEtOEZhMqZ5DRszZGrGR+AxxWhTg+nECCWbKIAOiAst5CdKLlHomTEdk6jaxH X-Received: by 2002:a1c:9950:: with SMTP id b77mr5942248wme.46.1567749364545; Thu, 05 Sep 2019 22:56:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567749364; cv=none; d=google.com; s=arc-20160816; b=02NASWQF7s73rOiTVDgNoMB0k0XLqiNtoiWkfSq0nPVzbdteYXeW35DYXvbxcHqX0E Jp+GT204hZaadtF6aC/OEw9LVsw8KqoXI9QU3ah7wJ6Q/EIj9pGfbIUACjkCog+BP+I6 5qwaK9DI6K7Q1Kqa2ciOe6O6Ww86IomSEPx7G6DA/Np6HRaG7ZnJYXghnRf6sadnffwX kV7mVh9IX4NbvSPhwtVNceDgMOnEWoKlQCHqCqKOjNAvtaVSdIIdcLGr6IE42wEm0nZs N26vlJMTRueq3SJ5ukNcEu1gLdl6KfdpkEGFZ0vXLn+5rjrWZWgBrc+CK9bEJb335qXs EORA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :cc:mime-version:message-id:date:to:from:dkim-signature:dkim-filter :delivered-to:dkim-signature:dkim-filter; bh=csEcEjVgVVCF1n1gIUoBfb0OVnE/WZUqy/dg9VquHMo=; b=S93w1fYv7N/mZGbn1EjnCkRA0bDHQAqQPT3A6xzVGeJZWBmCHEWbeco769b/AQVe/b aEcGxGaj+sZwSEGDuD67/HdBUMgwQpJ1FExPQVHEoT4us19oamsjY7IckK+llh7zrqdF 9BEOvfeNZL6CUJ8DkI/FSNAGNMrWHULBsG2qouAfs9W2t6gWC20hMyvjVeLLfvs33V5S 9kqfO24Kmv8oz/5GgAMaSbCZ/iRRczToPbFxQb0w3j7Zc+Rb5UOZxh3acTHBxdgFqsDt k7fX8MHz3/mDXg3tdvDyGuDSmSKXYeoxBLI1udlC7E2pPEEuMe9xFgdlRXM9VzkdfXeA C4uw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alsa-project.org header.s=default header.b=utljg87S; dkim=neutral (body hash did not verify) header.i=@ti.com header.s=ti-com-17Q1 header.b=gsAiXqp5; 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=QUARANTINE sp=NONE dis=QUARANTINE) header.from=ti.com Return-Path: Received: from alsa0.perex.cz (alsa0.perex.cz. [77.48.224.243]) by mx.google.com with ESMTPS id a15si448640wrg.30.2019.09.05.22.56.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 05 Sep 2019 22:56:04 -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=pass header.i=@alsa-project.org header.s=default header.b=utljg87S; dkim=neutral (body hash did not verify) header.i=@ti.com header.s=ti-com-17Q1 header.b=gsAiXqp5; 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=QUARANTINE sp=NONE dis=QUARANTINE) header.from=ti.com Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id EB603820; Fri, 6 Sep 2019 07:55:12 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz EB603820 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1567749363; bh=TkgN8KbTWniKWOsrio7solIiaNyOWrqeP0tzI9Kz95M=; h=From:To:Date:Cc:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=utljg87SBI6a16mHVBxDRer0lpJtYm/yd9/ppsVC9mGTd1/o089c5H2u4NHMJVbIc oZYnlmfeQ1kt84BEaYGb3l8/JXoSrgqQgCESM83zxPxRY2nEkDvqJTaOU3bXPPvHi8 TW/PzdI1hZ/lVznawQdd/g9SGhfKUo2exroDmV3M= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id D05BDF80390; Fri, 6 Sep 2019 07:55:11 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 66E8CF80394; Fri, 6 Sep 2019 07:55:09 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.1 required=5.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, PRX_BODY_78, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from lelv0143.ext.ti.com (lelv0143.ext.ti.com [198.47.23.248]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 184FDF80214 for ; Fri, 6 Sep 2019 07:55:01 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 184FDF80214 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b="gsAiXqp5" Received: from lelv0266.itg.ti.com ([10.180.67.225]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id x865swV5087402; Fri, 6 Sep 2019 00:54:58 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1567749298; bh=Vep51iM/zlBAmxTXn3JZO3WNV9FVkPBD9LlnvYsjub4=; h=From:To:CC:Subject:Date; b=gsAiXqp5mrMg28j8QM++HJ6EkwqEKo6EFdYteiMaWjlxZDDTs0wwV+YXysqeoDDdG a4n5COmOCPjtzBWE1+ZIe6kTk//PeAnb801+N6L/Zt3EScoDu+JjT5fLq5CI43nRf3 TAnVt86ciaoPzV1P4hXY5VCWYAh1eXo8lpxdYZZ4= Received: from DFLE106.ent.ti.com (dfle106.ent.ti.com [10.64.6.27]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x865swl7121656 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 6 Sep 2019 00:54:58 -0500 Received: from DFLE111.ent.ti.com (10.64.6.32) by DFLE106.ent.ti.com (10.64.6.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Fri, 6 Sep 2019 00:54:57 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) by DFLE111.ent.ti.com (10.64.6.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5 via Frontend Transport; Fri, 6 Sep 2019 00:54:58 -0500 Received: from feketebors.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id x865stga105682; Fri, 6 Sep 2019 00:54:56 -0500 From: Peter Ujfalusi To: , Date: Fri, 6 Sep 2019 08:55:24 +0300 Message-ID: <20190906055524.7393-1-peter.ujfalusi@ti.com> X-Mailer: git-send-email 2.23.0 MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Cc: tiwai@suse.de, alsa-devel@alsa-project.org, arthur.she@linaro.org Subject: [alsa-devel] [PATCH] ASoC: dmaengine: Make the pcm->name equal to pcm->id if the name is not set X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Some tools use the snd_pcm_info_get_name() to try to identify PCMs or for other purposes. Currently it is left empty with the dmaengine-pcm, in this case copy the pcm->id string as pcm->name. For example IGT is using this to find the HDMI PCM for testing audio on it. Signed-off-by: Peter Ujfalusi Reported-by: Arthur She --- Hi, this was actually reported for 4.14 kernel with omap-pcm (replaced by sdma-pcm in v4.18), since then we only use the generic dmaengine PCM but the same issue applies today. Regards, Peter sound/soc/soc-generic-dmaengine-pcm.c | 6 ++++++ 1 file changed, 6 insertions(+) -- Peter Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org https://mailman.alsa-project.org/mailman/listinfo/alsa-devel diff --git a/sound/soc/soc-generic-dmaengine-pcm.c b/sound/soc/soc-generic-dmaengine-pcm.c index 748f5f641002..d93db2c2b527 100644 --- a/sound/soc/soc-generic-dmaengine-pcm.c +++ b/sound/soc/soc-generic-dmaengine-pcm.c @@ -306,6 +306,12 @@ static int dmaengine_pcm_new(struct snd_soc_pcm_runtime *rtd) if (!dmaengine_pcm_can_report_residue(dev, pcm->chan[i])) pcm->flags |= SND_DMAENGINE_PCM_FLAG_NO_RESIDUE; + + if (rtd->pcm->streams[i].pcm->name[0] == '\0') { + strncpy(rtd->pcm->streams[i].pcm->name, + rtd->pcm->streams[i].pcm->id, + sizeof(rtd->pcm->streams[i].pcm->name)); + } } return 0;