From: Vineet Gupta <Vineet.Gupta1@synopsys.com>
To: Alan Cox <alan@linux.intel.com>
Cc: gregkh@linuxfoundation.org, linux-serial@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] serial/arc-uart: Add new driver
Date: Tue, 2 Oct 2012 10:03:18 +0530 [thread overview]
Message-ID: <506A6E8E.2000005@synopsys.com> (raw)
In-Reply-To: <20120928140248.54a10d06@bob.linux.org.uk>
On Friday 28 September 2012 06:32 PM, Alan Cox wrote:
>> +static void
>> +arc_serial_set_termios(struct uart_port *port, struct ktermios
>> *termios,
>> + struct ktermios *old)
>> +{
>> + struct arc_uart_port *uart = (struct arc_uart_port *)port;
>> + unsigned int baud, uartl, uarth, hw_val;
>> + unsigned long flags;
>> +
> Two things here. Firstly you want to write the actual baud back to the
> termios (tty_termios_encode_baud_rate) unless B0 is set.
>
> Secondly if you don't support hardware flow control, character size
> setting etc then you need to set those bits back so the caller knows.
> Two ways to do that. Either initialise the default termios for the tty
> type to the correct values and use tty_termios_copy_hw() or set them in
> the termios handler.
Just to give you an idea, is something on the lines of following OK for
both the above points above !
- uart_update_timeout(port, termios->c_cflag, baud);
+ new->c_cflag &= ~(CMSPAR|CRTSCTS); /* Don't care for
parity/flow ctrl */
+
+ if (old)
+ tty_termios_copy_hw(new, old);
+
+ /* Don't rewrite B0 */
+ if (tty_termios_baud_rate(new))
+ tty_termios_encode_baud_rate(new, baud, baud);
+
+ uart_update_timeout(port, new->c_cflag, baud);
Respun patch to follow shortly.
Thx,
Vineet
WARNING: multiple messages have this Message-ID (diff)
From: Vineet Gupta <Vineet.Gupta1@synopsys.com>
To: Alan Cox <alan@linux.intel.com>
Cc: <gregkh@linuxfoundation.org>, <linux-serial@vger.kernel.org>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] serial/arc-uart: Add new driver
Date: Tue, 2 Oct 2012 10:03:18 +0530 [thread overview]
Message-ID: <506A6E8E.2000005@synopsys.com> (raw)
In-Reply-To: <20120928140248.54a10d06@bob.linux.org.uk>
On Friday 28 September 2012 06:32 PM, Alan Cox wrote:
>> +static void
>> +arc_serial_set_termios(struct uart_port *port, struct ktermios
>> *termios,
>> + struct ktermios *old)
>> +{
>> + struct arc_uart_port *uart = (struct arc_uart_port *)port;
>> + unsigned int baud, uartl, uarth, hw_val;
>> + unsigned long flags;
>> +
> Two things here. Firstly you want to write the actual baud back to the
> termios (tty_termios_encode_baud_rate) unless B0 is set.
>
> Secondly if you don't support hardware flow control, character size
> setting etc then you need to set those bits back so the caller knows.
> Two ways to do that. Either initialise the default termios for the tty
> type to the correct values and use tty_termios_copy_hw() or set them in
> the termios handler.
Just to give you an idea, is something on the lines of following OK for
both the above points above !
- uart_update_timeout(port, termios->c_cflag, baud);
+ new->c_cflag &= ~(CMSPAR|CRTSCTS); /* Don't care for
parity/flow ctrl */
+
+ if (old)
+ tty_termios_copy_hw(new, old);
+
+ /* Don't rewrite B0 */
+ if (tty_termios_baud_rate(new))
+ tty_termios_encode_baud_rate(new, baud, baud);
+
+ uart_update_timeout(port, new->c_cflag, baud);
Respun patch to follow shortly.
Thx,
Vineet
next prev parent reply other threads:[~2012-10-02 4:33 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-28 12:35 [PATCH] serial/arc-uart: Add new driver Vineet.Gupta1
2012-09-28 12:35 ` Vineet.Gupta1
2012-09-28 13:02 ` Alan Cox
2012-09-28 13:02 ` Alan Cox
2012-10-02 4:33 ` Vineet Gupta [this message]
2012-10-02 4:33 ` Vineet Gupta
-- strict thread matches above, loose matches on Subject: below --
2012-10-25 6:30 [PATCH v4] serial/arc-uart: Add New Driver Vineet.Gupta1
2012-10-25 6:30 ` [PATCH] serial/arc-uart: Add new driver Vineet.Gupta1
2012-10-25 6:30 ` Vineet.Gupta1
2012-10-25 18:36 ` Greg KH
2012-10-26 6:16 ` Vineet Gupta
2012-10-26 6:16 ` Vineet Gupta
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=506A6E8E.2000005@synopsys.com \
--to=vineet.gupta1@synopsys.com \
--cc=alan@linux.intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.