Files
RedBear-OS/local/recipes/system/redbear-quirks/source/quirks.d/80-platform-x86.toml
T
vasilito 00e1c9ea16 quirks: Platform DMI dispatch infrastructure + 31-entry data file (R13)
Phase R13 (2026-06-07) — Laptop/Embedded DMI quirks. The
data side lands now; consumer wiring in inputd,
thermald, and redbear-upower is a follow-up.

Changes:

  1. PlatformDmiQuirkFlags (mod.rs:286) with 7 bits:
     TOUCHSCREEN, HOTKEY, ACCELEROMETER, ALS,
     TABLET_MODE, BATTERY, PROXIMITY.

  2. PlatformSubsystem enum (mod.rs:316) — dispatch label
     for TOML and consumers. from_name() for parsing,
     as_str() for logging, flag_bit() for converting to
     the bitflags.

  3. PlatformDmiQuirkRule (dmi.rs:566) — DMI match +
     subsystem. Each entry fires one subsystem.

  4. load_platform_dmi_quirks() (dmi.rs:583) — reads live
     SMBIOS, returns Vec<PlatformDmiQuirkRule> of all
     rules that fire. Falls back to empty vector if DMI
     data is unavailable.

  5. read_toml_platform_dmi_entries + parse_platform_dmi_toml
     (toml_loader.rs) — new [[platform_dmi_quirk]] TOML
     table with  sub-table +  string.
     Unknown subsystem names log a warning and skip.

  6. 1 new unit test: phase_r13_platform_subsystem_from_name_round_trip
     exercises all 7 subsystems. 124/124 tests pass.

  7. quirks.d/80-platform-x86.toml (201 lines) — 31 DMI
     entries covering:
       touchscreen (3): Chuwi Hi8 / Hi8 Pro / Hi10 Plus
       tablet_mode (8): Acer, Asus, Lenovo convertibles
       hotkey (12): Dynabook, GPD, AYA NEO, AYN, OneXPlayer,
                     Valve Steam Deck family
       accelerometer (5): GPD WIN series, AYA NEO 2, Valve
       battery (2): Samsung Galaxy Book, Chuwi Hi10 Plus
     Targeted at Red Bear's 2026 hardware scope. The full
     Linux 7.1 platform/x86 DMI surface is ~1153 entries;
     this is a focused subset that maps to actual Red Bear
     targets.

cargo test: 124/124 (was 123, +1 for the new test).
cargo check: clean.

Consumer wiring: load_platform_dmi_quirks() is callable
today from inputd, thermald, redbear-upower. Each
consumer can filter on rule.subsystem to dispatch the
appropriate behavior. This is a follow-up commit.
2026-06-07 21:41:07 +03:00

202 lines
5.6 KiB
TOML

