aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/musb
diff options
context:
space:
mode:
authorAnand Gadiyar <gadiyar@ti.com>2009-11-16 10:39:21 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2009-12-11 14:55:25 -0500
commit32c3b94e2b643bfeca5e48b0f7f0b81812c7a1d3 (patch)
tree8c868427abac6a9c8006cd2c44fa32ee164694ee /drivers/usb/musb
parent32340d3f75dba732a0545173ac65aab6fc3d4952 (diff)
USB: MUSB: save hardware revision at init
MUSB: save hardware revision at init This can be used later to flag workarounds for issues affecting particular revisions. Saving this at init avoids having to read the HWVERS register multiple times in code. While at it, use macros to extract the version information instead of using hardcoded values. Signed-off-by: Anand Gadiyar <gadiyar@ti.com> Cc: Ajay Kumar Gupta <ajay.gupta@ti.com> Acked-by: Felipe Balbi <felipe.balbi@nokia.com> Cc: David Brownell <dbrownell@users.sourceforge.net> Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/musb')
-rw-r--r--drivers/usb/musb/musb_core.c10
-rw-r--r--drivers/usb/musb/musb_core.h8
2 files changed, 12 insertions, 6 deletions
diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
index 547e0e390726..49f2346afad3 100644
--- a/drivers/usb/musb/musb_core.c
+++ b/drivers/usb/musb/musb_core.c
@@ -1319,7 +1319,6 @@ static int __init musb_core_init(u16 musb_type, struct musb *musb)
1319#endif 1319#endif
1320 u8 reg; 1320 u8 reg;
1321 char *type; 1321 char *type;
1322 u16 hwvers, rev_major, rev_minor;
1323 char aInfo[78], aRevision[32], aDate[12]; 1322 char aInfo[78], aRevision[32], aDate[12];
1324 void __iomem *mbase = musb->mregs; 1323 void __iomem *mbase = musb->mregs;
1325 int status = 0; 1324 int status = 0;
@@ -1391,11 +1390,10 @@ static int __init musb_core_init(u16 musb_type, struct musb *musb)
1391 } 1390 }
1392 1391
1393 /* log release info */ 1392 /* log release info */
1394 hwvers = musb_read_hwvers(mbase); 1393 musb->hwvers = musb_read_hwvers(mbase);
1395 rev_major = (hwvers >> 10) & 0x1f; 1394 snprintf(aRevision, 32, "%d.%d%s", MUSB_HWVERS_MAJOR(musb->hwvers),
1396 rev_minor = hwvers & 0x3ff; 1395 MUSB_HWVERS_MINOR(musb->hwvers),
1397 snprintf(aRevision, 32, "%d.%d%s", rev_major, 1396 (musb->hwvers & MUSB_HWVERS_RC) ? "RC" : "");
1398 rev_minor, (hwvers & 0x8000) ? "RC" : "");
1399 printk(KERN_DEBUG "%s: %sHDRC RTL version %s %s\n", 1397 printk(KERN_DEBUG "%s: %sHDRC RTL version %s %s\n",
1400 musb_driver_name, type, aRevision, aDate); 1398 musb_driver_name, type, aRevision, aDate);
1401 1399
diff --git a/drivers/usb/musb/musb_core.h b/drivers/usb/musb/musb_core.h
index 6aa5f22e5274..03d50909b078 100644
--- a/drivers/usb/musb/musb_core.h
+++ b/drivers/usb/musb/musb_core.h
@@ -322,6 +322,14 @@ struct musb {
322 struct clk *clock; 322 struct clk *clock;
323 irqreturn_t (*isr)(int, void *); 323 irqreturn_t (*isr)(int, void *);
324 struct work_struct irq_work; 324 struct work_struct irq_work;
325#define MUSB_HWVERS_MAJOR(x) ((x >> 10) & 0x1f)
326#define MUSB_HWVERS_MINOR(x) (x & 0x3ff)
327#define MUSB_HWVERS_RC 0x8000
328#define MUSB_HWVERS_1300 0x52C
329#define MUSB_HWVERS_1400 0x590
330#define MUSB_HWVERS_1800 0x720
331#define MUSB_HWVERS_2000 0x800
332 u16 hwvers;
325 333
326/* this hub status bit is reserved by USB 2.0 and not seen by usbcore */ 334/* this hub status bit is reserved by USB 2.0 and not seen by usbcore */
327#define MUSB_PORT_STAT_RESUME (1 << 31) 335#define MUSB_PORT_STAT_RESUME (1 << 31)