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

staging: typec: tcpm: Document data structures

Document struct tcpc_config and struct tcpc_dev.
Drop unused TCPC_USB_SWITCH_RESTORE.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Guenter Roeck and committed by
Greg Kroah-Hartman
98076fa6 44262fad

+50 -7
+50 -7
drivers/staging/typec/tcpm.h
··· 54 54 TCPC_TX_BIST_MODE_2 = 7 55 55 }; 56 56 57 + /** 58 + * struct tcpc_config - Port configuration 59 + * @src_pdo: PDO parameters sent to port partner as response to 60 + * PD_CTRL_GET_SOURCE_CAP message 61 + * @nr_src_pdo: Number of entries in @src_pdo 62 + * @snk_pdo: PDO parameters sent to partner as response to 63 + * PD_CTRL_GET_SINK_CAP message 64 + * @nr_snk_pdo: Number of entries in @snk_pdo 65 + * @max_snk_mv: Maximum acceptable sink voltage in mV 66 + * @max_snk_ma: Maximum sink current in mA 67 + * @max_snk_mw: Maximum required sink power in mW 68 + * @operating_snk_mw: 69 + * Required operating sink power in mW 70 + * @type: Port type (TYPEC_PORT_DFP, TYPEC_PORT_UFP, or 71 + * TYPEC_PORT_DRP) 72 + * @default_role: 73 + * Default port role (TYPEC_SINK or TYPEC_SOURCE). 74 + * Set to TYPEC_NO_PREFERRED_ROLE if no default role. 75 + * @try_role_hw:True if try.{Src,Snk} is implemented in hardware 76 + * @alt_modes: List of supported alternate modes 77 + */ 57 78 struct tcpc_config { 58 79 const u32 *src_pdo; 59 80 unsigned int nr_src_pdo; ··· 100 79 enum tcpc_usb_switch { 101 80 TCPC_USB_SWITCH_CONNECT, 102 81 TCPC_USB_SWITCH_DISCONNECT, 103 - TCPC_USB_SWITCH_RESTORE, /* TODO FIXME */ 104 82 }; 105 83 106 84 /* Mux state attributes */ ··· 124 104 void *priv_data; 125 105 }; 126 106 107 + /** 108 + * struct tcpc_dev - Port configuration and callback functions 109 + * @config: Pointer to port configuration 110 + * @get_vbus: Called to read current VBUS state 111 + * @get_current_limit: 112 + * Optional; called by the tcpm core when configured as a snk 113 + * and cc=Rp-def. This allows the tcpm to provide a fallback 114 + * current-limit detection method for the cc=Rp-def case. 115 + * For example, some tcpcs may include BC1.2 charger detection 116 + * and use that in this case. 117 + * @set_cc: Called to set value of CC pins 118 + * @get_cc: Called to read current CC pin values 119 + * @set_polarity: 120 + * Called to set polarity 121 + * @set_vconn: Called to enable or disable VCONN 122 + * @set_vbus: Called to enable or disable VBUS 123 + * @set_current_limit: 124 + * Optional; called to set current limit as negotiated 125 + * with partner. 126 + * @set_pd_rx: Called to enable or disable reception of PD messages 127 + * @set_roles: Called to set power and data roles 128 + * @start_drp_toggling: 129 + * Optional; if supported by hardware, called to start DRP 130 + * toggling. DRP toggling is stopped automatically if 131 + * a connection is established. 132 + * @try_role: Optional; called to set a preferred role 133 + * @pd_transmit:Called to transmit PD message 134 + * @mux: Pointer to multiplexer data 135 + */ 127 136 struct tcpc_dev { 128 137 const struct tcpc_config *config; 129 138 130 139 int (*init)(struct tcpc_dev *dev); 131 140 int (*get_vbus)(struct tcpc_dev *dev); 132 - /* 133 - * This optional callback gets called by the tcpm core when configured 134 - * as a snk and cc=Rp-def. This allows the tcpm to provide a fallback 135 - * current-limit detection method for the cc=Rp-def case. E.g. some 136 - * tcpcs may include BC1.2 charger detection and use that in this case. 137 - */ 138 141 int (*get_current_limit)(struct tcpc_dev *dev); 139 142 int (*set_cc)(struct tcpc_dev *dev, enum typec_cc_status cc); 140 143 int (*get_cc)(struct tcpc_dev *dev, enum typec_cc_status *cc1,