[PATCH] omap: mux: Add api to retrieve padconf offset based on muxname

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxx>
Signed-off-by: Govindraj.R <govindraj.raja@xxxxxx>
---
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


--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux