From nobody Wed Apr 29 08:21:28 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B8BCAC43334 for ; Fri, 10 Jun 2022 02:35:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346058AbiFJCf4 (ORCPT ); Thu, 9 Jun 2022 22:35:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53300 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231573AbiFJCfw (ORCPT ); Thu, 9 Jun 2022 22:35:52 -0400 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6ABF04F44E for ; Thu, 9 Jun 2022 19:35:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1654828551; x=1686364551; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=JbfVyJIpKWWl8KF3OlHEusSCn78ZocgcBg7L63EI6as=; b=lOQo5XFyvVMEeA+Q4gseyLS5GeIpC/J4f98wFsWOZqhO3RuVs7PvOoB9 re1ttZhhRxuZasoaAykHYVBEJO0Uo10wnAeJuuH7rASmTe05F0ORITe94 zPXQo5m3ttJH2SyiUjSWUbx70iKqKRRjqMUDeY/Rt+15y/gZcSJagRLgv 8t7OxbQMqVktkBJhKJrllix7+66vpc7324SihuNyqnAfSltbvF6Pcg8wB r186YkUTSPTN5HAVkAIcBAz05HIzHL0pjST36G1z5AJF6Uax+vsUFJ3oD SoG43fWt0udPdD8PEbxNuxklI12UHT86nxLiX439yBFea5NEFqIyyoalC w==; X-IronPort-AV: E=McAfee;i="6400,9594,10373"; a="341555035" X-IronPort-AV: E=Sophos;i="5.91,288,1647327600"; d="scan'208";a="341555035" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Jun 2022 19:35:51 -0700 X-IronPort-AV: E=Sophos;i="5.91,288,1647327600"; d="scan'208";a="637874955" Received: from bard-ubuntu.sh.intel.com ([10.239.185.57]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Jun 2022 19:35:48 -0700 From: Bard Liao To: alsa-devel@alsa-project.org, vkoul@kernel.org Cc: vinod.koul@linaro.org, linux-kernel@vger.kernel.org, tiwai@suse.de, broonie@kernel.org, gregkh@linuxfoundation.org, srinivas.kandagatla@linaro.org, pierre-louis.bossart@linux.intel.com, sanyog.r.kale@intel.com, bard.liao@intel.com Subject: [PATCH 1/2] soundwire: intel: uniquify debug message Date: Fri, 10 Jun 2022 10:35:36 +0800 Message-Id: <20220610023537.27223-2-yung-chuan.liao@linux.intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220610023537.27223-1-yung-chuan.liao@linux.intel.com> References: <20220610023537.27223-1-yung-chuan.liao@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Pierre-Louis Bossart The same debug message is replicated multiple time, add __func__ to figure out what link is ignored. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Reviewed-by: P=C3=A9ter Ujfalusi Signed-off-by: Bard Liao --- drivers/soundwire/intel.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/drivers/soundwire/intel.c b/drivers/soundwire/intel.c index 505c5ef061e3..808e2f320052 100644 --- a/drivers/soundwire/intel.c +++ b/drivers/soundwire/intel.c @@ -1328,8 +1328,8 @@ int intel_link_startup(struct auxiliary_device *auxde= v) =20 if (bus->prop.hw_disabled) { dev_info(dev, - "SoundWire master %d is disabled, ignoring\n", - sdw->instance); + "%s: SoundWire master %d is disabled, ignoring\n", + __func__, sdw->instance); return 0; } =20 @@ -1489,8 +1489,8 @@ int intel_link_process_wakeen_event(struct auxiliary_= device *auxdev) bus =3D &sdw->cdns.bus; =20 if (bus->prop.hw_disabled || !sdw->startup_done) { - dev_dbg(dev, "SoundWire master %d is disabled or not-started, ignoring\n= ", - bus->link_id); + dev_dbg(dev, "%s: SoundWire master %d is disabled or not-started, ignori= ng\n", + __func__, bus->link_id); return 0; } =20 @@ -1549,8 +1549,8 @@ static int __maybe_unused intel_pm_prepare(struct dev= ice *dev) int ret; =20 if (bus->prop.hw_disabled || !sdw->startup_done) { - dev_dbg(dev, "SoundWire master %d is disabled or not-started, ignoring\n= ", - bus->link_id); + dev_dbg(dev, "%s: SoundWire master %d is disabled or not-started, ignori= ng\n", + __func__, bus->link_id); return 0; } =20 @@ -1609,8 +1609,8 @@ static int __maybe_unused intel_suspend(struct device= *dev) int ret; =20 if (bus->prop.hw_disabled || !sdw->startup_done) { - dev_dbg(dev, "SoundWire master %d is disabled or not-started, ignoring\n= ", - bus->link_id); + dev_dbg(dev, "%s: SoundWire master %d is disabled or not-started, ignori= ng\n", + __func__, bus->link_id); return 0; } =20 @@ -1662,8 +1662,8 @@ static int __maybe_unused intel_suspend_runtime(struc= t device *dev) int ret; =20 if (bus->prop.hw_disabled || !sdw->startup_done) { - dev_dbg(dev, "SoundWire master %d is disabled or not-started, ignoring\n= ", - bus->link_id); + dev_dbg(dev, "%s: SoundWire master %d is disabled or not-started, ignori= ng\n", + __func__, bus->link_id); return 0; } =20 @@ -1727,8 +1727,8 @@ static int __maybe_unused intel_resume(struct device = *dev) int ret; =20 if (bus->prop.hw_disabled || !sdw->startup_done) { - dev_dbg(dev, "SoundWire master %d is disabled or not-started, ignoring\n= ", - bus->link_id); + dev_dbg(dev, "%s: SoundWire master %d is disabled or not-started, ignori= ng\n", + __func__, bus->link_id); return 0; } =20 @@ -1825,8 +1825,8 @@ static int __maybe_unused intel_resume_runtime(struct= device *dev) int ret; =20 if (bus->prop.hw_disabled || !sdw->startup_done) { - dev_dbg(dev, "SoundWire master %d is disabled or not-started, ignoring\n= ", - bus->link_id); + dev_dbg(dev, "%s: SoundWire master %d is disabled or not-started, ignori= ng\n", + __func__, bus->link_id); return 0; } =20 --=20 2.17.1 From nobody Wed Apr 29 08:21:28 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2810DC433EF for ; Fri, 10 Jun 2022 02:36:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346071AbiFJCgA (ORCPT ); Thu, 9 Jun 2022 22:36:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53538 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346055AbiFJCfz (ORCPT ); Thu, 9 Jun 2022 22:35:55 -0400 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D2FFD166692 for ; Thu, 9 Jun 2022 19:35:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1654828553; x=1686364553; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=uprg4ZL4jSezrQW9p9662ttg9PS3pP4zuCPQgHXP8oA=; b=QbiSBGBRc7SuxPnOwASQvTNKqvDhvr5ddUp/6gJ9u3KS4vuxgqGJ6oyf r/inuJSrFawoKMctGCpcJJA9lvoc/TZ0gAd+OdMidVbyZypHcSxDynjC/ kJVrrwU2aXsI5M/cxkhJW4aA3c4Q7yuGg7Yqw2pl17oNOiogh7HliyZgp d1jD7CR7L5qbD0I2XoeCpFIMUuAkTiGyr38LZ+SMGxeJBZw/i2D+Fmhst AzSh6EWXzvqGuRvpCA+3oYlPQoy++RhGavDkOKtCDGeNxcJ4vpSbo7Umt wkNXVNQvIh+y/ksjWlQFfvNcjZnbqI6ybYxC/gSB+QSMeScHOSB4Gz8aF w==; X-IronPort-AV: E=McAfee;i="6400,9594,10373"; a="341555037" X-IronPort-AV: E=Sophos;i="5.91,288,1647327600"; d="scan'208";a="341555037" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Jun 2022 19:35:53 -0700 X-IronPort-AV: E=Sophos;i="5.91,288,1647327600"; d="scan'208";a="637874970" Received: from bard-ubuntu.sh.intel.com ([10.239.185.57]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Jun 2022 19:35:51 -0700 From: Bard Liao To: alsa-devel@alsa-project.org, vkoul@kernel.org Cc: vinod.koul@linaro.org, linux-kernel@vger.kernel.org, tiwai@suse.de, broonie@kernel.org, gregkh@linuxfoundation.org, srinivas.kandagatla@linaro.org, pierre-louis.bossart@linux.intel.com, sanyog.r.kale@intel.com, bard.liao@intel.com Subject: [PATCH 2/2] soundwire: Intel: add trigger callback Date: Fri, 10 Jun 2022 10:35:37 +0800 Message-Id: <20220610023537.27223-3-yung-chuan.liao@linux.intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220610023537.27223-1-yung-chuan.liao@linux.intel.com> References: <20220610023537.27223-1-yung-chuan.liao@linux.intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" When a pipeline is split into FE and BE parts, the BE pipeline may need to be triggered separately in the BE trigger op. So add the trigger callback in the link_res ops that will be invoked during BE DAI trigger. Signed-off-by: Bard Liao Reviewed-by: Rander Wang Reviewed-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan --- drivers/soundwire/intel.c | 8 ++++++++ include/linux/soundwire/sdw_intel.h | 1 + 2 files changed, 9 insertions(+) diff --git a/drivers/soundwire/intel.c b/drivers/soundwire/intel.c index 808e2f320052..3f3c2c99cb8e 100644 --- a/drivers/soundwire/intel.c +++ b/drivers/soundwire/intel.c @@ -1004,9 +1004,17 @@ static int intel_trigger(struct snd_pcm_substream *s= ubstream, int cmd, struct sn { struct sdw_cdns *cdns =3D snd_soc_dai_get_drvdata(dai); struct sdw_intel *sdw =3D cdns_to_intel(cdns); + struct sdw_intel_link_res *res =3D sdw->link_res; struct sdw_cdns_dma_data *dma; int ret =3D 0; =20 + /* The .trigger callback is used to send required IPC to audio + * firmware. The .free_stream callback will still be called + * by intel_free_stream() in the TRIGGER_SUSPEND case. + */ + if (res->ops && res->ops->trigger) + res->ops->trigger(dai, cmd, substream->stream); + dma =3D snd_soc_dai_get_dma_data(dai, substream); if (!dma) { dev_err(dai->dev, "failed to get dma data in %s\n", diff --git a/include/linux/soundwire/sdw_intel.h b/include/linux/soundwire/= sdw_intel.h index 67e0d3e750b5..f638707fd712 100644 --- a/include/linux/soundwire/sdw_intel.h +++ b/include/linux/soundwire/sdw_intel.h @@ -119,6 +119,7 @@ struct sdw_intel_ops { struct sdw_intel_stream_params_data *params_data); int (*free_stream)(struct device *dev, struct sdw_intel_stream_free_data *free_data); + int (*trigger)(struct snd_soc_dai *dai, int cmd, int stream); }; =20 /** --=20 2.17.1