v4l2_create...links_to_pad(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

okay bestie, welcome to the Kernel API Manual entry for v4l2_create...links_to_pad(9) β€” yes the name is a whole mouthful, yes it's iconic, no we're not skipping a single letter of it ✨


🌸 NAME 🌸

v4l2_create_fwnode_links_to_pad β€” Create fwnode-based links from a source subdev to a sink pad. That's the whole vibe: source subdev on one side, sink pad on the other, links getting made in between πŸŽ€


✨ SYNOPSIS ✨

int v4l2_create_fwnode_links_to_pad (struct v4l2_subdev *src_sd , struct
media_pad *sink , u32 flags );

literally the entire signature, copy-pasted energy but make it cute πŸ’… returns an int, takes three things, we go through them right now 🫢


πŸ¦‹ ARGUMENTS πŸ¦‹

  • src_sd β€” pointer to a source subdev. yes, the source, the one doing the sourcing, main character of the connection 🌟
  • sink β€” pointer to a sink pad. the destination, the receiver, the one catching all the links πŸ’–
  • flags β€” the link flags. we'll get into why these have RULES in a sec, keep reading πŸ‘€

🧚 DESCRIPTION 🧚

so the way this function works is: it searches for fwnode endpoint connections from a source subdevice to a single sink pad, and if suitable connections turn up, it translates them into media links to that pad. no cap, that's the whole job 🌈

and here's the cute part β€” the function can be called by the sink, in its v4l2-async notifier bound callback, to create links from a bound source subdevice. so the sink is out here making its own connections, highkey independent energy πŸ‘‘

now, the flags argument specifies the link flags. and listen, bestie, this next bit matters: The caller shall ensure that the flags are valid regardless of the number of links that may be created. For instance β€” setting the MEDIA_LNK_FL_ENABLED flag will cause all created links to be enabled, which isn't valid if more than one link is created. 😭 so like, one flag, many links = chaos. do your vibe check first fr fr

⚠️ NOTE: Any sink subdevice that calls this function must implement the .get_fwnode_pad media operation in order to verify endpoints passed to the sink are owned by the sink. no .get_fwnode_pad, no deal β€” that's the security guard at the door πŸ™ˆ

Return 0 on success or a negative error code on failure. zero means slay, negative means try again πŸ’€


πŸŽ€ SEE ALSO πŸŽ€

all the friends in the group chat, go say hi πŸ«ΆπŸ¦‹


and that's the page, bestie! sign-off time: this one lives in ./include/media, dated October 2026, from the Kernel API Manual β€” go forth and create those fwnode links responsibly, ily, bye πŸ’–πŸŽ€βœ¨

πŸ“¦ where this page comes from