public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
From: "George G. Davis" <gdavis@mvista.com>
To: "Juha Yrjölä" <juha.yrjola@solidboot.com>
Cc: linux-omap-open-source@linux.omap.com
Subject: Re: [PATCH] serial: Add driver for OMAP UARTs
Date: Thu, 12 Apr 2007 09:37:10 -0400	[thread overview]
Message-ID: <20070412133710.GA9104@mvista.com> (raw)
In-Reply-To: <20070409204433.GA23320@mail.solidboot.com>

On Mon, Apr 09, 2007 at 11:44:33PM +0300, Juha Yrjölä wrote:
> --- /dev/null
> +++ b/drivers/serial/omap.c
> @@ -0,0 +1,893 @@


> +static int serial_omap_startup(struct uart_port *port)
> +{
> +	struct uart_omap_port *up = (struct uart_omap_port *)port;
> +	unsigned long flags;
> +	int retval;
> +
> +	enable_uart_clocks(up);
> +
> +	/*
> +	 * Allocate the IRQ
> +	 */
> +	retval = request_irq(up->port.irq, serial_omap_irq, 0, up->name, up);
> +	if (retval) {
> +		disable_uart_clocks(up);
> +		return retval;
> +	}
> +


> +}
> +
> +static void serial_omap_shutdown(struct uart_port *port)
> +{


> +	disable_uart_clocks(up);
> +
> +	clk_put(up->fclk);
> +	if (up->iclk != NULL)
> +		clk_put(up->iclk);
> +}


You should probably move {enable,disable}_uart_clocks() calls into the
uart_ops .pm function, serial_omap_pm() (which is currently a stub : ),
assuming clocks can be controlled per serial port.  In fact, if clocks
are controlled per serial port, then you may discover problems if you
do not move clock handling into the .pm function, e.g. try this when
one or more serial ports are not in use:

	cat /proc/tty/serial

If one or more serial ports are disabled, results should be garbage and
or the system may hang depending on behavior when serial port clocks
are disabled.  I expect you will need to s/serial/OMAP serial/ in the
above example but more on that below.


> +struct uart_ops serial_omap_pops = {
> +	.tx_empty	= serial_omap_tx_empty,
> +	.set_mctrl	= serial_omap_set_mctrl,
> +	.get_mctrl	= serial_omap_get_mctrl,
> +	.stop_tx	= serial_omap_stop_tx,
> +	.start_tx	= serial_omap_start_tx,
> +	.stop_rx	= serial_omap_stop_rx,
> +	.enable_ms	= serial_omap_enable_ms,
> +	.break_ctl	= serial_omap_break_ctl,
> +	.startup	= serial_omap_startup,
> +	.shutdown	= serial_omap_shutdown,
> +	.set_termios	= serial_omap_set_termios,
> +	.pm		= serial_omap_pm,
> +	.type		= serial_omap_type,
> +	.release_port	= serial_omap_release_port,
> +	.request_port	= serial_omap_request_port,
> +	.config_port	= serial_omap_config_port,
> +	.verify_port	= serial_omap_verify_port,
> +};
> +
> +static struct uart_driver serial_omap_reg = {
> +	.owner		= THIS_MODULE,
> +	.driver_name	= "OMAP serial",

You may want to reconsider ".driver_name" otherwise I suspect this may
appear as:

	"/proc/tty/driver/OMAP serial"

Yuck.  : )

> +	.dev_name	= "ttyS",
> +	.major		= TTY_MAJOR,
> +	.minor		= 64,
> +	.nr		= 3,
> +	.cons		= OMAP_CONSOLE,
> +};

--
Regards,
George

  parent reply	other threads:[~2007-04-12 13:37 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-09 20:44 [PATCH] serial: Add driver for OMAP UARTs Juha Yrjölä
2007-04-10  5:36 ` Syed Mohammed, Khasim
2007-04-10 10:07   ` Juha Yrjola
2007-04-10 12:28 ` Ville Tervo
2007-04-12 13:37 ` George G. Davis [this message]
2007-04-12 14:23   ` Testing SPI on omap5912 Raja Mallik
2007-04-17 20:06   ` [PATCH] serial: Add driver for OMAP UARTs Tony Lindgren

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=20070412133710.GA9104@mvista.com \
    --to=gdavis@mvista.com \
    --cc=juha.yrjola@solidboot.com \
    --cc=linux-omap-open-source@linux.omap.com \
    /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