public inbox for linux-serial@vger.kernel.org
 help / color / mirror / Atom feed
From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
To: Ley Foon Tan <lftan@altera.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Jiri Slaby <jslaby@suse.cz>, Rob Landley <rob@landley.net>,
	linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org
Subject: Re: [PATCHv2 2/2] serial: of_serial: Handle fifo-size property
Date: Fri, 22 Mar 2013 11:24:21 +0200	[thread overview]
Message-ID: <20130322092421.GA3134@xps8300> (raw)
In-Reply-To: <1363940208.2289.22.camel@leyfoon-vm>

Hi,

On Fri, Mar 22, 2013 at 04:16:48PM +0800, Ley Foon Tan wrote:
> On Fri, 2013-03-22 at 10:05 +0200, Heikki Krogerus wrote:
> > This will reduce the need for extra types in 8250.c just
> > in case the fifo size differs from the standard.
> Besides the fifo size, we need to have hardware flow control setting
> from device tree as well.

This is a bit problematic. We can set the uart_8250_port.capabilities
flag UART_CAP_AFE based on "hw-flow-control" property, but then the
properties from the type will not be used, just like in case of
fifosize. We would need to know all the flags of the type that are
normally taken from the uart_config[] array.

The UART_CAP_FIFO can be set by checking if we have set the
port.fifosize or not, so if the bellow is acceptable then I can make a
patch. There is no risk of overriding the capabilities for the
existing uarts, as we only touch the uart_8250_port.capabilities if
the new properties are used. So is it OK?

diff --git a/drivers/tty/serial/of_serial.c b/drivers/tty/serial/of_serial.c
index 267711b..cc5135d 100644
--- a/drivers/tty/serial/of_serial.c
+++ b/drivers/tty/serial/of_serial.c
@@ -171,11 +171,16 @@ static int of_platform_serial_probe(struct platform_device *ofdev)
 #ifdef CONFIG_SERIAL_8250
        case PORT_8250 ... PORT_MAX_8250:
        {
-               /* For now the of bindings don't support the extra
-                  8250 specific bits */
                struct uart_8250_port port8250;
                memset(&port8250, 0, sizeof(port8250));
                port8250.port = port;
+
+               if (port.fifosize)
+                       port8250.capabilities = UART_CAP_FIFO;
+
+               if (of_property_read_u32(np, "hw-flow-control", &prop) == 0)
+                       port8250.capabilities |= UART_CAP_AFE;
+
                ret = serial8250_register_8250_port(&port8250);
                break;
        }

-- 
heikki

  reply	other threads:[~2013-03-22  9:24 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-07  2:28 [PATCH] tty/serial: Add support for Altera serial port Ley Foon Tan
2013-03-21 10:46 ` Heikki Krogerus
2013-03-21 10:47   ` [PATCH 1/2] serial: 8250: Allow probe drivers to ignore tx_loadsz Heikki Krogerus
2013-03-21 10:48   ` [PATCH 2/2] serial: of_serial: Handle fifosize property Heikki Krogerus
2013-03-21 11:41     ` Ley Foon Tan
2013-03-21 13:24       ` Heikki Krogerus
2013-03-22  3:32         ` Ley Foon Tan
2013-03-22  7:41           ` Heikki Krogerus
2013-03-22  8:05             ` [PATCHv2 2/2] serial: of_serial: Handle fifo-size property Heikki Krogerus
2013-03-22  8:16               ` Ley Foon Tan
2013-03-22  9:24                 ` Heikki Krogerus [this message]
2013-03-25  8:42                   ` Heikki Krogerus

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=20130322092421.GA3134@xps8300 \
    --to=heikki.krogerus@linux.intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jslaby@suse.cz \
    --cc=lftan@altera.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=rob@landley.net \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox