Thomas Gleixner | caab277 | 2019-06-03 07:44:50 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Lukas Wunner | 2413306 | 2016-01-11 20:09:20 +0100 | [diff] [blame] | 2 | /* |
| 3 | * apple-gmux.h - microcontroller built into dual GPU MacBook Pro & Mac Pro |
| 4 | * Copyright (C) 2015 Lukas Wunner <lukas@wunner.de> |
Lukas Wunner | 2413306 | 2016-01-11 20:09:20 +0100 | [diff] [blame] | 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 | |
Lukas Wunner | b717211 | 2016-02-10 14:17:41 +0100 | [diff] [blame] | 14 | #if IS_ENABLED(CONFIG_APPLE_GMUX) |
| 15 | |
Lukas Wunner | 2413306 | 2016-01-11 20:09:20 +0100 | [diff] [blame] | 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 | { |
Lukas Wunner | c68ae33e | 2016-03-24 13:15:20 +0100 | [diff] [blame] | 27 | return acpi_dev_found(GMUX_ACPI_HID); |
Lukas Wunner | 2413306 | 2016-01-11 20:09:20 +0100 | [diff] [blame] | 28 | } |
| 29 | |
Lukas Wunner | b717211 | 2016-02-10 14:17:41 +0100 | [diff] [blame] | 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 | |
Lukas Wunner | 2413306 | 2016-01-11 20:09:20 +0100 | [diff] [blame] | 39 | #endif /* LINUX_APPLE_GMUX_H */ |