forked from Imagelibrary/rtems
libchip/ns16550: Allow user calculate baud divisor
This patch will allow the user to pass a function to calculate the baud divisor. This will allow for more flexibility, since for some BSPs like raspberrypi, the calculation of baud divisor is different from what is in the current driver.
This commit is contained in:
committed by
Christian Mauderer
parent
b89b44224c
commit
5857e83cfc
@@ -112,6 +112,8 @@ static uint32_t NS16550_GetBaudDivisor(ns16550_context *ctx, uint32_t baud)
|
||||
NS16550_FRACTIONAL_DIVIDER,
|
||||
fractionalDivider
|
||||
);
|
||||
} else if (ctx->calculate_baud_divisor != NULL) {
|
||||
baudDivisor = ctx->calculate_baud_divisor(ctx, baud);
|
||||
}
|
||||
|
||||
return baudDivisor;
|
||||
|
||||
Reference in New Issue
Block a user