platform/surface: Add Surface Hot-Plug driver
authorMaximilian Luz <luzmaximilian@gmail.com>
Fri, 5 Feb 2021 01:26:57 +0000 (02:26 +0100)
committerHans de Goede <hdegoede@redhat.com>
Mon, 8 Feb 2021 15:59:21 +0000 (16:59 +0100)
commitbd69bcce4aa089435e2891222236b1cb20395bec
tree6fde31612ba4b3389c6f765633a384877e09adf3
parentfc4325a1a34a8b2dffbd1b664cb41b9bead09f74
platform/surface: Add Surface Hot-Plug driver

Some Surface Book 2 and 3 models have a discrete GPU (dGPU) that is
hot-pluggable. On those devices, the dGPU is contained in the base,
which can be separated from the tablet part (containing CPU and
touchscreen) while the device is running.

It (in general) is presented as/behaves like a standard PCIe hot-plug
capable device, however, this device can also be put into D3cold. In
D3cold, the device itself is turned off and can thus not submit any
standard PCIe hot-plug events. To properly detect hot-(un)plugging while
the dGPU is in D3cold, out-of-band signaling is required. Without this,
the device state will only get updated during the next bus-check, eg.
via a manually issued lspci call.

This commit adds a driver to handle out-of-band PCIe hot-(un)plug events
on Microsoft Surface devices. On those devices, said events can be
detected via GPIO interrupts, which are then forwarded to the
corresponding ACPI DSM calls by this driver. The DSM then takes care of
issuing the appropriate bus-/device-check, causing the PCI core to
properly pick up the device change.

Signed-off-by: Maximilian Luz <luzmaximilian@gmail.com>
Link: https://lore.kernel.org/r/20210205012657.1951753-1-luzmaximilian@gmail.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
MAINTAINERS
drivers/platform/surface/Kconfig
drivers/platform/surface/Makefile
drivers/platform/surface/surface_hotplug.c [new file with mode: 0644]