#define pr_fmt(fmt) …
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/acpi.h>
#include <linux/dmi.h>
#include <linux/backlight.h>
#include <linux/platform_device.h>
#include <linux/rfkill.h>
#include <linux/i8042.h>
#include <linux/input.h>
#include <linux/input/sparse-keymap.h>
#include <acpi/video.h>
#define MSI_LCD_LEVEL_MAX …
#define MSI_EC_COMMAND_WIRELESS …
#define MSI_EC_COMMAND_LCD_LEVEL …
#define MSI_STANDARD_EC_COMMAND_ADDRESS …
#define MSI_STANDARD_EC_BLUETOOTH_MASK …
#define MSI_STANDARD_EC_WEBCAM_MASK …
#define MSI_STANDARD_EC_WLAN_MASK …
#define MSI_STANDARD_EC_3G_MASK …
#define MSI_STANDARD_EC_SCM_LOAD_ADDRESS …
#define MSI_STANDARD_EC_SCM_LOAD_MASK …
#define MSI_STANDARD_EC_FUNCTIONS_ADDRESS …
#define MSI_STANDARD_EC_TURBO_MASK …
#define MSI_STANDARD_EC_ECO_MASK …
#define MSI_STANDARD_EC_TOUCHPAD_MASK …
#define MSI_STANDARD_EC_TURBO_COOLDOWN_MASK …
#define MSI_STANDARD_EC_FAN_ADDRESS …
#define MSI_STANDARD_EC_AUTOFAN_MASK …
#ifdef CONFIG_PM_SLEEP
static int msi_laptop_resume(struct device *device);
#endif
static SIMPLE_DEV_PM_OPS(msi_laptop_pm, NULL, msi_laptop_resume);
#define MSI_STANDARD_EC_DEVICES_EXISTS_ADDRESS …
static bool force;
module_param(force, bool, 0);
MODULE_PARM_DESC(…) …;
static int auto_brightness;
module_param(auto_brightness, int, 0);
MODULE_PARM_DESC(…) …;
static const struct key_entry msi_laptop_keymap[] = …;
static struct input_dev *msi_laptop_input_dev;
static int wlan_s, bluetooth_s, threeg_s;
static int threeg_exists;
static struct rfkill *rfk_wlan, *rfk_bluetooth, *rfk_threeg;
struct quirk_entry { … };
static struct quirk_entry *quirks;
static int set_lcd_level(int level)
{ … }
static int get_lcd_level(void)
{ … }
static int get_auto_brightness(void)
{ … }
static int set_auto_brightness(int enable)
{ … }
static ssize_t set_device_state(const char *buf, size_t count, u8 mask)
{ … }
static int get_wireless_state(int *wlan, int *bluetooth)
{ … }
static int get_wireless_state_ec_standard(void)
{ … }
static int get_threeg_exists(void)
{ … }
static int bl_get_brightness(struct backlight_device *b)
{ … }
static int bl_update_status(struct backlight_device *b)
{ … }
static const struct backlight_ops msibl_ops = …;
static struct backlight_device *msibl_device;
static ssize_t show_wlan(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t store_wlan(struct device *dev,
struct device_attribute *attr, const char *buf, size_t count)
{ … }
static ssize_t show_bluetooth(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t store_bluetooth(struct device *dev,
struct device_attribute *attr, const char *buf, size_t count)
{ … }
static ssize_t show_threeg(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t store_threeg(struct device *dev,
struct device_attribute *attr, const char *buf, size_t count)
{ … }
static ssize_t show_lcd_level(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t store_lcd_level(struct device *dev,
struct device_attribute *attr, const char *buf, size_t count)
{ … }
static ssize_t show_auto_brightness(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t store_auto_brightness(struct device *dev,
struct device_attribute *attr, const char *buf, size_t count)
{ … }
static ssize_t show_touchpad(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t show_turbo(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t show_eco(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t show_turbo_cooldown(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t show_auto_fan(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t store_auto_fan(struct device *dev,
struct device_attribute *attr, const char *buf, size_t count)
{ … }
static DEVICE_ATTR(lcd_level, 0644, show_lcd_level, store_lcd_level);
static DEVICE_ATTR(auto_brightness, 0644, show_auto_brightness,
store_auto_brightness);
static DEVICE_ATTR(bluetooth, 0444, show_bluetooth, NULL);
static DEVICE_ATTR(wlan, 0444, show_wlan, NULL);
static DEVICE_ATTR(threeg, 0444, show_threeg, NULL);
static DEVICE_ATTR(touchpad, 0444, show_touchpad, NULL);
static DEVICE_ATTR(turbo_mode, 0444, show_turbo, NULL);
static DEVICE_ATTR(eco_mode, 0444, show_eco, NULL);
static DEVICE_ATTR(turbo_cooldown, 0444, show_turbo_cooldown, NULL);
static DEVICE_ATTR(auto_fan, 0644, show_auto_fan, store_auto_fan);
static struct attribute *msipf_attributes[] = …;
static struct attribute *msipf_old_attributes[] = …;
static const struct attribute_group msipf_attribute_group = …;
static const struct attribute_group msipf_old_attribute_group = …;
static struct platform_driver msipf_driver = …;
static struct platform_device *msipf_device;
static struct quirk_entry quirk_old_ec_model = …;
static struct quirk_entry quirk_load_scm_model = …;
static struct quirk_entry quirk_load_scm_ro_model = …;
static int dmi_check_cb(const struct dmi_system_id *dmi)
{ … }
static unsigned long msi_work_delay(int msecs)
{ … }
static const struct dmi_system_id msi_dmi_table[] __initconst = …;
MODULE_DEVICE_TABLE(dmi, msi_dmi_table);
static int rfkill_bluetooth_set(void *data, bool blocked)
{ … }
static int rfkill_wlan_set(void *data, bool blocked)
{ … }
static int rfkill_threeg_set(void *data, bool blocked)
{ … }
static const struct rfkill_ops rfkill_bluetooth_ops = …;
static const struct rfkill_ops rfkill_wlan_ops = …;
static const struct rfkill_ops rfkill_threeg_ops = …;
static void rfkill_cleanup(void)
{ … }
static bool msi_rfkill_set_state(struct rfkill *rfkill, bool blocked)
{ … }
static void msi_update_rfkill(struct work_struct *ignored)
{ … }
static DECLARE_DELAYED_WORK(msi_rfkill_dwork, msi_update_rfkill);
static void msi_send_touchpad_key(struct work_struct *ignored)
{ … }
static DECLARE_DELAYED_WORK(msi_touchpad_dwork, msi_send_touchpad_key);
static bool msi_laptop_i8042_filter(unsigned char data, unsigned char str,
struct serio *port)
{ … }
static void msi_init_rfkill(struct work_struct *ignored)
{ … }
static DECLARE_DELAYED_WORK(msi_rfkill_init, msi_init_rfkill);
static int rfkill_init(struct platform_device *sdev)
{ … }
static int msi_scm_disable_hw_fn_handling(void)
{ … }
#ifdef CONFIG_PM_SLEEP
static int msi_laptop_resume(struct device *device)
{ … }
#endif
static int __init msi_laptop_input_setup(void)
{ … }
static int __init load_scm_model_init(struct platform_device *sdev)
{ … }
static void msi_scm_model_exit(void)
{ … }
static int __init msi_init(void)
{ … }
static void __exit msi_cleanup(void)
{ … }
module_init(…) …;
module_exit(msi_cleanup);
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;