ssam_device_add(9)
π
ssam_device_add β the Kernel API Manual, but make it make sense π
okay bestie, so this is a page from the Kernel API Manual (ssam_device_add(9)) and it's literally about adding a SSAM client device. it's short, it's sweet, and it has β¨consequencesβ¨ if you get it wrong. let's get into it π«Ά
πΈ NAME πΈ
ssam_device_add β Add a SSAM client device. that's it, that's the vibe π
β¨ SYNOPSIS β¨
int ssam_device_add (struct ssam_device *sdev );
like, you hand it a sdev and it hands you back an int. iconic behavior, no notes π
π¦ ARGUMENTS π¦
sdevβ The SSAM client device to be added. that's the one you're putting into the world, bestie. give it a good home π‘
π DESCRIPTION π
so here's the tea β β added client devices must be guaranteed to always have a valid and active controller. like, always. no exceptions, periodt.
because of that, this function will fail with -ENODEV if the controller of the device:
- has not been initialized yet π
- has been suspended π
- or has been shut down π
the caller of this function should ensure that the corresponding call to ssam_device_remove is issued before the controller is shut down. this is important, okay? write it down. tattoo it. whatever works.
if the added device is a direct child of the controller device (default), it will be automatically removed when the controller is shut down β so that one's handled for you, slay β¨
by default, the controller device will become the parent of the newly created client device. the parent may be changed before ssam_device_add is called, but bestie, care must be taken that:
- a) the correct suspend/resume ordering is guaranteed
- b) the client device does not outlive the controller, i.e. that the device is removed before the controller is being shut down
β οΈ if these guarantees have to be manually enforced, please refer to thessam_client_linkandssam_client_bindfunctions β they are intended to set up device-links for this purpose. they're literally made for exactly this, iykyk π
π RETURN π
- Returns zero on success π
- a negative error code on failure π
no in-between, it's giving binary energy fr fr
β SEE ALSO β
the kernel file that lives here, no cap:
./drivers/platform/surface/aggregator/bus.c
and the whole friend group π:
ssam_device_alloc(9)ssam_device_remove(9)ssam_device_id_compatible(9)ssam_device_id_is_null(9)ssam_device_id_match(9)ssam_device_get_match(9)ssam_device_get_match_data(9)__ssam_device_driver_register(9)ssam_device_driver_unregister(9)ssam_bus_register(9)ssam_bus_unregister(9)__ssam_register_clients(9)ssam_remove_clients(9)
and that's the page! this little cutie came from ./drivers/platform/surface/agg... and it's dated October 2026, so yeah β future vibes only πΈπ¦ sign-off complete, go add those devices responsibly bestie π
β¨
π¦ 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