drivers/platform/x86/dual_accel_detect.h

Source file repositories/reference/linux-study-clean/drivers/platform/x86/dual_accel_detect.h

File Facts

System
Linux kernel
Corpus path
drivers/platform/x86/dual_accel_detect.h
Extension
.h
Size
1729 bytes
Lines
53
Domain
Driver Families
Bucket
drivers/platform
Inferred role
Driver Families: implementation source
Status
source implementation candidate

Why This File Exists

Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.

Dependency Surface

Detected Declarations

Annotated Snippet

#include <linux/acpi.h>
#include <linux/i2c.h>

static bool dual_accel_detect_bosc0200(void)
{
	struct acpi_device *adev;
	int count;

	adev = acpi_dev_get_first_match_dev("BOSC0200", NULL, -1);
	if (!adev)
		return false;

	count = i2c_acpi_client_count(adev);

	acpi_dev_put(adev);

	return count == 2;
}

static bool dual_accel_detect(void)
{
	/* Systems which use a pair of accels with KIOX010A / KIOX020A ACPI ids */
	if (acpi_dev_present("KIOX010A", NULL, -1) &&
	    acpi_dev_present("KIOX020A", NULL, -1))
		return true;

	/* Systems which use a single DUAL250E ACPI device to model 2 accels */
	if (acpi_dev_present("DUAL250E", NULL, -1))
		return true;

	/* Systems which use a single BOSC0200 ACPI device to model 2 accels */
	if (dual_accel_detect_bosc0200())
		return true;

	return false;
}

Annotation

Implementation Notes