From: Tony Lindgren <tony@atomide.com>
To: Russ Dill <russ.dill@gmail.com>
Cc: "Raja, Govindraj" <govindraj.raja@ti.com>,
linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
Felipe Balbi <balbi@ti.com>, Kevin Hilman <khilman@ti.com>
Subject: Re: [RESEND PATCH] ARM :OMAP2+: UART: Remove some of uart default pads
Date: Mon, 9 Apr 2012 13:36:51 -0700 [thread overview]
Message-ID: <20120409203651.GB6487@atomide.com> (raw)
In-Reply-To: <CA+Bv8XZgKg-Om9S=CcJEDWRan0pMZ_t1aCVT31q3REmcgLntBw@mail.gmail.com>
* Russ Dill <russ.dill@gmail.com> [120409 09:59]:
> > From: "Govindraj.R" <govindraj.raja@ti.com>
> > Date: Mon, 9 Apr 2012 15:16:52 +0530
> > Subject: [PATCH] ARM: OMAP2+: UART: Fix usage of default uart pads.
> > -static int __init
> > +int __init
> > omap_mux_get_by_name(const char *muxname,
> > struct omap_mux_partition **found_partition,
> > struct omap_mux **found_mux)
This can now be one one line:
int __init omap_mux_get_by_name(const char *muxname,
...
> > + u16 tx_mode, rx_mode;
> > +
> > + tx_mode = omap_mux_read(tx_partition, tx_mux->reg_offset);
> > + rx_mode = omap_mux_read(rx_partition, rx_mux->reg_offset);
> > +
> > + if (!(rx_mode & 0x07) && !(tx_mode & 0x07)) {
> > + default_omap_uart_pads[0].name = rx_pad_name;
> > + default_omap_uart_pads[0].flags =
> > + OMAP_DEVICE_PAD_REMUX | OMAP_DEVICE_PAD_WAKEUP;
> > + default_omap_uart_pads[0].enable = OMAP_PIN_INPUT |
> > + OMAP_MUX_MODE0;
> > + default_omap_uart_pads[0].idle = OMAP_PIN_INPUT |
> > + OMAP_MUX_MODE0;
> > +
> > + default_omap_uart_pads[1].name = tx_pad_name;
> > + default_omap_uart_pads[1].enable = OMAP_PIN_OUTPUT |
> > + OMAP_MUX_MODE0;
> > + bdata->pads = default_omap_uart_pads;
>
> You are assigning this variable to a structure on the stack.
>
> > + bdata->pads_cnt = ARRAY_SIZE(default_omap_uart_pads);
Also, maybe make that into a separate function with comments added that
we check that the default pins are muxed to uart rx and tx mode to start
with. Otherwise it's a bit hard to figure out what's going on here.
Then please split it into two patches: First one removes all the unsafe
muxing, then the second one enables wake-up events for the ports already
in uart rx/tx mode.
Regards,
Tony
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
WARNING: multiple messages have this Message-ID (diff)
From: tony@atomide.com (Tony Lindgren)
To: linux-arm-kernel@lists.infradead.org
Subject: [RESEND PATCH] ARM :OMAP2+: UART: Remove some of uart default pads
Date: Mon, 9 Apr 2012 13:36:51 -0700 [thread overview]
Message-ID: <20120409203651.GB6487@atomide.com> (raw)
In-Reply-To: <CA+Bv8XZgKg-Om9S=CcJEDWRan0pMZ_t1aCVT31q3REmcgLntBw@mail.gmail.com>
* Russ Dill <russ.dill@gmail.com> [120409 09:59]:
> > From: "Govindraj.R" <govindraj.raja@ti.com>
> > Date: Mon, 9 Apr 2012 15:16:52 +0530
> > Subject: [PATCH] ARM: OMAP2+: UART: Fix usage of default uart pads.
> > -static int __init
> > +int __init
> > ?omap_mux_get_by_name(const char *muxname,
> > ? ? ? ? ? ? ? ? ? ? ? ?struct omap_mux_partition **found_partition,
> > ? ? ? ? ? ? ? ? ? ? ? ?struct omap_mux **found_mux)
This can now be one one line:
int __init omap_mux_get_by_name(const char *muxname,
...
> > + ? ? ? ? ? ? ? u16 tx_mode, rx_mode;
> > +
> > + ? ? ? ? ? ? ? tx_mode = omap_mux_read(tx_partition, tx_mux->reg_offset);
> > + ? ? ? ? ? ? ? rx_mode = omap_mux_read(rx_partition, rx_mux->reg_offset);
> > +
> > + ? ? ? ? ? ? ? if (!(rx_mode & 0x07) && !(tx_mode & 0x07)) {
> > + ? ? ? ? ? ? ? ? ? ? ? default_omap_uart_pads[0].name = rx_pad_name;
> > + ? ? ? ? ? ? ? ? ? ? ? default_omap_uart_pads[0].flags ?=
> > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? OMAP_DEVICE_PAD_REMUX | OMAP_DEVICE_PAD_WAKEUP;
> > + ? ? ? ? ? ? ? ? ? ? ? default_omap_uart_pads[0].enable = OMAP_PIN_INPUT |
> > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? OMAP_MUX_MODE0;
> > + ? ? ? ? ? ? ? ? ? ? ? default_omap_uart_pads[0].idle = OMAP_PIN_INPUT |
> > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? OMAP_MUX_MODE0;
> > +
> > + ? ? ? ? ? ? ? ? ? ? ? default_omap_uart_pads[1].name = tx_pad_name;
> > + ? ? ? ? ? ? ? ? ? ? ? default_omap_uart_pads[1].enable = OMAP_PIN_OUTPUT |
> > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? OMAP_MUX_MODE0;
> > + ? ? ? ? ? ? ? ? ? ? ? bdata->pads = default_omap_uart_pads;
>
> You are assigning this variable to a structure on the stack.
>
> > + ? ? ? ? ? ? ? ? ? ? ? bdata->pads_cnt = ARRAY_SIZE(default_omap_uart_pads);
Also, maybe make that into a separate function with comments added that
we check that the default pins are muxed to uart rx and tx mode to start
with. Otherwise it's a bit hard to figure out what's going on here.
Then please split it into two patches: First one removes all the unsafe
muxing, then the second one enables wake-up events for the ports already
in uart rx/tx mode.
Regards,
Tony
next prev parent reply other threads:[~2012-04-09 20:36 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-21 10:02 [RESEND PATCH] ARM :OMAP2+: UART: Remove some of uart default pads Govindraj.R
2012-03-21 10:02 ` Govindraj.R
2012-04-03 18:19 ` Tony Lindgren
2012-04-03 18:19 ` Tony Lindgren
2012-04-04 6:14 ` Raja, Govindraj
2012-04-04 6:14 ` Raja, Govindraj
2012-04-05 16:58 ` Tony Lindgren
2012-04-05 16:58 ` Tony Lindgren
2012-04-05 17:02 ` Tony Lindgren
2012-04-05 17:02 ` Tony Lindgren
2012-04-06 6:05 ` Raja, Govindraj
2012-04-06 6:05 ` Raja, Govindraj
2012-04-06 18:15 ` Tony Lindgren
2012-04-06 18:15 ` Tony Lindgren
2012-04-09 11:08 ` Raja, Govindraj
2012-04-09 11:08 ` Raja, Govindraj
2012-04-09 16:56 ` Russ Dill
2012-04-09 16:56 ` Russ Dill
2012-04-09 20:36 ` Tony Lindgren [this message]
2012-04-09 20:36 ` 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=20120409203651.GB6487@atomide.com \
--to=tony@atomide.com \
--cc=balbi@ti.com \
--cc=govindraj.raja@ti.com \
--cc=khilman@ti.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-omap@vger.kernel.org \
--cc=russ.dill@gmail.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 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.