diff mbox

[1/2] OMAP2/3: SoC IDs: add omap_type() for determining GP/EMU/HS

Message ID 1244844693-24126-2-git-send-email-khilman@ti.deeprootsystems.com (mailing list archive)
State Accepted
Commit 3c195a1bd36ab83b248b9174412ee81a35a41e87
Headers show

Commit Message

Kevin Hilman June 12, 2009, 10:11 p.m. UTC
The omap_type() function is added and returns the DEVICETYPE field of
the CONTROL_STATUS register.  The result can be used for conditional
code based on whether device is GP, EMU or HS.

Signed-off-by: Kevin Hilman <khilman@ti.deeprootsystems.com>
---
 arch/arm/mach-omap2/id.c |   22 ++++++++++++++++++++++
 1 files changed, 22 insertions(+), 0 deletions(-)

Comments

Tony Lindgren June 17, 2009, 8:33 a.m. UTC | #1
This patch has been applied to the linux-omap
by youw fwiendly patch wobot.

Branch in linux-omap: omap-fixes

Initial commit ID (Likely to change): 3c195a1bd36ab83b248b9174412ee81a35a41e87

PatchWorks
http://patchwork.kernel.org/patch/29974/

Git (Likely to change, and takes a while to get mirrored)
http://git.kernel.org/?p=linux/kernel/git/tmlind/linux-omap-2.6.git;a=commit;h=3c195a1bd36ab83b248b9174412ee81a35a41e87


--
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
diff mbox

Patch

diff --git a/arch/arm/mach-omap2/id.c b/arch/arm/mach-omap2/id.c
index 458990e..a98201c 100644
--- a/arch/arm/mach-omap2/id.c
+++ b/arch/arm/mach-omap2/id.c
@@ -48,6 +48,28 @@  int omap_chip_is(struct omap_chip_id oci)
 }
 EXPORT_SYMBOL(omap_chip_is);
 
+int omap_type(void)
+{
+	u32 val = 0;
+
+	if (cpu_is_omap24xx())
+		val = omap_ctrl_readl(OMAP24XX_CONTROL_STATUS);
+	else if (cpu_is_omap34xx())
+		val = omap_ctrl_readl(OMAP343X_CONTROL_STATUS);
+	else {
+		pr_err("Cannot detect omap type!\n");
+		goto out;
+	}
+
+	val &= OMAP2_DEVICETYPE_MASK;
+	val >>= 8;
+
+out:
+	return val;
+}
+EXPORT_SYMBOL(omap_type);
+
+
 /*----------------------------------------------------------------------------*/
 
 #define OMAP_TAP_IDCODE		0x0204