ptp_find_pin(9)
ptp_find_pin(9) β the Kernel API Manual, bestie edition π β¨
okay so this is ptp_find_pin, and it's literally the glow-up you need when you're trying to figure out which pin handles a specific auxiliary function. iconic behavior, no cap. π
β¨ NAME β¨
ptp_find_pin β obtain the pin index of a given auxiliary function π«Ά
πΈ SYNOPSIS πΈ
int ptp_find_pin (struct ptp_clock *ptp , enum ptp_pin_function func ,
unsigned int chan );
π¦ ARGUMENTS π¦
ptpβ the clock you got fromptp_clock_register. your main character struct, basically πfuncβ one of theptp_pin_functionenumerated values. pick your vibe from the enum π«chanβ the particular functional channel to find. yes, the particular one, be specific bestie π
π DESCRIPTION π
okay so the tea is: the caller must hold ptp_clock::pincfg_mux. that's the rule, fr fr.
and here's the little plot twist π β drivers do not have access to that mutex, because ptp_clock is an opaque type. so you can't just grab it yourself, rude but that's how it is.
but wait, it gets better: the core code acquires the mutex before invoking the driver's ptp_clock_info::enable callback. so drivers may call this function from that context. slay, problem solved β¨
π₯ RETURN π₯
- pin index in the range of zero to
ptp_clock_caps.n_pins - 1π - or
-1if the auxiliary function cannot be found. not found = you get the-1, sorry bestie π
π SEE ALSO π
- Kernel file
./include/linux/ptp_clock_kernel.h - struct
ptp_clock_request(9) - struct
ptp_system_timestamp(9) - struct
ptp_clock_info(9) - struct
ptp_clock_event(9) scaled_ppm_to_ppb(9)diff_by_scaled_ppm(9)adjust_by_scaled_ppm(9)ptp_clock_register(9)ptp_clock_unregister(9)ptp_clock_event(9)ptp_clock_index(9)ptp_clock_index_by_of_node(9)ptp_clock_index_by_dev(9)ptp_find_pin_unlocked(9)ptp_schedule_worker(9)ptp_cancel_worker_sync(9)ptp_get_vclocks_index(9)ptp_convert_timestamp(9)
and that's the whole vibe check, bestie π§π this lil page lives over in ./include/linux, dated October 2026, and it's filed under ptp_find_pin(9) β go off, you've got this ππ
π¦ 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