]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/blob - include/linux/apple-gmux.h
Merge tag 'nfs-for-5.2-4' of git://git.linux-nfs.org/projects/anna/linux-nfs
[mirror_ubuntu-eoan-kernel.git] / include / linux / apple-gmux.h
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /*
3 * apple-gmux.h - microcontroller built into dual GPU MacBook Pro & Mac Pro
4 * Copyright (C) 2015 Lukas Wunner <lukas@wunner.de>
5 */
6
7 #ifndef LINUX_APPLE_GMUX_H
8 #define LINUX_APPLE_GMUX_H
9
10 #include <linux/acpi.h>
11
12 #define GMUX_ACPI_HID "APP000B"
13
14 #if IS_ENABLED(CONFIG_APPLE_GMUX)
15
16 /**
17 * apple_gmux_present() - detect if gmux is built into the machine
18 *
19 * Drivers may use this to activate quirks specific to dual GPU MacBook Pros
20 * and Mac Pros, e.g. for deferred probing, runtime pm and backlight.
21 *
22 * Return: %true if gmux is present and the kernel was configured
23 * with CONFIG_APPLE_GMUX, %false otherwise.
24 */
25 static inline bool apple_gmux_present(void)
26 {
27 return acpi_dev_found(GMUX_ACPI_HID);
28 }
29
30 #else /* !CONFIG_APPLE_GMUX */
31
32 static inline bool apple_gmux_present(void)
33 {
34 return false;
35 }
36
37 #endif /* !CONFIG_APPLE_GMUX */
38
39 #endif /* LINUX_APPLE_GMUX_H */