All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ley Foon Tan <lftan@altera.com>
To: Heikki Krogerus <heikki.krogerus@linux.intel.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: [PATCH 2/2] serial: of_serial: Handle fifosize property
Date: Thu, 21 Mar 2013 19:41:39 +0800	[thread overview]
Message-ID: <1363866099.2289.8.camel@leyfoon-vm> (raw)
In-Reply-To: <1363862880-17295-1-git-send-email-heikki.krogerus@linux.intel.com>

On Thu, 2013-03-21 at 12:48 +0200, Heikki Krogerus wrote:
> fifosize property is already used with a number of serial
> devices. This should reduce the need for extra types in
> 8250.c just in case the fifosize differs from the standard.
> 
> Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
> ---
>  Documentation/devicetree/bindings/tty/serial/of-serial.txt |    1 +
>  drivers/tty/serial/of_serial.c                             |    4 ++++
>  2 files changed, 5 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/tty/serial/of-serial.txt b/Documentation/devicetree/bindings/tty/serial/of-serial.txt
> index 8f01cb1..55fe4e7 100644
> --- a/Documentation/devicetree/bindings/tty/serial/of-serial.txt
> +++ b/Documentation/devicetree/bindings/tty/serial/of-serial.txt
> @@ -33,6 +33,7 @@ Optional properties:
>    RTAS and should not be registered.
>  - no-loopback-test: set to indicate that the port does not implements loopback
>    test mode
> +- fifosize: the fifo size of the UART.
>  
>  Example:
>  
> diff --git a/drivers/tty/serial/of_serial.c b/drivers/tty/serial/of_serial.c
> index b025d54..4f89761 100644
> --- a/drivers/tty/serial/of_serial.c
> +++ b/drivers/tty/serial/of_serial.c
> @@ -97,6 +97,10 @@ static int of_platform_serial_setup(struct platform_device *ofdev,
>  	if (of_property_read_u32(np, "reg-shift", &prop) == 0)
>  		port->regshift = prop;
>  
> +	/* Check for fifo size */
> +	if (of_property_read_u32(np, "fifosize", &prop) == 0)
> +		port->fifosize = prop;
> +
Suggest to use "fifo-size" for the device tree property, to align with
other DT properties.

>  	port->irq = irq_of_parse_and_map(np, 0);
>  	port->iotype = UPIO_MEM;
>  	if (of_property_read_u32(np, "reg-io-width", &prop) == 0) {

I think you need to remove the UPF_FIXED_TYPE from port-flags as well to
use the fifo size from device tree. Otherwise, it will get from the
static array in 8250.c.

LFTan



WARNING: multiple messages have this Message-ID (diff)
From: Ley Foon Tan <lftan@altera.com>
To: Heikki Krogerus <heikki.krogerus@linux.intel.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: [PATCH 2/2] serial: of_serial: Handle fifosize property
Date: Thu, 21 Mar 2013 19:41:39 +0800	[thread overview]
Message-ID: <1363866099.2289.8.camel@leyfoon-vm> (raw)
In-Reply-To: <1363862880-17295-1-git-send-email-heikki.krogerus@linux.intel.com>

On Thu, 2013-03-21 at 12:48 +0200, Heikki Krogerus wrote:
> fifosize property is already used with a number of serial
> devices. This should reduce the need for extra types in
> 8250.c just in case the fifosize differs from the standard.
> 
> Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
> ---
>  Documentation/devicetree/bindings/tty/serial/of-serial.txt |    1 +
>  drivers/tty/serial/of_serial.c                             |    4 ++++
>  2 files changed, 5 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/tty/serial/of-serial.txt b/Documentation/devicetree/bindings/tty/serial/of-serial.txt
> index 8f01cb1..55fe4e7 100644
> --- a/Documentation/devicetree/bindings/tty/serial/of-serial.txt
> +++ b/Documentation/devicetree/bindings/tty/serial/of-serial.txt
> @@ -33,6 +33,7 @@ Optional properties:
>    RTAS and should not be registered.
>  - no-loopback-test: set to indicate that the port does not implements loopback
>    test mode
> +- fifosize: the fifo size of the UART.
>  
>  Example:
>  
> diff --git a/drivers/tty/serial/of_serial.c b/drivers/tty/serial/of_serial.c
> index b025d54..4f89761 100644
> --- a/drivers/tty/serial/of_serial.c
> +++ b/drivers/tty/serial/of_serial.c
> @@ -97,6 +97,10 @@ static int of_platform_serial_setup(struct platform_device *ofdev,
>  	if (of_property_read_u32(np, "reg-shift", &prop) == 0)
>  		port->regshift = prop;
>  
> +	/* Check for fifo size */
> +	if (of_property_read_u32(np, "fifosize", &prop) == 0)
> +		port->fifosize = prop;
> +
Suggest to use "fifo-size" for the device tree property, to align with
other DT properties.

>  	port->irq = irq_of_parse_and_map(np, 0);
>  	port->iotype = UPIO_MEM;
>  	if (of_property_read_u32(np, "reg-io-width", &prop) == 0) {

I think you need to remove the UPF_FIXED_TYPE from port-flags as well to
use the fifo size from device tree. Otherwise, it will get from the
static array in 8250.c.

LFTan



  reply	other threads:[~2013-03-21 11:41 UTC|newest]

Thread overview: 16+ 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-07  2:28 ` 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 [this message]
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  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  8:16                 ` Ley Foon Tan
2013-03-22  9:24                 ` Heikki Krogerus
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=1363866099.2289.8.camel@leyfoon-vm \
    --to=lftan@altera.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=heikki.krogerus@linux.intel.com \
    --cc=jslaby@suse.cz \
    --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 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.