s5pc1xx: usb: fix compile error
authorMinkyu Kang <mk7.kang@samsung.com>
Tue, 28 Jul 2009 06:11:01 +0000 (15:11 +0900)
committerMinkyu Kang <mk7.kang@samsung.com>
Tue, 28 Jul 2009 06:11:01 +0000 (15:11 +0900)
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
cpu/arm_cortexa8/s5pc1xx/usb-hs-otg.c
cpu/arm_cortexa8/s5pc1xx/usb-hs-otg.h
cpu/arm_cortexa8/s5pc1xx/usb_downloader.c

index 5e90bb5..1e81749 100644 (file)
@@ -337,6 +337,18 @@ void s5p_usb_init_phy(void)
        udelay(20);
 }
 
+int s5p_usb_detect_irq(void)
+{
+       u32 status;
+       status = s5pc1xx_otg_read_reg(OTG_GINTSTS);
+       return (status & 0x800c3810);
+}
+
+void s5p_usb_clear_irq(void)
+{
+       s5pc1xx_otg_write_reg(0xffffffff, OTG_GINTSTS);
+}
+
 void s5p_usb_core_soft_reset(void)
 {
        u32 tmp;
index 72314be..670be59 100644 (file)
 #include <asm/arch/hardware.h>
 #include <asm/arch/usb-hs-otg.h>
 
-#define S5P_USBD_DETECT_IRQ()  (readl(S5P_OTG_GINTSTS) & 0x800c3810)
-#define S5P_USBD_CLEAR_IRQ()   do { \
-                                       writel(0xFFFFFFFF, (S5P_OTG_GINTSTS)); \
-                               } while (0)
-
 #define make_word_c(w) __constant_cpu_to_le16(w)
 #define make_word(w)   __cpu_to_le16(w)
 
@@ -271,6 +266,8 @@ int s5p_usbc_activate(void);
 void s5p_usb_stop(void);
 void s5p_udc_int_hndlr(void);
 void s5p_usb_tx(char *tx_data, int tx_size);
+int s5p_usb_detect_irq(void);
+void s5p_usb_clear_irq(void);
 
 /* in usbd-otg-hs.c */
 extern unsigned int s5p_usbd_dn_addr;
index 5d556b6..c9cf8e6 100644 (file)
@@ -97,9 +97,9 @@ void usb_init(void)
                        otg.speed ? "Full" : "High");
 
        while (!s5p_usb_connected) {
-               if (S5P_USBD_DETECT_IRQ()) {
+               if (s5p_usb_detect_irq()) {
                        s5p_udc_int_hndlr();
-                       S5P_USBD_CLEAR_IRQ();
+                       s5p_usb_clear_irq();
                }
        }
 
@@ -114,9 +114,9 @@ void usb_init(void)
 int usb_receive_packet(void)
 {
        while (1) {
-               if (S5P_USBD_DETECT_IRQ()) {
+               if (s5p_usb_detect_irq()) {
                        s5p_udc_int_hndlr();
-                       S5P_USBD_CLEAR_IRQ();
+                       s5p_usb_clear_irq();
                }
 
                if (s5p_receive_done) {