Skip to content

Commit 28ce553

Browse files
Heikki Krogerusgregkh
authored andcommitted
usb: typec: Improve Alt Mode documentation
Adding the document to the usb index file and fixing a few references. Also, exposing the code examples as "literal blocks" so they are more easy to read. Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 54578ee commit 28ce553

File tree

3 files changed

+14
-12
lines changed

3 files changed

+14
-12
lines changed

Documentation/driver-api/usb/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ Linux USB API
1919
dwc3
2020
writing_musb_glue_layer
2121
typec
22+
typec_bus
2223
usb3-debug-port
2324

2425
.. only:: subproject and html

Documentation/driver-api/usb/typec.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
.. _typec:
12

23
USB Type-C connector class
34
==========================

Documentation/driver-api/usb/typec_bus.rst

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ every alternate mode, so every alternate mode will need a custom driver.
1313
USB Type-C bus allows binding a driver to the discovered partner alternate
1414
modes by using the SVID and the mode number.
1515

16-
USB Type-C Connector Class provides a device for every alternate mode a port
17-
supports, and separate device for every alternate mode the partner supports.
18-
The drivers for the alternate modes are bound to the partner alternate mode
19-
devices, and the port alternate mode devices must be handled by the port
16+
:ref:`USB Type-C Connector Class <typec>` provides a device for every alternate
17+
mode a port supports, and separate device for every alternate mode the partner
18+
supports. The drivers for the alternate modes are bound to the partner alternate
19+
mode devices, and the port alternate mode devices must be handled by the port
2020
drivers.
2121

2222
When a new partner alternate mode device is registered, it is linked to the
@@ -46,7 +46,7 @@ enter any modes on their own.
4646
``->vdm`` is the most important callback in the operation callbacks vector. It
4747
will be used to deliver all the SVID specific commands from the partner to the
4848
alternate mode driver, and vice versa in case of port drivers. The drivers send
49-
the SVID specific commands to each other using :c:func:`typec_altmode_vmd()`.
49+
the SVID specific commands to each other using :c:func:`typec_altmode_vdm()`.
5050

5151
If the communication with the partner using the SVID specific commands results
5252
in need to reconfigure the pins on the connector, the alternate mode driver
@@ -67,15 +67,15 @@ Type-C Specification, and also put the connector back to ``TYPEC_STATE_USB``
6767
after the mode has been exited.
6868

6969
An example of working definitions for SVID specific pin configurations would
70-
look like this:
70+
look like this::
7171

72-
enum {
73-
ALTMODEX_CONF_A = TYPEC_STATE_MODAL,
74-
ALTMODEX_CONF_B,
75-
...
76-
};
72+
enum {
73+
ALTMODEX_CONF_A = TYPEC_STATE_MODAL,
74+
ALTMODEX_CONF_B,
75+
...
76+
};
7777

78-
Helper macro ``TYPEC_MODAL_STATE()`` can also be used:
78+
Helper macro ``TYPEC_MODAL_STATE()`` can also be used::
7979

8080
#define ALTMODEX_CONF_A = TYPEC_MODAL_STATE(0);
8181
#define ALTMODEX_CONF_B = TYPEC_MODAL_STATE(1);

0 commit comments

Comments
 (0)