X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=include%2Fg_dnl.h;h=ba49f1f5cb6c3c6e381652a1d1d2daf4964e34ed;hb=bd91508b50ade5c73b3749bf4e5ede31d2da7ef8;hp=f47395f35d3133510093080033237ebf54db1aa6;hpb=2c601c7208713ba9b2158c57adcf515f4bdbc212;p=people%2Fms%2Fu-boot.git diff --git a/include/g_dnl.h b/include/g_dnl.h index f47395f35d..ba49f1f5cb 100644 --- a/include/g_dnl.h +++ b/include/g_dnl.h @@ -2,20 +2,7 @@ * Copyright (C) 2012 Samsung Electronics * Lukasz Majewski * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, - * MA 02111-1307 USA + * SPDX-License-Identifier: GPL-2.0+ */ #ifndef __G_DOWNLOAD_H_ @@ -23,10 +10,38 @@ #include #include +#include +#include + +/* + * @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; +}; + +int g_dnl_bind_fixup(struct usb_device_descriptor *, const char *); +int g_dnl_get_board_bcd_device_number(int gcnum); +int g_dnl_board_usb_cable_connected(void); int g_dnl_register(const char *s); void g_dnl_unregister(void); +void g_dnl_set_serialnumber(char *); + +bool g_dnl_detach(void); +void g_dnl_trigger_detach(void); +void g_dnl_clear_detach(void); -/* USB initialization declaration - board specific */ -void board_usb_init(void); #endif /* __G_DOWNLOAD_H_ */