1*4882a593Smuzhiyun // SPDX-License-Identifier: GPL-2.0 2*4882a593Smuzhiyun /* 3*4882a593Smuzhiyun * Copyright (C) 2005 Dmitry Torokhov 4*4882a593Smuzhiyun * 5*4882a593Smuzhiyun * This program is free software; you can redistribute it and/or modify it 6*4882a593Smuzhiyun * under the terms of the GNU General Public License version 2 as published by 7*4882a593Smuzhiyun * the Free Software Foundation. 8*4882a593Smuzhiyun */ 9*4882a593Smuzhiyun 10*4882a593Smuzhiyun #ifndef __LINUX_USB_INPUT_H 11*4882a593Smuzhiyun #define __LINUX_USB_INPUT_H 12*4882a593Smuzhiyun 13*4882a593Smuzhiyun #include <linux/usb.h> 14*4882a593Smuzhiyun #include <linux/input.h> 15*4882a593Smuzhiyun #include <asm/byteorder.h> 16*4882a593Smuzhiyun 17*4882a593Smuzhiyun static inline void usb_to_input_id(const struct usb_device * dev,struct input_id * id)18*4882a593Smuzhiyunusb_to_input_id(const struct usb_device *dev, struct input_id *id) 19*4882a593Smuzhiyun { 20*4882a593Smuzhiyun id->bustype = BUS_USB; 21*4882a593Smuzhiyun id->vendor = le16_to_cpu(dev->descriptor.idVendor); 22*4882a593Smuzhiyun id->product = le16_to_cpu(dev->descriptor.idProduct); 23*4882a593Smuzhiyun id->version = le16_to_cpu(dev->descriptor.bcdDevice); 24*4882a593Smuzhiyun } 25*4882a593Smuzhiyun 26*4882a593Smuzhiyun #endif /* __LINUX_USB_INPUT_H */ 27