diff options
author | Magnus Damm <damm@igel.co.jp> | 2008-10-31 07:22:13 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2008-12-22 04:42:51 -0500 |
commit | af5be79a7f8d7067588dc2863d37f7cd22e5f2de (patch) | |
tree | b667ec42b98479669ed8e81f27b093672e9897b1 /drivers/usb/gadget/m66592-udc.h | |
parent | a42b6dd69cb1c61c5f5a24061a227c22071786de (diff) |
sh: sh_mobile usbf clock framework support
Add clock framework support to the usbf/m66592 driver and
adjust the cpu specific code accordingly.
Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'drivers/usb/gadget/m66592-udc.h')
-rw-r--r-- | drivers/usb/gadget/m66592-udc.h | 27 |
1 files changed, 7 insertions, 20 deletions
diff --git a/drivers/usb/gadget/m66592-udc.h b/drivers/usb/gadget/m66592-udc.h index f118f00f1466..286ce07e7960 100644 --- a/drivers/usb/gadget/m66592-udc.h +++ b/drivers/usb/gadget/m66592-udc.h | |||
@@ -23,6 +23,10 @@ | |||
23 | #ifndef __M66592_UDC_H__ | 23 | #ifndef __M66592_UDC_H__ |
24 | #define __M66592_UDC_H__ | 24 | #define __M66592_UDC_H__ |
25 | 25 | ||
26 | #if defined(CONFIG_SUPERH_BUILT_IN_M66592) && defined(CONFIG_HAVE_CLK) | ||
27 | #include <linux/clk.h> | ||
28 | #endif | ||
29 | |||
26 | #define M66592_SYSCFG 0x00 | 30 | #define M66592_SYSCFG 0x00 |
27 | #define M66592_XTAL 0xC000 /* b15-14: Crystal selection */ | 31 | #define M66592_XTAL 0xC000 /* b15-14: Crystal selection */ |
28 | #define M66592_XTAL48 0x8000 /* 48MHz */ | 32 | #define M66592_XTAL48 0x8000 /* 48MHz */ |
@@ -476,6 +480,9 @@ struct m66592_ep { | |||
476 | struct m66592 { | 480 | struct m66592 { |
477 | spinlock_t lock; | 481 | spinlock_t lock; |
478 | void __iomem *reg; | 482 | void __iomem *reg; |
483 | #if defined(CONFIG_SUPERH_BUILT_IN_M66592) && defined(CONFIG_HAVE_CLK) | ||
484 | struct clk *clk; | ||
485 | #endif | ||
479 | 486 | ||
480 | struct usb_gadget gadget; | 487 | struct usb_gadget gadget; |
481 | struct usb_gadget_driver *driver; | 488 | struct usb_gadget_driver *driver; |
@@ -604,26 +611,6 @@ static inline void m66592_mdfy(struct m66592 *m66592, u16 val, u16 pat, | |||
604 | #define m66592_bset(m66592, val, offset) \ | 611 | #define m66592_bset(m66592, val, offset) \ |
605 | m66592_mdfy(m66592, val, 0, offset) | 612 | m66592_mdfy(m66592, val, 0, offset) |
606 | 613 | ||
607 | #if defined(CONFIG_SUPERH_BUILT_IN_M66592) | ||
608 | #include <asm/io.h> | ||
609 | #define MSTPCR2 0xA4150038 /* for SH7722 */ | ||
610 | #define MSTPCR2_USB 0x00000800 | ||
611 | |||
612 | static inline void usbf_start_clock(void) | ||
613 | { | ||
614 | ctrl_outl(ctrl_inl(MSTPCR2) & ~MSTPCR2_USB, MSTPCR2); | ||
615 | } | ||
616 | |||
617 | static inline void usbf_stop_clock(void) | ||
618 | { | ||
619 | ctrl_outl(ctrl_inl(MSTPCR2) | MSTPCR2_USB, MSTPCR2); | ||
620 | } | ||
621 | |||
622 | #else | ||
623 | #define usbf_start_clock(x) | ||
624 | #define usbf_stop_clock(x) | ||
625 | #endif /* if defined(CONFIG_SUPERH_BUILT_IN_M66592) */ | ||
626 | |||
627 | #endif /* ifndef __M66592_UDC_H__ */ | 614 | #endif /* ifndef __M66592_UDC_H__ */ |
628 | 615 | ||
629 | 616 | ||