Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Heikki Krogerus and committed by
Greg Kroah-Hartman
28ce5539 54578ee8

+14 -12
+1
Documentation/driver-api/usb/index.rst
··· 19 19 dwc3 20 20 writing_musb_glue_layer 21 21 typec 22 + typec_bus 22 23 usb3-debug-port 23 24 24 25 .. only:: subproject and html
+1
Documentation/driver-api/usb/typec.rst
··· 1 + .. _typec: 1 2 2 3 USB Type-C connector class 3 4 ==========================
+12 -12
Documentation/driver-api/usb/typec_bus.rst
··· 13 13 USB Type-C bus allows binding a driver to the discovered partner alternate 14 14 modes by using the SVID and the mode number. 15 15 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 20 20 drivers. 21 21 22 22 When a new partner alternate mode device is registered, it is linked to the ··· 46 46 ``->vdm`` is the most important callback in the operation callbacks vector. It 47 47 will be used to deliver all the SVID specific commands from the partner to the 48 48 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()`. 50 50 51 51 If the communication with the partner using the SVID specific commands results 52 52 in need to reconfigure the pins on the connector, the alternate mode driver ··· 67 67 after the mode has been exited. 68 68 69 69 An example of working definitions for SVID specific pin configurations would 70 - look like this: 70 + look like this:: 71 71 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 + }; 77 77 78 - Helper macro ``TYPEC_MODAL_STATE()`` can also be used: 78 + Helper macro ``TYPEC_MODAL_STATE()`` can also be used:: 79 79 80 80 #define ALTMODEX_CONF_A = TYPEC_MODAL_STATE(0); 81 81 #define ALTMODEX_CONF_B = TYPEC_MODAL_STATE(1);