# Platform DMI dispatch rules — DMI-based, subsystem-tagged.
# Mined from Linux 7.1 `drivers/platform/x86/*` DMI tables.
# Each `[[platform_dmi_quirk]]` entry maps a DMI fingerprint to
# a single `subsystem` (touchscreen / hotkey / accelerometer /
# als / tablet_mode / battery / proximity). Consumers
# (inputd, acpid, thermald, redbear-upower, etc.) read the
# firing rules and react accordingly.
#
# Phase R13 (2026-06-07) initial commit. The data file is
# sparse by design — the audit estimated ~1153 Linux 7.1
# entries, but Red Bear's hardware scope is much narrower.
# Focus on hardware that ships in 2026 and that Red Bear
# actually targets: Framework, GPD, AYANEO, AYN, Dell,
# Lenovo, Asus, Valve, Chuwi, Acer.
#
# Consumers currently in the tree that could read this:
# - inputd: touchscreen, hotkey, accelerometer, tablet_mode
# - acpid: button, lid (related, not a direct match)
# - thermald: als (ambient light → thermal profile)
# - redbear-upower: battery
# Framework Laptop 13 / 16 — well-behaved; no quirks needed.
# Listed here as documentation of the absence of quirks.
# Chuwi Hi8 (CWI506 / ilife S806) — touchscreen needs I2C-HID fallback
[[platform_dmi_quirk]]
subsystem = "touchscreen"
match.sys_vendor = "ilife"
match.product_name = "S806"
# Chuwi Hi8 Pro (CWI513 / Hampoo X1D3_C806N) — same family
[[platform_dmi_quirk]]
subsystem = "touchscreen"
match.sys_vendor = "Hampoo"
match.product_name = "X1D3_C806N"
# Chuwi Hi10 Plus (CWI527) — touchscreen quirks
[[platform_dmi_quirk]]
subsystem = "touchscreen"
match.board_vendor = "Hampoo"
match.product_name = "Hi10 Pro tablet"
# Acer Switch V 10 (SW5-017) — convertible / tablet_mode
[[platform_dmi_quirk]]
subsystem = "tablet_mode"
match.sys_vendor = "Acer"
match.product_name = "SW5-017"
# Acer One 10 (S1003) — convertible / tablet_mode
[[platform_dmi_quirk]]
subsystem = "tablet_mode"
match.sys_vendor = "Acer"
match.product_name = "One S1003"
# Asus T100HAN — convertible / tablet_mode
[[platform_dmi_quirk]]
subsystem = "tablet_mode"
match.sys_vendor = "ASUSTeK COMPUTER INC."
match.product_name = "T100HAN"
# Asus T101HA / T103HAF — convertible / tablet_mode
[[platform_dmi_quirk]]
subsystem = "tablet_mode"
match.sys_vendor = "ASUSTeK COMPUTER INC."
match.product_name = "T101HA"
[[platform_dmi_quirk]]
subsystem = "tablet_mode"
match.sys_vendor = "ASUSTeK COMPUTER INC."
match.product_name = "T103HAF"
# Lenovo Ideapad Miix 320 (80SG) — convertible
[[platform_dmi_quirk]]
subsystem = "tablet_mode"
match.sys_vendor = "LENOVO"
match.product_name = "80SG"
# Lenovo Ideapad D330 (80XF) — convertible
[[platform_dmi_quirk]]
subsystem = "tablet_mode"
match.sys_vendor = "LENOVO"
match.product_name = "80XF"
# Lenovo Yoga Book (YB1-X91) — convertible + Wacom touchscreen
[[platform_dmi_quirk]]
subsystem = "tablet_mode"
match.sys_vendor = "Intel Corporation"
match.product_name = "CHERRYVIEW D1 PLATFORM"
# Dynabook K50 — wireless hotkey quirks
[[platform_dmi_quirk]]
subsystem = "hotkey"
match.sys_vendor = "Dynabook Inc."
match.product_name = "dynabook K50/FR"
# GPD MicroPC — wireless hotkey (airplane-mode)
[[platform_dmi_quirk]]
subsystem = "hotkey"
match.sys_vendor = "GPD"
match.product_name = "MicroPC"
# GPD Pocket 2/3 — wireless hotkey
[[platform_dmi_quirk]]
subsystem = "hotkey"
match.sys_vendor = "GPD"
match.product_name = "Pocket 2"
[[platform_dmi_quirk]]
subsystem = "hotkey"
match.sys_vendor = "GPD"
match.product_name = "Pocket 3"
# AYA NEO 2 / AIR / SLIDE — wireless hotkey (airplane-mode)
[[platform_dmi_quirk]]
subsystem = "hotkey"
match.sys_vendor = "AYANEO"
match.product_name = "AYANEO 2"
[[platform_dmi_quirk]]
subsystem = "hotkey"
match.sys_vendor = "AYANEO"
match.product_name = "AIR"
[[platform_dmi_quirk]]
subsystem = "hotkey"
match.sys_vendor = "AYANEO"
match.product_name = "SLIDE"
# AYN Loki Max / Zero — wireless hotkey
[[platform_dmi_quirk]]
subsystem = "hotkey"
match.sys_vendor = "ayn"
match.product_name = "Loki Max"
[[platform_dmi_quirk]]
subsystem = "hotkey"
match.sys_vendor = "ayn"
match.product_name = "Loki Zero"
# OneXPlayer — wireless hotkey
[[platform_dmi_quirk]]
subsystem = "hotkey"
match.sys_vendor = "ONE-NETBOOK TECHNOLOGY CO., LTD."
match.product_name = "ONE XPLAYER"
# Valve Steam Deck (Jupiter) — wireless hotkey
[[platform_dmi_quirk]]
subsystem = "hotkey"
match.sys_vendor = "Valve"
match.product_name = "Jupiter"
# Valve Steam Deck OLED (Galileo)
[[platform_dmi_quirk]]
subsystem = "hotkey"
match.sys_vendor = "Valve"
match.product_name = "Galileo"
# GPD WIN2/3/4 — accelerometer (auto-rotation in handheld mode)
[[platform_dmi_quirk]]
subsystem = "accelerometer"
match.sys_vendor = "GPD"
match.product_name = "WIN2"
[[platform_dmi_quirk]]
subsystem = "accelerometer"
match.sys_vendor = "GPD"
match.product_name = "G1618-03"
[[platform_dmi_quirk]]
subsystem = "accelerometer"
match.sys_vendor = "GPD"
match.product_name = "G1618-04"
# AYA NEO 2 — accelerometer
[[platform_dmi_quirk]]
subsystem = "accelerometer"
match.sys_vendor = "AYANEO"
match.product_name = "AYANEO 2"
# Valve Steam Deck — accelerometer
[[platform_dmi_quirk]]
subsystem = "accelerometer"
match.sys_vendor = "Valve"
match.product_name = "Jupiter"
[[platform_dmi_quirk]]
subsystem = "accelerometer"
match.sys_vendor = "Valve"
match.product_name = "Galileo"
# Samsung Galaxy Book 10.6 — battery reporting quirks
[[platform_dmi_quirk]]
subsystem = "battery"
match.sys_vendor = "SAMSUNG ELECTRONICS CO., LTD."
match.product_name = "Galaxy Book 10.6"
# Chuwi Hi10 Plus — battery quirk (BIX broken)
[[platform_dmi_quirk]]
subsystem = "battery"
match.board_vendor = "Hampoo"
match.product_name = "Hi10 Pro tablet"