2019-06-03 08:44:50 +03:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
2016-01-11 22:09:20 +03:00
|
|
|
/*
|
|
|
|
* apple-gmux.h - microcontroller built into dual GPU MacBook Pro & Mac Pro
|
|
|
|
* Copyright (C) 2015 Lukas Wunner <lukas@wunner.de>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef LINUX_APPLE_GMUX_H
|
|
|
|
#define LINUX_APPLE_GMUX_H
|
|
|
|
|
|
|
|
#include <linux/acpi.h>
|
|
|
|
|
|
|
|
#define GMUX_ACPI_HID "APP000B"
|
|
|
|
|
2016-02-10 16:17:41 +03:00
|
|
|
#if IS_ENABLED(CONFIG_APPLE_GMUX)
|
|
|
|
|
2016-01-11 22:09:20 +03:00
|
|
|
/**
|
|
|
|
* apple_gmux_present() - detect if gmux is built into the machine
|
|
|
|
*
|
|
|
|
* Drivers may use this to activate quirks specific to dual GPU MacBook Pros
|
|
|
|
* and Mac Pros, e.g. for deferred probing, runtime pm and backlight.
|
|
|
|
*
|
|
|
|
* Return: %true if gmux is present and the kernel was configured
|
|
|
|
* with CONFIG_APPLE_GMUX, %false otherwise.
|
|
|
|
*/
|
|
|
|
static inline bool apple_gmux_present(void)
|
|
|
|
{
|
2016-03-24 15:15:20 +03:00
|
|
|
return acpi_dev_found(GMUX_ACPI_HID);
|
2016-01-11 22:09:20 +03:00
|
|
|
}
|
|
|
|
|
2016-02-10 16:17:41 +03:00
|
|
|
#else /* !CONFIG_APPLE_GMUX */
|
|
|
|
|
|
|
|
static inline bool apple_gmux_present(void)
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif /* !CONFIG_APPLE_GMUX */
|
|
|
|
|
2016-01-11 22:09:20 +03:00
|
|
|
#endif /* LINUX_APPLE_GMUX_H */
|