1 // SPDX-License-Identifier: GPL-2.0 2 /* 3 * u_hid.h 4 * 5 * Utility definitions for the hid function 6 * 7 * Copyright (c) 2014 Samsung Electronics Co., Ltd. 8 * http://www.samsung.com 9 * 10 * Author: Andrzej Pietrasiewicz <andrzej.p@samsung.com> 11 * 12 * This program is free software; you can redistribute it and/or modify 13 * it under the terms of the GNU General Public License version 2 as 14 * published by the Free Software Foundation. 15 */ 16 17 #ifndef U_HID_H 18 #define U_HID_H 19 20 #include <linux/usb/composite.h> 21 22 struct f_hid_opts { 23 struct usb_function_instance func_inst; 24 int minor; 25 unsigned char subclass; 26 unsigned char protocol; 27 unsigned short report_length; 28 unsigned short report_desc_length; 29 unsigned char *report_desc; 30 bool report_desc_alloc; 31 32 /* 33 * Protect the data form concurrent access by read/write 34 * and create symlink/remove symlink. 35 */ 36 struct mutex lock; 37 int refcnt; 38 }; 39 40 int ghid_setup(struct usb_gadget *g, int count); 41 void ghid_cleanup(void); 42 43 #endif /* U_HID_H */ 44