#define pr_fmt(fmt) …
#include <linux/acpi.h>
#include <linux/backlight.h>
#include <linux/debugfs.h>
#include <linux/delay.h>
#include <linux/dmi.h>
#include <linux/fb.h>
#include <linux/hwmon.h>
#include <linux/hwmon-sysfs.h>
#include <linux/init.h>
#include <linux/input.h>
#include <linux/input/sparse-keymap.h>
#include <linux/kernel.h>
#include <linux/leds.h>
#include <linux/minmax.h>
#include <linux/module.h>
#include <linux/pci.h>
#include <linux/pci_hotplug.h>
#include <linux/platform_data/x86/asus-wmi.h>
#include <linux/platform_device.h>
#include <linux/platform_profile.h>
#include <linux/power_supply.h>
#include <linux/rfkill.h>
#include <linux/seq_file.h>
#include <linux/slab.h>
#include <linux/types.h>
#include <linux/units.h>
#include <acpi/battery.h>
#include <acpi/video.h>
#include "asus-wmi.h"
MODULE_AUTHOR(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;
static bool fnlock_default = …;
module_param(fnlock_default, bool, 0444);
#define to_asus_wmi_driver(pdrv) …
#define ASUS_WMI_MGMT_GUID …
#define NOTIFY_BRNUP_MIN …
#define NOTIFY_BRNUP_MAX …
#define NOTIFY_BRNDOWN_MIN …
#define NOTIFY_BRNDOWN_MAX …
#define NOTIFY_FNLOCK_TOGGLE …
#define NOTIFY_KBD_DOCK_CHANGE …
#define NOTIFY_KBD_BRTUP …
#define NOTIFY_KBD_BRTDWN …
#define NOTIFY_KBD_BRTTOGGLE …
#define NOTIFY_KBD_FBM …
#define NOTIFY_KBD_TTP …
#define NOTIFY_LID_FLIP …
#define NOTIFY_LID_FLIP_ROG …
#define ASUS_WMI_FNLOCK_BIOS_DISABLED …
#define ASUS_MID_FAN_DESC …
#define ASUS_GPU_FAN_DESC …
#define ASUS_FAN_DESC …
#define ASUS_FAN_MFUN …
#define ASUS_FAN_SFUN_READ …
#define ASUS_FAN_SFUN_WRITE …
#define ASUS_FAN_CTRL_FULLSPEED …
#define ASUS_FAN_CTRL_MANUAL …
#define ASUS_FAN_CTRL_AUTO …
#define ASUS_FAN_BOOST_MODE_NORMAL …
#define ASUS_FAN_BOOST_MODE_OVERBOOST …
#define ASUS_FAN_BOOST_MODE_OVERBOOST_MASK …
#define ASUS_FAN_BOOST_MODE_SILENT …
#define ASUS_FAN_BOOST_MODE_SILENT_MASK …
#define ASUS_FAN_BOOST_MODES_MASK …
#define ASUS_THROTTLE_THERMAL_POLICY_DEFAULT …
#define ASUS_THROTTLE_THERMAL_POLICY_OVERBOOST …
#define ASUS_THROTTLE_THERMAL_POLICY_SILENT …
#define USB_INTEL_XUSB2PR …
#define PCI_DEVICE_ID_INTEL_LYNXPOINT_LP_XHCI …
#define ASUS_ACPI_UID_ASUSWMI …
#define WMI_EVENT_MASK …
#define FAN_CURVE_POINTS …
#define FAN_CURVE_BUF_LEN …
#define FAN_CURVE_DEV_CPU …
#define FAN_CURVE_DEV_GPU …
#define FAN_CURVE_DEV_MID …
#define FAN_CURVE_PWM_MASK …
#define PPT_TOTAL_MIN …
#define PPT_TOTAL_MAX …
#define PPT_CPU_MIN …
#define PPT_CPU_MAX …
#define NVIDIA_BOOST_MIN …
#define NVIDIA_BOOST_MAX …
#define NVIDIA_TEMP_MIN …
#define NVIDIA_TEMP_MAX …
#define ASUS_SCREENPAD_BRIGHT_MIN …
#define ASUS_SCREENPAD_BRIGHT_MAX …
#define ASUS_SCREENPAD_BRIGHT_DEFAULT …
#define ASUS_MINI_LED_MODE_MASK …
#define ASUS_MINI_LED_OFF …
#define ASUS_MINI_LED_ON …
#define ASUS_MINI_LED_STRONG_MODE …
#define ASUS_MINI_LED_2024_WEAK …
#define ASUS_MINI_LED_2024_STRONG …
#define ASUS_MINI_LED_2024_OFF …
#define ASUS_USB0_PWR_EC0_CSEE …
#define ASUS_USB0_PWR_EC0_CSEE_WAIT …
static const char * const ashs_ids[] = …;
static int throttle_thermal_policy_write(struct asus_wmi *);
static bool ashs_present(void)
{ … }
struct bios_args { … } __packed;
struct agfn_args { … } __packed;
struct agfn_fan_args { … } __packed;
struct asus_wmi_debug { … };
struct asus_rfkill { … };
enum fan_type { … };
struct fan_curve_data { … };
struct asus_wmi { … };
static int asus_wmi_evaluate_method3(u32 method_id,
u32 arg0, u32 arg1, u32 arg2, u32 *retval)
{ … }
int asus_wmi_evaluate_method(u32 method_id, u32 arg0, u32 arg1, u32 *retval)
{ … }
EXPORT_SYMBOL_GPL(…);
static int asus_wmi_evaluate_method5(u32 method_id,
u32 arg0, u32 arg1, u32 arg2, u32 arg3, u32 arg4, u32 *retval)
{ … }
static int asus_wmi_evaluate_method_buf(u32 method_id,
u32 arg0, u32 arg1, u8 *ret_buffer, size_t size)
{ … }
static int asus_wmi_evaluate_method_agfn(const struct acpi_buffer args)
{ … }
static int asus_wmi_get_devstate(struct asus_wmi *asus, u32 dev_id, u32 *retval)
{ … }
static int asus_wmi_set_devstate(u32 dev_id, u32 ctrl_param,
u32 *retval)
{ … }
static int asus_wmi_get_devstate_bits(struct asus_wmi *asus,
u32 dev_id, u32 mask)
{ … }
static int asus_wmi_get_devstate_simple(struct asus_wmi *asus, u32 dev_id)
{ … }
static bool asus_wmi_dev_is_present(struct asus_wmi *asus, u32 dev_id)
{ … }
static void asus_wmi_tablet_sw_report(struct asus_wmi *asus, bool value)
{ … }
static void asus_wmi_tablet_sw_init(struct asus_wmi *asus, u32 dev_id, int event_code)
{ … }
static int asus_wmi_input_init(struct asus_wmi *asus)
{ … }
static void asus_wmi_input_exit(struct asus_wmi *asus)
{ … }
static void asus_wmi_tablet_mode_get_state(struct asus_wmi *asus)
{ … }
static ssize_t charge_mode_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static DEVICE_ATTR_RO(charge_mode);
static ssize_t dgpu_disable_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t dgpu_disable_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static DEVICE_ATTR_RW(dgpu_disable);
static ssize_t egpu_enable_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t egpu_enable_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static DEVICE_ATTR_RW(egpu_enable);
static ssize_t egpu_connected_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static DEVICE_ATTR_RO(egpu_connected);
static ssize_t gpu_mux_mode_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t gpu_mux_mode_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static DEVICE_ATTR_RW(gpu_mux_mode);
static ssize_t kbd_rgb_mode_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static DEVICE_ATTR_WO(kbd_rgb_mode);
static DEVICE_STRING_ATTR_RO(kbd_rgb_mode_index, 0444,
"cmd mode red green blue speed");
static struct attribute *kbd_rgb_mode_attrs[] = …;
static const struct attribute_group kbd_rgb_mode_group = …;
static ssize_t kbd_rgb_state_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static DEVICE_ATTR_WO(kbd_rgb_state);
static DEVICE_STRING_ATTR_RO(kbd_rgb_state_index, 0444,
"cmd boot awake sleep keyboard");
static struct attribute *kbd_rgb_state_attrs[] = …;
static const struct attribute_group kbd_rgb_state_group = …;
static const struct attribute_group *kbd_rgb_mode_groups[] = …;
static ssize_t ppt_pl2_sppt_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static ssize_t ppt_pl2_sppt_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{ … }
static DEVICE_ATTR_RW(ppt_pl2_sppt);
static ssize_t ppt_pl1_spl_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static ssize_t ppt_pl1_spl_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{ … }
static DEVICE_ATTR_RW(ppt_pl1_spl);
static ssize_t ppt_fppt_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static ssize_t ppt_fppt_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{ … }
static DEVICE_ATTR_RW(ppt_fppt);
static ssize_t ppt_apu_sppt_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static ssize_t ppt_apu_sppt_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{ … }
static DEVICE_ATTR_RW(ppt_apu_sppt);
static ssize_t ppt_platform_sppt_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static ssize_t ppt_platform_sppt_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{ … }
static DEVICE_ATTR_RW(ppt_platform_sppt);
static ssize_t nv_dynamic_boost_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static ssize_t nv_dynamic_boost_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{ … }
static DEVICE_ATTR_RW(nv_dynamic_boost);
static ssize_t nv_temp_target_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static ssize_t nv_temp_target_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{ … }
static DEVICE_ATTR_RW(nv_temp_target);
static ssize_t mcu_powersave_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t mcu_powersave_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static DEVICE_ATTR_RW(mcu_powersave);
static int charge_end_threshold;
static ssize_t charge_control_end_threshold_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static ssize_t charge_control_end_threshold_show(struct device *device,
struct device_attribute *attr,
char *buf)
{ … }
static DEVICE_ATTR_RW(charge_control_end_threshold);
static int asus_wmi_battery_add(struct power_supply *battery, struct acpi_battery_hook *hook)
{ … }
static int asus_wmi_battery_remove(struct power_supply *battery, struct acpi_battery_hook *hook)
{ … }
static struct acpi_battery_hook battery_hook = …;
static void asus_wmi_battery_init(struct asus_wmi *asus)
{ … }
static void asus_wmi_battery_exit(struct asus_wmi *asus)
{ … }
static void tpd_led_update(struct work_struct *work)
{ … }
static void tpd_led_set(struct led_classdev *led_cdev,
enum led_brightness value)
{ … }
static int read_tpd_led_state(struct asus_wmi *asus)
{ … }
static enum led_brightness tpd_led_get(struct led_classdev *led_cdev)
{ … }
static void kbd_led_update(struct asus_wmi *asus)
{ … }
static int kbd_led_read(struct asus_wmi *asus, int *level, int *env)
{ … }
static void do_kbd_led_set(struct led_classdev *led_cdev, int value)
{ … }
static void kbd_led_set(struct led_classdev *led_cdev,
enum led_brightness value)
{ … }
static void kbd_led_set_by_kbd(struct asus_wmi *asus, enum led_brightness value)
{ … }
static enum led_brightness kbd_led_get(struct led_classdev *led_cdev)
{ … }
static int wlan_led_unknown_state(struct asus_wmi *asus)
{ … }
static void wlan_led_update(struct work_struct *work)
{ … }
static void wlan_led_set(struct led_classdev *led_cdev,
enum led_brightness value)
{ … }
static enum led_brightness wlan_led_get(struct led_classdev *led_cdev)
{ … }
static void lightbar_led_update(struct work_struct *work)
{ … }
static void lightbar_led_set(struct led_classdev *led_cdev,
enum led_brightness value)
{ … }
static enum led_brightness lightbar_led_get(struct led_classdev *led_cdev)
{ … }
static int micmute_led_set(struct led_classdev *led_cdev,
enum led_brightness brightness)
{ … }
static enum led_brightness camera_led_get(struct led_classdev *led_cdev)
{ … }
static int camera_led_set(struct led_classdev *led_cdev,
enum led_brightness brightness)
{ … }
static void asus_wmi_led_exit(struct asus_wmi *asus)
{ … }
static int asus_wmi_led_init(struct asus_wmi *asus)
{ … }
static bool asus_wlan_rfkill_blocked(struct asus_wmi *asus)
{ … }
static void asus_rfkill_hotplug(struct asus_wmi *asus)
{ … }
static void asus_rfkill_notify(acpi_handle handle, u32 event, void *data)
{ … }
static int asus_register_rfkill_notifier(struct asus_wmi *asus, char *node)
{ … }
static void asus_unregister_rfkill_notifier(struct asus_wmi *asus, char *node)
{ … }
static int asus_get_adapter_status(struct hotplug_slot *hotplug_slot,
u8 *value)
{ … }
static const struct hotplug_slot_ops asus_hotplug_slot_ops = …;
static void asus_hotplug_work(struct work_struct *work)
{ … }
static int asus_setup_pci_hotplug(struct asus_wmi *asus)
{ … }
static int asus_rfkill_set(void *data, bool blocked)
{ … }
static void asus_rfkill_query(struct rfkill *rfkill, void *data)
{ … }
static int asus_rfkill_wlan_set(void *data, bool blocked)
{ … }
static const struct rfkill_ops asus_rfkill_wlan_ops = …;
static const struct rfkill_ops asus_rfkill_ops = …;
static int asus_new_rfkill(struct asus_wmi *asus,
struct asus_rfkill *arfkill,
const char *name, enum rfkill_type type, int dev_id)
{ … }
static void asus_wmi_rfkill_exit(struct asus_wmi *asus)
{ … }
static int asus_wmi_rfkill_init(struct asus_wmi *asus)
{ … }
static ssize_t panel_od_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t panel_od_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static DEVICE_ATTR_RW(panel_od);
static ssize_t boot_sound_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t boot_sound_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static DEVICE_ATTR_RW(boot_sound);
static ssize_t mini_led_mode_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t mini_led_mode_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static DEVICE_ATTR_RW(mini_led_mode);
static ssize_t available_mini_led_mode_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static DEVICE_ATTR_RO(available_mini_led_mode);
static void asus_wmi_set_xusb2pr(struct asus_wmi *asus)
{ … }
static void asus_wmi_set_als(void)
{ … }
static int asus_agfn_fan_speed_read(struct asus_wmi *asus, int fan,
int *speed)
{ … }
static int asus_agfn_fan_speed_write(struct asus_wmi *asus, int fan,
int *speed)
{ … }
static bool asus_wmi_has_agfn_fan(struct asus_wmi *asus)
{ … }
static int asus_fan_set_auto(struct asus_wmi *asus)
{ … }
static ssize_t pwm1_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{ … }
static ssize_t pwm1_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count) { … }
static ssize_t fan1_input_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{ … }
static ssize_t pwm1_enable_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{ … }
static ssize_t pwm1_enable_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static ssize_t asus_hwmon_temp1(struct device *dev,
struct device_attribute *attr,
char *buf)
{ … }
static ssize_t fan2_input_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{ … }
static ssize_t fan3_input_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{ … }
static ssize_t pwm2_enable_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{ … }
static ssize_t pwm2_enable_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static ssize_t pwm3_enable_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{ … }
static ssize_t pwm3_enable_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static DEVICE_ATTR_RW(pwm1);
static DEVICE_ATTR_RW(pwm1_enable);
static DEVICE_ATTR_RO(fan1_input);
static DEVICE_STRING_ATTR_RO(fan1_label, 0444, ASUS_FAN_DESC);
static DEVICE_ATTR_RW(pwm2_enable);
static DEVICE_ATTR_RO(fan2_input);
static DEVICE_STRING_ATTR_RO(fan2_label, 0444, ASUS_GPU_FAN_DESC);
static DEVICE_ATTR_RW(pwm3_enable);
static DEVICE_ATTR_RO(fan3_input);
static DEVICE_STRING_ATTR_RO(fan3_label, 0444, ASUS_MID_FAN_DESC);
static DEVICE_ATTR(temp1_input, S_IRUGO, asus_hwmon_temp1, NULL);
static struct attribute *hwmon_attributes[] = …;
static umode_t asus_hwmon_sysfs_is_visible(struct kobject *kobj,
struct attribute *attr, int idx)
{ … }
static const struct attribute_group hwmon_attribute_group = …;
__ATTRIBUTE_GROUPS(…);
static int asus_wmi_hwmon_init(struct asus_wmi *asus)
{ … }
static int asus_wmi_fan_init(struct asus_wmi *asus)
{ … }
static int fan_boost_mode_check_present(struct asus_wmi *asus)
{ … }
static int fan_boost_mode_write(struct asus_wmi *asus)
{ … }
static int fan_boost_mode_switch_next(struct asus_wmi *asus)
{ … }
static ssize_t fan_boost_mode_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t fan_boost_mode_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static DEVICE_ATTR_RW(fan_boost_mode);
static void fan_curve_copy_from_buf(struct fan_curve_data *data, u8 *buf)
{ … }
static int fan_curve_get_factory_default(struct asus_wmi *asus, u32 fan_dev)
{ … }
static int fan_curve_check_present(struct asus_wmi *asus, bool *available,
u32 fan_dev)
{ … }
static struct fan_curve_data *fan_curve_attr_select(struct asus_wmi *asus,
struct device_attribute *attr)
{ … }
static struct fan_curve_data *fan_curve_attr_2_select(struct asus_wmi *asus,
struct device_attribute *attr)
{ … }
static ssize_t fan_curve_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static int fan_curve_write(struct asus_wmi *asus,
struct fan_curve_data *data)
{ … }
static ssize_t fan_curve_store(struct device *dev,
struct device_attribute *attr, const char *buf,
size_t count)
{ … }
static ssize_t fan_curve_enable_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t fan_curve_enable_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static SENSOR_DEVICE_ATTR_RW(pwm1_enable, fan_curve_enable, FAN_CURVE_DEV_CPU);
static SENSOR_DEVICE_ATTR_2_RW(pwm1_auto_point1_temp, fan_curve,
FAN_CURVE_DEV_CPU, 0);
static SENSOR_DEVICE_ATTR_2_RW(pwm1_auto_point2_temp, fan_curve,
FAN_CURVE_DEV_CPU, 1);
static SENSOR_DEVICE_ATTR_2_RW(pwm1_auto_point3_temp, fan_curve,
FAN_CURVE_DEV_CPU, 2);
static SENSOR_DEVICE_ATTR_2_RW(pwm1_auto_point4_temp, fan_curve,
FAN_CURVE_DEV_CPU, 3);
static SENSOR_DEVICE_ATTR_2_RW(pwm1_auto_point5_temp, fan_curve,
FAN_CURVE_DEV_CPU, 4);
static SENSOR_DEVICE_ATTR_2_RW(pwm1_auto_point6_temp, fan_curve,
FAN_CURVE_DEV_CPU, 5);
static SENSOR_DEVICE_ATTR_2_RW(pwm1_auto_point7_temp, fan_curve,
FAN_CURVE_DEV_CPU, 6);
static SENSOR_DEVICE_ATTR_2_RW(pwm1_auto_point8_temp, fan_curve,
FAN_CURVE_DEV_CPU, 7);
static SENSOR_DEVICE_ATTR_2_RW(pwm1_auto_point1_pwm, fan_curve,
FAN_CURVE_DEV_CPU | FAN_CURVE_PWM_MASK, 0);
static SENSOR_DEVICE_ATTR_2_RW(pwm1_auto_point2_pwm, fan_curve,
FAN_CURVE_DEV_CPU | FAN_CURVE_PWM_MASK, 1);
static SENSOR_DEVICE_ATTR_2_RW(pwm1_auto_point3_pwm, fan_curve,
FAN_CURVE_DEV_CPU | FAN_CURVE_PWM_MASK, 2);
static SENSOR_DEVICE_ATTR_2_RW(pwm1_auto_point4_pwm, fan_curve,
FAN_CURVE_DEV_CPU | FAN_CURVE_PWM_MASK, 3);
static SENSOR_DEVICE_ATTR_2_RW(pwm1_auto_point5_pwm, fan_curve,
FAN_CURVE_DEV_CPU | FAN_CURVE_PWM_MASK, 4);
static SENSOR_DEVICE_ATTR_2_RW(pwm1_auto_point6_pwm, fan_curve,
FAN_CURVE_DEV_CPU | FAN_CURVE_PWM_MASK, 5);
static SENSOR_DEVICE_ATTR_2_RW(pwm1_auto_point7_pwm, fan_curve,
FAN_CURVE_DEV_CPU | FAN_CURVE_PWM_MASK, 6);
static SENSOR_DEVICE_ATTR_2_RW(pwm1_auto_point8_pwm, fan_curve,
FAN_CURVE_DEV_CPU | FAN_CURVE_PWM_MASK, 7);
static SENSOR_DEVICE_ATTR_RW(pwm2_enable, fan_curve_enable, FAN_CURVE_DEV_GPU);
static SENSOR_DEVICE_ATTR_2_RW(pwm2_auto_point1_temp, fan_curve,
FAN_CURVE_DEV_GPU, 0);
static SENSOR_DEVICE_ATTR_2_RW(pwm2_auto_point2_temp, fan_curve,
FAN_CURVE_DEV_GPU, 1);
static SENSOR_DEVICE_ATTR_2_RW(pwm2_auto_point3_temp, fan_curve,
FAN_CURVE_DEV_GPU, 2);
static SENSOR_DEVICE_ATTR_2_RW(pwm2_auto_point4_temp, fan_curve,
FAN_CURVE_DEV_GPU, 3);
static SENSOR_DEVICE_ATTR_2_RW(pwm2_auto_point5_temp, fan_curve,
FAN_CURVE_DEV_GPU, 4);
static SENSOR_DEVICE_ATTR_2_RW(pwm2_auto_point6_temp, fan_curve,
FAN_CURVE_DEV_GPU, 5);
static SENSOR_DEVICE_ATTR_2_RW(pwm2_auto_point7_temp, fan_curve,
FAN_CURVE_DEV_GPU, 6);
static SENSOR_DEVICE_ATTR_2_RW(pwm2_auto_point8_temp, fan_curve,
FAN_CURVE_DEV_GPU, 7);
static SENSOR_DEVICE_ATTR_2_RW(pwm2_auto_point1_pwm, fan_curve,
FAN_CURVE_DEV_GPU | FAN_CURVE_PWM_MASK, 0);
static SENSOR_DEVICE_ATTR_2_RW(pwm2_auto_point2_pwm, fan_curve,
FAN_CURVE_DEV_GPU | FAN_CURVE_PWM_MASK, 1);
static SENSOR_DEVICE_ATTR_2_RW(pwm2_auto_point3_pwm, fan_curve,
FAN_CURVE_DEV_GPU | FAN_CURVE_PWM_MASK, 2);
static SENSOR_DEVICE_ATTR_2_RW(pwm2_auto_point4_pwm, fan_curve,
FAN_CURVE_DEV_GPU | FAN_CURVE_PWM_MASK, 3);
static SENSOR_DEVICE_ATTR_2_RW(pwm2_auto_point5_pwm, fan_curve,
FAN_CURVE_DEV_GPU | FAN_CURVE_PWM_MASK, 4);
static SENSOR_DEVICE_ATTR_2_RW(pwm2_auto_point6_pwm, fan_curve,
FAN_CURVE_DEV_GPU | FAN_CURVE_PWM_MASK, 5);
static SENSOR_DEVICE_ATTR_2_RW(pwm2_auto_point7_pwm, fan_curve,
FAN_CURVE_DEV_GPU | FAN_CURVE_PWM_MASK, 6);
static SENSOR_DEVICE_ATTR_2_RW(pwm2_auto_point8_pwm, fan_curve,
FAN_CURVE_DEV_GPU | FAN_CURVE_PWM_MASK, 7);
static SENSOR_DEVICE_ATTR_RW(pwm3_enable, fan_curve_enable, FAN_CURVE_DEV_MID);
static SENSOR_DEVICE_ATTR_2_RW(pwm3_auto_point1_temp, fan_curve,
FAN_CURVE_DEV_MID, 0);
static SENSOR_DEVICE_ATTR_2_RW(pwm3_auto_point2_temp, fan_curve,
FAN_CURVE_DEV_MID, 1);
static SENSOR_DEVICE_ATTR_2_RW(pwm3_auto_point3_temp, fan_curve,
FAN_CURVE_DEV_MID, 2);
static SENSOR_DEVICE_ATTR_2_RW(pwm3_auto_point4_temp, fan_curve,
FAN_CURVE_DEV_MID, 3);
static SENSOR_DEVICE_ATTR_2_RW(pwm3_auto_point5_temp, fan_curve,
FAN_CURVE_DEV_MID, 4);
static SENSOR_DEVICE_ATTR_2_RW(pwm3_auto_point6_temp, fan_curve,
FAN_CURVE_DEV_MID, 5);
static SENSOR_DEVICE_ATTR_2_RW(pwm3_auto_point7_temp, fan_curve,
FAN_CURVE_DEV_MID, 6);
static SENSOR_DEVICE_ATTR_2_RW(pwm3_auto_point8_temp, fan_curve,
FAN_CURVE_DEV_MID, 7);
static SENSOR_DEVICE_ATTR_2_RW(pwm3_auto_point1_pwm, fan_curve,
FAN_CURVE_DEV_MID | FAN_CURVE_PWM_MASK, 0);
static SENSOR_DEVICE_ATTR_2_RW(pwm3_auto_point2_pwm, fan_curve,
FAN_CURVE_DEV_MID | FAN_CURVE_PWM_MASK, 1);
static SENSOR_DEVICE_ATTR_2_RW(pwm3_auto_point3_pwm, fan_curve,
FAN_CURVE_DEV_MID | FAN_CURVE_PWM_MASK, 2);
static SENSOR_DEVICE_ATTR_2_RW(pwm3_auto_point4_pwm, fan_curve,
FAN_CURVE_DEV_MID | FAN_CURVE_PWM_MASK, 3);
static SENSOR_DEVICE_ATTR_2_RW(pwm3_auto_point5_pwm, fan_curve,
FAN_CURVE_DEV_MID | FAN_CURVE_PWM_MASK, 4);
static SENSOR_DEVICE_ATTR_2_RW(pwm3_auto_point6_pwm, fan_curve,
FAN_CURVE_DEV_MID | FAN_CURVE_PWM_MASK, 5);
static SENSOR_DEVICE_ATTR_2_RW(pwm3_auto_point7_pwm, fan_curve,
FAN_CURVE_DEV_MID | FAN_CURVE_PWM_MASK, 6);
static SENSOR_DEVICE_ATTR_2_RW(pwm3_auto_point8_pwm, fan_curve,
FAN_CURVE_DEV_MID | FAN_CURVE_PWM_MASK, 7);
static struct attribute *asus_fan_curve_attr[] = …;
static umode_t asus_fan_curve_is_visible(struct kobject *kobj,
struct attribute *attr, int idx)
{ … }
static const struct attribute_group asus_fan_curve_attr_group = …;
__ATTRIBUTE_GROUPS(…);
static int asus_wmi_custom_fan_curve_init(struct asus_wmi *asus)
{ … }
static int throttle_thermal_policy_check_present(struct asus_wmi *asus)
{ … }
static int throttle_thermal_policy_write(struct asus_wmi *asus)
{ … }
static int throttle_thermal_policy_set_default(struct asus_wmi *asus)
{ … }
static int throttle_thermal_policy_switch_next(struct asus_wmi *asus)
{ … }
static ssize_t throttle_thermal_policy_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t throttle_thermal_policy_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static DEVICE_ATTR_RW(throttle_thermal_policy);
static int asus_wmi_platform_profile_get(struct platform_profile_handler *pprof,
enum platform_profile_option *profile)
{ … }
static int asus_wmi_platform_profile_set(struct platform_profile_handler *pprof,
enum platform_profile_option profile)
{ … }
static int platform_profile_setup(struct asus_wmi *asus)
{ … }
static int read_backlight_power(struct asus_wmi *asus)
{ … }
static int read_brightness_max(struct asus_wmi *asus)
{ … }
static int read_brightness(struct backlight_device *bd)
{ … }
static u32 get_scalar_command(struct backlight_device *bd)
{ … }
static int update_bl_status(struct backlight_device *bd)
{ … }
static const struct backlight_ops asus_wmi_bl_ops = …;
static int asus_wmi_backlight_notify(struct asus_wmi *asus, int code)
{ … }
static int asus_wmi_backlight_init(struct asus_wmi *asus)
{ … }
static void asus_wmi_backlight_exit(struct asus_wmi *asus)
{ … }
static int is_display_toggle(int code)
{ … }
static int read_screenpad_backlight_power(struct asus_wmi *asus)
{ … }
static int read_screenpad_brightness(struct backlight_device *bd)
{ … }
static int update_screenpad_bl_status(struct backlight_device *bd)
{ … }
static const struct backlight_ops asus_screenpad_bl_ops = …;
static int asus_screenpad_init(struct asus_wmi *asus)
{ … }
static void asus_screenpad_exit(struct asus_wmi *asus)
{ … }
static bool asus_wmi_has_fnlock_key(struct asus_wmi *asus)
{ … }
static void asus_wmi_fnlock_update(struct asus_wmi *asus)
{ … }
static int asus_wmi_get_event_code(u32 value)
{ … }
static void asus_wmi_handle_event_code(int code, struct asus_wmi *asus)
{ … }
static void asus_wmi_notify(u32 value, void *context)
{ … }
static ssize_t store_sys_wmi(struct asus_wmi *asus, int devid,
const char *buf, size_t count)
{ … }
static ssize_t show_sys_wmi(struct asus_wmi *asus, int devid, char *buf)
{ … }
#define ASUS_WMI_CREATE_DEVICE_ATTR(_name, _mode, _cm) …
ASUS_WMI_CREATE_DEVICE_ATTR(…);
ASUS_WMI_CREATE_DEVICE_ATTR(…);
ASUS_WMI_CREATE_DEVICE_ATTR(…);
ASUS_WMI_CREATE_DEVICE_ATTR(…);
ASUS_WMI_CREATE_DEVICE_ATTR(…);
static ssize_t cpufv_store(struct device *dev, struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static DEVICE_ATTR_WO(cpufv);
static struct attribute *platform_attributes[] = …;
static umode_t asus_sysfs_is_visible(struct kobject *kobj,
struct attribute *attr, int idx)
{ … }
static const struct attribute_group platform_attribute_group = …;
static void asus_wmi_sysfs_exit(struct platform_device *device)
{ … }
static int asus_wmi_sysfs_init(struct platform_device *device)
{ … }
static int asus_wmi_platform_init(struct asus_wmi *asus)
{ … }
struct asus_wmi_debugfs_node { … };
static int show_dsts(struct seq_file *m, void *data)
{ … }
static int show_devs(struct seq_file *m, void *data)
{ … }
static int show_call(struct seq_file *m, void *data)
{ … }
static struct asus_wmi_debugfs_node asus_wmi_debug_files[] = …;
static int asus_wmi_debugfs_open(struct inode *inode, struct file *file)
{ … }
static const struct file_operations asus_wmi_debugfs_io_ops = …;
static void asus_wmi_debugfs_exit(struct asus_wmi *asus)
{ … }
static void asus_wmi_debugfs_init(struct asus_wmi *asus)
{ … }
static int asus_wmi_add(struct platform_device *pdev)
{ … }
static void asus_wmi_remove(struct platform_device *device)
{ … }
static int asus_hotk_thaw(struct device *device)
{ … }
static int asus_hotk_resume(struct device *device)
{ … }
static int asus_hotk_resume_early(struct device *device)
{ … }
static int asus_hotk_prepare(struct device *device)
{ … }
static int asus_hotk_restore(struct device *device)
{ … }
static const struct dev_pm_ops asus_pm_ops = …;
static int asus_wmi_probe(struct platform_device *pdev)
{ … }
static bool used;
int __init_or_module asus_wmi_register_driver(struct asus_wmi_driver *driver)
{ … }
EXPORT_SYMBOL_GPL(…);
void asus_wmi_unregister_driver(struct asus_wmi_driver *driver)
{ … }
EXPORT_SYMBOL_GPL(…);
static int __init asus_wmi_init(void)
{ … }
static void __exit asus_wmi_exit(void)
{ … }
module_init(…) …;
module_exit(asus_wmi_exit);