u_hid.h 818 B

123456789101112131415161718192021222324252627282930313233343536373839
  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. #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 short report_length;
  21. unsigned short report_desc_length;
  22. unsigned char *report_desc;
  23. bool report_desc_alloc;
  24. /*
  25. * Protect the data form concurrent access by read/write
  26. * and create symlink/remove symlink.
  27. */
  28. struct mutex lock;
  29. int refcnt;
  30. };
  31. int ghid_setup(struct usb_gadget *g, int count);
  32. void ghid_cleanup(void);
  33. #endif /* U_HID_H */