diff options
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/ABI/testing/configfs-usb-gadget-uvc | 265 | ||||
-rw-r--r-- | Documentation/devicetree/bindings/phy/phy-miphy28lp.txt | 43 | ||||
-rw-r--r-- | Documentation/devicetree/bindings/phy/rockchip-usb-phy.txt | 37 | ||||
-rw-r--r-- | Documentation/devicetree/bindings/phy/samsung-phy.txt | 2 | ||||
-rw-r--r-- | Documentation/devicetree/bindings/usb/atmel-usb.txt | 5 | ||||
-rw-r--r-- | Documentation/devicetree/bindings/usb/dwc2.txt | 4 | ||||
-rw-r--r-- | Documentation/devicetree/bindings/usb/renesas_usbhs.txt | 2 | ||||
-rw-r--r-- | Documentation/devicetree/bindings/usb/usb-ehci.txt | 1 | ||||
-rw-r--r-- | Documentation/devicetree/bindings/usb/usb-nop-xceiv.txt | 10 | ||||
-rw-r--r-- | Documentation/usb/gadget-testing.txt | 728 | ||||
-rw-r--r-- | Documentation/usb/gadget_serial.txt | 8 | ||||
-rw-r--r-- | Documentation/usb/usbmon.txt | 2 |
12 files changed, 1074 insertions, 33 deletions
diff --git a/Documentation/ABI/testing/configfs-usb-gadget-uvc b/Documentation/ABI/testing/configfs-usb-gadget-uvc new file mode 100644 index 000000000000..2f4a0051b32d --- /dev/null +++ b/Documentation/ABI/testing/configfs-usb-gadget-uvc | |||
@@ -0,0 +1,265 @@ | |||
1 | What: /config/usb-gadget/gadget/functions/uvc.name | ||
2 | Date: Dec 2014 | ||
3 | KernelVersion: 3.20 | ||
4 | Description: UVC function directory | ||
5 | |||
6 | streaming_maxburst - 0..15 (ss only) | ||
7 | streaming_maxpacket - 1..1023 (fs), 1..3072 (hs/ss) | ||
8 | streaming_interval - 1..16 | ||
9 | |||
10 | What: /config/usb-gadget/gadget/functions/uvc.name/control | ||
11 | Date: Dec 2014 | ||
12 | KernelVersion: 3.20 | ||
13 | Description: Control descriptors | ||
14 | |||
15 | What: /config/usb-gadget/gadget/functions/uvc.name/control/class | ||
16 | Date: Dec 2014 | ||
17 | KernelVersion: 3.20 | ||
18 | Description: Class descriptors | ||
19 | |||
20 | What: /config/usb-gadget/gadget/functions/uvc.name/control/class/ss | ||
21 | Date: Dec 2014 | ||
22 | KernelVersion: 3.20 | ||
23 | Description: Super speed control class descriptors | ||
24 | |||
25 | What: /config/usb-gadget/gadget/functions/uvc.name/control/class/fs | ||
26 | Date: Dec 2014 | ||
27 | KernelVersion: 3.20 | ||
28 | Description: Full speed control class descriptors | ||
29 | |||
30 | What: /config/usb-gadget/gadget/functions/uvc.name/control/terminal | ||
31 | Date: Dec 2014 | ||
32 | KernelVersion: 3.20 | ||
33 | Description: Terminal descriptors | ||
34 | |||
35 | What: /config/usb-gadget/gadget/functions/uvc.name/control/terminal/output | ||
36 | Date: Dec 2014 | ||
37 | KernelVersion: 3.20 | ||
38 | Description: Output terminal descriptors | ||
39 | |||
40 | What: /config/usb-gadget/gadget/functions/uvc.name/control/terminal/output/default | ||
41 | Date: Dec 2014 | ||
42 | KernelVersion: 3.20 | ||
43 | Description: Default output terminal descriptors | ||
44 | |||
45 | All attributes read only: | ||
46 | iTerminal - index of string descriptor | ||
47 | bSourceID - id of the terminal to which this terminal | ||
48 | is connected | ||
49 | bAssocTerminal - id of the input terminal to which this output | ||
50 | terminal is associated | ||
51 | wTerminalType - terminal type | ||
52 | bTerminalID - a non-zero id of this terminal | ||
53 | |||
54 | What: /config/usb-gadget/gadget/functions/uvc.name/control/terminal/camera | ||
55 | Date: Dec 2014 | ||
56 | KernelVersion: 3.20 | ||
57 | Description: Camera terminal descriptors | ||
58 | |||
59 | What: /config/usb-gadget/gadget/functions/uvc.name/control/terminal/camera/default | ||
60 | Date: Dec 2014 | ||
61 | KernelVersion: 3.20 | ||
62 | Description: Default camera terminal descriptors | ||
63 | |||
64 | All attributes read only: | ||
65 | bmControls - bitmap specifying which controls are | ||
66 | supported for the video stream | ||
67 | wOcularFocalLength - the value of Locular | ||
68 | wObjectiveFocalLengthMax- the value of Lmin | ||
69 | wObjectiveFocalLengthMin- the value of Lmax | ||
70 | iTerminal - index of string descriptor | ||
71 | bAssocTerminal - id of the output terminal to which | ||
72 | this terminal is connected | ||
73 | wTerminalType - terminal type | ||
74 | bTerminalID - a non-zero id of this terminal | ||
75 | |||
76 | What: /config/usb-gadget/gadget/functions/uvc.name/control/processing | ||
77 | Date: Dec 2014 | ||
78 | KernelVersion: 3.20 | ||
79 | Description: Processing unit descriptors | ||
80 | |||
81 | What: /config/usb-gadget/gadget/functions/uvc.name/control/processing/default | ||
82 | Date: Dec 2014 | ||
83 | KernelVersion: 3.20 | ||
84 | Description: Default processing unit descriptors | ||
85 | |||
86 | All attributes read only: | ||
87 | iProcessing - index of string descriptor | ||
88 | bmControls - bitmap specifying which controls are | ||
89 | supported for the video stream | ||
90 | wMaxMultiplier - maximum digital magnification x100 | ||
91 | bSourceID - id of the terminal to which this unit is | ||
92 | connected | ||
93 | bUnitID - a non-zero id of this unit | ||
94 | |||
95 | What: /config/usb-gadget/gadget/functions/uvc.name/control/header | ||
96 | Date: Dec 2014 | ||
97 | KernelVersion: 3.20 | ||
98 | Description: Control header descriptors | ||
99 | |||
100 | What: /config/usb-gadget/gadget/functions/uvc.name/control/header/name | ||
101 | Date: Dec 2014 | ||
102 | KernelVersion: 3.20 | ||
103 | Description: Specific control header descriptors | ||
104 | |||
105 | dwClockFrequency | ||
106 | bcdUVC | ||
107 | What: /config/usb-gadget/gadget/functions/uvc.name/streaming | ||
108 | Date: Dec 2014 | ||
109 | KernelVersion: 3.20 | ||
110 | Description: Streaming descriptors | ||
111 | |||
112 | What: /config/usb-gadget/gadget/functions/uvc.name/streaming/class | ||
113 | Date: Dec 2014 | ||
114 | KernelVersion: 3.20 | ||
115 | Description: Streaming class descriptors | ||
116 | |||
117 | What: /config/usb-gadget/gadget/functions/uvc.name/streaming/class/ss | ||
118 | Date: Dec 2014 | ||
119 | KernelVersion: 3.20 | ||
120 | Description: Super speed streaming class descriptors | ||
121 | |||
122 | What: /config/usb-gadget/gadget/functions/uvc.name/streaming/class/hs | ||
123 | Date: Dec 2014 | ||
124 | KernelVersion: 3.20 | ||
125 | Description: High speed streaming class descriptors | ||
126 | |||
127 | What: /config/usb-gadget/gadget/functions/uvc.name/streaming/class/fs | ||
128 | Date: Dec 2014 | ||
129 | KernelVersion: 3.20 | ||
130 | Description: Full speed streaming class descriptors | ||
131 | |||
132 | What: /config/usb-gadget/gadget/functions/uvc.name/streaming/color_matching | ||
133 | Date: Dec 2014 | ||
134 | KernelVersion: 3.20 | ||
135 | Description: Color matching descriptors | ||
136 | |||
137 | What: /config/usb-gadget/gadget/functions/uvc.name/streaming/color_matching/default | ||
138 | Date: Dec 2014 | ||
139 | KernelVersion: 3.20 | ||
140 | Description: Default color matching descriptors | ||
141 | |||
142 | All attributes read only: | ||
143 | bMatrixCoefficients - matrix used to compute luma and | ||
144 | chroma values from the color primaries | ||
145 | bTransferCharacteristics- optoelectronic transfer | ||
146 | characteristic of the source picutre, | ||
147 | also called the gamma function | ||
148 | bColorPrimaries - color primaries and the reference | ||
149 | white | ||
150 | |||
151 | What: /config/usb-gadget/gadget/functions/uvc.name/streaming/mjpeg | ||
152 | Date: Dec 2014 | ||
153 | KernelVersion: 3.20 | ||
154 | Description: MJPEG format descriptors | ||
155 | |||
156 | What: /config/usb-gadget/gadget/functions/uvc.name/streaming/mjpeg/name | ||
157 | Date: Dec 2014 | ||
158 | KernelVersion: 3.20 | ||
159 | Description: Specific MJPEG format descriptors | ||
160 | |||
161 | All attributes read only, | ||
162 | except bmaControls and bDefaultFrameIndex: | ||
163 | bmaControls - this format's data for bmaControls in | ||
164 | the streaming header | ||
165 | bmInterfaceFlags - specifies interlace information, | ||
166 | read-only | ||
167 | bAspectRatioY - the X dimension of the picture aspect | ||
168 | ratio, read-only | ||
169 | bAspectRatioX - the Y dimension of the picture aspect | ||
170 | ratio, read-only | ||
171 | bmFlags - characteristics of this format, | ||
172 | read-only | ||
173 | bDefaultFrameIndex - optimum frame index for this stream | ||
174 | |||
175 | What: /config/usb-gadget/gadget/functions/uvc.name/streaming/mjpeg/name/name | ||
176 | Date: Dec 2014 | ||
177 | KernelVersion: 3.20 | ||
178 | Description: Specific MJPEG frame descriptors | ||
179 | |||
180 | dwFrameInterval - indicates how frame interval can be | ||
181 | programmed; a number of values | ||
182 | separated by newline can be specified | ||
183 | dwDefaultFrameInterval - the frame interval the device would | ||
184 | like to use as default | ||
185 | dwMaxVideoFrameBufferSize- the maximum number of bytes the | ||
186 | compressor will produce for a video | ||
187 | frame or still image | ||
188 | dwMaxBitRate - the maximum bit rate at the shortest | ||
189 | frame interval in bps | ||
190 | dwMinBitRate - the minimum bit rate at the longest | ||
191 | frame interval in bps | ||
192 | wHeight - height of decoded bitmap frame in px | ||
193 | wWidth - width of decoded bitmam frame in px | ||
194 | bmCapabilities - still image support, fixed frame-rate | ||
195 | support | ||
196 | |||
197 | What: /config/usb-gadget/gadget/functions/uvc.name/streaming/uncompressed | ||
198 | Date: Dec 2014 | ||
199 | KernelVersion: 3.20 | ||
200 | Description: Uncompressed format descriptors | ||
201 | |||
202 | What: /config/usb-gadget/gadget/functions/uvc.name/streaming/uncompressed/name | ||
203 | Date: Dec 2014 | ||
204 | KernelVersion: 3.20 | ||
205 | Description: Specific uncompressed format descriptors | ||
206 | |||
207 | bmaControls - this format's data for bmaControls in | ||
208 | the streaming header | ||
209 | bmInterfaceFlags - specifies interlace information, | ||
210 | read-only | ||
211 | bAspectRatioY - the X dimension of the picture aspect | ||
212 | ratio, read-only | ||
213 | bAspectRatioX - the Y dimension of the picture aspect | ||
214 | ratio, read-only | ||
215 | bDefaultFrameIndex - optimum frame index for this stream | ||
216 | bBitsPerPixel - number of bits per pixel used to | ||
217 | specify color in the decoded video | ||
218 | frame | ||
219 | guidFormat - globally unique id used to identify | ||
220 | stream-encoding format | ||
221 | |||
222 | What: /config/usb-gadget/gadget/functions/uvc.name/streaming/uncompressed/name/name | ||
223 | Date: Dec 2014 | ||
224 | KernelVersion: 3.20 | ||
225 | Description: Specific uncompressed frame descriptors | ||
226 | |||
227 | dwFrameInterval - indicates how frame interval can be | ||
228 | programmed; a number of values | ||
229 | separated by newline can be specified | ||
230 | dwDefaultFrameInterval - the frame interval the device would | ||
231 | like to use as default | ||
232 | dwMaxVideoFrameBufferSize- the maximum number of bytes the | ||
233 | compressor will produce for a video | ||
234 | frame or still image | ||
235 | dwMaxBitRate - the maximum bit rate at the shortest | ||
236 | frame interval in bps | ||
237 | dwMinBitRate - the minimum bit rate at the longest | ||
238 | frame interval in bps | ||
239 | wHeight - height of decoded bitmap frame in px | ||
240 | wWidth - width of decoded bitmam frame in px | ||
241 | bmCapabilities - still image support, fixed frame-rate | ||
242 | support | ||
243 | |||
244 | What: /config/usb-gadget/gadget/functions/uvc.name/streaming/header | ||
245 | Date: Dec 2014 | ||
246 | KernelVersion: 3.20 | ||
247 | Description: Streaming header descriptors | ||
248 | |||
249 | What: /config/usb-gadget/gadget/functions/uvc.name/streaming/header/name | ||
250 | Date: Dec 2014 | ||
251 | KernelVersion: 3.20 | ||
252 | Description: Specific streaming header descriptors | ||
253 | |||
254 | All attributes read only: | ||
255 | bTriggerUsage - how the host software will respond to | ||
256 | a hardware trigger interrupt event | ||
257 | bTriggerSupport - flag specifying if hardware | ||
258 | triggering is supported | ||
259 | bStillCaptureMethod - method of still image caputre | ||
260 | supported | ||
261 | bTerminalLink - id of the output terminal to which | ||
262 | the video endpoint of this interface | ||
263 | is connected | ||
264 | bmInfo - capabilities of this video streaming | ||
265 | interface | ||
diff --git a/Documentation/devicetree/bindings/phy/phy-miphy28lp.txt b/Documentation/devicetree/bindings/phy/phy-miphy28lp.txt index 46a135dae6b3..89caa885d08c 100644 --- a/Documentation/devicetree/bindings/phy/phy-miphy28lp.txt +++ b/Documentation/devicetree/bindings/phy/phy-miphy28lp.txt | |||
@@ -26,6 +26,7 @@ Required properties (port (child) node): | |||
26 | filled in "reg". It can also contain the offset of the system configuration | 26 | filled in "reg". It can also contain the offset of the system configuration |
27 | registers used as glue-logic to setup the device for SATA/PCIe or USB3 | 27 | registers used as glue-logic to setup the device for SATA/PCIe or USB3 |
28 | devices. | 28 | devices. |
29 | - st,syscfg : Offset of the parent configuration register. | ||
29 | - resets : phandle to the parent reset controller. | 30 | - resets : phandle to the parent reset controller. |
30 | - reset-names : Associated name must be "miphy-sw-rst". | 31 | - reset-names : Associated name must be "miphy-sw-rst". |
31 | 32 | ||
@@ -54,18 +55,12 @@ example: | |||
54 | phy_port0: port@9b22000 { | 55 | phy_port0: port@9b22000 { |
55 | reg = <0x9b22000 0xff>, | 56 | reg = <0x9b22000 0xff>, |
56 | <0x9b09000 0xff>, | 57 | <0x9b09000 0xff>, |
57 | <0x9b04000 0xff>, | 58 | <0x9b04000 0xff>; |
58 | <0x114 0x4>, /* sysctrl MiPHY cntrl */ | ||
59 | <0x818 0x4>, /* sysctrl MiPHY status*/ | ||
60 | <0xe0 0x4>, /* sysctrl PCIe */ | ||
61 | <0xec 0x4>; /* sysctrl SATA */ | ||
62 | reg-names = "sata-up", | 59 | reg-names = "sata-up", |
63 | "pcie-up", | 60 | "pcie-up", |
64 | "pipew", | 61 | "pipew"; |
65 | "miphy-ctrl-glue", | 62 | |
66 | "miphy-status-glue", | 63 | st,syscfg = <0x114 0x818 0xe0 0xec>; |
67 | "pcie-glue", | ||
68 | "sata-glue"; | ||
69 | #phy-cells = <1>; | 64 | #phy-cells = <1>; |
70 | st,osc-rdy; | 65 | st,osc-rdy; |
71 | reset-names = "miphy-sw-rst"; | 66 | reset-names = "miphy-sw-rst"; |
@@ -75,18 +70,13 @@ example: | |||
75 | phy_port1: port@9b2a000 { | 70 | phy_port1: port@9b2a000 { |
76 | reg = <0x9b2a000 0xff>, | 71 | reg = <0x9b2a000 0xff>, |
77 | <0x9b19000 0xff>, | 72 | <0x9b19000 0xff>, |
78 | <0x9b14000 0xff>, | 73 | <0x9b14000 0xff>; |
79 | <0x118 0x4>, | ||
80 | <0x81c 0x4>, | ||
81 | <0xe4 0x4>, | ||
82 | <0xf0 0x4>; | ||
83 | reg-names = "sata-up", | 74 | reg-names = "sata-up", |
84 | "pcie-up", | 75 | "pcie-up", |
85 | "pipew", | 76 | "pipew"; |
86 | "miphy-ctrl-glue", | 77 | |
87 | "miphy-status-glue", | 78 | st,syscfg = <0x118 0x81c 0xe4 0xf0>; |
88 | "pcie-glue", | 79 | |
89 | "sata-glue"; | ||
90 | #phy-cells = <1>; | 80 | #phy-cells = <1>; |
91 | st,osc-force-ext; | 81 | st,osc-force-ext; |
92 | reset-names = "miphy-sw-rst"; | 82 | reset-names = "miphy-sw-rst"; |
@@ -95,13 +85,12 @@ example: | |||
95 | 85 | ||
96 | phy_port2: port@8f95000 { | 86 | phy_port2: port@8f95000 { |
97 | reg = <0x8f95000 0xff>, | 87 | reg = <0x8f95000 0xff>, |
98 | <0x8f90000 0xff>, | 88 | <0x8f90000 0xff>; |
99 | <0x11c 0x4>, | ||
100 | <0x820 0x4>; | ||
101 | reg-names = "pipew", | 89 | reg-names = "pipew", |
102 | "usb3-up", | 90 | "usb3-up"; |
103 | "miphy-ctrl-glue", | 91 | |
104 | "miphy-status-glue"; | 92 | st,syscfg = <0x11c 0x820>; |
93 | |||
105 | #phy-cells = <1>; | 94 | #phy-cells = <1>; |
106 | reset-names = "miphy-sw-rst"; | 95 | reset-names = "miphy-sw-rst"; |
107 | resets = <&softreset STIH407_MIPHY2_SOFTRESET>; | 96 | resets = <&softreset STIH407_MIPHY2_SOFTRESET>; |
@@ -125,4 +114,4 @@ example: | |||
125 | 114 | ||
126 | Macro definitions for the supported miphy configuration can be found in: | 115 | Macro definitions for the supported miphy configuration can be found in: |
127 | 116 | ||
128 | include/dt-bindings/phy/phy-miphy28lp.h | 117 | include/dt-bindings/phy/phy.h |
diff --git a/Documentation/devicetree/bindings/phy/rockchip-usb-phy.txt b/Documentation/devicetree/bindings/phy/rockchip-usb-phy.txt new file mode 100644 index 000000000000..826454ac43bb --- /dev/null +++ b/Documentation/devicetree/bindings/phy/rockchip-usb-phy.txt | |||
@@ -0,0 +1,37 @@ | |||
1 | ROCKCHIP USB2 PHY | ||
2 | |||
3 | Required properties: | ||
4 | - compatible: rockchip,rk3288-usb-phy | ||
5 | - rockchip,grf : phandle to the syscon managing the "general | ||
6 | register files" | ||
7 | - #address-cells: should be 1 | ||
8 | - #size-cells: should be 0 | ||
9 | |||
10 | Sub-nodes: | ||
11 | Each PHY should be represented as a sub-node. | ||
12 | |||
13 | Sub-nodes | ||
14 | required properties: | ||
15 | - #phy-cells: should be 0 | ||
16 | - reg: PHY configure reg address offset in GRF | ||
17 | "0x320" - for PHY attach to OTG controller | ||
18 | "0x334" - for PHY attach to HOST0 controller | ||
19 | "0x348" - for PHY attach to HOST1 controller | ||
20 | |||
21 | Optional Properties: | ||
22 | - clocks : phandle + clock specifier for the phy clocks | ||
23 | - clock-names: string, clock name, must be "phyclk" | ||
24 | |||
25 | Example: | ||
26 | |||
27 | usbphy: phy { | ||
28 | compatible = "rockchip,rk3288-usb-phy"; | ||
29 | rockchip,grf = <&grf>; | ||
30 | #address-cells = <1>; | ||
31 | #size-cells = <0>; | ||
32 | |||
33 | usbphy0: usb-phy0 { | ||
34 | #phy-cells = <0>; | ||
35 | reg = <0x320>; | ||
36 | }; | ||
37 | }; | ||
diff --git a/Documentation/devicetree/bindings/phy/samsung-phy.txt b/Documentation/devicetree/bindings/phy/samsung-phy.txt index d5bad920827f..91e38cfe1f8f 100644 --- a/Documentation/devicetree/bindings/phy/samsung-phy.txt +++ b/Documentation/devicetree/bindings/phy/samsung-phy.txt | |||
@@ -3,8 +3,8 @@ Samsung S5P/EXYNOS SoC series MIPI CSIS/DSIM DPHY | |||
3 | 3 | ||
4 | Required properties: | 4 | Required properties: |
5 | - compatible : should be "samsung,s5pv210-mipi-video-phy"; | 5 | - compatible : should be "samsung,s5pv210-mipi-video-phy"; |
6 | - reg : offset and length of the MIPI DPHY register set; | ||
7 | - #phy-cells : from the generic phy bindings, must be 1; | 6 | - #phy-cells : from the generic phy bindings, must be 1; |
7 | - syscon - phandle to the PMU system controller; | ||
8 | 8 | ||
9 | For "samsung,s5pv210-mipi-video-phy" compatible PHYs the second cell in | 9 | For "samsung,s5pv210-mipi-video-phy" compatible PHYs the second cell in |
10 | the PHY specifier identifies the PHY and its meaning is as follows: | 10 | the PHY specifier identifies the PHY and its meaning is as follows: |
diff --git a/Documentation/devicetree/bindings/usb/atmel-usb.txt b/Documentation/devicetree/bindings/usb/atmel-usb.txt index bc2222ca3f2a..38fee0f66c12 100644 --- a/Documentation/devicetree/bindings/usb/atmel-usb.txt +++ b/Documentation/devicetree/bindings/usb/atmel-usb.txt | |||
@@ -51,7 +51,10 @@ usb1: gadget@fffa4000 { | |||
51 | Atmel High-Speed USB device controller | 51 | Atmel High-Speed USB device controller |
52 | 52 | ||
53 | Required properties: | 53 | Required properties: |
54 | - compatible: Should be "atmel,at91sam9rl-udc" | 54 | - compatible: Should be one of the following |
55 | "at91sam9rl-udc" | ||
56 | "at91sam9g45-udc" | ||
57 | "sama5d3-udc" | ||
55 | - reg: Address and length of the register set for the device | 58 | - reg: Address and length of the register set for the device |
56 | - interrupts: Should contain usba interrupt | 59 | - interrupts: Should contain usba interrupt |
57 | - ep childnode: To specify the number of endpoints and their properties. | 60 | - ep childnode: To specify the number of endpoints and their properties. |
diff --git a/Documentation/devicetree/bindings/usb/dwc2.txt b/Documentation/devicetree/bindings/usb/dwc2.txt index 482f815363ef..fd132cbee70e 100644 --- a/Documentation/devicetree/bindings/usb/dwc2.txt +++ b/Documentation/devicetree/bindings/usb/dwc2.txt | |||
@@ -20,6 +20,10 @@ Optional properties: | |||
20 | Refer to phy/phy-bindings.txt for generic phy consumer properties | 20 | Refer to phy/phy-bindings.txt for generic phy consumer properties |
21 | - dr_mode: shall be one of "host", "peripheral" and "otg" | 21 | - dr_mode: shall be one of "host", "peripheral" and "otg" |
22 | Refer to usb/generic.txt | 22 | Refer to usb/generic.txt |
23 | - g-use-dma: enable dma usage in gadget driver. | ||
24 | - g-rx-fifo-size: size of rx fifo size in gadget mode. | ||
25 | - g-np-tx-fifo-size: size of non-periodic tx fifo size in gadget mode. | ||
26 | - g-tx-fifo-size: size of periodic tx fifo per endpoint (except ep0) in gadget mode. | ||
23 | 27 | ||
24 | Example: | 28 | Example: |
25 | 29 | ||
diff --git a/Documentation/devicetree/bindings/usb/renesas_usbhs.txt b/Documentation/devicetree/bindings/usb/renesas_usbhs.txt index b08c903f8668..61b045b6d50e 100644 --- a/Documentation/devicetree/bindings/usb/renesas_usbhs.txt +++ b/Documentation/devicetree/bindings/usb/renesas_usbhs.txt | |||
@@ -14,6 +14,8 @@ Optional properties: | |||
14 | function should be enabled | 14 | function should be enabled |
15 | - phys: phandle + phy specifier pair | 15 | - phys: phandle + phy specifier pair |
16 | - phy-names: must be "usb" | 16 | - phy-names: must be "usb" |
17 | - dmas: Must contain a list of references to DMA specifiers. | ||
18 | - dma-names : Must contain a list of DMA names, "tx" or "rx". | ||
17 | 19 | ||
18 | Example: | 20 | Example: |
19 | usbhs: usb@e6590000 { | 21 | usbhs: usb@e6590000 { |
diff --git a/Documentation/devicetree/bindings/usb/usb-ehci.txt b/Documentation/devicetree/bindings/usb/usb-ehci.txt index 43c1a4e06767..0b04fdff9d5a 100644 --- a/Documentation/devicetree/bindings/usb/usb-ehci.txt +++ b/Documentation/devicetree/bindings/usb/usb-ehci.txt | |||
@@ -12,6 +12,7 @@ Optional properties: | |||
12 | - big-endian-regs : boolean, set this for hcds with big-endian registers | 12 | - big-endian-regs : boolean, set this for hcds with big-endian registers |
13 | - big-endian-desc : boolean, set this for hcds with big-endian descriptors | 13 | - big-endian-desc : boolean, set this for hcds with big-endian descriptors |
14 | - big-endian : boolean, for hcds with big-endian-regs + big-endian-desc | 14 | - big-endian : boolean, for hcds with big-endian-regs + big-endian-desc |
15 | - needs-reset-on-resume : boolean, set this to force EHCI reset after resume | ||
15 | - clocks : a list of phandle + clock specifier pairs | 16 | - clocks : a list of phandle + clock specifier pairs |
16 | - phys : phandle + phy specifier pair | 17 | - phys : phandle + phy specifier pair |
17 | - phy-names : "usb" | 18 | - phy-names : "usb" |
diff --git a/Documentation/devicetree/bindings/usb/usb-nop-xceiv.txt b/Documentation/devicetree/bindings/usb/usb-nop-xceiv.txt index 1bd37faba05b..5be01c859b7a 100644 --- a/Documentation/devicetree/bindings/usb/usb-nop-xceiv.txt +++ b/Documentation/devicetree/bindings/usb/usb-nop-xceiv.txt | |||
@@ -13,10 +13,15 @@ Optional properties: | |||
13 | - clock-frequency: the clock frequency (in Hz) that the PHY clock must | 13 | - clock-frequency: the clock frequency (in Hz) that the PHY clock must |
14 | be configured to. | 14 | be configured to. |
15 | 15 | ||
16 | - vcc-supply: phandle to the regulator that provides RESET to the PHY. | 16 | - vcc-supply: phandle to the regulator that provides power to the PHY. |
17 | 17 | ||
18 | - reset-gpios: Should specify the GPIO for reset. | 18 | - reset-gpios: Should specify the GPIO for reset. |
19 | 19 | ||
20 | - vbus-detect-gpio: should specify the GPIO detecting a VBus insertion | ||
21 | (see Documentation/devicetree/bindings/gpio/gpio.txt) | ||
22 | - vbus-regulator : should specifiy the regulator supplying current drawn from | ||
23 | the VBus line (see Documentation/devicetree/bindings/regulator/regulator.txt). | ||
24 | |||
20 | Example: | 25 | Example: |
21 | 26 | ||
22 | hsusb1_phy { | 27 | hsusb1_phy { |
@@ -26,8 +31,11 @@ Example: | |||
26 | clock-names = "main_clk"; | 31 | clock-names = "main_clk"; |
27 | vcc-supply = <&hsusb1_vcc_regulator>; | 32 | vcc-supply = <&hsusb1_vcc_regulator>; |
28 | reset-gpios = <&gpio1 7 GPIO_ACTIVE_LOW>; | 33 | reset-gpios = <&gpio1 7 GPIO_ACTIVE_LOW>; |
34 | vbus-detect-gpio = <&gpio2 13 GPIO_ACTIVE_HIGH>; | ||
35 | vbus-regulator = <&vbus_regulator>; | ||
29 | }; | 36 | }; |
30 | 37 | ||
31 | hsusb1_phy is a NOP USB PHY device that gets its clock from an oscillator | 38 | hsusb1_phy is a NOP USB PHY device that gets its clock from an oscillator |
32 | and expects that clock to be configured to 19.2MHz by the NOP PHY driver. | 39 | and expects that clock to be configured to 19.2MHz by the NOP PHY driver. |
33 | hsusb1_vcc_regulator provides power to the PHY and GPIO 7 controls RESET. | 40 | hsusb1_vcc_regulator provides power to the PHY and GPIO 7 controls RESET. |
41 | GPIO 13 detects VBus insertion, and accordingly notifies the vbus-regulator. | ||
diff --git a/Documentation/usb/gadget-testing.txt b/Documentation/usb/gadget-testing.txt new file mode 100644 index 000000000000..076ac7ba7f93 --- /dev/null +++ b/Documentation/usb/gadget-testing.txt | |||
@@ -0,0 +1,728 @@ | |||
1 | This file summarizes information on basic testing of USB functions | ||
2 | provided by gadgets. | ||
3 | |||
4 | 1. ACM function | ||
5 | 2. ECM function | ||
6 | 3. ECM subset function | ||
7 | 4. EEM function | ||
8 | 5. FFS function | ||
9 | 6. HID function | ||
10 | 7. LOOPBACK function | ||
11 | 8. MASS STORAGE function | ||
12 | 9. MIDI function | ||
13 | 10. NCM function | ||
14 | 11. OBEX function | ||
15 | 12. PHONET function | ||
16 | 13. RNDIS function | ||
17 | 14. SERIAL function | ||
18 | 15. SOURCESINK function | ||
19 | 16. UAC1 function | ||
20 | 17. UAC2 function | ||
21 | 18. UVC function | ||
22 | |||
23 | |||
24 | 1. ACM function | ||
25 | =============== | ||
26 | |||
27 | The function is provided by usb_f_acm.ko module. | ||
28 | |||
29 | Function-specific configfs interface | ||
30 | ------------------------------------ | ||
31 | |||
32 | The function name to use when creating the function directory is "acm". | ||
33 | The ACM function provides just one attribute in its function directory: | ||
34 | |||
35 | port_num | ||
36 | |||
37 | The attribute is read-only. | ||
38 | |||
39 | There can be at most 4 ACM/generic serial/OBEX ports in the system. | ||
40 | |||
41 | |||
42 | Testing the ACM function | ||
43 | ------------------------ | ||
44 | |||
45 | On the host: cat > /dev/ttyACM<X> | ||
46 | On the device : cat /dev/ttyGS<Y> | ||
47 | |||
48 | then the other way round | ||
49 | |||
50 | On the device: cat > /dev/ttyGS<Y> | ||
51 | On the host: cat /dev/ttyACM<X> | ||
52 | |||
53 | 2. ECM function | ||
54 | =============== | ||
55 | |||
56 | The function is provided by usb_f_ecm.ko module. | ||
57 | |||
58 | Function-specific configfs interface | ||
59 | ------------------------------------ | ||
60 | |||
61 | The function name to use when creating the function directory is "ecm". | ||
62 | The ECM function provides these attributes in its function directory: | ||
63 | |||
64 | ifname - network device interface name associated with this | ||
65 | function instance | ||
66 | qmult - queue length multiplier for high and super speed | ||
67 | host_addr - MAC address of host's end of this | ||
68 | Ethernet over USB link | ||
69 | dev_addr - MAC address of device's end of this | ||
70 | Ethernet over USB link | ||
71 | |||
72 | and after creating the functions/ecm.<instance name> they contain default | ||
73 | values: qmult is 5, dev_addr and host_addr are randomly selected. | ||
74 | Except for ifname they can be written to until the function is linked to a | ||
75 | configuration. The ifname is read-only and contains the name of the interface | ||
76 | which was assigned by the net core, e. g. usb0. | ||
77 | |||
78 | Testing the ECM function | ||
79 | ------------------------ | ||
80 | |||
81 | Configure IP addresses of the device and the host. Then: | ||
82 | |||
83 | On the device: ping <host's IP> | ||
84 | On the host: ping <device's IP> | ||
85 | |||
86 | 3. ECM subset function | ||
87 | ====================== | ||
88 | |||
89 | The function is provided by usb_f_ecm_subset.ko module. | ||
90 | |||
91 | Function-specific configfs interface | ||
92 | ------------------------------------ | ||
93 | |||
94 | The function name to use when creating the function directory is "geth". | ||
95 | The ECM subset function provides these attributes in its function directory: | ||
96 | |||
97 | ifname - network device interface name associated with this | ||
98 | function instance | ||
99 | qmult - queue length multiplier for high and super speed | ||
100 | host_addr - MAC address of host's end of this | ||
101 | Ethernet over USB link | ||
102 | dev_addr - MAC address of device's end of this | ||
103 | Ethernet over USB link | ||
104 | |||
105 | and after creating the functions/ecm.<instance name> they contain default | ||
106 | values: qmult is 5, dev_addr and host_addr are randomly selected. | ||
107 | Except for ifname they can be written to until the function is linked to a | ||
108 | configuration. The ifname is read-only and contains the name of the interface | ||
109 | which was assigned by the net core, e. g. usb0. | ||
110 | |||
111 | Testing the ECM subset function | ||
112 | ------------------------------- | ||
113 | |||
114 | Configure IP addresses of the device and the host. Then: | ||
115 | |||
116 | On the device: ping <host's IP> | ||
117 | On the host: ping <device's IP> | ||
118 | |||
119 | 4. EEM function | ||
120 | =============== | ||
121 | |||
122 | The function is provided by usb_f_eem.ko module. | ||
123 | |||
124 | Function-specific configfs interface | ||
125 | ------------------------------------ | ||
126 | |||
127 | The function name to use when creating the function directory is "eem". | ||
128 | The EEM function provides these attributes in its function directory: | ||
129 | |||
130 | ifname - network device interface name associated with this | ||
131 | function instance | ||
132 | qmult - queue length multiplier for high and super speed | ||
133 | host_addr - MAC address of host's end of this | ||
134 | Ethernet over USB link | ||
135 | dev_addr - MAC address of device's end of this | ||
136 | Ethernet over USB link | ||
137 | |||
138 | and after creating the functions/eem.<instance name> they contain default | ||
139 | values: qmult is 5, dev_addr and host_addr are randomly selected. | ||
140 | Except for ifname they can be written to until the function is linked to a | ||
141 | configuration. The ifname is read-only and contains the name of the interface | ||
142 | which was assigned by the net core, e. g. usb0. | ||
143 | |||
144 | Testing the EEM function | ||
145 | ------------------------ | ||
146 | |||
147 | Configure IP addresses of the device and the host. Then: | ||
148 | |||
149 | On the device: ping <host's IP> | ||
150 | On the host: ping <device's IP> | ||
151 | |||
152 | 5. FFS function | ||
153 | =============== | ||
154 | |||
155 | The function is provided by usb_f_fs.ko module. | ||
156 | |||
157 | Function-specific configfs interface | ||
158 | ------------------------------------ | ||
159 | |||
160 | The function name to use when creating the function directory is "ffs". | ||
161 | The function directory is intentionally empty and not modifiable. | ||
162 | |||
163 | After creating the directory there is a new instance (a "device") of FunctionFS | ||
164 | available in the system. Once a "device" is available, the user should follow | ||
165 | the standard procedure for using FunctionFS (mount it, run the userspace | ||
166 | process which implements the function proper). The gadget should be enabled | ||
167 | by writing a suitable string to usb_gadget/<gadget>/UDC. | ||
168 | |||
169 | Testing the FFS function | ||
170 | ------------------------ | ||
171 | |||
172 | On the device: start the function's userspace daemon, enable the gadget | ||
173 | On the host: use the USB function provided by the device | ||
174 | |||
175 | 6. HID function | ||
176 | =============== | ||
177 | |||
178 | The function is provided by usb_f_hid.ko module. | ||
179 | |||
180 | Function-specific configfs interface | ||
181 | ------------------------------------ | ||
182 | |||
183 | The function name to use when creating the function directory is "hid". | ||
184 | The HID function provides these attributes in its function directory: | ||
185 | |||
186 | protocol - HID protocol to use | ||
187 | report_desc - data to be used in HID reports, except data | ||
188 | passed with /dev/hidg<X> | ||
189 | report_length - HID report length | ||
190 | subclass - HID subclass to use | ||
191 | |||
192 | For a keyboard the protocol and the subclass are 1, the report_length is 8, | ||
193 | while the report_desc is: | ||
194 | |||
195 | $ hd my_report_desc | ||
196 | 00000000 05 01 09 06 a1 01 05 07 19 e0 29 e7 15 00 25 01 |..........)...%.| | ||
197 | 00000010 75 01 95 08 81 02 95 01 75 08 81 03 95 05 75 01 |u.......u.....u.| | ||
198 | 00000020 05 08 19 01 29 05 91 02 95 01 75 03 91 03 95 06 |....).....u.....| | ||
199 | 00000030 75 08 15 00 25 65 05 07 19 00 29 65 81 00 c0 |u...%e....)e...| | ||
200 | 0000003f | ||
201 | |||
202 | Such a sequence of bytes can be stored to the attribute with echo: | ||
203 | |||
204 | $ echo -ne \\x05\\x01\\x09\\x06\\xa1..... | ||
205 | |||
206 | Testing the HID function | ||
207 | ------------------------ | ||
208 | |||
209 | Device: | ||
210 | - create the gadget | ||
211 | - connect the gadget to a host, preferably not the one used | ||
212 | to control the gadget | ||
213 | - run a program which writes to /dev/hidg<N>, e.g. | ||
214 | a userspace program found in Documentation/usb/gadget_hid.txt: | ||
215 | |||
216 | $ ./hid_gadget_test /dev/hidg0 keyboard | ||
217 | |||
218 | Host: | ||
219 | - observe the keystrokes from the gadget | ||
220 | |||
221 | 7. LOOPBACK function | ||
222 | ==================== | ||
223 | |||
224 | The function is provided by usb_f_ss_lb.ko module. | ||
225 | |||
226 | Function-specific configfs interface | ||
227 | ------------------------------------ | ||
228 | |||
229 | The function name to use when creating the function directory is "Loopback". | ||
230 | The LOOPBACK function provides these attributes in its function directory: | ||
231 | |||
232 | qlen - depth of loopback queue | ||
233 | bulk_buflen - buffer length | ||
234 | |||
235 | Testing the LOOPBACK function | ||
236 | ----------------------------- | ||
237 | |||
238 | device: run the gadget | ||
239 | host: test-usb | ||
240 | |||
241 | http://www.linux-usb.org/usbtest/testusb.c | ||
242 | |||
243 | 8. MASS STORAGE function | ||
244 | ======================== | ||
245 | |||
246 | The function is provided by usb_f_mass_storage.ko module. | ||
247 | |||
248 | Function-specific configfs interface | ||
249 | ------------------------------------ | ||
250 | |||
251 | The function name to use when creating the function directory is "mass_storage". | ||
252 | The MASS STORAGE function provides these attributes in its directory: | ||
253 | files: | ||
254 | |||
255 | stall - Set to permit function to halt bulk endpoints. | ||
256 | Disabled on some USB devices known not to work | ||
257 | correctly. You should set it to true. | ||
258 | num_buffers - Number of pipeline buffers. Valid numbers | ||
259 | are 2..4. Available only if | ||
260 | CONFIG_USB_GADGET_DEBUG_FILES is set. | ||
261 | |||
262 | and a default lun.0 directory corresponding to SCSI LUN #0. | ||
263 | |||
264 | A new lun can be added with mkdir: | ||
265 | |||
266 | $ mkdir functions/mass_storage.0/partition.5 | ||
267 | |||
268 | Lun numbering does not have to be continuous, except for lun #0 which is | ||
269 | created by default. A maximum of 8 luns can be specified and they all must be | ||
270 | named following the <name>.<number> scheme. The numbers can be 0..8. | ||
271 | Probably a good convention is to name the luns "lun.<number>", | ||
272 | although it is not mandatory. | ||
273 | |||
274 | In each lun directory there are the following attribute files: | ||
275 | |||
276 | file - The path to the backing file for the LUN. | ||
277 | Required if LUN is not marked as removable. | ||
278 | ro - Flag specifying access to the LUN shall be | ||
279 | read-only. This is implied if CD-ROM emulation | ||
280 | is enabled as well as when it was impossible | ||
281 | to open "filename" in R/W mode. | ||
282 | removable - Flag specifying that LUN shall be indicated as | ||
283 | being removable. | ||
284 | cdrom - Flag specifying that LUN shall be reported as | ||
285 | being a CD-ROM. | ||
286 | nofua - Flag specifying that FUA flag | ||
287 | in SCSI WRITE(10,12) | ||
288 | |||
289 | Testing the MASS STORAGE function | ||
290 | --------------------------------- | ||
291 | |||
292 | device: connect the gadget, enable it | ||
293 | host: dmesg, see the USB drives appear (if system configured to automatically | ||
294 | mount) | ||
295 | |||
296 | 9. MIDI function | ||
297 | ================ | ||
298 | |||
299 | The function is provided by usb_f_midi.ko module. | ||
300 | |||
301 | Function-specific configfs interface | ||
302 | ------------------------------------ | ||
303 | |||
304 | The function name to use when creating the function directory is "midi". | ||
305 | The MIDI function provides these attributes in its function directory: | ||
306 | |||
307 | buflen - MIDI buffer length | ||
308 | id - ID string for the USB MIDI adapter | ||
309 | in_ports - number of MIDI input ports | ||
310 | index - index value for the USB MIDI adapter | ||
311 | out_ports - number of MIDI output ports | ||
312 | qlen - USB read request queue length | ||
313 | |||
314 | Testing the MIDI function | ||
315 | ------------------------- | ||
316 | |||
317 | There are two cases: playing a mid from the gadget to | ||
318 | the host and playing a mid from the host to the gadget. | ||
319 | |||
320 | 1) Playing a mid from the gadget to the host | ||
321 | host) | ||
322 | |||
323 | $ arecordmidi -l | ||
324 | Port Client name Port name | ||
325 | 14:0 Midi Through Midi Through Port-0 | ||
326 | 24:0 MIDI Gadget MIDI Gadget MIDI 1 | ||
327 | $ arecordmidi -p 24:0 from_gadget.mid | ||
328 | |||
329 | gadget) | ||
330 | |||
331 | $ aplaymidi -l | ||
332 | Port Client name Port name | ||
333 | 20:0 f_midi f_midi | ||
334 | |||
335 | $ aplaymidi -p 20:0 to_host.mid | ||
336 | |||
337 | 2) Playing a mid from the host to the gadget | ||
338 | gadget) | ||
339 | |||
340 | $ arecordmidi -l | ||
341 | Port Client name Port name | ||
342 | 20:0 f_midi f_midi | ||
343 | |||
344 | $ arecordmidi -p 20:0 from_host.mid | ||
345 | |||
346 | host) | ||
347 | |||
348 | $ aplaymidi -l | ||
349 | Port Client name Port name | ||
350 | 14:0 Midi Through Midi Through Port-0 | ||
351 | 24:0 MIDI Gadget MIDI Gadget MIDI 1 | ||
352 | |||
353 | $ aplaymidi -p24:0 to_gadget.mid | ||
354 | |||
355 | The from_gadget.mid should sound identical to the to_host.mid. | ||
356 | The from_host.id should sound identical to the to_gadget.mid. | ||
357 | |||
358 | MIDI files can be played to speakers/headphones with e.g. timidity installed | ||
359 | |||
360 | $ aplaymidi -l | ||
361 | Port Client name Port name | ||
362 | 14:0 Midi Through Midi Through Port-0 | ||
363 | 24:0 MIDI Gadget MIDI Gadget MIDI 1 | ||
364 | 128:0 TiMidity TiMidity port 0 | ||
365 | 128:1 TiMidity TiMidity port 1 | ||
366 | 128:2 TiMidity TiMidity port 2 | ||
367 | 128:3 TiMidity TiMidity port 3 | ||
368 | |||
369 | $ aplaymidi -p 128:0 file.mid | ||
370 | |||
371 | MIDI ports can be logically connected using the aconnect utility, e.g.: | ||
372 | |||
373 | $ aconnect 24:0 128:0 # try it on the host | ||
374 | |||
375 | After the gadget's MIDI port is connected to timidity's MIDI port, | ||
376 | whatever is played at the gadget side with aplaymidi -l is audible | ||
377 | in host's speakers/headphones. | ||
378 | |||
379 | 10. NCM function | ||
380 | ================ | ||
381 | |||
382 | The function is provided by usb_f_ncm.ko module. | ||
383 | |||
384 | Function-specific configfs interface | ||
385 | ------------------------------------ | ||
386 | |||
387 | The function name to use when creating the function directory is "ncm". | ||
388 | The NCM function provides these attributes in its function directory: | ||
389 | |||
390 | ifname - network device interface name associated with this | ||
391 | function instance | ||
392 | qmult - queue length multiplier for high and super speed | ||
393 | host_addr - MAC address of host's end of this | ||
394 | Ethernet over USB link | ||
395 | dev_addr - MAC address of device's end of this | ||
396 | Ethernet over USB link | ||
397 | |||
398 | and after creating the functions/ncm.<instance name> they contain default | ||
399 | values: qmult is 5, dev_addr and host_addr are randomly selected. | ||
400 | Except for ifname they can be written to until the function is linked to a | ||
401 | configuration. The ifname is read-only and contains the name of the interface | ||
402 | which was assigned by the net core, e. g. usb0. | ||
403 | |||
404 | Testing the NCM function | ||
405 | ------------------------ | ||
406 | |||
407 | Configure IP addresses of the device and the host. Then: | ||
408 | |||
409 | On the device: ping <host's IP> | ||
410 | On the host: ping <device's IP> | ||
411 | |||
412 | 11. OBEX function | ||
413 | ================= | ||
414 | |||
415 | The function is provided by usb_f_obex.ko module. | ||
416 | |||
417 | Function-specific configfs interface | ||
418 | ------------------------------------ | ||
419 | |||
420 | The function name to use when creating the function directory is "obex". | ||
421 | The OBEX function provides just one attribute in its function directory: | ||
422 | |||
423 | port_num | ||
424 | |||
425 | The attribute is read-only. | ||
426 | |||
427 | There can be at most 4 ACM/generic serial/OBEX ports in the system. | ||
428 | |||
429 | Testing the OBEX function | ||
430 | ------------------------- | ||
431 | |||
432 | On device: seriald -f /dev/ttyGS<Y> -s 1024 | ||
433 | On host: serialc -v <vendorID> -p <productID> -i<interface#> -a1 -s1024 \ | ||
434 | -t<out endpoint addr> -r<in endpoint addr> | ||
435 | |||
436 | where seriald and serialc are Felipe's utilities found here: | ||
437 | |||
438 | https://git.gitorious.org/usb/usb-tools.git master | ||
439 | |||
440 | 12. PHONET function | ||
441 | =================== | ||
442 | |||
443 | The function is provided by usb_f_phonet.ko module. | ||
444 | |||
445 | Function-specific configfs interface | ||
446 | ------------------------------------ | ||
447 | |||
448 | The function name to use when creating the function directory is "phonet". | ||
449 | The PHONET function provides just one attribute in its function directory: | ||
450 | |||
451 | ifname - network device interface name associated with this | ||
452 | function instance | ||
453 | |||
454 | Testing the PHONET function | ||
455 | --------------------------- | ||
456 | |||
457 | It is not possible to test the SOCK_STREAM protocol without a specific piece | ||
458 | of hardware, so only SOCK_DGRAM has been tested. For the latter to work, | ||
459 | in the past I had to apply the patch mentioned here: | ||
460 | |||
461 | http://www.spinics.net/lists/linux-usb/msg85689.html | ||
462 | |||
463 | These tools are required: | ||
464 | |||
465 | git://git.gitorious.org/meego-cellular/phonet-utils.git | ||
466 | |||
467 | On the host: | ||
468 | |||
469 | $ ./phonet -a 0x10 -i usbpn0 | ||
470 | $ ./pnroute add 0x6c usbpn0 | ||
471 | $./pnroute add 0x10 usbpn0 | ||
472 | $ ifconfig usbpn0 up | ||
473 | |||
474 | On the device: | ||
475 | |||
476 | $ ./phonet -a 0x6c -i upnlink0 | ||
477 | $ ./pnroute add 0x10 upnlink0 | ||
478 | $ ifconfig upnlink0 up | ||
479 | |||
480 | Then a test program can be used: | ||
481 | |||
482 | http://www.spinics.net/lists/linux-usb/msg85690.html | ||
483 | |||
484 | On the device: | ||
485 | |||
486 | $ ./pnxmit -a 0x6c -r | ||
487 | |||
488 | On the host: | ||
489 | |||
490 | $ ./pnxmit -a 0x10 -s 0x6c | ||
491 | |||
492 | As a result some data should be sent from host to device. | ||
493 | Then the other way round: | ||
494 | |||
495 | On the host: | ||
496 | |||
497 | $ ./pnxmit -a 0x10 -r | ||
498 | |||
499 | On the device: | ||
500 | |||
501 | $ ./pnxmit -a 0x6c -s 0x10 | ||
502 | |||
503 | 13. RNDIS function | ||
504 | ================== | ||
505 | |||
506 | The function is provided by usb_f_rndis.ko module. | ||
507 | |||
508 | Function-specific configfs interface | ||
509 | ------------------------------------ | ||
510 | |||
511 | The function name to use when creating the function directory is "rndis". | ||
512 | The RNDIS function provides these attributes in its function directory: | ||
513 | |||
514 | ifname - network device interface name associated with this | ||
515 | function instance | ||
516 | qmult - queue length multiplier for high and super speed | ||
517 | host_addr - MAC address of host's end of this | ||
518 | Ethernet over USB link | ||
519 | dev_addr - MAC address of device's end of this | ||
520 | Ethernet over USB link | ||
521 | |||
522 | and after creating the functions/rndis.<instance name> they contain default | ||
523 | values: qmult is 5, dev_addr and host_addr are randomly selected. | ||
524 | Except for ifname they can be written to until the function is linked to a | ||
525 | configuration. The ifname is read-only and contains the name of the interface | ||
526 | which was assigned by the net core, e. g. usb0. | ||
527 | |||
528 | By default there can be only 1 RNDIS interface in the system. | ||
529 | |||
530 | Testing the RNDIS function | ||
531 | -------------------------- | ||
532 | |||
533 | Configure IP addresses of the device and the host. Then: | ||
534 | |||
535 | On the device: ping <host's IP> | ||
536 | On the host: ping <device's IP> | ||
537 | |||
538 | 14. SERIAL function | ||
539 | =================== | ||
540 | |||
541 | The function is provided by usb_f_gser.ko module. | ||
542 | |||
543 | Function-specific configfs interface | ||
544 | ------------------------------------ | ||
545 | |||
546 | The function name to use when creating the function directory is "gser". | ||
547 | The SERIAL function provides just one attribute in its function directory: | ||
548 | |||
549 | port_num | ||
550 | |||
551 | The attribute is read-only. | ||
552 | |||
553 | There can be at most 4 ACM/generic serial/OBEX ports in the system. | ||
554 | |||
555 | Testing the SERIAL function | ||
556 | --------------------------- | ||
557 | |||
558 | On host: insmod usbserial | ||
559 | echo VID PID >/sys/bus/usb-serial/drivers/generic/new_id | ||
560 | On host: cat > /dev/ttyUSB<X> | ||
561 | On target: cat /dev/ttyGS<Y> | ||
562 | |||
563 | then the other way round | ||
564 | |||
565 | On target: cat > /dev/ttyGS<Y> | ||
566 | On host: cat /dev/ttyUSB<X> | ||
567 | |||
568 | 15. SOURCESINK function | ||
569 | ======================= | ||
570 | |||
571 | The function is provided by usb_f_ss_lb.ko module. | ||
572 | |||
573 | Function-specific configfs interface | ||
574 | ------------------------------------ | ||
575 | |||
576 | The function name to use when creating the function directory is "SourceSink". | ||
577 | The SOURCESINK function provides these attributes in its function directory: | ||
578 | |||
579 | pattern - 0 (all zeros), 1 (mod63), 2 (none) | ||
580 | isoc_interval - 1..16 | ||
581 | isoc_maxpacket - 0 - 1023 (fs), 0 - 1024 (hs/ss) | ||
582 | isoc_mult - 0..2 (hs/ss only) | ||
583 | isoc_maxburst - 0..15 (ss only) | ||
584 | bulk_buflen - buffer length | ||
585 | |||
586 | Testing the SOURCESINK function | ||
587 | ------------------------------- | ||
588 | |||
589 | device: run the gadget | ||
590 | host: test-usb | ||
591 | |||
592 | http://www.linux-usb.org/usbtest/testusb.c | ||
593 | |||
594 | 16. UAC1 function | ||
595 | ================= | ||
596 | |||
597 | The function is provided by usb_f_uac1.ko module. | ||
598 | |||
599 | Function-specific configfs interface | ||
600 | ------------------------------------ | ||
601 | |||
602 | The function name to use when creating the function directory is "uac1". | ||
603 | The uac1 function provides these attributes in its function directory: | ||
604 | |||
605 | audio_buf_size - audio buffer size | ||
606 | fn_cap - capture pcm device file name | ||
607 | fn_cntl - control device file name | ||
608 | fn_play - playback pcm device file name | ||
609 | req_buf_size - ISO OUT endpoint request buffer size | ||
610 | req_count - ISO OUT endpoint request count | ||
611 | |||
612 | The attributes have sane default values. | ||
613 | |||
614 | Testing the UAC1 function | ||
615 | ------------------------- | ||
616 | |||
617 | device: run the gadget | ||
618 | host: aplay -l # should list our USB Audio Gadget | ||
619 | |||
620 | 17. UAC2 function | ||
621 | ================= | ||
622 | |||
623 | The function is provided by usb_f_uac2.ko module. | ||
624 | |||
625 | Function-specific configfs interface | ||
626 | ------------------------------------ | ||
627 | |||
628 | The function name to use when creating the function directory is "uac2". | ||
629 | The uac2 function provides these attributes in its function directory: | ||
630 | |||
631 | chmask - capture channel mask | ||
632 | c_srate - capture sampling rate | ||
633 | c_ssize - capture sample size (bytes) | ||
634 | p_chmask - playback channel mask | ||
635 | p_srate - playback sampling rate | ||
636 | p_ssize - playback sample size (bytes) | ||
637 | |||
638 | The attributes have sane default values. | ||
639 | |||
640 | Testing the UAC2 function | ||
641 | ------------------------- | ||
642 | |||
643 | device: run the gadget | ||
644 | host: aplay -l # should list our USB Audio Gadget | ||
645 | |||
646 | This function does not require real hardware support, it just | ||
647 | sends a stream of audio data to/from the host. In order to | ||
648 | actually hear something at the device side, a command similar | ||
649 | to this must be used at the device side: | ||
650 | |||
651 | $ arecord -f dat -t wav -D hw:2,0 | aplay -D hw:0,0 & | ||
652 | |||
653 | e.g.: | ||
654 | |||
655 | $ arecord -f dat -t wav -D hw:CARD=UAC2Gadget,DEV=0 | \ | ||
656 | aplay -D default:CARD=OdroidU3 | ||
657 | |||
658 | 18. UVC function | ||
659 | ================ | ||
660 | |||
661 | The function is provided by usb_f_uvc.ko module. | ||
662 | |||
663 | Function-specific configfs interface | ||
664 | ------------------------------------ | ||
665 | |||
666 | The function name to use when creating the function directory is "uvc". | ||
667 | The uvc function provides these attributes in its function directory: | ||
668 | |||
669 | streaming_interval - interval for polling endpoint for data transfers | ||
670 | streaming_maxburst - bMaxBurst for super speed companion descriptor | ||
671 | streaming_maxpacket - maximum packet size this endpoint is capable of | ||
672 | sending or receiving when this configuration is | ||
673 | selected | ||
674 | |||
675 | There are also "control" and "streaming" subdirectories, each of which contain | ||
676 | a number of their subdirectories. There are some sane defaults provided, but | ||
677 | the user must provide the following: | ||
678 | |||
679 | control header - create in control/header, link from control/class/fs | ||
680 | and/or control/class/ss | ||
681 | streaming header - create in streaming/header, link from | ||
682 | streaming/class/fs and/or streaming/class/hs and/or | ||
683 | streaming/class/ss | ||
684 | format description - create in streaming/mjpeg and/or | ||
685 | streaming/uncompressed | ||
686 | frame description - create in streaming/mjpeg/<format> and/or in | ||
687 | streaming/uncompressed/<format> | ||
688 | |||
689 | Each frame description contains frame interval specification, and each | ||
690 | such specification consists of a number of lines with an inverval value | ||
691 | in each line. The rules stated above are best illustrated with an example: | ||
692 | |||
693 | # mkdir functions/uvc.usb0/control/header/h | ||
694 | # cd functions/uvc.usb0/control/header/h | ||
695 | # ln -s header/h class/fs | ||
696 | # ln -s header/h class/ss | ||
697 | # mkdir -p functions/uvc.usb0/streaming/uncompressed/u/360p | ||
698 | # cat <<EOF > functions/uvc.usb0/streaming/uncompressed/u/360p/dwFrameInterval | ||
699 | 666666 | ||
700 | 1000000 | ||
701 | 5000000 | ||
702 | EOF | ||
703 | # cd $GADGET_CONFIGFS_ROOT | ||
704 | # mkdir functions/uvc.usb0/streaming/header/h | ||
705 | # cd functions/uvc.usb0/streaming/header/h | ||
706 | # ln -s ../../uncompressed/u | ||
707 | # cd ../../class/fs | ||
708 | # ln -s ../../header/h | ||
709 | # cd ../../class/hs | ||
710 | # ln -s ../../header/h | ||
711 | # cd ../../class/ss | ||
712 | # ln -s ../../header/h | ||
713 | |||
714 | |||
715 | Testing the UVC function | ||
716 | ------------------------ | ||
717 | |||
718 | device: run the gadget, modprobe vivid | ||
719 | |||
720 | # uvc-gadget -u /dev/video<uvc video node #> -v /dev/video<vivid video node #> | ||
721 | |||
722 | where uvc-gadget is this program: | ||
723 | http://git.ideasonboard.org/uvc-gadget.git | ||
724 | |||
725 | with these patches: | ||
726 | http://www.spinics.net/lists/linux-usb/msg99220.html | ||
727 | |||
728 | host: luvcview -f yuv | ||
diff --git a/Documentation/usb/gadget_serial.txt b/Documentation/usb/gadget_serial.txt index 61e67f6a20a0..6b4a88a8c8e3 100644 --- a/Documentation/usb/gadget_serial.txt +++ b/Documentation/usb/gadget_serial.txt | |||
@@ -236,8 +236,12 @@ I: If#= 0 Alt= 0 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=serial | |||
236 | E: Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms | 236 | E: Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms |
237 | E: Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms | 237 | E: Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms |
238 | 238 | ||
239 | You must explicitly load the usbserial driver with parameters to | 239 | You must load the usbserial driver and explicitly set its parameters |
240 | configure it to recognize the gadget serial device, like this: | 240 | to configure it to recognize the gadget serial device, like this: |
241 | |||
242 | echo 0x0525 0xA4A6 >/sys/bus/usb-serial/drivers/generic/new_id | ||
243 | |||
244 | The legacy way is to use module parameters: | ||
241 | 245 | ||
242 | modprobe usbserial vendor=0x0525 product=0xA4A6 | 246 | modprobe usbserial vendor=0x0525 product=0xA4A6 |
243 | 247 | ||
diff --git a/Documentation/usb/usbmon.txt b/Documentation/usb/usbmon.txt index 7587d84ebd16..28425f736756 100644 --- a/Documentation/usb/usbmon.txt +++ b/Documentation/usb/usbmon.txt | |||
@@ -72,7 +72,7 @@ to listen on a single bus, otherwise, to listen on all buses, type: | |||
72 | 72 | ||
73 | # cat /sys/kernel/debug/usb/usbmon/0u > /tmp/1.mon.out | 73 | # cat /sys/kernel/debug/usb/usbmon/0u > /tmp/1.mon.out |
74 | 74 | ||
75 | This process will be reading until killed. Naturally, the output can be | 75 | This process will read until it is killed. Naturally, the output can be |
76 | redirected to a desirable location. This is preferred, because it is going | 76 | redirected to a desirable location. This is preferred, because it is going |
77 | to be quite long. | 77 | to be quite long. |
78 | 78 | ||