#include <asm/unaligned.h>
#include <linux/acpi.h>
#include <linux/delay.h>
#include <linux/jiffies.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/notifier.h>
#include <linux/platform_device.h>
#include <linux/rwsem.h>
#include <linux/surface_aggregator/controller.h>
#include <linux/surface_acpi_notify.h>
struct san_data { … };
#define to_san_data(ptr, member) …
static struct workqueue_struct *san_wq;
struct san_rqsg_if { … };
static struct san_rqsg_if san_rqsg_if = …;
static int san_set_rqsg_interface_device(struct device *dev)
{ … }
int san_client_link(struct device *client)
{ … }
EXPORT_SYMBOL_GPL(…);
int san_dgpu_notifier_register(struct notifier_block *nb)
{ … }
EXPORT_SYMBOL_GPL(…);
int san_dgpu_notifier_unregister(struct notifier_block *nb)
{ … }
EXPORT_SYMBOL_GPL(…);
static int san_dgpu_notifier_call(struct san_dgpu_event *evt)
{ … }
#define SAN_DSM_REVISION …
static const guid_t SAN_DSM_UUID = …;
enum san_dsm_event_fn { … };
enum sam_event_cid_bat { … };
enum sam_event_cid_tmp { … };
struct san_event_work { … };
static int san_acpi_notify_event(struct device *dev, u64 func,
union acpi_object *param)
{ … }
static int san_evt_bat_adp(struct device *dev, const struct ssam_event *event)
{ … }
static int san_evt_bat_bix(struct device *dev, const struct ssam_event *event)
{ … }
static int san_evt_bat_bst(struct device *dev, const struct ssam_event *event)
{ … }
static int san_evt_bat_dptf(struct device *dev, const struct ssam_event *event)
{ … }
static unsigned long san_evt_bat_delay(u8 cid)
{ … }
static bool san_evt_bat(const struct ssam_event *event, struct device *dev)
{ … }
static void san_evt_bat_workfn(struct work_struct *work)
{ … }
static u32 san_evt_bat_nf(struct ssam_event_notifier *nf,
const struct ssam_event *event)
{ … }
static int san_evt_tmp_trip(struct device *dev, const struct ssam_event *event)
{ … }
static bool san_evt_tmp(const struct ssam_event *event, struct device *dev)
{ … }
static u32 san_evt_tmp_nf(struct ssam_event_notifier *nf,
const struct ssam_event *event)
{ … }
struct gsb_data_in { … } __packed;
struct gsb_data_rqsx { … } __packed;
struct gsb_data_etwl { … } __packed;
struct gsb_data_out { … } __packed;
gsb_buffer_data;
struct gsb_buffer { … } __packed;
#define SAN_GSB_MAX_RQSX_PAYLOAD …
#define SAN_GSB_MAX_RESPONSE …
#define SAN_GSB_COMMAND …
enum san_gsb_request_cv { … };
#define SAN_REQUEST_NUM_TRIES …
static acpi_status san_etwl(struct san_data *d, struct gsb_buffer *b)
{ … }
static
struct gsb_data_rqsx *san_validate_rqsx(struct device *dev, const char *type,
struct gsb_buffer *b)
{ … }
static void gsb_rqsx_response_error(struct gsb_buffer *gsb, int status)
{ … }
static void gsb_rqsx_response_success(struct gsb_buffer *gsb, u8 *ptr, size_t len)
{ … }
static acpi_status san_rqst_fixup_suspended(struct san_data *d,
struct ssam_request *rqst,
struct gsb_buffer *gsb)
{ … }
static acpi_status san_rqst(struct san_data *d, struct gsb_buffer *buffer)
{ … }
static acpi_status san_rqsg(struct san_data *d, struct gsb_buffer *buffer)
{ … }
static acpi_status san_opreg_handler(u32 function, acpi_physical_address command,
u32 bits, u64 *value64, void *opreg_context,
void *region_context)
{ … }
static int san_events_register(struct platform_device *pdev)
{ … }
static void san_events_unregister(struct platform_device *pdev)
{ … }
#define san_consumer_printk(level, dev, handle, fmt, ...) …
#define san_consumer_dbg(dev, handle, fmt, ...) …
#define san_consumer_warn(dev, handle, fmt, ...) …
static acpi_status san_consumer_setup(acpi_handle handle, u32 lvl,
void *context, void **rv)
{ … }
static int san_consumer_links_setup(struct platform_device *pdev)
{ … }
static int san_probe(struct platform_device *pdev)
{ … }
static void san_remove(struct platform_device *pdev)
{ … }
static const struct acpi_device_id san_match[] = …;
MODULE_DEVICE_TABLE(acpi, san_match);
static struct platform_driver surface_acpi_notify = …;
static int __init san_init(void)
{ … }
module_init(…) …;
static void __exit san_exit(void)
{ … }
module_exit(san_exit);
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;