ssam_client_bind(9)
π ssam_client_bind(9) β Kernel API Manual π
okay so bestie, we're in ssam_client_bind(9) today and honestly this one is kinda iconic once you get the vibe of it π«Ά
β¨ NAME β¨
ssam_client_bind β Bind an arbitrary client device to the controller.
πΈ SYNOPSIS πΈ
struct ssam_controller * ssam_client_bind (struct device *client );
π ARGUMENTS π
clientβ The client device. that's it, that's the whole arg π
π¦ DESCRIPTION π¦
okay so the whole point: you're linking an arbitrary client device to the controller by creating a device link between it as consumer and the main controller device as provider. slay. π
and like, why would you even do this? because this function can be used for non-SSAM devices to guarantee that the controller returned by this function is valid for as long as the driver of the client device is bound, and that proper suspend and resume ordering is guaranteed. no cap, that's the whole guarantee β¨
it does essentially the same as ssam_client_link, except the order is a little different: it first fetches the main controller reference, then creates the link, and finally returns this reference. note that this function does not increment the reference counter of the controller, because, thanks to the link, the controller lifetime is assured as long as the driver of the client device is bound. π§
β οΈ okay now the important part, bestie, please read this one β it is not valid to use the controller reference obtained by this method outside of the driver bound to the client device at the time of calling this function, without first incrementing the reference count of the controller via ssam_controller_get. and even after doing that, care must be taken that requests are only submitted and notifiers are only (un-)registered when the controller is active and not suspended. in other words: the device link only lives as long as the client driver is bound and any guarantees enforced by this link (e.g. active controller state) can only be relied upon as long as this link exists and may need to be enforced in other ways afterwards. π like, the vibes are conditional, fr fr.
good news though: the created device link does not have to be destructed manually. it is removed automatically once the driver of the client device unbinds. so like, no cleanup era for you π
π RETURN π
returns the controller on success π β or an error pointer with -ENODEV if the controller is not present, not ready or going to be removed soon, or -ENOMEM if the device link could not be created for other reasons. π
β SEE ALSO β
Kernel file ./drivers/platform/surface/aggregator/core.c
and that's the whole page bestie, go forth and bind responsibly π
mwah π this was ./drivers/platform/surface/agg... β October 2026, ssam_client_bind(9), signing off π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms