u_hid.h 855 B

12345678910111213141516171819202122232425262728293031323334353637383940
  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 <[email protected]>
  11. */
  12. #ifndef U_HID_H
  13. #define U_HID_H
  14. #include <linux/usb/composite.h>
  15. struct f_hid_opts {
  16. struct usb_function_instance func_inst;
  17. int minor;
  18. unsigned char subclass;
  19. unsigned char protocol;
  20. unsigned char no_out_endpoint;
  21. unsigned short report_length;
  22. unsigned short report_desc_length;
  23. unsigned char *report_desc;
  24. bool report_desc_alloc;
  25. /*
  26. * Protect the data form concurrent access by read/write
  27. * and create symlink/remove symlink.
  28. */
  29. struct mutex lock;
  30. int refcnt;
  31. };
  32. int ghid_setup(struct usb_gadget *g, int count);
  33. void ghid_cleanup(void);
  34. #endif /* U_HID_H */