#define pr_fmt(fmt) …
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/slab.h>
#include <linux/types.h>
#include <linux/input.h>
#include <linux/input/sparse-keymap.h>
#include <linux/platform_device.h>
#include <linux/platform_profile.h>
#include <linux/hwmon.h>
#include <linux/acpi.h>
#include <linux/mutex.h>
#include <linux/cleanup.h>
#include <linux/power_supply.h>
#include <linux/rfkill.h>
#include <linux/string.h>
#include <linux/dmi.h>
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;
MODULE_ALIAS(…) …;
MODULE_ALIAS(…) …;
#define HPWMI_EVENT_GUID …
#define HPWMI_BIOS_GUID …
#define HP_OMEN_EC_THERMAL_PROFILE_FLAGS_OFFSET …
#define HP_OMEN_EC_THERMAL_PROFILE_TIMER_OFFSET …
#define HP_OMEN_EC_THERMAL_PROFILE_OFFSET …
#define ACPI_AC_CLASS …
#define zero_if_sup(tmp) …
static const char * const omen_thermal_profile_boards[] = …;
static const char * const omen_thermal_profile_force_v0_boards[] = …;
static const char * const omen_timed_thermal_profile_boards[] = …;
static const char * const victus_thermal_profile_boards[] = …;
enum hp_wmi_radio { … };
enum hp_wmi_event_ids { … };
struct bios_args { … };
enum hp_wmi_commandtype { … };
enum hp_wmi_gm_commandtype { … };
enum hp_wmi_command { … };
enum hp_wmi_hardware_mask { … };
struct bios_return { … };
enum hp_return_value { … };
enum hp_wireless2_bits { … };
enum hp_thermal_profile_omen_v0 { … };
enum hp_thermal_profile_omen_v1 { … };
enum hp_thermal_profile_omen_flags { … };
enum hp_thermal_profile_victus { … };
enum hp_thermal_profile { … };
#define IS_HWBLOCKED(x) …
#define IS_SWBLOCKED(x) …
struct bios_rfkill2_device_state { … };
#define HPWMI_MAX_RFKILL2_DEVICES …
struct bios_rfkill2_state { … };
static const struct key_entry hp_wmi_keymap[] = …;
static DEFINE_MUTEX(active_platform_profile_lock);
static struct input_dev *hp_wmi_input_dev;
static struct input_dev *camera_shutter_input_dev;
static struct platform_device *hp_wmi_platform_dev;
static struct platform_profile_handler platform_profile_handler;
static struct notifier_block platform_power_source_nb;
static enum platform_profile_option active_platform_profile;
static bool platform_profile_support;
static bool zero_insize_support;
static struct rfkill *wifi_rfkill;
static struct rfkill *bluetooth_rfkill;
static struct rfkill *wwan_rfkill;
struct rfkill2_device { … };
static int rfkill2_count;
static struct rfkill2_device rfkill2[HPWMI_MAX_RFKILL2_DEVICES];
static const char * const tablet_chassis_types[] = …;
#define DEVICE_MODE_TABLET …
static inline int encode_outsize_for_pvsz(int outsize)
{ … }
static int hp_wmi_perform_query(int query, enum hp_wmi_command command,
void *buffer, int insize, int outsize)
{ … }
static int hp_wmi_get_fan_speed(int fan)
{ … }
static int hp_wmi_read_int(int query)
{ … }
static int hp_wmi_get_dock_state(void)
{ … }
static int hp_wmi_get_tablet_mode(void)
{ … }
static int omen_thermal_profile_set(int mode)
{ … }
static bool is_omen_thermal_profile(void)
{ … }
static int omen_get_thermal_policy_version(void)
{ … }
static int omen_thermal_profile_get(void)
{ … }
static int hp_wmi_fan_speed_max_set(int enabled)
{ … }
static int hp_wmi_fan_speed_max_get(void)
{ … }
static int __init hp_wmi_bios_2008_later(void)
{ … }
static int __init hp_wmi_bios_2009_later(void)
{ … }
static int __init hp_wmi_enable_hotkeys(void)
{ … }
static int hp_wmi_set_block(void *data, bool blocked)
{ … }
static const struct rfkill_ops hp_wmi_rfkill_ops = …;
static bool hp_wmi_get_sw_state(enum hp_wmi_radio r)
{ … }
static bool hp_wmi_get_hw_state(enum hp_wmi_radio r)
{ … }
static int hp_wmi_rfkill2_set_block(void *data, bool blocked)
{ … }
static const struct rfkill_ops hp_wmi_rfkill2_ops = …;
static int hp_wmi_rfkill2_refresh(void)
{ … }
static ssize_t display_show(struct device *dev, struct device_attribute *attr,
char *buf)
{ … }
static ssize_t hddtemp_show(struct device *dev, struct device_attribute *attr,
char *buf)
{ … }
static ssize_t als_show(struct device *dev, struct device_attribute *attr,
char *buf)
{ … }
static ssize_t dock_show(struct device *dev, struct device_attribute *attr,
char *buf)
{ … }
static ssize_t tablet_show(struct device *dev, struct device_attribute *attr,
char *buf)
{ … }
static ssize_t postcode_show(struct device *dev, struct device_attribute *attr,
char *buf)
{ … }
static ssize_t als_store(struct device *dev, struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static ssize_t postcode_store(struct device *dev, struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static int camera_shutter_input_setup(void)
{ … }
static DEVICE_ATTR_RO(display);
static DEVICE_ATTR_RO(hddtemp);
static DEVICE_ATTR_RW(als);
static DEVICE_ATTR_RO(dock);
static DEVICE_ATTR_RO(tablet);
static DEVICE_ATTR_RW(postcode);
static struct attribute *hp_wmi_attrs[] = …;
ATTRIBUTE_GROUPS(…);
static void hp_wmi_notify(u32 value, void *context)
{ … }
static int __init hp_wmi_input_setup(void)
{ … }
static void hp_wmi_input_destroy(void)
{ … }
static int __init hp_wmi_rfkill_setup(struct platform_device *device)
{ … }
static int __init hp_wmi_rfkill2_setup(struct platform_device *device)
{ … }
static int platform_profile_omen_get_ec(enum platform_profile_option *profile)
{ … }
static int platform_profile_omen_get(struct platform_profile_handler *pprof,
enum platform_profile_option *profile)
{ … }
static bool has_omen_thermal_profile_ec_timer(void)
{ … }
inline int omen_thermal_profile_ec_flags_set(enum hp_thermal_profile_omen_flags flags)
{ … }
inline int omen_thermal_profile_ec_timer_set(u8 value)
{ … }
static int platform_profile_omen_set_ec(enum platform_profile_option profile)
{ … }
static int platform_profile_omen_set(struct platform_profile_handler *pprof,
enum platform_profile_option profile)
{ … }
static int thermal_profile_get(void)
{ … }
static int thermal_profile_set(int thermal_profile)
{ … }
static int hp_wmi_platform_profile_get(struct platform_profile_handler *pprof,
enum platform_profile_option *profile)
{ … }
static int hp_wmi_platform_profile_set(struct platform_profile_handler *pprof,
enum platform_profile_option profile)
{ … }
static bool is_victus_thermal_profile(void)
{ … }
static int platform_profile_victus_get_ec(enum platform_profile_option *profile)
{ … }
static int platform_profile_victus_get(struct platform_profile_handler *pprof,
enum platform_profile_option *profile)
{ … }
static int platform_profile_victus_set_ec(enum platform_profile_option profile)
{ … }
static int platform_profile_victus_set(struct platform_profile_handler *pprof,
enum platform_profile_option profile)
{ … }
static int omen_powersource_event(struct notifier_block *nb,
unsigned long value,
void *data)
{ … }
static int omen_register_powersource_event_handler(void)
{ … }
static inline void omen_unregister_powersource_event_handler(void)
{ … }
static int thermal_profile_setup(void)
{ … }
static int hp_wmi_hwmon_init(void);
static int __init hp_wmi_bios_setup(struct platform_device *device)
{ … }
static void __exit hp_wmi_bios_remove(struct platform_device *device)
{ … }
static int hp_wmi_resume_handler(struct device *device)
{ … }
static const struct dev_pm_ops hp_wmi_pm_ops = …;
static struct platform_driver hp_wmi_driver __refdata = …;
static umode_t hp_wmi_hwmon_is_visible(const void *data,
enum hwmon_sensor_types type,
u32 attr, int channel)
{ … }
static int hp_wmi_hwmon_read(struct device *dev, enum hwmon_sensor_types type,
u32 attr, int channel, long *val)
{ … }
static int hp_wmi_hwmon_write(struct device *dev, enum hwmon_sensor_types type,
u32 attr, int channel, long val)
{ … }
static const struct hwmon_channel_info * const info[] = …;
static const struct hwmon_ops ops = …;
static const struct hwmon_chip_info chip_info = …;
static int hp_wmi_hwmon_init(void)
{ … }
static int __init hp_wmi_init(void)
{ … }
module_init(…) …;
static void __exit hp_wmi_exit(void)
{ … }
module_exit(hp_wmi_exit);