for your device
- CONFIG_USBD_PRODUCTID 0xFFFF
- Some USB device drivers may need to check USB cable attachment.
- In this case you can enable following config in BoardName.h:
- CONFIG_USB_CABLE_CHECK
- This enables function definition:
- - usb_cable_connected() in include/usb.h
- Implementation of this function is board-specific.
-
- ULPI Layer Support:
The ULPI (UTMI Low Pin (count) Interface) PHYs are supported via
the generic ULPI layer. The generic layer accesses the ULPI PHY
return 0;
}
-#ifdef CONFIG_USB_CABLE_CHECK
-int usb_cable_connected(void)
-{
- return 0;
-}
-#endif
-
#ifdef CONFIG_BOARD_EARLY_INIT_F
int exynos_early_init_f(void)
{
return s3c_udc_probe(&s5pc210_otg_data);
}
-#ifdef CONFIG_USB_CABLE_CHECK
-int usb_cable_connected(void)
+int g_dnl_board_usb_cable_connected(void)
{
struct pmic *muic = pmic_get("MAX8997_MUIC");
if (!muic)
return !!muic->chrg->chrg_type(muic);
}
#endif
-#endif
static void pmic_reset(void)
{
return s3c_udc_probe(&s5pc210_otg_data);
}
-#ifdef CONFIG_USB_CABLE_CHECK
-int usb_cable_connected(void)
+int g_dnl_board_usb_cable_connected(void)
{
struct pmic *muic = pmic_get("MAX77693_MUIC");
if (!muic)
return !!muic->chrg->chrg_type(muic);
}
#endif
-#endif
static int pmic_init_max77686(void)
{
return s3c_udc_probe(&s5pc210_otg_data);
}
-#ifdef CONFIG_USB_CABLE_CHECK
-int usb_cable_connected(void)
-{
- return 0;
-}
-#endif
-
int exynos_early_init_f(void)
{
wdt_stop();
/* Timeout unit: seconds */
int cable_ready_timeout = UMS_CABLE_READY_TIMEOUT;
- if (!usb_cable_connected()) {
+ if (!g_dnl_board_usb_cable_connected()) {
+ /*
+ * Won't execute if we don't know whether the cable is
+ * connected.
+ */
puts("Please connect USB cable.\n");
- while (!usb_cable_connected()) {
+ while (!g_dnl_board_usb_cable_connected()) {
if (ctrlc()) {
puts("\rCTRL+C - Operation aborted.\n");
goto exit;
#include <config.h>
#include <malloc.h>
#include <common.h>
-#include <usb.h>
+#include <g_dnl.h>
#include <linux/err.h>
#include <linux/usb/ch9.h>
/* Handle CTRL+C */
if (ctrlc())
return -EPIPE;
-#ifdef CONFIG_USB_CABLE_CHECK
+
/* Check cable connection */
- if (!usb_cable_connected())
+ if (!g_dnl_board_usb_cable_connected())
return -EIO;
-#endif
+
k = 0;
}
return gcnum;
}
+__weak int g_dnl_board_usb_cable_connected(void)
+{
+ return -EOPNOTSUPP;
+}
+
static int g_dnl_get_bcd_device_number(struct usb_composite_dev *cdev)
{
struct usb_gadget *gadget = cdev->gadget;
#define CONFIG_USB_GADGET_S3C_UDC_OTG
#define CONFIG_USB_GADGET_DUALSPEED
#define CONFIG_USB_GADGET_VBUS_DRAW 2
-#define CONFIG_USB_CABLE_CHECK
#define CONFIG_CMD_USB_MASS_STORAGE
#define CONFIG_USB_GADGET_MASS_STORAGE
#include <linux/usb/ch9.h>
#include <linux/usb/gadget.h>
int g_dnl_bind_fixup(struct usb_device_descriptor *, const char *);
+int g_dnl_board_usb_cable_connected(void);
int g_dnl_register(const char *s);
void g_dnl_unregister(void);
void g_dnl_set_serialnumber(char *);
*/
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
#define USB_MAX_STOR_DEV 5