From: sricharan <r.sricharan@ti.com>
To: linux-omap@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org, tony@atomide.com,
b-cousson@ti.com, santosh.shilimkar@ti.com
Subject: [PATCH] omap2+: mux: Remove the use of IDLE flag.
Date: Wed, 9 Mar 2011 13:15:38 +0530 [thread overview]
Message-ID: <1299656738-7885-1-git-send-email-r.sricharan@ti.com> (raw)
Currently OMAP_DEVICE_PAD_IDLE flag is used to mux pins
dynamically. This can be simplified by using the enabled
state variable of each pad. This also fixes the issue of
the static pads not getting muxed after idling and
disable/enable state transitions.
Signed-off-by: sricharan <r.sricharan@ti.com>
---
arch/arm/mach-omap2/mux.c | 19 +++++++------------
arch/arm/mach-omap2/mux.h | 1 -
2 files changed, 7 insertions(+), 13 deletions(-)
diff --git a/arch/arm/mach-omap2/mux.c b/arch/arm/mach-omap2/mux.c
index 8717370..bb043cb 100644
--- a/arch/arm/mach-omap2/mux.c
+++ b/arch/arm/mach-omap2/mux.c
@@ -359,7 +359,6 @@ void omap_hwmod_mux(struct omap_hwmod_mux_info *hmux, u8 state)
struct omap_device_pad *pad = hmux->pads_dynamic[i];
int val = -EINVAL;
- pad->flags |= OMAP_DEVICE_PAD_IDLE;
val = pad->idle;
omap_mux_write(pad->partition, val,
pad->mux->reg_offset);
@@ -369,25 +368,18 @@ void omap_hwmod_mux(struct omap_hwmod_mux_info *hmux, u8 state)
}
/* Runtime enabling of dynamic pads */
- if ((state == _HWMOD_STATE_ENABLED) && hmux->pads_dynamic) {
- int idled = 0;
-
+ if ((state == _HWMOD_STATE_ENABLED) && hmux->pads_dynamic
+ && hmux->enabled) {
for (i = 0; i < hmux->nr_pads_dynamic; i++) {
struct omap_device_pad *pad = hmux->pads_dynamic[i];
int val = -EINVAL;
- if (!(pad->flags & OMAP_DEVICE_PAD_IDLE))
- continue;
-
- pad->flags &= ~OMAP_DEVICE_PAD_IDLE;
val = pad->enable;
omap_mux_write(pad->partition, val,
pad->mux->reg_offset);
- idled++;
}
- if (idled)
- return;
+ return;
}
/* Enabling or disabling of all pads */
@@ -404,7 +396,6 @@ void omap_hwmod_mux(struct omap_hwmod_mux_info *hmux, u8 state)
pad->name, val);
break;
case _HWMOD_STATE_DISABLED:
- default:
/* Use safe mode unless OMAP_DEVICE_PAD_REMUX */
if (flags & OMAP_DEVICE_PAD_REMUX)
val = pad->off;
@@ -412,6 +403,10 @@ void omap_hwmod_mux(struct omap_hwmod_mux_info *hmux, u8 state)
val = OMAP_MUX_MODE7;
pr_debug("%s: Disabling %s %x\n", __func__,
pad->name, val);
+ break;
+ default:
+ /* Nothing to be done */
+ break;
};
if (val >= 0) {
diff --git a/arch/arm/mach-omap2/mux.h b/arch/arm/mach-omap2/mux.h
index 1d5bf42..8920fa4 100644
--- a/arch/arm/mach-omap2/mux.h
+++ b/arch/arm/mach-omap2/mux.h
@@ -159,7 +159,6 @@ struct omap_board_mux {
u16 value;
};
-#define OMAP_DEVICE_PAD_IDLE BIT(7) /* Not needed for board-*.c */
#define OMAP_DEVICE_PAD_REMUX BIT(1) /* Dynamically remux a pad,
needs enable, idle and off
values */
--
1.7.0.4
next reply other threads:[~2011-03-09 7:45 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-09 7:45 sricharan [this message]
2011-03-09 19:42 ` [PATCH] omap2+: mux: Remove the use of IDLE flag Tony Lindgren
-- strict thread matches above, loose matches on Subject: below --
2011-03-07 4:35 sricharan
2011-03-08 16:40 ` Tony Lindgren
2011-03-09 7:49 ` Sricharan R
2011-03-09 11:49 ` Sricharan R
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=1299656738-7885-1-git-send-email-r.sricharan@ti.com \
--to=r.sricharan@ti.com \
--cc=b-cousson@ti.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-omap@vger.kernel.org \
--cc=santosh.shilimkar@ti.com \
--cc=tony@atomide.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;
as well as URLs for NNTP newsgroup(s).