Lines Matching +full:sub +full:- +full:function

1 /* SPDX-License-Identifier: GPL-2.0+ */
3 * Surface System Aggregator Module (SSAM) bus and client-device subsystem.
5 * Main interface for the surface-aggregator bus, surface-aggregator client
7 * Provides support for non-platform/non-ACPI SSAM clients via dedicated
10 * Copyright (C) 2019-2021 Maximilian Luz <luzmaximilian@gmail.com>
23 /* -- Surface System Aggregator Module bus. --------------------------------- */
26 * enum ssam_device_domain - SAM device domain.
36 * enum ssam_virtual_tc - Target categories for the virtual SAM domain.
44 * struct ssam_device_uid - Unique identifier for SSAM device.
49 * @function: Sub-function of the device. This field can be used to split a
59 u8 function; member
75 * SSAM_DEVICE() - Initialize a &struct ssam_device_id with the given
81 * @fun: Sub-function of the device.
86 * matching should ignore target ID, instance ID, and/or sub-function,
92 * %SSAM_ANY_IID, or %SSAM_ANY_FUN, respectively. Other non-&u8 values are not
103 .function = __builtin_choose_expr((fun) != SSAM_ANY_FUN, (fun), 0)
106 * SSAM_VDEV() - Initialize a &struct ssam_device_id as virtual device with
111 * @fun: Sub-function of the device.
117 * instance ID, and/or sub-function, respectively. This macro initializes the
122 * %SSAM_ANY_IID, or %SSAM_ANY_FUN, respectively. Other non-&u8 values are not
129 * SSAM_SDEV() - Initialize a &struct ssam_device_id as physical SSH device
134 * @fun: Sub-function of the device.
140 * sub-function, respectively. This macro initializes the ``match_flags``
145 * %SSAM_ANY_IID, or %SSAM_ANY_FUN, respectively. Other non-&u8 values are not
152 * struct ssam_device - SSAM client device.
165 * struct ssam_device_driver - SSAM client device driver.
184 * is_ssam_device() - Check if the given device is a SSAM client device.
193 return d->type == &ssam_device_type; in is_ssam_device()
197 * to_ssam_device() - Casts the given device to a SSAM client device.
213 * to_ssam_device_driver() - Casts the given device driver to a SSAM client
244 * ssam_device_get() - Increment reference count of SSAM client device.
251 * See ssam_device_put() for the counter-part of this function.
257 return sdev ? to_ssam_device(get_device(&sdev->dev)) : NULL; in ssam_device_get()
261 * ssam_device_put() - Decrement reference count of SSAM client device.
268 * See ssam_device_get() for the counter-part of this function.
273 put_device(&sdev->dev); in ssam_device_put()
277 * ssam_device_get_drvdata() - Get driver-data of SSAM client device.
278 * @sdev: The device to get the driver-data from.
280 * Return: Returns the driver-data of the given device, previously set via
285 return dev_get_drvdata(&sdev->dev); in ssam_device_get_drvdata()
289 * ssam_device_set_drvdata() - Set driver-data of SSAM client device.
290 * @sdev: The device to set the driver-data of.
291 * @data: The data to set the device's driver-data pointer to.
295 dev_set_drvdata(&sdev->dev, data); in ssam_device_set_drvdata()
302 * ssam_device_driver_register() - Register a SSAM client device driver.
309 * module_ssam_device_driver() - Helper macro for SSAM device driver
322 /* -- Helpers for client-device requests. ----------------------------------- */
325 * SSAM_DEFINE_SYNC_REQUEST_CL_N() - Define synchronous client-device SAM
326 * request function with neither argument nor return value.
327 * @name: Name of the generated function.
330 * Defines a function executing the synchronous SAM request specified by
332 * specifying parameters are not hard-coded, but instead are provided via the
333 * client device, specifically its UID, supplied when calling this function.
334 * The generated function takes care of setting up the request struct, buffer
339 * The generated function is defined as ``static int name(struct ssam_device
346 * the generated function.
352 return __raw_##name(sdev->ctrl, sdev->uid.target, \
353 sdev->uid.instance); \
357 * SSAM_DEFINE_SYNC_REQUEST_CL_W() - Define synchronous client-device SAM
358 * request function with argument.
359 * @name: Name of the generated function.
363 * Defines a function executing the synchronous SAM request specified by
365 * return value. Device specifying parameters are not hard-coded, but instead
367 * calling this function. The generated function takes care of setting up the
372 * The generated function is defined as ``static int name(struct ssam_device
380 * the generated function.
386 return __raw_##name(sdev->ctrl, sdev->uid.target, \
387 sdev->uid.instance, arg); \
391 * SSAM_DEFINE_SYNC_REQUEST_CL_R() - Define synchronous client-device SAM
392 * request function with return value.
393 * @name: Name of the generated function.
397 * Defines a function executing the synchronous SAM request specified by
399 * type @rtype. Device specifying parameters are not hard-coded, but instead
401 * calling this function. The generated function takes care of setting up the
406 * The generated function is defined as ``static int name(struct ssam_device
414 * the generated function.
420 return __raw_##name(sdev->ctrl, sdev->uid.target, \
421 sdev->uid.instance, ret); \