Commit | Line | Data |
---|---|---|
caab277b | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
2413306c LW |
2 | /* |
3 | * apple-gmux.h - microcontroller built into dual GPU MacBook Pro & Mac Pro | |
4 | * Copyright (C) 2015 Lukas Wunner <lukas@wunner.de> | |
2413306c LW |
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 | ||
b7172119 LW |
14 | #if IS_ENABLED(CONFIG_APPLE_GMUX) |
15 | ||
2413306c LW |
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 | { | |
c68ae33e | 27 | return acpi_dev_found(GMUX_ACPI_HID); |
2413306c LW |
28 | } |
29 | ||
b7172119 LW |
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 | ||
2413306c | 39 | #endif /* LINUX_APPLE_GMUX_H */ |