linux-surface / surface-pro-x

Tracking and meta repository for Surface Pro X support.
76 stars 6 forks source link

Support for Volume Buttons #16

Closed qzed closed 2 years ago

qzed commented 2 years ago

Volume buttons seem to be handled via the (mostly) standard Surface MSHW0040 GPIO button device. Unfortunately, this does not seem to include the power button. A pin map is provided below:

VOL_DOWN  PMC8180A pin 1 (ACPI 0x80)
VOL_UP    PMC8180A pin 6 (ACPI 0x85)
PWR       PMC8180A pin ? (ACPI 0x00)

Note: GPIO indexing on PMC8180A is one-based in DT. Pins translate to ACPI as DT + 0x80 - 1. The power button seems to either have an invalid index to be ignored/skipped (0x00) or this value indicates some special other pin. Implementation for the power button will therefore be tracked in another issue.

Implementation should only require adding the respective DT entries. See https://www.kernel.org/doc/Documentation/devicetree/bindings/input/gpio-keys.txt for details.

qzed commented 2 years ago

Support for volume buttons has been implemented in https://github.com/linux-surface/kernel/commit/1cbacc669c8e79b5dd4f0dd9146d5db9eeab267f.