From: Ulrik Bech Hald <ubh@ti.com>
To: linux-omap@vger.kernel.org
Cc: Ulrik Bech Hald <ubh@ti.com>
Subject: [PATCH 1/1] OMAP3:Re-introduce omap_type()
Date: Fri, 12 Jun 2009 15:58:31 -0500 [thread overview]
Message-ID: <1244840311-11809-1-git-send-email-ubh@ti.com> (raw)
The functionality of omap_type() is needed for eg. watchdog
device registration to distinguish different device types.
Signed-off-by: Ulrik Bech Hald <ubh@ti.com>
---
arch/arm/mach-omap2/id.c | 21 +++++++++++++++++++++
1 files changed, 21 insertions(+), 0 deletions(-)
mode change 100644 => 100755 arch/arm/mach-omap2/id.c
diff --git a/arch/arm/mach-omap2/id.c b/arch/arm/mach-omap2/id.c
old mode 100644
new mode 100755
index 458990e..9fa61b4
--- a/arch/arm/mach-omap2/id.c
+++ b/arch/arm/mach-omap2/id.c
@@ -48,6 +48,27 @@ 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
--
1.5.4.3
next reply other threads:[~2009-06-12 20:53 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-12 20:58 Ulrik Bech Hald [this message]
2009-06-12 22:12 ` [PATCH 1/1] OMAP3:Re-introduce omap_type() Kevin Hilman
2009-06-15 13:04 ` Hald, Ulrik Bech
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=1244840311-11809-1-git-send-email-ubh@ti.com \
--to=ubh@ti.com \
--cc=linux-omap@vger.kernel.org \
/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