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;
#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)
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;
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();
}
}
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) {