]>
Commit | Line | Data |
---|---|---|
83d290c5 | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
1d4a0b6c ŁM |
2 | /* |
3 | * Copyright (C) 2012 Samsung Electronics | |
4 | * Lukasz Majewski <[email protected]> | |
1d4a0b6c ŁM |
5 | */ |
6 | ||
7 | #ifndef __G_DOWNLOAD_H_ | |
8 | #define __G_DOWNLOAD_H_ | |
9 | ||
10 | #include <linux/usb/ch9.h> | |
1d4a0b6c | 11 | #include <linux/usb/gadget.h> |
c4d0e856 MZ |
12 | #include <linux/usb/composite.h> |
13 | #include <linker_lists.h> | |
14 | ||
15 | /* | |
16 | * @usb_fname: unescaped USB function name | |
17 | * @callback_ptr: bind callback, one per function name | |
18 | */ | |
19 | #define DECLARE_GADGET_BIND_CALLBACK(usb_fname, callback_ptr) \ | |
20 | ll_entry_declare(struct g_dnl_bind_callback, \ | |
21 | __usb_function_name_##usb_fname, \ | |
22 | g_dnl_bind_callbacks) = { \ | |
23 | .usb_function_name = #usb_fname, \ | |
24 | .fptr = callback_ptr \ | |
25 | } | |
26 | ||
27 | typedef int (*g_dnl_bind_callback_f)(struct usb_configuration *); | |
28 | ||
29 | /* used in Gadget downloader callback linker list */ | |
30 | struct g_dnl_bind_callback { | |
31 | const char *usb_function_name; | |
32 | g_dnl_bind_callback_f fptr; | |
33 | }; | |
34 | ||
d6eae7b0 | 35 | int g_dnl_bind_fixup(struct usb_device_descriptor *, const char *); |
05a950cf | 36 | int g_dnl_get_board_bcd_device_number(int gcnum); |
75504e95 | 37 | int g_dnl_board_usb_cable_connected(void); |
1d4a0b6c ŁM |
38 | int g_dnl_register(const char *s); |
39 | void g_dnl_unregister(void); | |
ec9002e4 | 40 | void g_dnl_set_serialnumber(char *); |
bcd677f2 | 41 | void g_dnl_set_product(const char *s); |
1d4a0b6c | 42 | |
fe1b28c9 RH |
43 | bool g_dnl_detach(void); |
44 | void g_dnl_trigger_detach(void); | |
45 | void g_dnl_clear_detach(void); | |
05341a87 | 46 | int run_usb_dnl_gadget(int usbctrl_index, char *usb_dnl_gadget); |
fe1b28c9 | 47 | |
1d4a0b6c | 48 | #endif /* __G_DOWNLOAD_H_ */ |