ad7380_osr_to_regval(9)
π ad7380_osr_to_regval β the Kernel API Manual's cutest little ratio-translator β¨
okay so bestie, welcome to the Kernel API Manual π and buckle up because this function is short but she is mighty.
πΈ NAME πΈ
ad7380_osr_to_regval β literally converts a ratio into an OSR register value. that's it. that's the whole job. and she does it flawlessly π
β¨ SYNOPSIS β¨
int ad7380_osr_to_regval (int ratio );
ngl, one function, one argument, zero drama π«Ά
π¦ ARGUMENTS π¦
ratioβ the ratio you wanna check π that's the whole thing, she's just a number walking in asking "do I belong here?"
π DESCRIPTION π
okay so here's the vibe check π₯ this function checks whether ratio is actually present in the list of available ratios β like, is she on the guest list or not π
and if she is on the list? boom π₯ you get back the corresponding value that needs to be written to the register to select that ratio. it's giving translator, it's giving matchmaker, it's giving iconic π
no cap, this is a "find my ratio's register value" moment and it ate π
β RETURN β
- the register value, which lives in the range
0to7π -EINVALif there is not an exact match π β no partial credit, no "close enough", she needs the exact ratio or it's a no from her fr fr
π₯ SEE ALSO π₯
- the kernel file
./drivers/iio/adc/ad7380.cβ go read the source, iykyk π ad7380_regval_to_osr(9)β the reverse queen β¨ad7380_update_xfers(9)β her other bestie π«Ά
and that's the page, bestie β from the Kernel API Manual, the ./drivers/iio/adc directory, dated October 2026 π mwah, go forth and match your ratios π§ββοΈπ
π¦ 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