Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1730636
| Path | csiph.com!news.redatomik.org!weretis.net!feeder4.news.weretis.net!news.unit0.net!news.panservice.it!bofh.it!news.nic.it!robomod |
|---|---|
| From | Guenter Roeck <linux@roeck-us.net> |
| Newsgroups | linux.kernel |
| Subject | [PATCH v3 2/5] staging: typec: tcpm: Document data structures |
| Date | Tue, 12 Sep 2017 05:40:01 +0200 |
| Message-ID | <uoKdj-4d7-3@gated-at.bofh.it> (permalink) |
| References | <uoKdj-4d7-1@gated-at.bofh.it> |
| X-Original-To | Greg Kroah-Hartman <gregkh@linuxfoundation.org> |
| Dkim-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=48i8Sa1i5GMZBIPakzwQg5l1Ms3G9sggibigN+njcVw=; b=eQ/JCBRnufSOOrz/9dldkCGfMjyGpfG3E9scqH6cPWj97qnEHHd+qObXQ61YQvEI8J YVUgSP94L1sjx6SwUAWx1WGuXWuQvKYXh6EOuhfunR/1MuUKL8unYgcECZIi5v7ErXUt mJt+Xt/lQbRvn+dMESBMJxKCFDru6hxHL/dE0xIUFua0CCPHKQe8dUl6rvdtbCUovwsB IPEKpE+V2N5baJSYnyBIMJeb0lz4ohi1mcQ0fpkxLJGfhm+0PqjBtwM46MJ9x/x1ZXhj AI+DPAHmosWC1HZzalsfjhbFKSa8tUbIBFDRvHO2FpdaQCBSrA+A35ffpFxLPcrLsp4z 81Bw== |
| X-Google-Dkim-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=48i8Sa1i5GMZBIPakzwQg5l1Ms3G9sggibigN+njcVw=; b=uckkeKIgpzuHKSMYxm0N+Y1x4VR97N9YNu3rdji0euosoT1gbxjfkye2W03yDhIS9Q o+UxEhUNZYwqiRMLzGRNpDGBx0C4CFtcARLSEUsz08y9NCXINecpoEcPhmLHlUQQuizu 3FM4WZkA1OmEd0h4GZW8RGwFTjKhOCQsy4kjlTyqCZHqtVFYa350iYy1OdyuKgW7AC4/ ItDU0trMAdmBHqsjUuCyfvWcUrowzFd7iV5P42MKPLfpo/74EBw7tkAMYXoZ7wqEeX4D QUSw02IiFvdeWMmPK9Pxfb/tcWlXwpu9aIHdoUAMasJhrIMZdHzpe69W5SrfjjVDvB0y LjVg== |
| X-Gm-Message-State | AHPjjUhqdmENdP5u3Ep2Q5l9z+aRs6Adhpqc8ojS5l9qws7K8mtlUMYL D8W9HC6OU5PSmw== |
| X-Google-SMTP-Source | ADKCNb4XF/+E5YYOfm4QwM/SX+P2IqxQPuwYrPjB7fjt/VFFsoIXyTIrZms5+AEhvg6oKgXelDNC1Q== |
| X-Received | by 10.99.190.3 with SMTP id l3mr13251494pgf.79.1505187133394; Mon, 11 Sep 2017 20:32:13 -0700 (PDT) |
| X-Mailer | git-send-email 2.7.4 |
| Sender | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 99 |
| Organization | linux.* mail to news gateway |
| X-Original-Cc | Heikki Krogerus <heikki.krogerus@linux.intel.com>, Yueyao Zhu <yueyao@google.com>, Badhri Jagan Sridharan <badhri@google.com>, Hans de Goede <hdegoede@redhat.com>, linux-kernel@vger.kernel.org, devel@driverdev.osuosl.org, linux-usb@vger.kernel.org, Guenter Roeck <linux@roeck-us.net> |
| X-Original-Date | Mon, 11 Sep 2017 20:32:05 -0700 |
| X-Original-Message-ID | <1505187128-5459-2-git-send-email-linux@roeck-us.net> |
| X-Original-References | <1505187128-5459-1-git-send-email-linux@roeck-us.net> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | csiph.com linux.kernel:1730636 |
Show key headers only | View raw
Document struct tcpc_config and struct tcpc_dev.
Drop unused TCPC_USB_SWITCH_RESTORE.
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
v2, v3: No change
drivers/staging/typec/tcpm.h | 57 ++++++++++++++++++++++++++++++++++++++------
1 file changed, 50 insertions(+), 7 deletions(-)
diff --git a/drivers/staging/typec/tcpm.h b/drivers/staging/typec/tcpm.h
index 7e9a6b7b5cd6..073197f0d2bb 100644
--- a/drivers/staging/typec/tcpm.h
+++ b/drivers/staging/typec/tcpm.h
@@ -54,6 +54,27 @@ enum tcpm_transmit_type {
TCPC_TX_BIST_MODE_2 = 7
};
+/**
+ * struct tcpc_config - Port configuration
+ * @src_pdo: PDO parameters sent to port partner as response to
+ * PD_CTRL_GET_SOURCE_CAP message
+ * @nr_src_pdo: Number of entries in @src_pdo
+ * @snk_pdo: PDO parameters sent to partner as response to
+ * PD_CTRL_GET_SINK_CAP message
+ * @nr_snk_pdo: Number of entries in @snk_pdo
+ * @max_snk_mv: Maximum acceptable sink voltage in mV
+ * @max_snk_ma: Maximum sink current in mA
+ * @max_snk_mw: Maximum required sink power in mW
+ * @operating_snk_mw:
+ * Required operating sink power in mW
+ * @type: Port type (TYPEC_PORT_DFP, TYPEC_PORT_UFP, or
+ * TYPEC_PORT_DRP)
+ * @default_role:
+ * Default port role (TYPEC_SINK or TYPEC_SOURCE).
+ * Set to TYPEC_NO_PREFERRED_ROLE if no default role.
+ * @try_role_hw:True if try.{Src,Snk} is implemented in hardware
+ * @alt_modes: List of supported alternate modes
+ */
struct tcpc_config {
const u32 *src_pdo;
unsigned int nr_src_pdo;
@@ -79,7 +100,6 @@ struct tcpc_config {
enum tcpc_usb_switch {
TCPC_USB_SWITCH_CONNECT,
TCPC_USB_SWITCH_DISCONNECT,
- TCPC_USB_SWITCH_RESTORE, /* TODO FIXME */
};
/* Mux state attributes */
@@ -104,17 +124,40 @@ struct tcpc_mux_dev {
void *priv_data;
};
+/**
+ * struct tcpc_dev - Port configuration and callback functions
+ * @config: Pointer to port configuration
+ * @get_vbus: Called to read current VBUS state
+ * @get_current_limit:
+ * Optional; called by the tcpm core when configured as a snk
+ * and cc=Rp-def. This allows the tcpm to provide a fallback
+ * current-limit detection method for the cc=Rp-def case.
+ * For example, some tcpcs may include BC1.2 charger detection
+ * and use that in this case.
+ * @set_cc: Called to set value of CC pins
+ * @get_cc: Called to read current CC pin values
+ * @set_polarity:
+ * Called to set polarity
+ * @set_vconn: Called to enable or disable VCONN
+ * @set_vbus: Called to enable or disable VBUS
+ * @set_current_limit:
+ * Optional; called to set current limit as negotiated
+ * with partner.
+ * @set_pd_rx: Called to enable or disable reception of PD messages
+ * @set_roles: Called to set power and data roles
+ * @start_drp_toggling:
+ * Optional; if supported by hardware, called to start DRP
+ * toggling. DRP toggling is stopped automatically if
+ * a connection is established.
+ * @try_role: Optional; called to set a preferred role
+ * @pd_transmit:Called to transmit PD message
+ * @mux: Pointer to multiplexer data
+ */
struct tcpc_dev {
const struct tcpc_config *config;
int (*init)(struct tcpc_dev *dev);
int (*get_vbus)(struct tcpc_dev *dev);
- /*
- * This optional callback gets called by the tcpm core when configured
- * as a snk and cc=Rp-def. This allows the tcpm to provide a fallback
- * current-limit detection method for the cc=Rp-def case. E.g. some
- * tcpcs may include BC1.2 charger detection and use that in this case.
- */
int (*get_current_limit)(struct tcpc_dev *dev);
int (*set_cc)(struct tcpc_dev *dev, enum typec_cc_status cc);
int (*get_cc)(struct tcpc_dev *dev, enum typec_cc_status *cc1,
--
2.7.4
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH v3 1/5] staging: typec: tcpm: Drop commented out code Guenter Roeck <linux@roeck-us.net> - 2017-09-12 05:40 +0200
[PATCH v3 3/5] staging: typec: pd: Document struct pd_message Guenter Roeck <linux@roeck-us.net> - 2017-09-12 05:40 +0200
[PATCH v3 2/5] staging: typec: tcpm: Document data structures Guenter Roeck <linux@roeck-us.net> - 2017-09-12 05:40 +0200
Re: [PATCH v3 1/5] staging: typec: tcpm: Drop commented out code Heikki Krogerus <heikki.krogerus@linux.intel.com> - 2017-09-12 09:50 +0200
Re: [PATCH v3 1/5] staging: typec: tcpm: Drop commented out code Guenter Roeck <linux@roeck-us.net> - 2017-09-12 18:50 +0200
Re: [PATCH v3 1/5] staging: typec: tcpm: Drop commented out code Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-09-18 11:10 +0200
csiph-web