1# SPDX-License-Identifier: GPL-2.0+
2# Copyright (C) 2019-2020 Maximilian Luz <luzmaximilian@gmail.com>
3
4menuconfig SURFACE_AGGREGATOR
5	tristate "Microsoft Surface System Aggregator Module Subsystem and Drivers"
6	depends on SERIAL_DEV_BUS
7	select CRC_CCITT
8	help
9	  The Surface System Aggregator Module (Surface SAM or SSAM) is an
10	  embedded controller (EC) found on 5th- and later-generation Microsoft
11	  Surface devices (i.e. Surface Pro 5, Surface Book 2, Surface Laptop,
12	  and newer, with exception of Surface Go series devices).
13
14	  Depending on the device in question, this EC provides varying
15	  functionality, including:
16	  - EC access from ACPI via Surface ACPI Notify (5th- and 6th-generation)
17	  - battery status information (all devices)
18	  - thermal sensor access (all devices)
19	  - performance mode / cooling mode control (all devices)
20	  - clipboard detachment system control (Surface Book 2 and 3)
21	  - HID / keyboard input (Surface Laptops, Surface Book 3)
22
23	  This option controls whether the Surface SAM subsystem core will be
24	  built. This includes a driver for the Surface Serial Hub (SSH), which
25	  is the device responsible for the communication with the EC, and a
26	  basic kernel interface exposing the EC functionality to other client
27	  drivers, i.e. allowing them to make requests to the EC and receive
28	  events from it. Selecting this option alone will not provide any
29	  client drivers and therefore no functionality beyond the in-kernel
30	  interface. Said functionality is the responsibility of the respective
31	  client drivers.
32
33	  Note: While 4th-generation Surface devices also make use of a SAM EC,
34	  due to a difference in the communication interface of the controller,
35	  only 5th and later generations are currently supported. Specifically,
36	  devices using SAM-over-SSH are supported, whereas devices using
37	  SAM-over-HID, which is used on the 4th generation, are currently not
38	  supported.
39
40	  Choose m if you want to build the SAM subsystem core and SSH driver as
41	  module, y if you want to build it into the kernel and n if you don't
42	  want it at all.
43
44config SURFACE_AGGREGATOR_BUS
45	bool "Surface System Aggregator Module Bus"
46	depends on SURFACE_AGGREGATOR
47	default y
48	help
49	  Expands the Surface System Aggregator Module (SSAM) core driver by
50	  providing a dedicated bus and client-device type.
51
52	  This bus and device type are intended to provide and simplify support
53	  for non-platform and non-ACPI SSAM devices, i.e. SSAM devices that are
54	  not auto-detectable via the conventional means (e.g. ACPI).
55
56config SURFACE_AGGREGATOR_ERROR_INJECTION
57	bool "Surface System Aggregator Module Error Injection Capabilities"
58	depends on SURFACE_AGGREGATOR
59	depends on FUNCTION_ERROR_INJECTION
60	help
61	  Provides error-injection capabilities for the Surface System
62	  Aggregator Module subsystem and Surface Serial Hub driver.
63
64	  Specifically, exports error injection hooks to be used with the
65	  kernel's function error injection capabilities to simulate underlying
66	  transport and communication problems, such as invalid data sent to or
67	  received from the EC, dropped data, and communication timeouts.
68	  Intended for development and debugging.
69