OSDN Git Service

platform/surface: aggregator_registry: Generify subsystem hub functionality
authorMaximilian Luz <luzmaximilian@gmail.com>
Fri, 27 May 2022 02:34:44 +0000 (04:34 +0200)
committerHans de Goede <hdegoede@redhat.com>
Mon, 13 Jun 2022 15:25:08 +0000 (17:25 +0200)
commit1aa4c85bab7623469271d5a9cde3e3005b56fb7c
treef394aeaddcb03efb53620e71ebfebdfdc1486bd5
parent25e2ca7301bd3ca5a63a6be41d729eb42202bc21
platform/surface: aggregator_registry: Generify subsystem hub functionality

The Surface System Aggregator Module (SSAM) has multiple subsystems that
can manage detachable devices. At the moment, we only support the "base"
(BAS/0x11) subsystem, which is used on the Surface Book 3 to manage
devices (including keyboard, touchpad, and secondary battery) connected
to the base of the device.

The Surface Pro 8 has a new type-cover with keyboard and touchpad, which
is managed via the KIP/0x0e subsystem. The general procedure is the
same, but with slightly different events and setup. To make
implementation of the KIP hub easier and prevent duplication, generify
the parts of the base hub that we can use for the KIP hub (or any
potential future subsystem hubs).

This also switches over to use the newly introduced "hot-remove"
functionality, which should prevent communication issues when devices
have been detached.

Lastly, also drop the undocumented and unused sysfs "state" attribute of
the base hub. It has at best been useful for debugging.

Signed-off-by: Maximilian Luz <luzmaximilian@gmail.com>
Link: https://lore.kernel.org/r/20220527023447.2460025-10-luzmaximilian@gmail.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
drivers/platform/surface/surface_aggregator_registry.c