utils for the Panasonic FZ-G1, including rotation lock and media buttons
Find a file
2026-08-17 20:02:37 +01:00
kernel git init 2026-08-17 16:18:24 +01:00
src git init 2026-08-17 16:18:24 +01:00
Cargo.toml git init 2026-08-17 16:18:24 +01:00
README.md readme,md 2026-08-17 20:02:37 +01:00

ptk-utils

Linux userspace utility + kernel module for the Panasonic Toughpad FZ-G1 system interface — the functionality the Windows "System Interface Manager" (MeiTBMan.exe & friends) provides, reimplemented from scratch against the machine's ACPI firmware.

Everything here was reverse engineered from the DSDT (\_SB.HKEY / \_SB.WLSW / \_SB.TBTN / \_SB.MIS2) and verified on hardware. No Panasonic code is used or needed.

What you get

Feature How Status
Bezel buttons A1 / A2 ptk_acpi module → evdev KEY_PROG1 / KEY_PROG2 bind in KDE shortcuts
Wireless switch events ptk_acpi module → SW_RFKILL_ALL
Hotkeys (Fn keys, etc.) mainline panasonic_laptop → "Panasonic Laptop Support" evdev already worked
Brightness / mute / sticky key sysfs knobs on MAT0019 via ptk-utils get/set
Rotation-lock bezel button sends Super+XF86Launch5 (the Win+O chord) on the AT keyboard bind to ptk-utils rotlock-toggle
Battery eco mode (charge limit) firmware encoding differs from mainline driver's expectation ⚠️ read via raw SINF; write path TBD (MIS2 mailbox)

Layout

src/        Rust CLI (ptk-utils)
kernel/     ptk_acpi.c — out-of-tree ACPI driver for MAT0028 + MAT0037

How it works

Panasonic exposes four vendor ACPI devices on this machine:

  • MAT0019 \_SB.HKEY — hotkey queue + a 37-entry function table (SINF/SGET/SSET). Handled by the in-kernel panasonic_laptop driver, which creates sysfs knobs directly on the ACPI device node (/sys/bus/acpi/devices/MAT0019:00/).
  • MAT0037 \_SB.TBTN — tablet bezel buttons. EC queries push codes into a queue (HIND), then Notify(0x80). Buttons report as down/up pairs, even code = press, odd = release: 0x38/0x39 = A1, 0x42/0x43 = A2. Mainline has no driver — that's ptk_acpi.
  • MAT0028 \_SB.WLSW — wireless switch (hard + soft rfkill state, event 0x50). Also handled by ptk_acpi.
  • MAT0040 \_SB.MIS2 — Panasonic "misc function" mailbox (memory buffer + SMI 0xE9 doorbell) used by the Windows tools for BIOS-level functions. Not yet driven.

The rotation-lock button is none of these: it's hardwired to emit the Windows rotation-lock keyboard chord (Super_L + XF86Launch5) through the PS/2 keyboard, so it needs no driver at all — just a shortcut binding.

Build & install

CLI

cargo build --release
install -Dm755 target/release/ptk-utils ~/.local/bin/ptk-utils

Reading evdev nodes requires the input group (re-login after):

sudo usermod -aG input $USER

Kernel module (DKMS — survives kernel updates)

sudo pacman -S dkms linux-cachyos-headers   # headers for your kernel
sudo mkdir -p /usr/src/ptk_acpi-0.1
sudo cp kernel/{ptk_acpi.c,Makefile,dkms.conf} /usr/src/ptk_acpi-0.1/
sudo dkms add ptk_acpi/0.1
sudo dkms install ptk_acpi/0.1

Auto-loads at boot via ACPI modalias. Manual load: sudo modprobe ptk_acpi.

CachyOS kernels are clang-built; the module must be too. The Makefile takes LLVM=1 (already wired into dkms.conf).

Usage

ptk-utils status            # dump all HKEY knobs
ptk-utils get mute          # read one knob
sudo ptk-utils set mute 1   # write one knob
ptk-utils listen            # live hotkey/button events (auto-detects device)
ptk-utils buttons           # DSDT-derived event code reference table
ptk-utils rotlock-toggle    # toggle KWin auto-rotate once (for shortcut binding)
ptk-utils rotlock           # daemon: toggle on TBTN button 3 (if present)

Wiring the buttons in KDE

  • A1 / A2: System Settings → Shortcuts → record Prog1/Prog2 like any key.
  • Rotation lock: Custom Shortcuts → New → Global Shortcut → Command/URL, record the trigger by pressing the bezel button (Meta+XF86Launch5), command: ptk-utils rotlock-toggle. Must run inside the KDE session (needs the session bus; a GUI-launched shortcut has it).

Known quirks

  • eco_mode sysfs knob EIOs: the mainline driver expects SINF[0x0A] as value+3 and writes via \_SB.ECWR, which doesn't exist in this DSDT. The firmware actually reports eco state as 0x01/0x81 (bit 7 = on). The write path likely goes through the MIS2 mailbox — not yet reversed.
  • cdpower EIOs: no optical drive in a tablet.
  • TBTN codes 0x36/0x37 exist in firmware but have never been observed from any physical button.