Lines Matching +full:system +full:- +full:controller

1 /* SPDX-License-Identifier: GPL-2.0+ */
3 * Main SSAM/SSH controller structure and functionality.
5 * Copyright (C) 2019-2022 Maximilian Luz <luzmaximilian@gmail.com>
22 #include <linux/surface_aggregator/controller.h>
28 /* -- Safe counters. -------------------------------------------------------- */
31 * struct ssh_seq_counter - Safe counter for SSH sequence IDs.
39 * struct ssh_rqid_counter - Safe counter for SSH request IDs.
47 /* -- Event/notification system. -------------------------------------------- */
50 * struct ssam_nf_head - Notifier head for SSAM events.
52 * @head: List-head for notifier blocks registered under this head.
60 * struct ssam_nf - Notifier callback- and activation-registry for SSAM events.
61 * @lock: Lock guarding (de-)registration of notifier blocks. Note: This
64 * @refcount: The root of the RB-tree used for reference-counting enabled
75 /* -- Event/async request completion system. -------------------------------- */
80 * struct ssam_event_item - Struct for event queuing and completion.
99 * struct ssam_event_queue - Queue for completing received events.
100 * @cplt: Reference to the completion system on which this queue is active.
102 * @head: The list-head of the queue.
114 * struct ssam_event_target - Set of queues for a single SSH target ID.
122 * struct ssam_cplt - SSAM event/async request completion system.
123 * @dev: The device with which this system is associated. Only used
142 /* -- Main SSAM device structures. ------------------------------------------ */
145 * enum ssam_controller_state - State values for &struct ssam_controller.
147 * The controller has not been initialized yet or has been deinitialized.
149 * The controller is initialized, but has not been started yet.
151 * The controller has been started and is ready to use.
153 * The controller has been stopped.
155 * The controller has been suspended.
166 * struct ssam_controller_caps - Controller device capabilities.
169 * @screen_on_sleep_idle_timeout: SAM UART screen-on sleep idle timeout.
170 * @screen_off_sleep_idle_timeout: SAM UART screen-off sleep idle timeout.
173 * Controller and SSH device capabilities found in ACPI.
184 * struct ssam_controller - SSAM controller device.
185 * @kref: Reference count of the controller.
186 * @lock: Main lock for the controller, used to guard state changes.
187 * @state: Controller state.
189 * @cplt: Completion system for SSH/SSAM events and asynchronous requests.
196 * @caps: The controller device capabilities.
223 #define ssam_dbg(ctrl, fmt, ...) rtl_dbg(&(ctrl)->rtl, fmt, ##__VA_ARGS__)
224 #define ssam_info(ctrl, fmt, ...) rtl_info(&(ctrl)->rtl, fmt, ##__VA_ARGS__)
225 #define ssam_warn(ctrl, fmt, ...) rtl_warn(&(ctrl)->rtl, fmt, ##__VA_ARGS__)
226 #define ssam_err(ctrl, fmt, ...) rtl_err(&(ctrl)->rtl, fmt, ##__VA_ARGS__)
229 * ssam_controller_receive_buf() - Provide input-data to the controller.
230 * @ctrl: The controller.
234 * Provide input data to be evaluated by the controller, which has been
235 * received via the lower-level transport.
238 * layer of the controller has been shut down, %-ESHUTDOWN.
244 return ssh_ptl_rx_rcvbuf(&ctrl->rtl.ptl, buf, n); in ssam_controller_receive_buf()
248 * ssam_controller_write_wakeup() - Notify the controller that the underlying
250 * @ctrl: The controller.
254 ssh_ptl_tx_wakeup_transfer(&ctrl->rtl.ptl); in ssam_controller_write_wakeup()