Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'platform-drivers-x86-v6.2-3' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86

Pull x86 platform driver fixes from Hans de Goede:

- Fix false positive apple_gmux backlight detection on older iGPU only
MacBook models

- Various other small fixes and hardware-id additions

* tag 'platform-drivers-x86-v6.2-3' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86:
platform/x86: thinkpad_acpi: Fix profile modes on Intel platforms
ACPI: video: Fix apple gmux detection
platform/x86: apple-gmux: Add apple_gmux_detect() helper
platform/x86: apple-gmux: Move port defines to apple-gmux.h
platform/x86: hp-wmi: Fix cast to smaller integer type warning
platform/x86/amd: pmc: Add a module parameter to disable workarounds
platform/x86/amd: pmc: Disable IRQ1 wakeup for RN/CZN
platform/x86: asus-wmi: Fix kbd_dock_devid tablet-switch reporting
platform/x86: gigabyte-wmi: add support for B450M DS3H WIFI-CF
platform/x86: hp-wmi: Handle Omen Key event
platform/x86: dell-wmi: Add a keymap for KEY_MUTE in type 0x0010 table

+211 -111
+3 -21
drivers/acpi/video_detect.c
··· 110 110 } 111 111 #endif 112 112 113 - static bool apple_gmux_backlight_present(void) 114 - { 115 - struct acpi_device *adev; 116 - struct device *dev; 117 - 118 - adev = acpi_dev_get_first_match_dev(GMUX_ACPI_HID, NULL, -1); 119 - if (!adev) 120 - return false; 121 - 122 - dev = acpi_get_first_physical_node(adev); 123 - if (!dev) 124 - return false; 125 - 126 - /* 127 - * drivers/platform/x86/apple-gmux.c only supports old style 128 - * Apple GMUX with an IO-resource. 129 - */ 130 - return pnp_get_resource(to_pnp_dev(dev), IORESOURCE_IO, 0) != NULL; 131 - } 132 - 133 113 /* Force to use vendor driver when the ACPI device is known to be 134 114 * buggy */ 135 115 static int video_detect_force_vendor(const struct dmi_system_id *d) ··· 746 766 { 747 767 static DEFINE_MUTEX(init_mutex); 748 768 static bool nvidia_wmi_ec_present; 769 + static bool apple_gmux_present; 749 770 static bool native_available; 750 771 static bool init_done; 751 772 static long video_caps; ··· 760 779 ACPI_UINT32_MAX, find_video, NULL, 761 780 &video_caps, NULL); 762 781 nvidia_wmi_ec_present = nvidia_wmi_ec_supported(); 782 + apple_gmux_present = apple_gmux_detect(NULL, NULL); 763 783 init_done = true; 764 784 } 765 785 if (native) ··· 782 800 if (nvidia_wmi_ec_present) 783 801 return acpi_backlight_nvidia_wmi_ec; 784 802 785 - if (apple_gmux_backlight_present()) 803 + if (apple_gmux_present) 786 804 return acpi_backlight_apple_gmux; 787 805 788 806 /* Use ACPI video if available, except when native should be preferred. */
+56 -2
drivers/platform/x86/amd/pmc.c
··· 22 22 #include <linux/pci.h> 23 23 #include <linux/platform_device.h> 24 24 #include <linux/rtc.h> 25 + #include <linux/serio.h> 25 26 #include <linux/suspend.h> 26 27 #include <linux/seq_file.h> 27 28 #include <linux/uaccess.h> ··· 160 159 static bool enable_stb; 161 160 module_param(enable_stb, bool, 0644); 162 161 MODULE_PARM_DESC(enable_stb, "Enable the STB debug mechanism"); 162 + 163 + static bool disable_workarounds; 164 + module_param(disable_workarounds, bool, 0644); 165 + MODULE_PARM_DESC(disable_workarounds, "Disable workarounds for platform bugs"); 163 166 164 167 static struct amd_pmc_dev pmc; 165 168 static int amd_pmc_send_cmd(struct amd_pmc_dev *dev, u32 arg, u32 *data, u8 msg, bool ret); ··· 658 653 return -EINVAL; 659 654 } 660 655 656 + static int amd_pmc_czn_wa_irq1(struct amd_pmc_dev *pdev) 657 + { 658 + struct device *d; 659 + int rc; 660 + 661 + if (!pdev->major) { 662 + rc = amd_pmc_get_smu_version(pdev); 663 + if (rc) 664 + return rc; 665 + } 666 + 667 + if (pdev->major > 64 || (pdev->major == 64 && pdev->minor > 65)) 668 + return 0; 669 + 670 + d = bus_find_device_by_name(&serio_bus, NULL, "serio0"); 671 + if (!d) 672 + return 0; 673 + if (device_may_wakeup(d)) { 674 + dev_info_once(d, "Disabling IRQ1 wakeup source to avoid platform firmware bug\n"); 675 + disable_irq_wake(1); 676 + device_set_wakeup_enable(d, false); 677 + } 678 + put_device(d); 679 + 680 + return 0; 681 + } 682 + 661 683 static int amd_pmc_verify_czn_rtc(struct amd_pmc_dev *pdev, u32 *arg) 662 684 { 663 685 struct rtc_device *rtc_device; ··· 747 715 /* Reset and Start SMU logging - to monitor the s0i3 stats */ 748 716 amd_pmc_setup_smu_logging(pdev); 749 717 750 - /* Activate CZN specific RTC functionality */ 751 - if (pdev->cpu_id == AMD_CPU_ID_CZN) { 718 + /* Activate CZN specific platform bug workarounds */ 719 + if (pdev->cpu_id == AMD_CPU_ID_CZN && !disable_workarounds) { 752 720 rc = amd_pmc_verify_czn_rtc(pdev, &arg); 753 721 if (rc) { 754 722 dev_err(pdev->dev, "failed to set RTC: %d\n", rc); ··· 814 782 .check = amd_pmc_s2idle_check, 815 783 .restore = amd_pmc_s2idle_restore, 816 784 }; 785 + 786 + static int __maybe_unused amd_pmc_suspend_handler(struct device *dev) 787 + { 788 + struct amd_pmc_dev *pdev = dev_get_drvdata(dev); 789 + 790 + if (pdev->cpu_id == AMD_CPU_ID_CZN && !disable_workarounds) { 791 + int rc = amd_pmc_czn_wa_irq1(pdev); 792 + 793 + if (rc) { 794 + dev_err(pdev->dev, "failed to adjust keyboard wakeup: %d\n", rc); 795 + return rc; 796 + } 797 + } 798 + 799 + return 0; 800 + } 801 + 802 + static SIMPLE_DEV_PM_OPS(amd_pmc_pm, amd_pmc_suspend_handler, NULL); 803 + 817 804 #endif 818 805 819 806 static const struct pci_device_id pmc_pci_ids[] = { ··· 1031 980 .name = "amd_pmc", 1032 981 .acpi_match_table = amd_pmc_acpi_ids, 1033 982 .dev_groups = pmc_groups, 983 + #ifdef CONFIG_SUSPEND 984 + .pm = &amd_pmc_pm, 985 + #endif 1034 986 }, 1035 987 .probe = amd_pmc_probe, 1036 988 .remove = amd_pmc_remove,
+18 -75
drivers/platform/x86/apple-gmux.c
··· 64 64 65 65 static struct apple_gmux_data *apple_gmux_data; 66 66 67 - /* 68 - * gmux port offsets. Many of these are not yet used, but may be in the 69 - * future, and it's useful to have them documented here anyhow. 70 - */ 71 - #define GMUX_PORT_VERSION_MAJOR 0x04 72 - #define GMUX_PORT_VERSION_MINOR 0x05 73 - #define GMUX_PORT_VERSION_RELEASE 0x06 74 - #define GMUX_PORT_SWITCH_DISPLAY 0x10 75 - #define GMUX_PORT_SWITCH_GET_DISPLAY 0x11 76 - #define GMUX_PORT_INTERRUPT_ENABLE 0x14 77 - #define GMUX_PORT_INTERRUPT_STATUS 0x16 78 - #define GMUX_PORT_SWITCH_DDC 0x28 79 - #define GMUX_PORT_SWITCH_EXTERNAL 0x40 80 - #define GMUX_PORT_SWITCH_GET_EXTERNAL 0x41 81 - #define GMUX_PORT_DISCRETE_POWER 0x50 82 - #define GMUX_PORT_MAX_BRIGHTNESS 0x70 83 - #define GMUX_PORT_BRIGHTNESS 0x74 84 - #define GMUX_PORT_VALUE 0xc2 85 - #define GMUX_PORT_READ 0xd0 86 - #define GMUX_PORT_WRITE 0xd4 87 - 88 - #define GMUX_MIN_IO_LEN (GMUX_PORT_BRIGHTNESS + 4) 89 - 90 67 #define GMUX_INTERRUPT_ENABLE 0xff 91 68 #define GMUX_INTERRUPT_DISABLE 0x00 92 69 ··· 224 247 gmux_index_write32(gmux_data, port, val); 225 248 else 226 249 gmux_pio_write32(gmux_data, port, val); 227 - } 228 - 229 - static bool gmux_is_indexed(struct apple_gmux_data *gmux_data) 230 - { 231 - u16 val; 232 - 233 - outb(0xaa, gmux_data->iostart + 0xcc); 234 - outb(0x55, gmux_data->iostart + 0xcd); 235 - outb(0x00, gmux_data->iostart + 0xce); 236 - 237 - val = inb(gmux_data->iostart + 0xcc) | 238 - (inb(gmux_data->iostart + 0xcd) << 8); 239 - 240 - if (val == 0x55aa) 241 - return true; 242 - 243 - return false; 244 250 } 245 251 246 252 /** ··· 565 605 int ret = -ENXIO; 566 606 acpi_status status; 567 607 unsigned long long gpe; 608 + bool indexed = false; 609 + u32 version; 568 610 569 611 if (apple_gmux_data) 570 612 return -EBUSY; 613 + 614 + if (!apple_gmux_detect(pnp, &indexed)) { 615 + pr_info("gmux device not present\n"); 616 + return -ENODEV; 617 + } 571 618 572 619 gmux_data = kzalloc(sizeof(*gmux_data), GFP_KERNEL); 573 620 if (!gmux_data) ··· 582 615 pnp_set_drvdata(pnp, gmux_data); 583 616 584 617 res = pnp_get_resource(pnp, IORESOURCE_IO, 0); 585 - if (!res) { 586 - pr_err("Failed to find gmux I/O resource\n"); 587 - goto err_free; 588 - } 589 - 590 618 gmux_data->iostart = res->start; 591 619 gmux_data->iolen = resource_size(res); 592 - 593 - if (gmux_data->iolen < GMUX_MIN_IO_LEN) { 594 - pr_err("gmux I/O region too small (%lu < %u)\n", 595 - gmux_data->iolen, GMUX_MIN_IO_LEN); 596 - goto err_free; 597 - } 598 620 599 621 if (!request_region(gmux_data->iostart, gmux_data->iolen, 600 622 "Apple gmux")) { ··· 591 635 goto err_free; 592 636 } 593 637 594 - /* 595 - * Invalid version information may indicate either that the gmux 596 - * device isn't present or that it's a new one that uses indexed 597 - * io 598 - */ 599 - 600 - ver_major = gmux_read8(gmux_data, GMUX_PORT_VERSION_MAJOR); 601 - ver_minor = gmux_read8(gmux_data, GMUX_PORT_VERSION_MINOR); 602 - ver_release = gmux_read8(gmux_data, GMUX_PORT_VERSION_RELEASE); 603 - if (ver_major == 0xff && ver_minor == 0xff && ver_release == 0xff) { 604 - if (gmux_is_indexed(gmux_data)) { 605 - u32 version; 606 - mutex_init(&gmux_data->index_lock); 607 - gmux_data->indexed = true; 608 - version = gmux_read32(gmux_data, 609 - GMUX_PORT_VERSION_MAJOR); 610 - ver_major = (version >> 24) & 0xff; 611 - ver_minor = (version >> 16) & 0xff; 612 - ver_release = (version >> 8) & 0xff; 613 - } else { 614 - pr_info("gmux device not present\n"); 615 - ret = -ENODEV; 616 - goto err_release; 617 - } 638 + if (indexed) { 639 + mutex_init(&gmux_data->index_lock); 640 + gmux_data->indexed = true; 641 + version = gmux_read32(gmux_data, GMUX_PORT_VERSION_MAJOR); 642 + ver_major = (version >> 24) & 0xff; 643 + ver_minor = (version >> 16) & 0xff; 644 + ver_release = (version >> 8) & 0xff; 645 + } else { 646 + ver_major = gmux_read8(gmux_data, GMUX_PORT_VERSION_MAJOR); 647 + ver_minor = gmux_read8(gmux_data, GMUX_PORT_VERSION_MINOR); 648 + ver_release = gmux_read8(gmux_data, GMUX_PORT_VERSION_RELEASE); 618 649 } 619 650 pr_info("Found gmux version %d.%d.%d [%s]\n", ver_major, ver_minor, 620 651 ver_release, (gmux_data->indexed ? "indexed" : "classic"));
+12 -5
drivers/platform/x86/asus-wmi.c
··· 225 225 226 226 int tablet_switch_event_code; 227 227 u32 tablet_switch_dev_id; 228 + bool tablet_switch_inverted; 228 229 229 230 enum fan_type fan_type; 230 231 enum fan_type gpu_fan_type; ··· 494 493 } 495 494 496 495 /* Input **********************************************************************/ 496 + static void asus_wmi_tablet_sw_report(struct asus_wmi *asus, bool value) 497 + { 498 + input_report_switch(asus->inputdev, SW_TABLET_MODE, 499 + asus->tablet_switch_inverted ? !value : value); 500 + input_sync(asus->inputdev); 501 + } 502 + 497 503 static void asus_wmi_tablet_sw_init(struct asus_wmi *asus, u32 dev_id, int event_code) 498 504 { 499 505 struct device *dev = &asus->platform_device->dev; ··· 509 501 result = asus_wmi_get_devstate_simple(asus, dev_id); 510 502 if (result >= 0) { 511 503 input_set_capability(asus->inputdev, EV_SW, SW_TABLET_MODE); 512 - input_report_switch(asus->inputdev, SW_TABLET_MODE, result); 504 + asus_wmi_tablet_sw_report(asus, result); 513 505 asus->tablet_switch_dev_id = dev_id; 514 506 asus->tablet_switch_event_code = event_code; 515 507 } else if (result == -ENODEV) { ··· 542 534 case asus_wmi_no_tablet_switch: 543 535 break; 544 536 case asus_wmi_kbd_dock_devid: 537 + asus->tablet_switch_inverted = true; 545 538 asus_wmi_tablet_sw_init(asus, ASUS_WMI_DEVID_KBD_DOCK, NOTIFY_KBD_DOCK_CHANGE); 546 539 break; 547 540 case asus_wmi_lid_flip_devid: ··· 582 573 return; 583 574 584 575 result = asus_wmi_get_devstate_simple(asus, asus->tablet_switch_dev_id); 585 - if (result >= 0) { 586 - input_report_switch(asus->inputdev, SW_TABLET_MODE, result); 587 - input_sync(asus->inputdev); 588 - } 576 + if (result >= 0) 577 + asus_wmi_tablet_sw_report(asus, result); 589 578 } 590 579 591 580 /* dGPU ********************************************************************/
+3
drivers/platform/x86/dell/dell-wmi-base.c
··· 261 261 { KE_KEY, 0x57, { KEY_BRIGHTNESSDOWN } }, 262 262 { KE_KEY, 0x58, { KEY_BRIGHTNESSUP } }, 263 263 264 + /*Speaker Mute*/ 265 + { KE_KEY, 0x109, { KEY_MUTE} }, 266 + 264 267 /* Mic mute */ 265 268 { KE_KEY, 0x150, { KEY_MICMUTE } }, 266 269
+1
drivers/platform/x86/gigabyte-wmi.c
··· 141 141 142 142 static const struct dmi_system_id gigabyte_wmi_known_working_platforms[] = { 143 143 DMI_EXACT_MATCH_GIGABYTE_BOARD_NAME("B450M DS3H-CF"), 144 + DMI_EXACT_MATCH_GIGABYTE_BOARD_NAME("B450M DS3H WIFI-CF"), 144 145 DMI_EXACT_MATCH_GIGABYTE_BOARD_NAME("B450M S2H V2"), 145 146 DMI_EXACT_MATCH_GIGABYTE_BOARD_NAME("B550 AORUS ELITE AX V2"), 146 147 DMI_EXACT_MATCH_GIGABYTE_BOARD_NAME("B550 AORUS ELITE"),
+5 -1
drivers/platform/x86/hp/hp-wmi.c
··· 90 90 HPWMI_PEAKSHIFT_PERIOD = 0x0F, 91 91 HPWMI_BATTERY_CHARGE_PERIOD = 0x10, 92 92 HPWMI_SANITIZATION_MODE = 0x17, 93 + HPWMI_OMEN_KEY = 0x1D, 93 94 HPWMI_SMART_EXPERIENCE_APP = 0x21, 94 95 }; 95 96 ··· 217 216 { KE_KEY, 0x213b, { KEY_INFO } }, 218 217 { KE_KEY, 0x2169, { KEY_ROTATE_DISPLAY } }, 219 218 { KE_KEY, 0x216a, { KEY_SETUP } }, 219 + { KE_KEY, 0x21a5, { KEY_PROG2 } }, /* HP Omen Key */ 220 + { KE_KEY, 0x21a7, { KEY_FN_ESC } }, 220 221 { KE_KEY, 0x21a9, { KEY_TOUCHPAD_OFF } }, 221 222 { KE_KEY, 0x121a9, { KEY_TOUCHPAD_ON } }, 222 223 { KE_KEY, 0x231b, { KEY_HELP } }, ··· 551 548 552 549 static int hp_wmi_set_block(void *data, bool blocked) 553 550 { 554 - enum hp_wmi_radio r = (enum hp_wmi_radio) data; 551 + enum hp_wmi_radio r = (long)data; 555 552 int query = BIT(r + 8) | ((!blocked) << r); 556 553 int ret; 557 554 ··· 813 810 case HPWMI_SMART_ADAPTER: 814 811 break; 815 812 case HPWMI_BEZEL_BUTTON: 813 + case HPWMI_OMEN_KEY: 816 814 key_code = hp_wmi_read_int(HPWMI_HOTKEY_QUERY); 817 815 if (key_code < 0) 818 816 break;
+6 -5
drivers/platform/x86/thinkpad_acpi.c
··· 10496 10496 if (err) 10497 10497 goto unlock; 10498 10498 } 10499 - } 10500 - if (dytc_capabilities & BIT(DYTC_FC_PSC)) { 10499 + } else if (dytc_capabilities & BIT(DYTC_FC_PSC)) { 10501 10500 err = dytc_command(DYTC_SET_COMMAND(DYTC_FUNCTION_PSC, perfmode, 1), &output); 10502 10501 if (err) 10503 10502 goto unlock; ··· 10524 10525 err = dytc_command(DYTC_CMD_MMC_GET, &output); 10525 10526 else 10526 10527 err = dytc_cql_command(DYTC_CMD_GET, &output); 10527 - } else if (dytc_capabilities & BIT(DYTC_FC_PSC)) 10528 + funcmode = DYTC_FUNCTION_MMC; 10529 + } else if (dytc_capabilities & BIT(DYTC_FC_PSC)) { 10528 10530 err = dytc_command(DYTC_CMD_GET, &output); 10529 - 10531 + /* Check if we are PSC mode, or have AMT enabled */ 10532 + funcmode = (output >> DYTC_GET_FUNCTION_BIT) & 0xF; 10533 + } 10530 10534 mutex_unlock(&dytc_mutex); 10531 10535 if (err) 10532 10536 return; 10533 10537 10534 - funcmode = (output >> DYTC_GET_FUNCTION_BIT) & 0xF; 10535 10538 perfmode = (output >> DYTC_GET_MODE_BIT) & 0xF; 10536 10539 convert_dytc_to_profile(funcmode, perfmode, &profile); 10537 10540 if (profile != dytc_current_profile) {
+107 -2
include/linux/apple-gmux.h
··· 8 8 #define LINUX_APPLE_GMUX_H 9 9 10 10 #include <linux/acpi.h> 11 + #include <linux/io.h> 12 + #include <linux/pnp.h> 11 13 12 14 #define GMUX_ACPI_HID "APP000B" 13 15 16 + /* 17 + * gmux port offsets. Many of these are not yet used, but may be in the 18 + * future, and it's useful to have them documented here anyhow. 19 + */ 20 + #define GMUX_PORT_VERSION_MAJOR 0x04 21 + #define GMUX_PORT_VERSION_MINOR 0x05 22 + #define GMUX_PORT_VERSION_RELEASE 0x06 23 + #define GMUX_PORT_SWITCH_DISPLAY 0x10 24 + #define GMUX_PORT_SWITCH_GET_DISPLAY 0x11 25 + #define GMUX_PORT_INTERRUPT_ENABLE 0x14 26 + #define GMUX_PORT_INTERRUPT_STATUS 0x16 27 + #define GMUX_PORT_SWITCH_DDC 0x28 28 + #define GMUX_PORT_SWITCH_EXTERNAL 0x40 29 + #define GMUX_PORT_SWITCH_GET_EXTERNAL 0x41 30 + #define GMUX_PORT_DISCRETE_POWER 0x50 31 + #define GMUX_PORT_MAX_BRIGHTNESS 0x70 32 + #define GMUX_PORT_BRIGHTNESS 0x74 33 + #define GMUX_PORT_VALUE 0xc2 34 + #define GMUX_PORT_READ 0xd0 35 + #define GMUX_PORT_WRITE 0xd4 36 + 37 + #define GMUX_MIN_IO_LEN (GMUX_PORT_BRIGHTNESS + 4) 38 + 14 39 #if IS_ENABLED(CONFIG_APPLE_GMUX) 40 + static inline bool apple_gmux_is_indexed(unsigned long iostart) 41 + { 42 + u16 val; 43 + 44 + outb(0xaa, iostart + 0xcc); 45 + outb(0x55, iostart + 0xcd); 46 + outb(0x00, iostart + 0xce); 47 + 48 + val = inb(iostart + 0xcc) | (inb(iostart + 0xcd) << 8); 49 + if (val == 0x55aa) 50 + return true; 51 + 52 + return false; 53 + } 15 54 16 55 /** 17 - * apple_gmux_present() - detect if gmux is built into the machine 56 + * apple_gmux_detect() - detect if gmux is built into the machine 57 + * 58 + * @pnp_dev: Device to probe or NULL to use the first matching device 59 + * @indexed_ret: Returns (by reference) if the gmux is indexed or not 60 + * 61 + * Detect if a supported gmux device is present by actually probing it. 62 + * This avoids the false positives returned on some models by 63 + * apple_gmux_present(). 64 + * 65 + * Return: %true if a supported gmux ACPI device is detected and the kernel 66 + * was configured with CONFIG_APPLE_GMUX, %false otherwise. 67 + */ 68 + static inline bool apple_gmux_detect(struct pnp_dev *pnp_dev, bool *indexed_ret) 69 + { 70 + u8 ver_major, ver_minor, ver_release; 71 + struct device *dev = NULL; 72 + struct acpi_device *adev; 73 + struct resource *res; 74 + bool indexed = false; 75 + bool ret = false; 76 + 77 + if (!pnp_dev) { 78 + adev = acpi_dev_get_first_match_dev(GMUX_ACPI_HID, NULL, -1); 79 + if (!adev) 80 + return false; 81 + 82 + dev = get_device(acpi_get_first_physical_node(adev)); 83 + acpi_dev_put(adev); 84 + if (!dev) 85 + return false; 86 + 87 + pnp_dev = to_pnp_dev(dev); 88 + } 89 + 90 + res = pnp_get_resource(pnp_dev, IORESOURCE_IO, 0); 91 + if (!res || resource_size(res) < GMUX_MIN_IO_LEN) 92 + goto out; 93 + 94 + /* 95 + * Invalid version information may indicate either that the gmux 96 + * device isn't present or that it's a new one that uses indexed io. 97 + */ 98 + ver_major = inb(res->start + GMUX_PORT_VERSION_MAJOR); 99 + ver_minor = inb(res->start + GMUX_PORT_VERSION_MINOR); 100 + ver_release = inb(res->start + GMUX_PORT_VERSION_RELEASE); 101 + if (ver_major == 0xff && ver_minor == 0xff && ver_release == 0xff) { 102 + indexed = apple_gmux_is_indexed(res->start); 103 + if (!indexed) 104 + goto out; 105 + } 106 + 107 + if (indexed_ret) 108 + *indexed_ret = indexed; 109 + 110 + ret = true; 111 + out: 112 + put_device(dev); 113 + return ret; 114 + } 115 + 116 + /** 117 + * apple_gmux_present() - check if gmux ACPI device is present 18 118 * 19 119 * Drivers may use this to activate quirks specific to dual GPU MacBook Pros 20 120 * and Mac Pros, e.g. for deferred probing, runtime pm and backlight. 21 121 * 22 - * Return: %true if gmux is present and the kernel was configured 122 + * Return: %true if gmux ACPI device is present and the kernel was configured 23 123 * with CONFIG_APPLE_GMUX, %false otherwise. 24 124 */ 25 125 static inline bool apple_gmux_present(void) ··· 130 30 #else /* !CONFIG_APPLE_GMUX */ 131 31 132 32 static inline bool apple_gmux_present(void) 33 + { 34 + return false; 35 + } 36 + 37 + static inline bool apple_gmux_detect(struct pnp_dev *pnp_dev, bool *indexed_ret) 133 38 { 134 39 return false; 135 40 }