summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/configs/trats.h2
-rw-r--r--include/g_dnl.h1
-rw-r--r--include/usb.h10
-rw-r--r--include/usb_mass_storage.h33
4 files changed, 28 insertions, 18 deletions
diff --git a/include/configs/trats.h b/include/configs/trats.h
index 6ed3313265..3d080c4d19 100644
--- a/include/configs/trats.h
+++ b/include/configs/trats.h
@@ -321,9 +321,7 @@
#define CONFIG_SYS_VIDEO_LOGO_MAX_SIZE ((500 * 120 * 4) + (1 << 12))
#define CONFIG_CMD_USB_MASS_STORAGE
-#if defined(CONFIG_CMD_USB_MASS_STORAGE)
#define CONFIG_USB_GADGET_MASS_STORAGE
-#endif
/* Pass open firmware flat tree */
#define CONFIG_OF_LIBFDT 1
diff --git a/include/g_dnl.h b/include/g_dnl.h
index de669fb85a..8f813c21ee 100644
--- a/include/g_dnl.h
+++ b/include/g_dnl.h
@@ -13,5 +13,6 @@
int g_dnl_bind_fixup(struct usb_device_descriptor *, const char *);
int g_dnl_register(const char *s);
void g_dnl_unregister(void);
+void g_dnl_set_serialnumber(char *);
#endif /* __G_DOWNLOAD_H_ */
diff --git a/include/usb.h b/include/usb.h
index d9fedeeff7..736730e896 100644
--- a/include/usb.h
+++ b/include/usb.h
@@ -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
diff --git a/include/usb_mass_storage.h b/include/usb_mass_storage.h
index 13f535ce2e..9df3adcf2a 100644
--- a/include/usb_mass_storage.h
+++ b/include/usb_mass_storage.h
@@ -9,32 +9,33 @@
#define __USB_MASS_STORAGE_H__
#define SECTOR_SIZE 0x200
-
#include <mmc.h>
#include <linux/usb/composite.h>
-struct ums_device {
- struct mmc *mmc;
- int dev_num;
- int offset;
- int part_size;
-};
+#ifndef UMS_START_SECTOR
+#define UMS_START_SECTOR 0
+#endif
-struct ums_board_info {
- int (*read_sector)(struct ums_device *ums_dev,
+#ifndef UMS_NUM_SECTORS
+#define UMS_NUM_SECTORS 0
+#endif
+
+struct ums {
+ int (*read_sector)(struct ums *ums_dev,
ulong start, lbaint_t blkcnt, void *buf);
- int (*write_sector)(struct ums_device *ums_dev,
+ int (*write_sector)(struct ums *ums_dev,
ulong start, lbaint_t blkcnt, const void *buf);
- void (*get_capacity)(struct ums_device *ums_dev,
- long long int *capacity);
+ unsigned int start_sector;
+ unsigned int num_sectors;
const char *name;
- struct ums_device ums_dev;
+ struct mmc *mmc;
};
-int fsg_init(struct ums_board_info *);
+extern struct ums *ums;
+
+int fsg_init(struct ums *);
void fsg_cleanup(void);
-struct ums_board_info *board_ums_init(unsigned int, unsigned int,
- unsigned int);
+struct ums *ums_init(unsigned int);
int fsg_main_thread(void *);
#ifdef CONFIG_USB_GADGET_MASS_STORAGE
OpenPOWER on IntegriCloud