int usb_adapter_state(void) { //int port_stats = 0; int charg_statue = 0, err = 0; if (1 == usb_modules_status){ TEST("### udc probed:usb charging ###\n"); return 0; } usb_base = usb_adapter_base; ccm_adapter__base = ccm_blk_base; disable_irq(18); usb_udc_init(); charg_statue = bsp_usb_poll(); //port_stats = readl(USB_PORTSC1)>>10&0x3; mxc_usb_stop(); enable_irq(18); //usbotg_clock_gate(0); //printk("port_stats =%d charg_statue = %d\n",port_stats,charg_statue); //printk(" charg_statue = %d\n",charg_statue); if (0 == charg_statue) { TEST("### USB 3rd adapter ###\n"); return ADAPTER_INSERT; } if (1 == charg_statue) { TEST("### Micro usb charging ###\n"); return USB_INSERT; } TEST("### %s:unknown device:%d ###\n", __func__, charg_statue); return err; }
/* * mxc_udc_init function */ int mxc_udc_init(void) { set_usboh3_clk(); set_usb_phy1_clk(); enable_usboh3_clk(1); enable_usb_phy1_clk(1); usb_udc_init(); return 0; }
/* * mxc_udc_init function */ int mxc_udc_init(void) { set_usboh3_clk(); set_usb_phy1_clk(); enable_usboh3_clk(1); #if defined(CONFIG_MX6Q) || defined(CONFIG_MX6DL) udc_disable_over_current(); #endif enable_usb_phy1_clk(1); usb_udc_init(); return 0; }
/* * mxc_udc_init function */ int mxc_udc_init(void) { udc_pins_setting(); set_usb_phy1_clk(); enable_usboh3_clk(1); #if (defined(CONFIG_MX6) || defined(CONFIG_MX7)) udc_disable_over_current(); #endif enable_usb_phy1_clk(1); usb_udc_init(); return 0; }