Advertisement
Guest User

Untitled

a guest
Oct 15th, 2010
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. #define EXTRABAUD 1000000
  2.  
  3. unsigned int
  4. uart_get_divisor(struct uart_port *port, unsigned int baud)
  5. {
  6. unsigned int quot;
  7.  
  8. #ifdef EXTRABAUD
  9. if( baud == 115200 ) {
  10. baud = EXTRABAUD;
  11. }
  12. #endif
  13.  
  14. /*
  15. * Old custom speed handling.
  16. */
  17. if (baud == 38400 && (port->flags & UPF_SPD_MASK) == UPF_SPD_CUST)
  18. quot = port->custom_divisor;
  19. else
  20. quot = (port->uartclk + (8 * baud)) / (16 * baud);
  21.  
  22. return quot;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement