input.h 526 B

12345678910111213141516171819202122
  1. // SPDX-License-Identifier: GPL-2.0
  2. /*
  3. * Copyright (C) 2005 Dmitry Torokhov
  4. */
  5. #ifndef __LINUX_USB_INPUT_H
  6. #define __LINUX_USB_INPUT_H
  7. #include <linux/usb.h>
  8. #include <linux/input.h>
  9. #include <asm/byteorder.h>
  10. static inline void
  11. usb_to_input_id(const struct usb_device *dev, struct input_id *id)
  12. {
  13. id->bustype = BUS_USB;
  14. id->vendor = le16_to_cpu(dev->descriptor.idVendor);
  15. id->product = le16_to_cpu(dev->descriptor.idProduct);
  16. id->version = le16_to_cpu(dev->descriptor.bcdDevice);
  17. }
  18. #endif /* __LINUX_USB_INPUT_H */