include/linux/apple-gmux.h

Source file repositories/reference/linux-study-clean/include/linux/apple-gmux.h

File Facts

System
Linux kernel
Corpus path
include/linux/apple-gmux.h
Extension
.h
Size
4738 bytes
Lines
181
Domain
Core OS
Bucket
Core Kernel Interface
Inferred role
Core OS: implementation source
Status
source implementation candidate

Why This File Exists

Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.

Dependency Surface

Detected Declarations

Annotated Snippet

if (ver_major == 0xff && ver_minor == 0xff && ver_release == 0xff) {
			if (apple_gmux_is_indexed(res->start))
				type = APPLE_GMUX_TYPE_INDEXED;
			else
				goto out;
		}
	} else {
		res = pnp_get_resource(pnp_dev, IORESOURCE_MEM, 0);
		if (res && apple_gmux_is_mmio(res->start))
			type = APPLE_GMUX_TYPE_MMIO;
		else
			goto out;
	}

	if (type_ret)
		*type_ret = type;

	ret = true;
out:
	put_device(dev);
	return ret;
}

/**
 * apple_gmux_present() - check if gmux ACPI device is present
 *
 * 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 ACPI device is present and the kernel was configured
 * with CONFIG_APPLE_GMUX, %false otherwise.
 */
static inline bool apple_gmux_present(void)
{
	return acpi_dev_found(GMUX_ACPI_HID);
}

#else  /* !CONFIG_APPLE_GMUX */

static inline bool apple_gmux_present(void)
{
	return false;
}

static inline bool apple_gmux_detect(struct pnp_dev *pnp_dev, bool *indexed_ret)
{
	return false;
}

#endif /* !CONFIG_APPLE_GMUX */

#endif /* LINUX_APPLE_GMUX_H */

Annotation

Implementation Notes