forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-13 9d77db3c730780c8ef5ccd4b66403ff5675cfe4e
kernel/drivers/platform/x86/msi-laptop.c
....@@ -1,22 +1,9 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*-*-linux-c-*-*/
23
34 /*
45 Copyright (C) 2006 Lennart Poettering <mzxreary (at) 0pointer (dot) de>
56
6
- This program is free software; you can redistribute it and/or modify
7
- it under the terms of the GNU General Public License as published by
8
- the Free Software Foundation; either version 2 of the License, or
9
- (at your option) any later version.
10
-
11
- This program is distributed in the hope that it will be useful, but
12
- WITHOUT ANY WARRANTY; without even the implied warranty of
13
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
- General Public License for more details.
15
-
16
- You should have received a copy of the GNU General Public License
17
- along with this program; if not, write to the Free Software
18
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19
- 02110-1301, USA.
207 */
218
229 /*
....@@ -223,7 +210,7 @@
223210 return -EINVAL;
224211
225212 if (quirks->ec_read_only)
226
- return -EOPNOTSUPP;
213
+ return 0;
227214
228215 /* read current device state */
229216 result = ec_read(MSI_STANDARD_EC_COMMAND_ADDRESS, &rdata);
....@@ -609,11 +596,10 @@
609596 {
610597 .ident = "MSI S270",
611598 .matches = {
612
- DMI_MATCH(DMI_SYS_VENDOR, "MICRO-STAR INT'L CO.,LTD"),
599
+ DMI_MATCH(DMI_SYS_VENDOR, "MICRO-STAR INT"),
613600 DMI_MATCH(DMI_PRODUCT_NAME, "MS-1013"),
614601 DMI_MATCH(DMI_PRODUCT_VERSION, "0131"),
615
- DMI_MATCH(DMI_CHASSIS_VENDOR,
616
- "MICRO-STAR INT'L CO.,LTD")
602
+ DMI_MATCH(DMI_CHASSIS_VENDOR, "MICRO-STAR INT")
617603 },
618604 .driver_data = &quirk_old_ec_model,
619605 .callback = dmi_check_cb
....@@ -646,8 +632,7 @@
646632 DMI_MATCH(DMI_SYS_VENDOR, "NOTEBOOK"),
647633 DMI_MATCH(DMI_PRODUCT_NAME, "SAM2000"),
648634 DMI_MATCH(DMI_PRODUCT_VERSION, "0131"),
649
- DMI_MATCH(DMI_CHASSIS_VENDOR,
650
- "MICRO-STAR INT'L CO.,LTD")
635
+ DMI_MATCH(DMI_CHASSIS_VENDOR, "MICRO-STAR INT")
651636 },
652637 .driver_data = &quirk_old_ec_model,
653638 .callback = dmi_check_cb
....@@ -856,15 +841,15 @@
856841 static void msi_init_rfkill(struct work_struct *ignored)
857842 {
858843 if (rfk_wlan) {
859
- rfkill_set_sw_state(rfk_wlan, !wlan_s);
844
+ msi_rfkill_set_state(rfk_wlan, !wlan_s);
860845 rfkill_wlan_set(NULL, !wlan_s);
861846 }
862847 if (rfk_bluetooth) {
863
- rfkill_set_sw_state(rfk_bluetooth, !bluetooth_s);
848
+ msi_rfkill_set_state(rfk_bluetooth, !bluetooth_s);
864849 rfkill_bluetooth_set(NULL, !bluetooth_s);
865850 }
866851 if (rfk_threeg) {
867
- rfkill_set_sw_state(rfk_threeg, !threeg_s);
852
+ msi_rfkill_set_state(rfk_threeg, !threeg_s);
868853 rfkill_threeg_set(NULL, !threeg_s);
869854 }
870855 }
....@@ -1061,8 +1046,7 @@
10611046 return -EINVAL;
10621047
10631048 /* Register backlight stuff */
1064
-
1065
- if (quirks->old_ec_model ||
1049
+ if (quirks->old_ec_model &&
10661050 acpi_video_get_backlight_type() == acpi_backlight_vendor) {
10671051 struct backlight_properties props;
10681052 memset(&props, 0, sizeof(struct backlight_properties));
....@@ -1130,6 +1114,8 @@
11301114 fail_create_group:
11311115 if (quirks->load_scm_model) {
11321116 i8042_remove_filter(msi_laptop_i8042_filter);
1117
+ cancel_delayed_work_sync(&msi_touchpad_dwork);
1118
+ input_unregister_device(msi_laptop_input_dev);
11331119 cancel_delayed_work_sync(&msi_rfkill_dwork);
11341120 cancel_work_sync(&msi_rfkill_work);
11351121 rfkill_cleanup();
....@@ -1150,6 +1136,7 @@
11501136 {
11511137 if (quirks->load_scm_model) {
11521138 i8042_remove_filter(msi_laptop_i8042_filter);
1139
+ cancel_delayed_work_sync(&msi_touchpad_dwork);
11531140 input_unregister_device(msi_laptop_input_dev);
11541141 cancel_delayed_work_sync(&msi_rfkill_dwork);
11551142 cancel_work_sync(&msi_rfkill_work);