All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] omap: mux: Add api to retrieve padconf offset based on muxname
@ 2010-06-14 14:13 Govindraj.R
  2010-07-01 12:15 ` Tony Lindgren
  0 siblings, 1 reply; 2+ messages in thread
From: Govindraj.R @ 2010-06-14 14:13 UTC (permalink / raw)
  To: linux-omap; +Cc: Tony Lindgren

Adds a padconf offset retrieval api which will
get us the padconf offset based on muxname provided
which can be later used with omap_ctrl_writew,
omap_ctrl_readw calls for remuxing signals.

Cc: Tony Lindgren <tony@atomide.com>
Signed-off-by: Govindraj.R <govindraj.raja@ti.com>
---
Patch is based on earlier discussion with Tony
http://marc.info/?l=linux-omap&m=127609369220618&w=2

 arch/arm/mach-omap2/mux.c |   17 +++++++++++++++++
 arch/arm/mach-omap2/mux.h |    6 ++++++
 2 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/mux.c b/arch/arm/mach-omap2/mux.c
index 8b3d269..afe45ce 100644
--- a/arch/arm/mach-omap2/mux.c
+++ b/arch/arm/mach-omap2/mux.c
@@ -882,6 +882,23 @@ free:

 #endif	/* CONFIG_OMAP_MUX */

+u16 omap_mux_request_signal(char *muxname)
+{
+	struct omap_mux_entry *e;
+	u16 offset = -EINVAL;
+
+	list_for_each_entry(e, &muxmodes, node) {
+		struct omap_mux *m = &e->mux;
+		char *m0_entry = m->muxnames[0];
+
+		if (!strcmp(muxname, m0_entry)) {
+			offset = m->reg_offset + OMAP_MUX_BASE_OFFSET;
+			break;
+		}
+	}
+	return offset;
+}
+
 static u16 omap_mux_get_by_gpio(int gpio)
 {
 	struct omap_mux_entry *e;
diff --git a/arch/arm/mach-omap2/mux.h b/arch/arm/mach-omap2/mux.h
index 480abc5..dc5e121 100644
--- a/arch/arm/mach-omap2/mux.h
+++ b/arch/arm/mach-omap2/mux.h
@@ -132,6 +132,12 @@ static inline int omap_mux_init_signal(char *muxname, int val)
 #endif

 /**
+ * omap_mux_request_signal - get mux register offset based on mux name
+ * @muxname: Mux name in mode0_name.signal_name format
+ */
+u16 omap_mux_request_signal(char *muxname);
+
+/**
  * omap_mux_get_gpio() - get mux register value based on GPIO number
  * @gpio:		GPIO number
  *
-- 
1.6.3.3



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-07-01 12:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-14 14:13 [PATCH] omap: mux: Add api to retrieve padconf offset based on muxname Govindraj.R
2010-07-01 12:15 ` Tony Lindgren

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.