From ebcb0370e7a9503cdcfbed917fc8e6e0f49892f1 Mon Sep 17 00:00:00 2001
From: Oliver Neukum <oneukum@suse.com>
Date: Mon, 12 Jul 2021 13:24:50 +0200
Subject: [PATCH] kABI: restore struct tcpc_config definition
Patch-mainline: Never, kABI fix up
References: git-fixes
Restore the deleted member of struct tcpc_dev,which can be NULL
and redefine struct tcpc_config
Signed-off-by: Oliver Neukum <oneukum@suse.com>
---
include/linux/usb/tcpm.h | 40 ++++++++++++++++++++++++++++++++++++++++
1 file changed, 40 insertions(+)
diff --git a/include/linux/usb/tcpm.h b/include/linux/usb/tcpm.h
index e7979c01c..39c24cf60 100644
--- a/include/linux/usb/tcpm.h
+++ b/include/linux/usb/tcpm.h
@@ -46,6 +46,45 @@ 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
+ * @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;
+
+ const u32 *snk_pdo;
+ unsigned int nr_snk_pdo;
+
+ const u32 *snk_vdo;
+ unsigned int nr_snk_vdo;
+
+ unsigned int operating_snk_mw;
+
+ enum typec_port_type type;
+ enum typec_port_data data;
+ enum typec_role default_role;
+ bool try_role_hw; /* try.{src,snk} implemented in hardware */
+ bool self_powered; /* port belongs to a self powered device */
+
+ const struct typec_altmode_desc *alt_modes;
+};
+
/* Mux state attributes */
#define TCPC_MUX_USB_ENABLED BIT(0) /* USB enabled */
#define TCPC_MUX_DP_ENABLED BIT(1) /* DP enabled */
@@ -81,6 +120,7 @@ enum tcpm_transmit_type {
* @mux: Pointer to multiplexer data
*/
struct tcpc_dev {
+ const struct tcpc_config *config;
struct fwnode_handle *fwnode;
int (*init)(struct tcpc_dev *dev);
--
2.26.2