devm_v4l2_s...k_get_legacy(9)
π 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, iykykfixed_rateβ interpret theclk_rateas a fixed rate or default rate. so it's giving "which meaning ofclk_rateare 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: settingfixed_ratetotrueandclk_rateto0is 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:
v4l2_ctrl_query_fill(9)enum v4l2_i2c_tuner_type(9)v4l2_i2c_new_subdev(9)v4l2_i2c_new_subdev_board(9)v4l2_i2c_subdev_set_name(9)v4l2_i2c_subdev_init(9)v4l2_i2c_subdev_addr(9)v4l2_i2c_tuner_addrs(9)v4l2_i2c_subdev_unregister(9)v4l2_spi_new_subdev(9)v4l2_spi_subdev_init(9)v4l2_spi_subdev_unregister(9)v4l_bound_align_image(9)v4l2_find_nearest_size_conditional(9)v4l2_find_nearest_size(9)v4l2_g_parm_cap(9)v4l2_s_parm_cap(9)enum v4l2_pixel_encoding(9)struct v4l2_format_info(9)v4l2_get_link_freq(9)v4l2_get_active_data_lanes(9)v4l2_link_freq_to_bitmap(9)devm_v4l2_sensor_clk_get(9)
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
- 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