blob: ddb10aa67b14360ee0f6f63b5f733b1176557588 [file] [log] [blame]
Thomas Gleixnercaab2772019-06-03 07:44:50 +02001/* SPDX-License-Identifier: GPL-2.0-only */
Lukas Wunner24133062016-01-11 20:09:20 +01002/*
3 * apple-gmux.h - microcontroller built into dual GPU MacBook Pro & Mac Pro
4 * Copyright (C) 2015 Lukas Wunner <lukas@wunner.de>
Lukas Wunner24133062016-01-11 20:09:20 +01005 */
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 Wunnerb7172112016-02-10 14:17:41 +010014#if IS_ENABLED(CONFIG_APPLE_GMUX)
15
Lukas Wunner24133062016-01-11 20:09:20 +010016/**
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 */
25static inline bool apple_gmux_present(void)
26{
Lukas Wunnerc68ae33e2016-03-24 13:15:20 +010027 return acpi_dev_found(GMUX_ACPI_HID);
Lukas Wunner24133062016-01-11 20:09:20 +010028}
29
Lukas Wunnerb7172112016-02-10 14:17:41 +010030#else /* !CONFIG_APPLE_GMUX */
31
32static inline bool apple_gmux_present(void)
33{
34 return false;
35}
36
37#endif /* !CONFIG_APPLE_GMUX */
38
Lukas Wunner24133062016-01-11 20:09:20 +010039#endif /* LINUX_APPLE_GMUX_H */