Received: by 2002:ab2:3c46:0:b0:1f5:f2ab:c469 with SMTP id x6csp86327lqf; Thu, 25 Apr 2024 23:41:17 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX5hzAEef5l8xRvKspVAlST5mKxStlKR7g9Ub49et4x0Xl8LLi1WrIgukbicEp47QC9aHFAYbLn1T45VbZG/aYU5uzeP89h9snHrVVo7Q== X-Google-Smtp-Source: AGHT+IFFeTqpI05rrZ5f2sxFNtNRdSXF0G5U9ngY40awLLDIqvPzd6Vu7nqhtIL5EJYPxSwt6l2w X-Received: by 2002:a17:906:a896:b0:a58:c639:9518 with SMTP id ha22-20020a170906a89600b00a58c6399518mr1136121ejb.76.1714113677734; Thu, 25 Apr 2024 23:41:17 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714113677; cv=pass; d=google.com; s=arc-20160816; b=HXHhwKwB79ubHBeit0NFPI8HuXc9crC5D4Q3FbKOEYLkL0nFOGUP0QsKj2xT6W3HP3 3xM+H0qchn7fhHocdHWiz7/M4yTvABOb+NbzsAegRvJ3ahtsVjDltzzC95kcV8qEfUCu bgv4UpvIxLCYOZzPrVFuPiBGBf6Ps8eqyLhw4kG/e4Dw7FZVVZK2yZQBmtVZ5H6nrTP1 mbyaJPh/ZnaIUkD/SfL8pxIhYL47fmVW5aG9YLh0VCNh9DOcbVrE2cB7JtXtBIw66Uaa JWbo1CwEC1vNBc8PfEmzPX/mrJhjEGXNg1oD8zPNfRfgPvfoeCnd+GvTEtQKTQk0rTds tl3w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=QerqVSIB2KD9dNJ9No/ARx2D8a0/oKLOSAzMsWfF9yg=; fh=DQfWcJ7a6lABpgAjlslbt+lALChD4jPOSQFW0XC7h54=; b=Bx1jbbZhs1qMgiZ+lRjTOc/KP9POseoKz0jNoOsEOGHw1iqTdzALva/oqc+idfZCbv y11dwKMVBkyp/EwPO3gxlGE+IHKwVLcnRpMaqM1Ef1L0MwX3ZQtZ+jC027iMwbqsRuAg YUvgZKMj/rYNM/Ke+7yst5ObWh4bWd5mrpz92GewHQiniyWgqQbtNn/6bS7a6cHw5I5H f2MYw18u+Djwvo57ojbs0Rg95keKObH0enFBcOh0gEllrdV6cuCUHjFW57YznpBtvYYC Ebb2pYOMFHYFt92duaxSYkwxMiLLkuuw5O/eGe9ySek0z2bBO3GTp4SSvb2e3i5Kgmaz TArQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=UKi8CvVx; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-159590-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-159590-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id k8-20020a17090632c800b00a58bd872961si1418382ejk.1046.2024.04.25.23.41.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Apr 2024 23:41:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-159590-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=UKi8CvVx; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-159590-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-159590-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 5D47D1F22EA0 for ; Fri, 26 Apr 2024 06:41:17 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 81EA313A41C; Fri, 26 Apr 2024 06:40:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="UKi8CvVx" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E1FFC13AA31; Fri, 26 Apr 2024 06:40:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.9 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714113644; cv=none; b=ef3x9QNVbMqeeKDUn0uBrDHoWgIgCejtKNXHRSDgk/4ABNdy010ERb17XEKd0M9jA31bNcpijHKjbN1deKjJ5ckS8rkG0s2KzQQ1zXvMFhLt8fpjYdVPRB1XwuU69ofpkvvTKEHyuxGUy8qM614hVNs4o4elnAs8dPHbi/yFYmA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714113644; c=relaxed/simple; bh=10H4S20sO62kKq9BD7lzNSalZU2xlXNz9QAxvCzyf9k=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Wfl7iEvJA0OjYYDXXCdRsKI1ALSREhgEhew4rVmxU9pyGvlYxo8uS7S5eo9zXK0AEpUg/aDP6dtR1YZMNTdcFVBFJDFwD+Dmx+XqM96d6K/MDg1Uqm7QKTQabM2ZnMkvGhraGFrG8lVTAocYo5dTs3vkf/jiUL/AAOt8vY7guO4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=UKi8CvVx; arc=none smtp.client-ip=192.198.163.9 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1714113643; x=1745649643; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=10H4S20sO62kKq9BD7lzNSalZU2xlXNz9QAxvCzyf9k=; b=UKi8CvVxXNEtzzmZPG/sg/MNagXjVIiIWu/FV8H5gQ0yGlGXMWlpyneh AGDdwXUxQOXJC5DPCPjgrNKlja0P6XKh+wAFs6YFXKOyYfc0h2woDCe5N PwodYYMF64/heXI3bbg0aEMnZLc1ybNLdqqQeAVAp0QqsKJtD15jM5HDs fEY+G7yZ1oBm03YSJZCtv8nCohENsa89pc5txsXnOsh+anIPrngUUydNL kq28ep1JvGX1SZupIq+gr6FfJKxBWGefij4Ms1TGHGtmeJM4xA0n0LqDF i2t2RRtuJ2AajMeQAYaTGhjirhfQqJNDa5xan+/Ja1yQtgvvaftGB+/wU g==; X-CSE-ConnectionGUID: kZkXFkl8TnucxuuE/vrAhg== X-CSE-MsgGUID: FciQic7fS1iF4pmpi0/+xg== X-IronPort-AV: E=McAfee;i="6600,9927,11055"; a="20526098" X-IronPort-AV: E=Sophos;i="6.07,231,1708416000"; d="scan'208";a="20526098" Received: from fmviesa006.fm.intel.com ([10.60.135.146]) by fmvoesa103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Apr 2024 23:40:40 -0700 X-CSE-ConnectionGUID: g5wA7+IwTRWzOAoaud2ppw== X-CSE-MsgGUID: XYGWmrzNQCqq1s+iIVQ13g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,231,1708416000"; d="scan'208";a="25399054" Received: from yungchua-ws.ostc.intel.com (HELO yungchua-ws.intel.com) ([10.54.69.90]) by fmviesa006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Apr 2024 23:40:40 -0700 From: Bard Liao To: linux-sound@vger.kernel.org, vkoul@kernel.org Cc: vinod.koul@linaro.org, linux-kernel@vger.kernel.org, pierre-louis.bossart@linux.intel.com, bard.liao@intel.com Subject: [PATCH RESEND 2/2] soundwire: intel_ace2x: simplify check_wake() Date: Fri, 26 Apr 2024 06:40:30 +0000 Message-Id: <20240426064030.2305343-3-yung-chuan.liao@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240426064030.2305343-1-yung-chuan.liao@linux.intel.com> References: <20240426064030.2305343-1-yung-chuan.liao@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Pierre-Louis Bossart Since LunarLake, we use the HDadio WAKEEN/WAKESTS to detect wakes for SoundWire codecs. This patch follows the HDaudio example and simplifies the behavior on wake-up by unconditionally waking up all links. This behavior makes a lot of sense when removing the jack, which may signal that the user wants to start rendering audio using the local amplifiers. Resuming all links helps make sure the amplifiers are ready to be used. Worst case, the pm_runtime suspend would kick-in after several seconds of inactivity. Closes: https://github.com/thesofproject/linux/issues/4687 Co-developed-by: Bard Liao Signed-off-by: Bard Liao Signed-off-by: Pierre-Louis Bossart Reviewed-by: Keqiao Zhang --- drivers/soundwire/intel_ace2x.c | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/drivers/soundwire/intel_ace2x.c b/drivers/soundwire/intel_ace2x.c index 8812527af4a8..75e629c938dc 100644 --- a/drivers/soundwire/intel_ace2x.c +++ b/drivers/soundwire/intel_ace2x.c @@ -51,22 +51,12 @@ static void intel_shim_vs_set_clock_source(struct sdw_intel *sdw, u32 source) static int intel_shim_check_wake(struct sdw_intel *sdw) { - u16 lsdiid = 0; - u16 wake_sts; - int ret; - - /* find out which bits are set in LSDIID for this sublink */ - ret = hdac_bus_eml_sdw_get_lsdiid_unlocked(sdw->link_res->hbus, sdw->instance, &lsdiid); - if (ret < 0) - return ret; - /* - * we need to use the global HDaudio WAKEEN/STS to be able to detect - * wakes in low-power modes + * We follow the HDaudio example and resume unconditionally + * without checking the WAKESTS bit for that specific link */ - wake_sts = snd_hdac_chip_readw(sdw->link_res->hbus, STATESTS); - return wake_sts & lsdiid; + return 1; } static void intel_shim_wake(struct sdw_intel *sdw, bool wake_enable) -- 2.34.1