From 75504e9592745021006cb8905b5ff5a51d9d1cb3 Mon Sep 17 00:00:00 2001 From: Mateusz Zalega Date: Wed, 30 Apr 2014 13:07:48 +0200 Subject: usb: dfu: fix boards wo USB cable detection Former usb_cable_connected() patch broke compilation of boards which do not support this feature. I've renamed usb_cable_connected() to g_dnl_usb_cable_connected() and added its default implementation to gadget downloader driver code. There's only one driver of this kind and it's unlikely there'll be another, so there's no point in keeping it in /common. Previously this function was declared in usb.h. I've moved it, since it's more appropriate to keep it in g_dnl.h - usb.h seems to be intended for USB host implementation. Existing code, confronted with default -EOPNOTSUPP return value, continues as if the cable was connected. CONFIG_USB_CABLE_CHECK was removed. Change-Id: Ib9198621adee2811b391c64512f14646cefd0369 Signed-off-by: Mateusz Zalega Acked-by: Marek Vasut Acked-by: Lukasz Majewski --- include/configs/exynos4-dt.h | 1 - include/g_dnl.h | 1 + include/usb.h | 10 ---------- 3 files changed, 1 insertion(+), 11 deletions(-) (limited to 'include') diff --git a/include/configs/exynos4-dt.h b/include/configs/exynos4-dt.h index 2040bf7..cbd2d20 100644 --- a/include/configs/exynos4-dt.h +++ b/include/configs/exynos4-dt.h @@ -127,7 +127,6 @@ #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 diff --git a/include/g_dnl.h b/include/g_dnl.h index 8f813c2..f4e8d10 100644 --- a/include/g_dnl.h +++ b/include/g_dnl.h @@ -11,6 +11,7 @@ #include #include 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 *); diff --git a/include/usb.h b/include/usb.h index 736730e..d9fedee 100644 --- a/include/usb.h +++ b/include/usb.h @@ -197,16 +197,6 @@ int board_usb_init(int index, enum usb_init_type 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 #define USB_MAX_STOR_DEV 5 -- cgit v1.1