#include <linux/acpi.h>
#include <linux/debugfs.h>
#include <linux/delay.h>
#include <linux/dmi.h>
#include <linux/input.h>
#include <linux/input/sparse-keymap.h>
#include <linux/leds.h>
#include <linux/module.h>
#include <linux/mutex.h>
#include <linux/platform_device.h>
#include <linux/power_supply.h>
#include <linux/sysfs.h>
#include <linux/wmi.h>
#include <acpi/battery.h>
#define HWMI_METHOD_GUID …
#define HWMI_EVENT_GUID …
#define WMI0_EXPENSIVE_GUID …
#define WMI0_EVENT_GUID …
enum { … };
hwmi_arg;
struct quirk_entry { … };
static struct quirk_entry *quirks;
struct huawei_wmi_debug { … };
struct huawei_wmi { … };
static struct huawei_wmi *huawei_wmi;
static const struct key_entry huawei_wmi_keymap[] = …;
static int battery_reset = …;
static int report_brightness = …;
module_param(battery_reset, bint, 0444);
MODULE_PARM_DESC(…) …;
module_param(report_brightness, bint, 0444);
MODULE_PARM_DESC(…) …;
static int __init dmi_matched(const struct dmi_system_id *dmi)
{ … }
static struct quirk_entry quirk_unknown = …;
static struct quirk_entry quirk_battery_reset = …;
static struct quirk_entry quirk_matebook_x = …;
static const struct dmi_system_id huawei_quirks[] = …;
static int huawei_wmi_call(struct huawei_wmi *huawei,
struct acpi_buffer *in, struct acpi_buffer *out)
{ … }
static int huawei_wmi_cmd(u64 arg, u8 *buf, size_t buflen)
{ … }
static int huawei_wmi_micmute_led_set(struct led_classdev *led_cdev,
enum led_brightness brightness)
{ … }
static void huawei_wmi_leds_setup(struct device *dev)
{ … }
static int huawei_wmi_battery_get(int *start, int *end)
{ … }
static int huawei_wmi_battery_set(int start, int end)
{ … }
static ssize_t charge_control_start_threshold_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{ … }
static ssize_t charge_control_end_threshold_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{ … }
static ssize_t charge_control_thresholds_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{ … }
static ssize_t charge_control_start_threshold_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t size)
{ … }
static ssize_t charge_control_end_threshold_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t size)
{ … }
static ssize_t charge_control_thresholds_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t size)
{ … }
static DEVICE_ATTR_RW(charge_control_start_threshold);
static DEVICE_ATTR_RW(charge_control_end_threshold);
static DEVICE_ATTR_RW(charge_control_thresholds);
static int huawei_wmi_battery_add(struct power_supply *battery, struct acpi_battery_hook *hook)
{ … }
static int huawei_wmi_battery_remove(struct power_supply *battery, struct acpi_battery_hook *hook)
{ … }
static struct acpi_battery_hook huawei_wmi_battery_hook = …;
static void huawei_wmi_battery_setup(struct device *dev)
{ … }
static void huawei_wmi_battery_exit(struct device *dev)
{ … }
static int huawei_wmi_fn_lock_get(int *on)
{ … }
static int huawei_wmi_fn_lock_set(int on)
{ … }
static ssize_t fn_lock_state_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{ … }
static ssize_t fn_lock_state_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t size)
{ … }
static DEVICE_ATTR_RW(fn_lock_state);
static void huawei_wmi_fn_lock_setup(struct device *dev)
{ … }
static void huawei_wmi_fn_lock_exit(struct device *dev)
{ … }
static void huawei_wmi_debugfs_call_dump(struct seq_file *m, void *data,
union acpi_object *obj)
{ … }
static int huawei_wmi_debugfs_call_show(struct seq_file *m, void *data)
{ … }
DEFINE_SHOW_ATTRIBUTE(…);
static void huawei_wmi_debugfs_setup(struct device *dev)
{ … }
static void huawei_wmi_debugfs_exit(struct device *dev)
{ … }
static void huawei_wmi_process_key(struct input_dev *idev, int code)
{ … }
static void huawei_wmi_input_notify(u32 value, void *context)
{ … }
static int huawei_wmi_input_setup(struct device *dev, const char *guid)
{ … }
static void huawei_wmi_input_exit(struct device *dev, const char *guid)
{ … }
static const struct wmi_device_id huawei_wmi_events_id_table[] = …;
static int huawei_wmi_probe(struct platform_device *pdev)
{ … }
static void huawei_wmi_remove(struct platform_device *pdev)
{ … }
static struct platform_driver huawei_wmi_driver = …;
static __init int huawei_wmi_init(void)
{ … }
static __exit void huawei_wmi_exit(void)
{ … }
module_init(…) …;
module_exit(huawei_wmi_exit);
MODULE_ALIAS(…) …;
MODULE_DEVICE_TABLE(wmi, huawei_wmi_events_id_table);
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;