media_create_pad_links(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

okay bestie, welcome to the Kernel API Manual corner where media_create_pad_links is the main character. This page is about making links between media entities, and it's lowkey a whole vibe for 1:n, n:1, and crossbar n:n setups. πŸ’…

✨ NAME ✨

media_create_pad_links β€” creates a link between two entities. Fr fr, that's the whole job. 🫢

πŸŽ€ SYNOPSIS πŸŽ€

int media_create_pad_links (const struct media_device *mdev , const u32
source_function , struct media_entity *source , const u16 source_pad ,
const u32 sink_function , struct media_entity *sink , const u16 sink_pad
, u32 flags , const bool allow_both_undefined );

πŸ’– ARGUMENTS πŸ’–

  • mdev β€” pointer to the media_device that contains the object. πŸ’–
  • source_function β€” function of the source entities. Used only if source is NULL. ✨
  • source β€” pointer to media_entity of the source pad. If NULL, it will use all entities that matches the sink_function. 🫢
  • source_pad β€” number of the source pad in the pads array. πŸ”₯
  • sink_function β€” function of the sink entities. Used only if sink is NULL. ✨
  • sink β€” pointer to media_entity of the sink pad. If NULL, it will use all entities that matches the sink_function. 🫢
  • sink_pad β€” number of the sink pad in the pads array. πŸ”₯
  • flags β€” link flags, as defined in include/uapi/linux/media.h. πŸ‘‘
  • allow_both_undefined β€” if true, then both source and sink can be NULL. In such case, it will create a crossbar between all entities that matches source_function to all entities that matches sink_function. If false, it will return 0 and won't create any link if both source and sink are NULL. 🚨

πŸ¦‹ DESCRIPTION πŸ¦‹

Valid values for flags are giving:

  • MEDIA_LNK_FL_ENABLED β€” indicates that the link is enabled and can be used to transfer media data. If multiple links are created and this flag is passed as an argument, only the first created link will have this flag. βœ…
  • MEDIA_LNK_FL_IMMUTABLE β€” indicates that the link enabled state can't be modified at runtime. If MEDIA_LNK_FL_IMMUTABLE is set, then MEDIA_LNK_FL_ENABLED must also be set since an immutable link is always enabled. πŸ”’

It is common for some devices to have multiple source and/or sink entities of the same type that should be linked. While media_create_pad_link creates link by link, this function is meant to allow 1:n, n:1 and even cross-bar (n:n) links. πŸ˜­πŸ’–

🚨 NOTE: Before calling this function, media_entity_pads_init and media_device_register_entity should be called previously for the entities to be linked. No skipping, bestie. 🫢

🌈 SEE ALSO 🌈

The whole squad is here, in original order:


mwah πŸ’‹ this page came from source/version ./include/media, dated October 2026 β€” media_create_pad_links(9) out! 🫢✨

πŸ“¦ where this page comes from