linux/drivers/acpi/x86/s2idle.c

// SPDX-License-Identifier: GPL-2.0
/*
 * Architecture-specific ACPI-based support for suspend-to-idle.
 *
 * Author: Rafael J. Wysocki <[email protected]>
 * Author: Srinivas Pandruvada <[email protected]>
 * Author: Shyam Sundar S K <[email protected]>
 *
 * On platforms supporting the Low Power S0 Idle interface there is an ACPI
 * device object with the PNP0D80 compatible device ID (System Power Management
 * Controller) and a specific _DSM method under it.  That method, if present,
 * can be used to indicate to the platform that the OS is transitioning into a
 * low-power state in which certain types of activity are not desirable or that
 * it is leaving such a state, which allows the platform to adjust its operation
 * mode accordingly.
 */

#include <linux/acpi.h>
#include <linux/device.h>
#include <linux/dmi.h>
#include <linux/suspend.h>

#include "../sleep.h"

#ifdef CONFIG_SUSPEND

static bool sleep_no_lps0 __read_mostly;
module_param(sleep_no_lps0, bool, 0644);
MODULE_PARM_DESC();

static const struct acpi_device_id lps0_device_ids[] =;

/* Microsoft platform agnostic UUID */
#define ACPI_LPS0_DSM_UUID_MICROSOFT

#define ACPI_LPS0_DSM_UUID

#define ACPI_LPS0_GET_DEVICE_CONSTRAINTS
#define ACPI_LPS0_SCREEN_OFF
#define ACPI_LPS0_SCREEN_ON
#define ACPI_LPS0_ENTRY
#define ACPI_LPS0_EXIT
#define ACPI_LPS0_MS_ENTRY
#define ACPI_LPS0_MS_EXIT

/* AMD */
#define ACPI_LPS0_DSM_UUID_AMD
#define ACPI_LPS0_ENTRY_AMD
#define ACPI_LPS0_EXIT_AMD
#define ACPI_LPS0_SCREEN_OFF_AMD
#define ACPI_LPS0_SCREEN_ON_AMD

static acpi_handle lps0_device_handle;
static guid_t lps0_dsm_guid;
static int lps0_dsm_func_mask;

static guid_t lps0_dsm_guid_microsoft;
static int lps0_dsm_func_mask_microsoft;
static int lps0_dsm_state;

/* Device constraint entry structure */
struct lpi_device_info {};

/* Constraint package structure */
struct lpi_device_constraint {};

struct lpi_constraints {};

/* AMD Constraint package structure */
struct lpi_device_constraint_amd {};

static LIST_HEAD(lps0_s2idle_devops_head);

static struct lpi_constraints *lpi_constraints_table;
static int lpi_constraints_table_size;
static int rev_id;

#define for_each_lpi_constraint(entry)

static void lpi_device_get_constraints_amd(void)
{}

static void lpi_device_get_constraints(void)
{}

/**
 * acpi_get_lps0_constraint - Get the LPS0 constraint for a device.
 * @adev: Device to get the constraint for.
 *
 * The LPS0 constraint is the shallowest (minimum) power state in which the
 * device can be so as to allow the platform as a whole to achieve additional
 * energy conservation by utilizing a system-wide low-power state.
 *
 * Returns:
 *  - ACPI power state value of the constraint for @adev on success.
 *  - Otherwise, ACPI_STATE_UNKNOWN.
 */
int acpi_get_lps0_constraint(struct acpi_device *adev)
{}

static void lpi_check_constraints(void)
{}

static bool acpi_s2idle_vendor_amd(void)
{}

static const char *acpi_sleep_dsm_state_to_str(unsigned int state)
{}

static void acpi_sleep_run_lps0_dsm(unsigned int func, unsigned int func_mask, guid_t dsm_guid)
{}


static int validate_dsm(acpi_handle handle, const char *uuid, int rev, guid_t *dsm_guid)
{}

struct amd_lps0_hid_device_data {};

static const struct amd_lps0_hid_device_data amd_picasso =;

static const struct amd_lps0_hid_device_data amd_cezanne =;

static const struct acpi_device_id amd_hid_ids[] =;

static int lps0_device_attach(struct acpi_device *adev,
			      const struct acpi_device_id *not_used)
{}

static struct acpi_scan_handler lps0_handler =;

int acpi_s2idle_prepare_late(void)
{}

void acpi_s2idle_check(void)
{}

void acpi_s2idle_restore_early(void)
{}

static const struct platform_s2idle_ops acpi_s2idle_ops_lps0 =;

void __init acpi_s2idle_setup(void)
{}

int acpi_register_lps0_dev(struct acpi_s2idle_dev_ops *arg)
{}
EXPORT_SYMBOL_GPL();

void acpi_unregister_lps0_dev(struct acpi_s2idle_dev_ops *arg)
{}
EXPORT_SYMBOL_GPL();

#endif /* CONFIG_SUSPEND */