| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /*-*-linux-c-*-*/ |
|---|
| 2 | 3 | |
|---|
| 3 | 4 | /* |
|---|
| 4 | 5 | Copyright (C) 2006 Lennart Poettering <mzxreary (at) 0pointer (dot) de> |
|---|
| 5 | 6 | |
|---|
| 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. |
|---|
| 20 | 7 | */ |
|---|
| 21 | 8 | |
|---|
| 22 | 9 | /* |
|---|
| .. | .. |
|---|
| 223 | 210 | return -EINVAL; |
|---|
| 224 | 211 | |
|---|
| 225 | 212 | if (quirks->ec_read_only) |
|---|
| 226 | | - return -EOPNOTSUPP; |
|---|
| 213 | + return 0; |
|---|
| 227 | 214 | |
|---|
| 228 | 215 | /* read current device state */ |
|---|
| 229 | 216 | result = ec_read(MSI_STANDARD_EC_COMMAND_ADDRESS, &rdata); |
|---|
| .. | .. |
|---|
| 609 | 596 | { |
|---|
| 610 | 597 | .ident = "MSI S270", |
|---|
| 611 | 598 | .matches = { |
|---|
| 612 | | - DMI_MATCH(DMI_SYS_VENDOR, "MICRO-STAR INT'L CO.,LTD"), |
|---|
| 599 | + DMI_MATCH(DMI_SYS_VENDOR, "MICRO-STAR INT"), |
|---|
| 613 | 600 | DMI_MATCH(DMI_PRODUCT_NAME, "MS-1013"), |
|---|
| 614 | 601 | 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") |
|---|
| 617 | 603 | }, |
|---|
| 618 | 604 | .driver_data = &quirk_old_ec_model, |
|---|
| 619 | 605 | .callback = dmi_check_cb |
|---|
| .. | .. |
|---|
| 646 | 632 | DMI_MATCH(DMI_SYS_VENDOR, "NOTEBOOK"), |
|---|
| 647 | 633 | DMI_MATCH(DMI_PRODUCT_NAME, "SAM2000"), |
|---|
| 648 | 634 | 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") |
|---|
| 651 | 636 | }, |
|---|
| 652 | 637 | .driver_data = &quirk_old_ec_model, |
|---|
| 653 | 638 | .callback = dmi_check_cb |
|---|
| .. | .. |
|---|
| 856 | 841 | static void msi_init_rfkill(struct work_struct *ignored) |
|---|
| 857 | 842 | { |
|---|
| 858 | 843 | if (rfk_wlan) { |
|---|
| 859 | | - rfkill_set_sw_state(rfk_wlan, !wlan_s); |
|---|
| 844 | + msi_rfkill_set_state(rfk_wlan, !wlan_s); |
|---|
| 860 | 845 | rfkill_wlan_set(NULL, !wlan_s); |
|---|
| 861 | 846 | } |
|---|
| 862 | 847 | if (rfk_bluetooth) { |
|---|
| 863 | | - rfkill_set_sw_state(rfk_bluetooth, !bluetooth_s); |
|---|
| 848 | + msi_rfkill_set_state(rfk_bluetooth, !bluetooth_s); |
|---|
| 864 | 849 | rfkill_bluetooth_set(NULL, !bluetooth_s); |
|---|
| 865 | 850 | } |
|---|
| 866 | 851 | if (rfk_threeg) { |
|---|
| 867 | | - rfkill_set_sw_state(rfk_threeg, !threeg_s); |
|---|
| 852 | + msi_rfkill_set_state(rfk_threeg, !threeg_s); |
|---|
| 868 | 853 | rfkill_threeg_set(NULL, !threeg_s); |
|---|
| 869 | 854 | } |
|---|
| 870 | 855 | } |
|---|
| .. | .. |
|---|
| 1061 | 1046 | return -EINVAL; |
|---|
| 1062 | 1047 | |
|---|
| 1063 | 1048 | /* Register backlight stuff */ |
|---|
| 1064 | | - |
|---|
| 1065 | | - if (quirks->old_ec_model || |
|---|
| 1049 | + if (quirks->old_ec_model && |
|---|
| 1066 | 1050 | acpi_video_get_backlight_type() == acpi_backlight_vendor) { |
|---|
| 1067 | 1051 | struct backlight_properties props; |
|---|
| 1068 | 1052 | memset(&props, 0, sizeof(struct backlight_properties)); |
|---|
| .. | .. |
|---|
| 1130 | 1114 | fail_create_group: |
|---|
| 1131 | 1115 | if (quirks->load_scm_model) { |
|---|
| 1132 | 1116 | i8042_remove_filter(msi_laptop_i8042_filter); |
|---|
| 1117 | + cancel_delayed_work_sync(&msi_touchpad_dwork); |
|---|
| 1118 | + input_unregister_device(msi_laptop_input_dev); |
|---|
| 1133 | 1119 | cancel_delayed_work_sync(&msi_rfkill_dwork); |
|---|
| 1134 | 1120 | cancel_work_sync(&msi_rfkill_work); |
|---|
| 1135 | 1121 | rfkill_cleanup(); |
|---|
| .. | .. |
|---|
| 1150 | 1136 | { |
|---|
| 1151 | 1137 | if (quirks->load_scm_model) { |
|---|
| 1152 | 1138 | i8042_remove_filter(msi_laptop_i8042_filter); |
|---|
| 1139 | + cancel_delayed_work_sync(&msi_touchpad_dwork); |
|---|
| 1153 | 1140 | input_unregister_device(msi_laptop_input_dev); |
|---|
| 1154 | 1141 | cancel_delayed_work_sync(&msi_rfkill_dwork); |
|---|
| 1155 | 1142 | cancel_work_sync(&msi_rfkill_work); |
|---|