ssam_device_add(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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:

  1. a) the correct suspend/resume ordering is guaranteed
  2. 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 the ssam_client_link and ssam_client_bind functions β€” 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 πŸ’–:


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