ep93xx_spi_calc_divisors(9)
β¨ ep93xx_spi_calc_divisors β¨
okay so bestie, welcome to the Kernel API Manual β this one's a tiny little kernel helper from the SPI world, and it's literally just here to do math for you π
π NAME
ep93xx_spi_calc_divisors β the function that calculates SPI clock divisors β
Like, that's it. That's the whole job. It does the clock math so you don't have to. Slay.
πΈ SYNOPSIS
int ep93xx_spi_calc_divisors (struct spi_controller *host , u32 rate ,
u8 *div_cpsr , u8 *div_scr );
Returns an int. Takes a host, a rate, and two pointers to write dividers into. Very demure, very mindful π«Ά
π¦ ARGUMENTS
hostβ the SPI host π (yourstruct spi_controller *, the main character of this whole operation)rateβ the desired SPI output clock rate, as au32. i.e. the speed you're dreaming of β¨div_cpsrβ pointer to return the cpsr (pre-scaler) divider β it writes the pre-scaler back out through here π₯div_scrβ pointer to return the scr divider through here π
so yeah, you hand it the host + the rate you want, and it hands you back both dividers via those pointers. no cap.
π SEE ALSO
- Kernel file
./drivers/spi/spi-ep93xx.cπ struct ep93xx_spi(9)ep93xx_spi_read_write(9)ep93xx_spi_dma_prepare(9)ep93xx_spi_dma_finish(9)
go read those if you wanna see the whole squad in action, iykyk π
ngl this one's short and sweet β no options, no env vars, no exit statuses, no bugs listed. just vibes, dividers, and a struct spi_controller *. drink water, check your return value, periodt π
okay that's the whole page bestie!! this came from the source ./drivers/spi and it's dated October 2026 β so mark your calendar, mwah ππ«Άπ
π¦ 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