[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20120112143900.27b92668@pyramind.ukuu.org.uk>
Date: Thu, 12 Jan 2012 14:39:00 +0000
From: Alan Cox <alan@...rguk.ukuu.org.uk>
To: Rajanikanth H V <rajanikanth.hv@...ricsson.com>
Cc: "linux-serial@...r.kernel.org" <linux-serial@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"gregkh@...e.de" <gregkh@...e.de>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>
Subject: Re: tty/serial: Need clarification on Support for 4+M Baudrate
On Thu, 12 Jan 2012 15:20:46 +0100
Rajanikanth H V <rajanikanth.hv@...ricsson.com> wrote:
> Alan,
>
> FYI: I am not using application, rather I have a Bluetooth driver invoking
> encode_baud_rate(...), please find log below.
>
> I made sure that c_ispeed = c_ospeed = 4.05M Baud, however I see
> tty_termios_encode_baud_rate(...) is normalizing to 4.0
>
>
> manual trace log below:
> ======================================================================================
>
> 4.05M Arbitrary Baud Setting Sequence:
> [ 9.664703] alloc_set_baud_rate_cmd Setting arbitrary baudrate using BOTHER baudrate:89 c_cflag:020000016262
> [ 9.774658] XXXXXX_hci_uart_set_baudrate c_cflag:020000016262 baud:4050000
4050000 seems a bit odd - you want cflag&CBAUD == BOTHER so I'd expect
the low bits to end rather different things to 6262 ?
So something like
struct ktermios new = *tty->termios;
new.c_cflag &= ~(CBAUD|CIBAUD);
new.c_cflag |= BOTHER;
new.c_ispeed = 4050000;
new.c_ospeed = 4050000;
tty_set_termios(tty, &new); /* Can sleep */
/* Returned new will now hold actual values selected */
should do the trick providing the low level driver supports the rate.
Alan
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists