162306a36Sopenharmony_ci.. SPDX-License-Identifier: GPL-2.0+
262306a36Sopenharmony_ci
362306a36Sopenharmony_ci.. |san_client_link| replace:: :c:func:`san_client_link`
462306a36Sopenharmony_ci.. |san_dgpu_notifier_register| replace:: :c:func:`san_dgpu_notifier_register`
562306a36Sopenharmony_ci.. |san_dgpu_notifier_unregister| replace:: :c:func:`san_dgpu_notifier_unregister`
662306a36Sopenharmony_ci
762306a36Sopenharmony_ci===================
862306a36Sopenharmony_ciSurface ACPI Notify
962306a36Sopenharmony_ci===================
1062306a36Sopenharmony_ci
1162306a36Sopenharmony_ciThe Surface ACPI Notify (SAN) device provides the bridge between ACPI and
1262306a36Sopenharmony_ciSAM controller. Specifically, ACPI code can execute requests and handle
1362306a36Sopenharmony_cibattery and thermal events via this interface. In addition to this, events
1462306a36Sopenharmony_cirelating to the discrete GPU (dGPU) of the Surface Book 2 can be sent from
1562306a36Sopenharmony_ciACPI code (note: the Surface Book 3 uses a different method for this). The
1662306a36Sopenharmony_cionly currently known event sent via this interface is a dGPU power-on
1762306a36Sopenharmony_cinotification. While this driver handles the former part internally, it only
1862306a36Sopenharmony_cirelays the dGPU events to any other driver interested via its public API and
1962306a36Sopenharmony_cidoes not handle them.
2062306a36Sopenharmony_ci
2162306a36Sopenharmony_ciThe public interface of this driver is split into two parts: Client
2262306a36Sopenharmony_ciregistration and notifier-block registration.
2362306a36Sopenharmony_ci
2462306a36Sopenharmony_ciA client to the SAN interface can be linked as consumer to the SAN device
2562306a36Sopenharmony_civia |san_client_link|. This can be used to ensure that the a client
2662306a36Sopenharmony_cireceiving dGPU events does not miss any events due to the SAN interface not
2762306a36Sopenharmony_cibeing set up as this forces the client driver to unbind once the SAN driver
2862306a36Sopenharmony_ciis unbound.
2962306a36Sopenharmony_ci
3062306a36Sopenharmony_ciNotifier-blocks can be registered by any device for as long as the module is
3162306a36Sopenharmony_ciloaded, regardless of being linked as client or not. Registration is done
3262306a36Sopenharmony_ciwith |san_dgpu_notifier_register|. If the notifier is not needed any more, it
3362306a36Sopenharmony_cishould be unregistered via |san_dgpu_notifier_unregister|.
3462306a36Sopenharmony_ci
3562306a36Sopenharmony_ciConsult the API documentation below for more details.
3662306a36Sopenharmony_ci
3762306a36Sopenharmony_ci
3862306a36Sopenharmony_ciAPI Documentation
3962306a36Sopenharmony_ci=================
4062306a36Sopenharmony_ci
4162306a36Sopenharmony_ci.. kernel-doc:: include/linux/surface_acpi_notify.h
4262306a36Sopenharmony_ci
4362306a36Sopenharmony_ci.. kernel-doc:: drivers/platform/surface/surface_acpi_notify.c
4462306a36Sopenharmony_ci    :export:
45