usb: ums: add ums exit feature by ctrl+c or by detach usb cable

This patch allows exiting from UMS mode to u-boot prompt
by detaching usb cable or by pressing ctrl+c.

Add new config: CONFIG_USB_CABLE_CHECK. If defined then board
file should provide function: usb_cable_connected() (include/usb.h)
that return 1 if cable is connected and 0 otherwise.

Changes v2:
- add a note to the README

Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
Cc: Marek Vasut <marex@denx.de>
This commit is contained in:
Przemyslaw Marczak
2013-10-23 14:30:46 +02:00
committed by Marek Vasut
parent 4b19ed6c76
commit 351e9b2069
4 changed files with 51 additions and 11 deletions

View File

@@ -197,6 +197,16 @@ 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