linux/drivers/acpi/acpi_tad.c

// SPDX-License-Identifier: GPL-2.0
/*
 * ACPI Time and Alarm (TAD) Device Driver
 *
 * Copyright (C) 2018 Intel Corporation
 * Author: Rafael J. Wysocki <[email protected]>
 *
 * This driver is based on Section 9.18 of the ACPI 6.2 specification revision.
 *
 * It only supports the system wakeup capabilities of the TAD.
 *
 * Provided are sysfs attributes, available under the TAD platform device,
 * allowing user space to manage the AC and DC wakeup timers of the TAD:
 * set and read their values, set and check their expire timer wake policies,
 * check and clear their status and check the capabilities of the TAD reported
 * by AML.  The DC timer attributes are only present if the TAD supports a
 * separate DC alarm timer.
 *
 * The wakeup events handling and power management of the TAD is expected to
 * be taken care of by the ACPI PM domain attached to its platform device.
 */

#include <linux/acpi.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
#include <linux/suspend.h>

MODULE_DESCRIPTION();
MODULE_LICENSE();
MODULE_AUTHOR();

/* ACPI TAD capability flags (ACPI 6.2, Section 9.18.2) */
#define ACPI_TAD_AC_WAKE
#define ACPI_TAD_DC_WAKE
#define ACPI_TAD_RT
#define ACPI_TAD_RT_IN_MS
#define ACPI_TAD_S4_S5__GWS
#define ACPI_TAD_AC_S4_WAKE
#define ACPI_TAD_AC_S5_WAKE
#define ACPI_TAD_DC_S4_WAKE
#define ACPI_TAD_DC_S5_WAKE

/* ACPI TAD alarm timer selection */
#define ACPI_TAD_AC_TIMER
#define ACPI_TAD_DC_TIMER

/* Special value for disabled timer or expired timer wake policy. */
#define ACPI_TAD_WAKE_DISABLED

struct acpi_tad_driver_data {};

struct acpi_tad_rt {} __packed;

static int acpi_tad_set_real_time(struct device *dev, struct acpi_tad_rt *rt)
{}

static int acpi_tad_get_real_time(struct device *dev, struct acpi_tad_rt *rt)
{}

static char *acpi_tad_rt_next_field(char *s, int *val)
{}

static ssize_t time_store(struct device *dev, struct device_attribute *attr,
			  const char *buf, size_t count)
{}

static ssize_t time_show(struct device *dev, struct device_attribute *attr,
			 char *buf)
{}

static DEVICE_ATTR_RW(time);

static struct attribute *acpi_tad_time_attrs[] =;
static const struct attribute_group acpi_tad_time_attr_group =;

static int acpi_tad_wake_set(struct device *dev, char *method, u32 timer_id,
			     u32 value)
{}

static int acpi_tad_wake_write(struct device *dev, const char *buf, char *method,
			       u32 timer_id, const char *specval)
{}

static ssize_t acpi_tad_wake_read(struct device *dev, char *buf, char *method,
				  u32 timer_id, const char *specval)
{}

static const char *alarm_specval =;

static int acpi_tad_alarm_write(struct device *dev, const char *buf,
				u32 timer_id)
{}

static ssize_t acpi_tad_alarm_read(struct device *dev, char *buf, u32 timer_id)
{}

static const char *policy_specval =;

static int acpi_tad_policy_write(struct device *dev, const char *buf,
				 u32 timer_id)
{}

static ssize_t acpi_tad_policy_read(struct device *dev, char *buf, u32 timer_id)
{}

static int acpi_tad_clear_status(struct device *dev, u32 timer_id)
{}

static int acpi_tad_status_write(struct device *dev, const char *buf, u32 timer_id)
{}

static ssize_t acpi_tad_status_read(struct device *dev, char *buf, u32 timer_id)
{}

static ssize_t caps_show(struct device *dev, struct device_attribute *attr,
			 char *buf)
{}

static DEVICE_ATTR_RO(caps);

static ssize_t ac_alarm_store(struct device *dev, struct device_attribute *attr,
			      const char *buf, size_t count)
{}

static ssize_t ac_alarm_show(struct device *dev, struct device_attribute *attr,
			     char *buf)
{}

static DEVICE_ATTR_RW(ac_alarm);

static ssize_t ac_policy_store(struct device *dev, struct device_attribute *attr,
			       const char *buf, size_t count)
{}

static ssize_t ac_policy_show(struct device *dev, struct device_attribute *attr,
			      char *buf)
{}

static DEVICE_ATTR_RW(ac_policy);

static ssize_t ac_status_store(struct device *dev, struct device_attribute *attr,
			       const char *buf, size_t count)
{}

static ssize_t ac_status_show(struct device *dev, struct device_attribute *attr,
			      char *buf)
{}

static DEVICE_ATTR_RW(ac_status);

static struct attribute *acpi_tad_attrs[] =;
static const struct attribute_group acpi_tad_attr_group =;

static ssize_t dc_alarm_store(struct device *dev, struct device_attribute *attr,
			      const char *buf, size_t count)
{}

static ssize_t dc_alarm_show(struct device *dev, struct device_attribute *attr,
			     char *buf)
{}

static DEVICE_ATTR_RW(dc_alarm);

static ssize_t dc_policy_store(struct device *dev, struct device_attribute *attr,
			       const char *buf, size_t count)
{}

static ssize_t dc_policy_show(struct device *dev, struct device_attribute *attr,
			      char *buf)
{}

static DEVICE_ATTR_RW(dc_policy);

static ssize_t dc_status_store(struct device *dev, struct device_attribute *attr,
			       const char *buf, size_t count)
{}

static ssize_t dc_status_show(struct device *dev, struct device_attribute *attr,
			      char *buf)
{}

static DEVICE_ATTR_RW(dc_status);

static struct attribute *acpi_tad_dc_attrs[] =;
static const struct attribute_group acpi_tad_dc_attr_group =;

static int acpi_tad_disable_timer(struct device *dev, u32 timer_id)
{}

static void acpi_tad_remove(struct platform_device *pdev)
{}

static int acpi_tad_probe(struct platform_device *pdev)
{}

static const struct acpi_device_id acpi_tad_ids[] =;

static struct platform_driver acpi_tad_driver =;
MODULE_DEVICE_TABLE(acpi, acpi_tad_ids);

module_platform_driver();