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 <m.zalega@samsung.com>
Acked-by: Marek Vasut <marex@denx.de>
Acked-by: Lukasz Majewski <l.majewski@samsung.com>
This commit is contained in:
Mateusz Zalega
2014-04-30 13:07:48 +02:00
committed by Lukasz Majewski
parent 6b423b752b
commit 75504e9592
11 changed files with 18 additions and 44 deletions

View File

@@ -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