eb0e90a820
The Surface Aggregator EC provides varying functionality, depending on the Surface device. To manage this functionality, we use dedicated client devices for each subsystem or virtual device of the EC. While some of these clients are described as standard devices in ACPI and the corresponding client drivers can be implemented as platform drivers in the kernel (making use of the controller API already present), many devices, especially on newer Surface models, cannot be found there. To simplify management of these devices, we introduce a new bus and client device type for the Surface Aggregator subsystem. The new device type takes care of managing the controller reference, essentially guaranteeing its validity for as long as the client device exists, thus alleviating the need to manually establish device links for that purpose in the client driver (as has to be done with the platform devices). Signed-off-by: Maximilian Luz <luzmaximilian@gmail.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/20201221183959.1186143-7-luzmaximilian@gmail.com Signed-off-by: Hans de Goede <hdegoede@redhat.com>
28 lines
783 B
C
28 lines
783 B
C
/* SPDX-License-Identifier: GPL-2.0+ */
|
|
/*
|
|
* Surface System Aggregator Module bus and device integration.
|
|
*
|
|
* Copyright (C) 2019-2020 Maximilian Luz <luzmaximilian@gmail.com>
|
|
*/
|
|
|
|
#ifndef _SURFACE_AGGREGATOR_BUS_H
|
|
#define _SURFACE_AGGREGATOR_BUS_H
|
|
|
|
#include <linux/surface_aggregator/controller.h>
|
|
|
|
#ifdef CONFIG_SURFACE_AGGREGATOR_BUS
|
|
|
|
void ssam_controller_remove_clients(struct ssam_controller *ctrl);
|
|
|
|
int ssam_bus_register(void);
|
|
void ssam_bus_unregister(void);
|
|
|
|
#else /* CONFIG_SURFACE_AGGREGATOR_BUS */
|
|
|
|
static inline void ssam_controller_remove_clients(struct ssam_controller *ctrl) {}
|
|
static inline int ssam_bus_register(void) { return 0; }
|
|
static inline void ssam_bus_unregister(void) {}
|
|
|
|
#endif /* CONFIG_SURFACE_AGGREGATOR_BUS */
|
|
#endif /* _SURFACE_AGGREGATOR_BUS_H */
|