drivers/platform/x86/x86-android-tablets/other.c
Source file repositories/reference/linux-study-clean/drivers/platform/x86/x86-android-tablets/other.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/platform/x86/x86-android-tablets/other.c- Extension
.c- Size
- 26249 bytes
- Lines
- 884
- 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.
- 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.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/acpi.hlinux/gpio/machine.hlinux/gpio/property.hlinux/input-event-codes.hlinux/leds.hlinux/pci.hlinux/platform_device.hlinux/pwm.hdt-bindings/leds/common.hshared-psy-info.hx86-android-tablets.h
Detected Declarations
function chuwi_hi8_initfunction czc_p10t_initfunction vexia_edu_atla10_9v_initfunction xiaomi_mipad2_brightness_setfunction xiaomi_mipad2_init
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0-or-later
/*
* DMI based code to deal with broken DSDTs on X86 tablets which ship with
* Android as (part of) the factory image. The factory kernels shipped on these
* devices typically have a bunch of things hardcoded, rather than specified
* in their DSDT.
*
* Copyright (C) 2021-2023 Hans de Goede <hansg@kernel.org>
*/
#include <linux/acpi.h>
#include <linux/gpio/machine.h>
#include <linux/gpio/property.h>
#include <linux/input-event-codes.h>
#include <linux/leds.h>
#include <linux/pci.h>
#include <linux/platform_device.h>
#include <linux/pwm.h>
#include <dt-bindings/leds/common.h>
#include "shared-psy-info.h"
#include "x86-android-tablets.h"
/*
* Advantech MICA-071
* This is a standard Windows tablet, but it has an extra "quick launch" button
* which is not described in the ACPI tables in anyway.
* Use the x86-android-tablets infra to create a gpio-keys device for this.
*/
static const struct software_node advantech_mica_071_gpio_keys_node = {
.name = "prog1_key",
};
static const struct property_entry advantech_mica_071_prog1_key_props[] = {
PROPERTY_ENTRY_U32("linux,code", KEY_PROG1),
PROPERTY_ENTRY_STRING("label", "prog1_key"),
PROPERTY_ENTRY_GPIO("gpios", &baytrail_gpiochip_nodes[0], 2, GPIO_ACTIVE_LOW),
PROPERTY_ENTRY_U32("debounce-interval", 50),
{ }
};
static const struct software_node advantech_mica_071_prog1_key_node = {
.parent = &advantech_mica_071_gpio_keys_node,
.properties = advantech_mica_071_prog1_key_props,
};
static const struct software_node *advantech_mica_071_button_swnodes[] = {
&advantech_mica_071_gpio_keys_node,
&advantech_mica_071_prog1_key_node,
NULL
};
const struct x86_dev_info advantech_mica_071_info __initconst = {
.gpio_button_swnodes = advantech_mica_071_button_swnodes,
.gpiochip_type = X86_GPIOCHIP_BAYTRAIL,
};
/*
* When booted with the BIOS set to Android mode the Chuwi Hi8 (CWI509) DSDT
* contains a whole bunch of bogus ACPI I2C devices and is missing entries
* for the touchscreen and the accelerometer.
*/
static const struct property_entry chuwi_hi8_gsl1680_props[] = {
PROPERTY_ENTRY_U32("touchscreen-size-x", 1665),
PROPERTY_ENTRY_U32("touchscreen-size-y", 1140),
PROPERTY_ENTRY_BOOL("touchscreen-swapped-x-y"),
PROPERTY_ENTRY_BOOL("silead,home-button"),
PROPERTY_ENTRY_STRING("firmware-name", "gsl1680-chuwi-hi8.fw"),
{ }
};
static const struct software_node chuwi_hi8_gsl1680_node = {
.properties = chuwi_hi8_gsl1680_props,
};
static const char * const chuwi_hi8_mount_matrix[] = {
"1", "0", "0",
"0", "-1", "0",
"0", "0", "1"
};
static const struct property_entry chuwi_hi8_bma250e_props[] = {
PROPERTY_ENTRY_STRING_ARRAY("mount-matrix", chuwi_hi8_mount_matrix),
{ }
};
static const struct software_node chuwi_hi8_bma250e_node = {
.properties = chuwi_hi8_bma250e_props,
};
Annotation
- Immediate include surface: `linux/acpi.h`, `linux/gpio/machine.h`, `linux/gpio/property.h`, `linux/input-event-codes.h`, `linux/leds.h`, `linux/pci.h`, `linux/platform_device.h`, `linux/pwm.h`.
- Detected declarations: `function chuwi_hi8_init`, `function czc_p10t_init`, `function vexia_edu_atla10_9v_init`, `function xiaomi_mipad2_brightness_set`, `function xiaomi_mipad2_init`.
- Atlas domain: Driver Families / drivers/platform.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.