Merge tag 'linux-can-next-for-4.12-20170427' of git://git.kernel.org/pub/scm/linux...
[linux-2.6/btrfs-unstable.git] / include / linux / apple-gmux.h
blob714186de8c3629c5ebcc44da6660f77eb7c31523
1 /*
2 * apple-gmux.h - microcontroller built into dual GPU MacBook Pro & Mac Pro
3 * Copyright (C) 2015 Lukas Wunner <lukas@wunner.de>
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License (version 2) as
7 * published by the Free Software Foundation.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, see <http://www.gnu.org/licenses/>.
18 #ifndef LINUX_APPLE_GMUX_H
19 #define LINUX_APPLE_GMUX_H
21 #include <linux/acpi.h>
23 #define GMUX_ACPI_HID "APP000B"
25 #if IS_ENABLED(CONFIG_APPLE_GMUX)
27 /**
28 * apple_gmux_present() - detect if gmux is built into the machine
30 * Drivers may use this to activate quirks specific to dual GPU MacBook Pros
31 * and Mac Pros, e.g. for deferred probing, runtime pm and backlight.
33 * Return: %true if gmux is present and the kernel was configured
34 * with CONFIG_APPLE_GMUX, %false otherwise.
36 static inline bool apple_gmux_present(void)
38 return acpi_dev_found(GMUX_ACPI_HID);
41 #else /* !CONFIG_APPLE_GMUX */
43 static inline bool apple_gmux_present(void)
45 return false;
48 #endif /* !CONFIG_APPLE_GMUX */
50 #endif /* LINUX_APPLE_GMUX_H */