devm_v4l2_s...k_get_legacy(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… devm_v4l2_sensor_clk_get_legacy β€” like, the whole manual, but make it make sense

okay so this is a page from the Kernel API Manual, and honestly? the vibe is legacy driver energy. bestie, this one's a look back, not a look forward β€” i'll explain 🌸


✨ NAME ✨

devm_v4l2_sensor_clk_get_legacy β€” lookup and obtain a reference to a clock producer for a camera sensor. that's it, that's the whole job πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

struct clk * devm_v4l2_sensor_clk_get_legacy (struct device *dev , const
char *id , bool fixed_rate , unsigned long clk_rate );

literally the whole signature, character for character, no notes πŸ‘‘


🌸 ARGUMENTS 🌸

  • dev β€” device for v4l2 sensor clock "consumer". yeah the quotes are in the original, she's being ✨quoted✨
  • id β€” clock consumer ID. the name it goes by, iykyk
  • fixed_rate β€” interpret the clk_rate as a fixed rate or default rate. so it's giving "which meaning of clk_rate are we using today" πŸ€”
  • clk_rate β€” the clock rate. the number. the frequency. her πŸ’…

πŸ’– DESCRIPTION πŸ’–

so this function behaves the same way as devm_v4l2_sensor_clk_get β€” same energy, same everything β€” except that it extends the behaviour on ACPI platforms to all platforms. no cap, that's the whole flex 🌈

the function also provides the ability to set the clock rate to a fixed frequency by setting fixed_rate to true and specifying the fixed frequency in clk_rate. OR, alternative vibe: use a default clock rate when the "clock-frequency" property is absent by setting fixed_rate to false and specifying the default frequency in clk_rate. pick your fighter 🫢

⚠️ okay this part matters: setting fixed_rate to true and clk_rate to 0 is an error. like, that combo is not it. don't do it 🚫

huge caveat time, and i mean it: this function is meant to support legacy behaviour in existing drivers only. it must not be used in any new driver. periodt. if you're writing something new, this is not your girl πŸ™ˆ

returns a pointer to a struct clk on success, or an error pointer on failure. classic 🎯


πŸ‘‘ SEE ALSO πŸ‘‘

kernel file ./include/media/v4l2-common.h, plus the whole friend group:


and that's the page!! source is ./include/media, dated October 2026 β€” mwah, go read the non-legacy one if you're starting something new, ily, bye πŸ§šπŸ’œ

πŸ“¦ where this page comes from