]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - include/usb.h
tegra: imx: omap: enable Moschip USB ethernet support for several boards
[karo-tx-uboot.git] / include / usb.h
index a96ec235c853c07ff026e0dc1304e245221c8e5f..736730e8964258470939f218c32853b3571328b8 100644 (file)
@@ -129,6 +129,16 @@ struct usb_device {
        unsigned int slot_id;
 };
 
+/*
+ * You can initialize platform's USB host or device
+ * ports by passing this enum as an argument to
+ * board_usb_init().
+ */
+enum usb_init_type {
+       USB_INIT_HOST,
+       USB_INIT_DEVICE
+};
+
 /**********************************************************************
  * this is how the lowlevel part communicate with the outer world
  */
@@ -142,7 +152,7 @@ struct usb_device {
        defined(CONFIG_USB_MUSB_DSPS) || defined(CONFIG_USB_MUSB_AM35X) || \
        defined(CONFIG_USB_MUSB_OMAP2PLUS) || defined(CONFIG_USB_XHCI)
 
-int usb_lowlevel_init(int index, void **controller);
+int usb_lowlevel_init(int index, enum usb_init_type init, void **controller);
 int usb_lowlevel_stop(int index);
 
 int submit_bulk_msg(struct usb_device *dev, unsigned long pipe,
@@ -167,8 +177,34 @@ int submit_int_msg(struct usb_device *dev, unsigned long pipe, void *buffer,
 
 extern void udc_disconnect(void);
 
-#else
-#error USB Lowlevel not defined
+#endif
+
+/*
+ * board-specific hardware initialization, called by
+ * usb drivers and u-boot commands
+ *
+ * @param index USB controller number
+ * @param init initializes controller as USB host or device
+ */
+int board_usb_init(int index, enum usb_init_type init);
+
+/*
+ * can be used to clean up after failed USB initialization attempt
+ * vide: board_usb_init()
+ *
+ * @param index USB controller number for selective cleanup
+ * @param init usb_init_type passed to board_usb_init()
+ */
+int board_usb_cleanup(int index, enum usb_init_type init);
+
+/*
+ * If CONFIG_USB_CABLE_CHECK is set then this function
+ * should be defined in board file.
+ *
+ * @return 1 if cable is connected and 0 otherwise.
+ */
+#ifdef CONFIG_USB_CABLE_CHECK
+int usb_cable_connected(void);
 #endif
 
 #ifdef CONFIG_USB_STORAGE