use board serial number from device tree
[linux-usb-otg] / usb-hid-start.sh
1 #!/bin/bash
2 cd /sys/kernel/config/usb_gadget
3 mkdir g1
4 cd g1
5 echo "0x1d6b" > idVendor
6 echo "0x0104" > idProduct
7 mkdir strings/0x409
8 echo "My␣serial" > strings/0x409/serialnumber
9 echo "My␣Vendor" > strings/0x409/manufacturer
10 echo "My␣Product" > strings/0x409/product
11 mkdir functions/hid.usb0
12 echo 1 > functions/hid.usb0/protocol
13 echo 1 > functions/hid.usb0/subclass
14 echo 8 > functions/hid.usb0/report_length
15 /bin/echo -ne \\x05\\x01\\x09\\x06\\xa1\\x01\\x05\\x07\\x19\\xe0\\x29\\xe7\\x15\\x00\\x25\\x01\\x75\\x01\\x95\\x08\\x81\\x02\\x95\\x01\\x75\\x08\\x81\\x03\\x95\\x05\\x75\\x01\\x05\\x08\\x19\\x01\\x29\\x05\\x91\\x02\\x95\\x01\\x75\\x03\\x91\\x03\\x95\\x06\\x75\\x08\\x15\\x00\\x25\\x65\\x05\\x07\\x19\\x00\\x29\\x65\\x81\\x00\\xc0 > functions/hid.usb0/report_desc
16 mkdir configs/c.1
17 mkdir configs/c.1/strings/0x409
18 echo Conf 1 > configs/c.1/strings/0x409/configuration
19 echo 120 > configs/c.1/MaxPower
20 ln -s functions/hid.usb0 configs/c.1
21 echo musb-hdrc.1.auto > UDC