Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1388705pxb; Thu, 28 Jan 2021 15:33:54 -0800 (PST) X-Google-Smtp-Source: ABdhPJy5s2jCXr/LJxD6iQNRcTE0KejX8XR+ynIJ22GU/B9N11jyhi6P4E1SIX1mGp2J39gNGM/1 X-Received: by 2002:a05:6402:312e:: with SMTP id dd14mr2275786edb.366.1611876834023; Thu, 28 Jan 2021 15:33:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611876834; cv=none; d=google.com; s=arc-20160816; b=MtXxyXmoIxntRiCUIJ0u+Bv4m89Etvd3poLqttJCb1mOCNllXn8o4EadtbXQe0zVIl 7FVIf5Nj8Lkg3Lb6g2MovRcePM4jWB73SHKa07SOZYzkkg35aq7fPKNWpZ4mckyfo8Fl 9VeVItN7pBLRLzAqUEA4IHVxxVqiq6Cg+lf3QWtx44EUmyL8ADz4oWUjKhUvW12iMXOd ziw1nRNlPZQrLh37Rvv/eUokxCcx009CoOGvCuCGMvZhtstWAt8/x6tdN0hM2S+Zk+hB 6MFqxwDnZruTeqSnJ1exMY3+GpeuEmTADxg2yVKJUnvWfXCxuNdte/CLB4Zn4rX+VU5L fhUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :ironport-sdr:ironport-sdr; bh=SQYpOJUVbVAuHIQmlNUnZfAS6syv5iJPz9csPsBzY2U=; b=CeYgaIsZwfq12NKtWzQjo5z36xY6O9J98F4eBxUS+4Xolf1oXROtCOhphWciHwI6rq 2X1vWY3biEcm4+I/5V/CmlRpp/o8PGlxfHJGaMj9FkJ+Bk02qYicw2+wgGFHo0D47OSs CG5J9UkbyiaLu4OCRsV9QAiBIjtSA0ZIYm2IuM3cqvXGZkrtTqhVsu1gkeha6j0nefib SJn9IOwvgIaDqUaQK+imKpqE1iIWiPfTUP2RWL7X1o0eogt8Eiqbb4QJQYzJlMUDnLCx GUFT5xXQI7CuBefJMqDK0QCOTpUE5eG5BizlO77cZ4SPEcuuNzqLE1wopHZvULnqdxhQ 8THQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gu20si3757301ejb.562.2021.01.28.15.33.29; Thu, 28 Jan 2021 15:33:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231156AbhA1XbM (ORCPT + 99 others); Thu, 28 Jan 2021 18:31:12 -0500 Received: from mga11.intel.com ([192.55.52.93]:4524 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231310AbhA1X3S (ORCPT ); Thu, 28 Jan 2021 18:29:18 -0500 IronPort-SDR: shD4p6NIhhDYysjMOHVHh5S6pluVZI9JCxZsyDK4Hxw6NgEBIjEk05jhKaplqSoZrLDdWz6SI4 G+K7y+RAXlrA== X-IronPort-AV: E=McAfee;i="6000,8403,9878"; a="176824524" X-IronPort-AV: E=Sophos;i="5.79,383,1602572400"; d="scan'208";a="176824524" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Jan 2021 15:27:33 -0800 IronPort-SDR: +ZI6vXBLOqRjUcuHT/LG/VTH07moeD/Zdy9kQBygbrtWx9TEZE9zLp7UchICfQpI7U7kqq5+zu e91yvUuuJz/w== X-IronPort-AV: E=Sophos;i="5.79,383,1602572400"; d="scan'208";a="354359314" Received: from paasikivi.fi.intel.com ([10.237.72.42]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Jan 2021 15:27:29 -0800 Received: from punajuuri.localdomain (punajuuri.localdomain [192.168.240.130]) by paasikivi.fi.intel.com (Postfix) with ESMTP id BB510211D8; Fri, 29 Jan 2021 01:27:27 +0200 (EET) Received: from sailus by punajuuri.localdomain with local (Exim 4.92) (envelope-from ) id 1l5GhF-0004F8-MI; Fri, 29 Jan 2021 01:27:29 +0200 From: Sakari Ailus To: linux-i2c@vger.kernel.org Cc: Wolfram Sang , "Rafael J. Wysocki" , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, Greg Kroah-Hartman , rajmohan.mani@intel.com, Tomasz Figa , Bartosz Golaszewski , Bingbu Cao , Chiranjeevi Rapolu , Hyungwoo Yang , linux-media@vger.kernel.org Subject: [PATCH v9 1/7] ACPI: scan: Obtain device's desired enumeration power state Date: Fri, 29 Jan 2021 01:27:23 +0200 Message-Id: <20210128232729.16064-1-sakari.ailus@linux.intel.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200903081550.6012-1-sakari.ailus@linux.intel.com> References: <20200903081550.6012-1-sakari.ailus@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Store a device's desired enumeration power state in struct acpi_device_power_flags during acpi_device object's initialisation. Signed-off-by: Sakari Ailus --- drivers/acpi/scan.c | 6 ++++++ include/acpi/acpi_bus.h | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c index 1d7a02ee45e05..b077c645c9845 100644 --- a/drivers/acpi/scan.c +++ b/drivers/acpi/scan.c @@ -987,6 +987,8 @@ static void acpi_bus_init_power_state(struct acpi_device *device, int state) static void acpi_bus_get_power_flags(struct acpi_device *device) { + unsigned long long pre; + acpi_status status; u32 i; /* Presence of _PS0|_PR0 indicates 'power manageable' */ @@ -1008,6 +1010,10 @@ static void acpi_bus_get_power_flags(struct acpi_device *device) if (acpi_has_method(device->handle, "_DSW")) device->power.flags.dsw_present = 1; + status = acpi_evaluate_integer(device->handle, "_PRE", NULL, &pre); + if (ACPI_SUCCESS(status) && !pre) + device->power.flags.allow_low_power_probe = 1; + /* * Enumerate supported power management states */ diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h index 02a716a0af5d4..020b850120883 100644 --- a/include/acpi/acpi_bus.h +++ b/include/acpi/acpi_bus.h @@ -258,7 +258,8 @@ struct acpi_device_power_flags { u32 power_removed:1; /* Optimize Dx->D0 */ u32 ignore_parent:1; /* Power is independent of parent power state */ u32 dsw_present:1; /* _DSW present? */ - u32 reserved:26; + u32 allow_low_power_probe:1; /* Allow low power state in device probe */ + u32 reserved:25; }; struct acpi_device_power_state { -- 2.20.1