Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2355032pxb; Fri, 5 Feb 2021 16:11:56 -0800 (PST) X-Google-Smtp-Source: ABdhPJzJxvbnkx7ikgOaZV6Udmxt9Uwuk30qe/so1W7ExyjmdJ1IrQxNfM63XRMTRBr/BYtPhxtg X-Received: by 2002:a17:906:9bcd:: with SMTP id de13mr6196844ejc.245.1612570316061; Fri, 05 Feb 2021 16:11:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612570316; cv=none; d=google.com; s=arc-20160816; b=Ceqpt+CSFr+YExabA9BwFYcKvuNb6sXOJZ2ckbha23rVLCQ6CkT3oN035STq2syKHP GYnzBiUJXu5j7OGhd3EYnhwMFy+7xQAEd483JfrBz5hdMBvHWFTjvd+Cg4Jodc7sOAVy 1f3NrY6eczl1zx2obLq+n0iCEsebRClibmSPsJhkRFkqeOgAJ5WDkp4YE23aK4N1Pjph k7ma8oPF4rCSMbmltTWq7zqq+oy8XXdkPJ5ECj/1/+wMm19vslyBNxh1Y0D9Y3tLt/lO ZG1uSWx3q3XhwPXZnUsP7Y7tN54wpgs9tHbkQzfD59aMwFzb+T6PgPtg21W9Yo7hsf+d eLOQ== 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=dS7okKjytQ1isRa+xilriy/n/q7er5Lc1edGZWLzfPM=; b=VS0XhRisXM7w3+GEUYHr2Vytxqs5wxKK1R3bGGgR7aXsysps9FXRLYhd1ZER3rUDK0 6L+USzF8FJ0HPhe4rS3n7sCTkwwz8WEcW1k4A5cA4eWrbp1bKEtpDr5sgcvv9UpeIMQ2 6zZONQGhgj6vFxg7lqFPop6+q84J8dLwj6xbK2sMX4hrzN7qDBZuJf5IwmBCVqZngBZu zpPGKqAURd8DHYlkBOzrL+fvEJfVkUJHkvcYQegv7sFbCjbPXQsmI4hczxE6sRwzl1GX y586aVK1u/8HCkt/jp1UxYERLH+eIwx4+zUt1n0o8tGyLfXoLKaFuI6XLtpVH29F9mJb SXMw== 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 i7si7755779ejo.54.2021.02.05.16.11.31; Fri, 05 Feb 2021 16:11:56 -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 S231345AbhBFAKY (ORCPT + 99 others); Fri, 5 Feb 2021 19:10:24 -0500 Received: from mga12.intel.com ([192.55.52.136]:60933 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229959AbhBEN2w (ORCPT ); Fri, 5 Feb 2021 08:28:52 -0500 IronPort-SDR: bddQPWHzeoSAMSHsOqoxWeS/RdT8900zcMB6YvYOpHqkI72WAtuVnsB1vTmApN3vPfD9qvbHRd SA16q4rA4zqw== X-IronPort-AV: E=McAfee;i="6000,8403,9885"; a="160589439" X-IronPort-AV: E=Sophos;i="5.81,154,1610438400"; d="scan'208";a="160589439" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Feb 2021 05:24:56 -0800 IronPort-SDR: exWrynaxi8nwsAbdPFhPyxc/U2dfzuhauTirkVS6W2IifPhiOPeSDsPekze/NI4HnzifAq77Ov 12UU4uW5QArw== X-IronPort-AV: E=Sophos;i="5.81,154,1610438400"; d="scan'208";a="393862627" Received: from paasikivi.fi.intel.com ([10.237.72.42]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Feb 2021 05:24:53 -0800 Received: from punajuuri.localdomain (punajuuri.localdomain [192.168.240.130]) by paasikivi.fi.intel.com (Postfix) with ESMTP id 822D7205D2; Fri, 5 Feb 2021 15:24:51 +0200 (EET) Received: from sailus by punajuuri.localdomain with local (Exim 4.92) (envelope-from ) id 1l816f-0005GE-9P; Fri, 05 Feb 2021 15:25:05 +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 v10 1/7] ACPI: scan: Obtain device's desired enumeration power state Date: Fri, 5 Feb 2021 15:24:59 +0200 Message-Id: <20210205132505.20173-2-sakari.ailus@linux.intel.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210205132505.20173-1-sakari.ailus@linux.intel.com> References: <20210205132505.20173-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 during acpi_device object's initialisation. Signed-off-by: Sakari Ailus --- drivers/acpi/scan.c | 4 ++++ include/acpi/acpi_bus.h | 1 + 2 files changed, 5 insertions(+) diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c index 1d7a02ee45e05..cdff32f297122 100644 --- a/drivers/acpi/scan.c +++ b/drivers/acpi/scan.c @@ -987,6 +987,7 @@ 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 dse = ACPI_STATE_D0; u32 i; /* Presence of _PS0|_PR0 indicates 'power manageable' */ @@ -1008,6 +1009,9 @@ static void acpi_bus_get_power_flags(struct acpi_device *device) if (acpi_has_method(device->handle, "_DSW")) device->power.flags.dsw_present = 1; + acpi_evaluate_integer(device->handle, "_DSE", NULL, &dse); + device->power.state_for_enumeration = dse; + /* * Enumerate supported power management states */ diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h index 02a716a0af5d4..becfc9f57002b 100644 --- a/include/acpi/acpi_bus.h +++ b/include/acpi/acpi_bus.h @@ -276,6 +276,7 @@ struct acpi_device_power { int state; /* Current state */ struct acpi_device_power_flags flags; struct acpi_device_power_state states[ACPI_D_STATE_COUNT]; /* Power states (D0-D3Cold) */ + u8 state_for_enumeration; /* Maximum power state for enumeration */ }; /* Performance Management */ -- 2.20.1