From: s.hauer@pengutronix.de (Sascha Hauer)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/2] imx: Add save/restore functions for UART control regs
Date: Mon, 19 Dec 2011 11:10:23 +0100 [thread overview]
Message-ID: <20111219101023.GE27267@pengutronix.de> (raw)
In-Reply-To: <4EEEDE94.3080804@googlemail.com>
On Mon, Dec 19, 2011 at 07:49:56AM +0100, Dirk Behme wrote:
> On 19.12.2011 04:49, Shawn Guo wrote:
> >On Sun, Dec 18, 2011 at 06:34:14PM +0100, Dirk Behme wrote:
> >>Factor out the uart save/restore functionality instead of
> >>having the same code several times in the driver.
> >>
> >>Signed-off-by: Dirk Behme<dirk.behme@gmail.com>
> >>CC: Saleem Abdulrasool<compnerd@compnerd.org>
> >>CC: Sascha Hauer<s.hauer@pengutronix.de>
> >>CC: Fabio Estevam<festevam@gmail.com>
> >>CC: Uwe Kleine-K?nig<u.kleine-koenig@pengutronix.de>
> >>CC: linux-serial at vger.kernel.org
> >>---
> >> drivers/tty/serial/imx.c | 38 +++++++++++++++++++++++++++++++-------
> >> 1 files changed, 31 insertions(+), 7 deletions(-)
> >>
> >>diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
> >>index 163fc90..6a01c2a 100644
> >>--- a/drivers/tty/serial/imx.c
> >>+++ b/drivers/tty/serial/imx.c
> >>@@ -260,6 +260,31 @@ static inline int is_imx21_uart(struct imx_port *sport)
> >> }
> >>
> >> /*
> >>+ * Save and restore functions for UCR1, UCR2 and UCR3 registers
> >>+ */
> >>+static void imx_console_mode(struct uart_port *port,
> >
> >Function name imx_console_mode seems not like a couple with
> >imx_console_restore. And I guess something like
> >imx_port_ucrs_save[restore] would be better?
> >
> >>+ unsigned int *ucr1,
> >>+ unsigned int *ucr2,
> >>+ unsigned int *ucr3)
> >
> >Can we define something like 'struct imx_port_ucrs' to contains these?
>
> Yes, we could have different function names above and use a struct.
>
> I implemented what Sascha asked for in
>
> http://www.spinics.net/lists/arm-kernel/msg144960.html
>
> though:
>
> -- Sascha wrote: --
> I'm thinking about:
>
> imx_console_mode(struct uart_port *port, u32 *ucr1, u32 *ucr2, u32 *ucr2);
> imx_console_restore(struct uart_port *port, u32 ucr1, u32 ucr2, u32 ucr3);
> -- Sascha end --
>
> It seems Shawn proposes
>
> imx_port_ucrs_save(struct uart_port *port, struct *imx_port_ucrs);
> imx_port_ucrs_restore(struct uart_port *port, struct *imx_port_ucrs);
>
> (?)
>
> Sascha, Shawn: Could you agree on what we should use?
I think save/restore are better names.
Maybe I thought about a function which saves the current values *and*
sets ucrx to other values. In that case imx_port_ucrs_save() would be
the wrong name.
>
> Once you agreed, I will send an update of both two patches.
+1 for save/restore
Sascha
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
prev parent reply other threads:[~2011-12-19 10:10 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-18 17:34 [PATCH 1/2] imx: Add save/restore functions for UART control regs Dirk Behme
2011-12-18 17:34 ` [PATCH 2/2 v2] imx: add polled io uart methods Dirk Behme
2011-12-19 3:52 ` Shawn Guo
2011-12-19 3:49 ` [PATCH 1/2] imx: Add save/restore functions for UART control regs Shawn Guo
2011-12-19 6:49 ` Dirk Behme
2011-12-19 7:20 ` Shawn Guo
2011-12-19 10:10 ` Sascha Hauer [this message]
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=20111219101023.GE27267@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox