2018-05-07 05:58:06 +08:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0+ */
|
2012-08-06 20:41:05 +08:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2012 Samsung Electronics
|
|
|
|
* Lukasz Majewski <l.majewski@samsung.com>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __G_DOWNLOAD_H_
|
|
|
|
#define __G_DOWNLOAD_H_
|
|
|
|
|
|
|
|
#include <linux/usb/ch9.h>
|
|
|
|
#include <linux/usb/gadget.h>
|
2014-04-29 03:13:28 +08:00
|
|
|
#include <linux/usb/composite.h>
|
|
|
|
#include <linker_lists.h>
|
|
|
|
|
|
|
|
/*
|
|
|
|
* @usb_fname: unescaped USB function name
|
|
|
|
* @callback_ptr: bind callback, one per function name
|
|
|
|
*/
|
|
|
|
#define DECLARE_GADGET_BIND_CALLBACK(usb_fname, callback_ptr) \
|
|
|
|
ll_entry_declare(struct g_dnl_bind_callback, \
|
|
|
|
__usb_function_name_##usb_fname, \
|
|
|
|
g_dnl_bind_callbacks) = { \
|
|
|
|
.usb_function_name = #usb_fname, \
|
|
|
|
.fptr = callback_ptr \
|
|
|
|
}
|
|
|
|
|
|
|
|
typedef int (*g_dnl_bind_callback_f)(struct usb_configuration *);
|
|
|
|
|
|
|
|
/* used in Gadget downloader callback linker list */
|
|
|
|
struct g_dnl_bind_callback {
|
|
|
|
const char *usb_function_name;
|
|
|
|
g_dnl_bind_callback_f fptr;
|
|
|
|
};
|
|
|
|
|
2013-10-08 20:30:41 +08:00
|
|
|
int g_dnl_bind_fixup(struct usb_device_descriptor *, const char *);
|
2015-07-10 05:26:38 +08:00
|
|
|
int g_dnl_get_board_bcd_device_number(int gcnum);
|
2014-04-30 19:07:48 +08:00
|
|
|
int g_dnl_board_usb_cable_connected(void);
|
2012-08-06 20:41:05 +08:00
|
|
|
int g_dnl_register(const char *s);
|
|
|
|
void g_dnl_unregister(void);
|
2013-11-04 21:05:01 +08:00
|
|
|
void g_dnl_set_serialnumber(char *);
|
2012-08-06 20:41:05 +08:00
|
|
|
|
2014-12-11 04:43:03 +08:00
|
|
|
bool g_dnl_detach(void);
|
|
|
|
void g_dnl_trigger_detach(void);
|
|
|
|
void g_dnl_clear_detach(void);
|
2016-07-28 20:09:15 +08:00
|
|
|
int run_usb_dnl_gadget(int usbctrl_index, char *usb_dnl_gadget);
|
2014-12-11 04:43:03 +08:00
|
|
|
|
2012-08-06 20:41:05 +08:00
|
|
|
#endif /* __G_DOWNLOAD_H_ */
|