Lines Matching +full:long +full:- +full:press +full:- +full:ms

1 // SPDX-License-Identifier: GPL-2.0-or-later
2 /*-*-linux-c-*-*/
10 * msi-laptop.c - MSI S270 laptop support. This laptop is sold under
15 * This driver exports a few files in /sys/devices/platform/msi-laptop-pf/:
17 * lcd_level - Screen brightness: contains a single integer in the
20 * auto_brightness - Enable automatic brightness control: contains
25 * wlan - WLAN subsystem enabled: contains either 0 or 1. (ro)
27 * bluetooth - Bluetooth subsystem enabled: contains either 0 or 1
33 * available to userspace under /sys/class/backlight/msi-laptop-bl/.
53 #include <linux/input/sparse-keymap.h>
72 /* Power LED is orange - Turbo mode */
74 /* Power LED is green - ECO mode */
118 * disable the original Wlan/Bluetooth control by BIOS when user press
121 * On Linux, msi-laptop driver will do the same thing to disable the
147 return -EINVAL; in set_lcd_level()
208 return -EINVAL; in set_device_state()
210 if (quirks->ec_read_only) in set_device_state()
293 return set_lcd_level(b->props.brightness); in bl_update_status()
311 if (quirks->old_ec_model) { in show_wlan()
335 if (quirks->old_ec_model) { in show_bluetooth()
360 if (quirks->old_ec_model) in show_threeg()
361 return -ENODEV; in show_threeg()
397 return -EINVAL; in store_lcd_level()
426 return -EINVAL; in store_auto_brightness()
513 return -EINVAL; in store_auto_fan()
561 .name = "msi-laptop-pf",
586 pr_info("Identified laptop model '%s'\n", dmi->ident); in dmi_check_cb()
588 quirks = dmi->driver_data; in dmi_check_cb()
593 static unsigned long msi_work_delay(int msecs) in msi_work_delay()
595 if (quirks->ec_delay) in msi_work_delay()
605 DMI_MATCH(DMI_SYS_VENDOR, "MICRO-STAR INT"),
606 DMI_MATCH(DMI_PRODUCT_NAME, "MS-1013"),
608 DMI_MATCH(DMI_CHASSIS_VENDOR, "MICRO-STAR INT")
616 DMI_MATCH(DMI_SYS_VENDOR, "Micro-Star International"),
617 DMI_MATCH(DMI_PRODUCT_NAME, "MS-1058"),
619 DMI_MATCH(DMI_BOARD_NAME, "MS-1058")
627 DMI_MATCH(DMI_SYS_VENDOR, "Micro-Star International"),
628 DMI_MATCH(DMI_PRODUCT_NAME, "MS-1412"),
630 DMI_MATCH(DMI_BOARD_NAME, "MS-1412")
641 DMI_MATCH(DMI_CHASSIS_VENDOR, "MICRO-STAR INT")
650 "MICRO-STAR INTERNATIONAL CO., LTD"),
651 DMI_MATCH(DMI_PRODUCT_NAME, "MS-N034"),
653 "MICRO-STAR INTERNATIONAL CO., LTD")
662 "MICRO-STAR INTERNATIONAL CO., LTD"),
663 DMI_MATCH(DMI_PRODUCT_NAME, "MS-N051"),
665 "MICRO-STAR INTERNATIONAL CO., LTD")
674 "MICRO-STAR INTERNATIONAL CO., LTD"),
675 DMI_MATCH(DMI_PRODUCT_NAME, "MS-N014"),
684 "Micro-Star International"),
694 "Micro-Star International Co., Ltd."),
704 "MICRO-STAR INTERNATIONAL CO., LTD"),
775 if (quirks->ec_read_only) in msi_rfkill_set_state()
863 rfk_bluetooth = rfkill_alloc("msi-bluetooth", &sdev->dev, in rfkill_init()
867 retval = -ENOMEM; in rfkill_init()
874 rfk_wlan = rfkill_alloc("msi-wlan", &sdev->dev, RFKILL_TYPE_WLAN, in rfkill_init()
877 retval = -ENOMEM; in rfkill_init()
885 rfk_threeg = rfkill_alloc("msi-threeg", &sdev->dev, in rfkill_init()
888 retval = -ENOMEM; in rfkill_init()
919 if (!quirks->load_scm_model) in msi_scm_disable_hw_fn_handling()
948 return -ENOMEM; in msi_laptop_input_setup()
950 msi_laptop_input_dev->name = "MSI Laptop hotkeys"; in msi_laptop_input_setup()
951 msi_laptop_input_dev->phys = "msi-laptop/input0"; in msi_laptop_input_setup()
952 msi_laptop_input_dev->id.bustype = BUS_HOST; in msi_laptop_input_setup()
974 if (!quirks->ec_read_only) { in load_scm_model_init()
1019 if (!quirks->load_scm_model) in msi_scm_model_exit()
1034 return -ENODEV; in msi_init()
1043 if (!quirks->old_ec_model) in msi_init()
1047 return -EINVAL; in msi_init()
1050 if (quirks->old_ec_model && in msi_init()
1055 props.max_brightness = MSI_LCD_LEVEL_MAX - 1; in msi_init()
1056 msibl_device = backlight_device_register("msi-laptop-bl", NULL, in msi_init()
1069 msipf_device = platform_device_alloc("msi-laptop-pf", PLATFORM_DEVID_NONE); in msi_init()
1071 ret = -ENOMEM; in msi_init()
1079 if (quirks->load_scm_model && (load_scm_model_init(msipf_device) < 0)) { in msi_init()
1080 ret = -EINVAL; in msi_init()
1084 ret = sysfs_create_group(&msipf_device->dev.kobj, in msi_init()
1089 if (!quirks->old_ec_model) { in msi_init()
1091 ret = device_create_file(&msipf_device->dev, in msi_init()
1096 ret = sysfs_create_group(&msipf_device->dev.kobj, in msi_init()
1112 sysfs_remove_group(&msipf_device->dev.kobj, &msipf_attribute_group); in msi_init()
1130 sysfs_remove_group(&msipf_device->dev.kobj, &msipf_attribute_group); in msi_cleanup()
1131 if (!quirks->old_ec_model && threeg_exists) in msi_cleanup()
1132 device_remove_file(&msipf_device->dev, &dev_attr_threeg); in msi_cleanup()
1137 if (quirks->old_ec_model) { in msi_cleanup()