uart_get_divisor(9)
β¨ uart_get_divisor(9) β¨
okay so real quick β this is a page from the Kernel API Manual, and it's all about uart_get_divisor, bestie. it's a tiny little function with one job and honestly it ate π
πΈ NAME πΈ
uart_get_divisor β returns the uart clock divisor, that's it, that's the whole vibe π
π¦ SYNOPSIS π¦
unsigned int uart_get_divisor (struct uart_port *port , unsigned int baud );
like look at her, so compact, so iconic π
π ARGUMENTS π
portβ theuart_portstructure that describes the port. she's the main character here, she holds all the info about which port we're talking about π«Άbaudβ the baud rate you actually want. the dream rate. the goal π
β DESCRIPTION β
so what it does: it calculates the divisor for the baud rate you passed in, using baud_base / baud, and it rounds it appropriately. ngl that's the whole thing π
and then there's this one little special case, okay, pay attention:
if it's 38400 baud and a custom divisor is selected, it returns the custom divisor instead. not the calculated one. the custom one. periodt π
Locking: caller dependent. and yes that means exactly what it sounds like β whether any locking happens is on whoever's calling it. no cap, that's your problem, not hers π
π₯ SEE ALSO π₯
kernel file ./drivers/tty/serial/serial_core.c β and honestly the whole friend group is here, so let me introduce everyone:
uart_write_wakeup(9)uart_update_timeout(9)uart_get_baud_rate(9)uart_get_lsr_info(9)uart_console_write(9)uart_parse_earlycon(9)uart_parse_options(9)uart_set_options(9)uart_change_pm(9)uart_register_driver(9)uart_unregister_driver(9)serial_core_add_one_port(9)serial_core_remove_one_port(9)uart_match_port(9)uart_handle_dcd_change(9)uart_handle_cts_change(9)uart_insert_char(9)uart_try_toggle_sysrq(9)uart_get_rs485_mode(9)
every single one, no skips, we don't do that here π§
and that's the page!! lived in ./drivers/tty/serial, dated October 2026 β mwah, sending you off with a kiss, go divide some clocks bestie ππβ¨
π¦ 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