From nobody Sun Feb 8 10:33:36 2026 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9E7E740BF2 for ; Mon, 5 Feb 2024 16:43:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707151424; cv=none; b=bUJwO5kRyVB8x+FDCmSHrtZKN/JMAy9CQO8zfYfFjTbduVw4aVrHfBJo+4hMx70MIoXzLYM890B+RL1K3fP5xl4OiC0dwbx+dtdSmBFN1I5oNHICzuaxpvAri2V/vHlIjW6gpW+0H4QRBsRINryrTHQi7HRm0l7aaXHU3GLsn+s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707151424; c=relaxed/simple; bh=xLjwZJOeXZFadK4nYdC3krKeoAWYMaGJ7UQfwJG985E=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=pVc83WRP9yeS8huLHYdgoYXNjs6BN2m3gp3ZYyO6lwr02qf5PzNcQ9QaMZp8TL/sTOcBPGTwmOtlxm4krukNhxNokBPL8rf+Hc/baN7FCeEBLshgTChfSdVOAoeqyViSVMXmHRxk5TBLwoJqnDp5GZEYntlDbPPXd1/J+lMN/J4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de Received: from dude02.red.stw.pengutronix.de ([2a0a:edc0:0:1101:1d::28]) by metis.whiteo.stw.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1rX240-0004Lp-9O; Mon, 05 Feb 2024 17:43:20 +0100 From: Marco Felsch To: gregkh@linuxfoundation.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, linux@roeck-us.net, heikki.krogerus@linux.intel.com Cc: linux-usb@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 1/4] dt-bindings: usb: typec-tcpci: add tcpci compatible binding Date: Mon, 5 Feb 2024 17:43:13 +0100 Message-Id: <20240205164316.805408-2-m.felsch@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240205164316.805408-1-m.felsch@pengutronix.de> References: <20240205164316.805408-1-m.felsch@pengutronix.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a0a:edc0:0:1101:1d::28 X-SA-Exim-Mail-From: m.felsch@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" This binding descripes the generic TCPCI specification [1]. So add the generic binding support since which can be used if an different TCPC is used compatible which is compatible to [1]. [1] https://www.usb.org/sites/default/files/documents/usb-port_controller_s= pecification_rev2.0_v1.0_0.pdf Signed-off-by: Marco Felsch --- Documentation/devicetree/bindings/usb/nxp,ptn5110.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/usb/nxp,ptn5110.yaml b/Docum= entation/devicetree/bindings/usb/nxp,ptn5110.yaml index eaedb4cc6b6c..7bd7bbbac9e0 100644 --- a/Documentation/devicetree/bindings/usb/nxp,ptn5110.yaml +++ b/Documentation/devicetree/bindings/usb/nxp,ptn5110.yaml @@ -11,7 +11,9 @@ maintainers: =20 properties: compatible: - const: nxp,ptn5110 + enum: + - nxp,ptn5110 + - tcpci =20 reg: maxItems: 1 --=20 2.39.2 From nobody Sun Feb 8 10:33:36 2026 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BFBEE3BB3B for ; Mon, 5 Feb 2024 16:43:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707151424; cv=none; b=SWPWKqA+6GKGiCOKs2XadaTsmjCr/khmEHCQdvM7T8w0b2N2CG5Y650u7h8SsPro/OTSfI7P5MWAEGgnhf4Lol6mxGPFjOXVJK6a54+RkaXMFekvShrcpMehP+fej34AFegNn0JwplrKKASDltCf8oDUrdfGPAly4jZH54t2zTc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707151424; c=relaxed/simple; bh=BXEfUqrdgr1DKewKs2YvG49yuJcxFfA8kMr2pr3Rye8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=MIZuRpAIb1CcpGh4mzRrtznnD1fUw8RuiHu3CaPbFJ399suFEAK1TWLKbIoyeQGIuSOeBBznwJ8ymk49jf2up6LzrDjRm7/NP8WMAg5mhWCZSjylepaiEEhRqwQN9NgFKeV79hxdz+oABVOJJrUC809oJpLHscKaQvnXrPOP/1Q= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de Received: from dude02.red.stw.pengutronix.de ([2a0a:edc0:0:1101:1d::28]) by metis.whiteo.stw.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1rX240-0004Lp-CN; Mon, 05 Feb 2024 17:43:20 +0100 From: Marco Felsch To: gregkh@linuxfoundation.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, linux@roeck-us.net, heikki.krogerus@linux.intel.com Cc: linux-usb@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 2/4] usb: typec: tcpci: add generic tcpci compatible Date: Mon, 5 Feb 2024 17:43:14 +0100 Message-Id: <20240205164316.805408-3-m.felsch@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240205164316.805408-1-m.felsch@pengutronix.de> References: <20240205164316.805408-1-m.felsch@pengutronix.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a0a:edc0:0:1101:1d::28 X-SA-Exim-Mail-From: m.felsch@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" The driver already support the tcpci binding for the i2c_device_id so add the support for the of_device_id too. Signed-off-by: Marco Felsch --- drivers/usb/typec/tcpm/tcpci.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/usb/typec/tcpm/tcpci.c b/drivers/usb/typec/tcpm/tcpci.c index 0ee3e6e29bb1..7118551827f6 100644 --- a/drivers/usb/typec/tcpm/tcpci.c +++ b/drivers/usb/typec/tcpm/tcpci.c @@ -889,6 +889,7 @@ MODULE_DEVICE_TABLE(i2c, tcpci_id); #ifdef CONFIG_OF static const struct of_device_id tcpci_of_match[] =3D { { .compatible =3D "nxp,ptn5110", }, + { .compatible =3D "tcpci", }, {}, }; MODULE_DEVICE_TABLE(of, tcpci_of_match); --=20 2.39.2 From nobody Sun Feb 8 10:33:36 2026 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8440A4594E for ; Mon, 5 Feb 2024 16:43:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707151424; cv=none; b=jaluNrZK/k5XtoaTPJdFVpcBQ6Mr33FDYXNOuwBd2jzPo9gbPz+nhUAC9EX0IZdKWVhjXjzKEPAC3EmqBvQS/KWvrRkICbvOehaQZMYblM3+8YScpcYcgstqSLDjZHzS0/FngLDU/qPgw4pnJlXQZEnLp8X0dc2wu9F7YV+I5Pw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707151424; c=relaxed/simple; bh=6ce/oM+A5BQBKmsjuKRsNMcb1p8URx3gBAgN9rO3k/4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=luRuTbICMAT9Gfz/Y0sSPj1QWeCfxW+mcsx6STWi0XaQoa57rdPIiMOU84UAQzDBHsG8W5w2hlnhUOCfVJisfVO9YTp1Lk5D9qdlQIeq0aCXwvxpqnqBAlLoO5AhwZfiNWq3NPMZW/l1w9ng+3MF9XH4sUY8klu9CkcrM0PzfY4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de Received: from dude02.red.stw.pengutronix.de ([2a0a:edc0:0:1101:1d::28]) by metis.whiteo.stw.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1rX240-0004Lp-E3; Mon, 05 Feb 2024 17:43:20 +0100 From: Marco Felsch To: gregkh@linuxfoundation.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, linux@roeck-us.net, heikki.krogerus@linux.intel.com Cc: linux-usb@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 3/4] usb: typec: tcpm: add support to set tcpc connector orientatition Date: Mon, 5 Feb 2024 17:43:15 +0100 Message-Id: <20240205164316.805408-4-m.felsch@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240205164316.805408-1-m.felsch@pengutronix.de> References: <20240205164316.805408-1-m.felsch@pengutronix.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a0a:edc0:0:1101:1d::28 X-SA-Exim-Mail-From: m.felsch@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" This adds the support to set the connector orientation value accordingly. This is part of the optional CONFIG_STANDARD_OUTPUT register 0x18, specified within the USB port controller spsicification rev. 2.0 [1]. [1] https://www.usb.org/sites/default/files/documents/usb-port_controller_s= pecification_rev2.0_v1.0_0.pdf Signed-off-by: Marco Felsch --- drivers/usb/typec/tcpm/tcpm.c | 6 ++++++ include/linux/usb/tcpm.h | 2 ++ 2 files changed, 8 insertions(+) diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm.c index 5945e3a2b0f7..85ca26687324 100644 --- a/drivers/usb/typec/tcpm/tcpm.c +++ b/drivers/usb/typec/tcpm/tcpm.c @@ -1099,6 +1099,12 @@ static int tcpm_set_roles(struct tcpm_port *port, bo= ol attached, if (ret < 0) return ret; =20 + if (port->tcpc->set_orientation) { + ret =3D port->tcpc->set_orientation(port->tcpc, orientation); + if (ret < 0) + return ret; + } + port->pwr_role =3D role; port->data_role =3D data; typec_set_data_role(port->typec_port, data); diff --git a/include/linux/usb/tcpm.h b/include/linux/usb/tcpm.h index 65fac5e1f317..93b681ff3ef9 100644 --- a/include/linux/usb/tcpm.h +++ b/include/linux/usb/tcpm.h @@ -133,6 +133,8 @@ struct tcpc_dev { enum typec_cc_status *cc2); int (*set_polarity)(struct tcpc_dev *dev, enum typec_cc_polarity polarity); + int (*set_orientation)(struct tcpc_dev *dev, + enum typec_orientation orientation); int (*set_vconn)(struct tcpc_dev *dev, bool on); int (*set_vbus)(struct tcpc_dev *dev, bool on, bool charge); int (*set_current_limit)(struct tcpc_dev *dev, u32 max_ma, u32 mv); --=20 2.39.2 From nobody Sun Feb 8 10:33:36 2026 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 337DF45035 for ; Mon, 5 Feb 2024 16:43:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707151423; cv=none; b=nPzshe9y6Q3HwsrulSL7dxdEiH/vdDpFPmCSwFuCDi0WIlbAvNWCVt8emiEUTHL6ZIkFSPRz6FursiCyOipkgP8dSeb8LQLlRB1bNcbliiSzdgX7sQKQ1mUW24lDvulNbmasYHqBS/Bb9sKVnjaCSYSIcDS80iL4DhS2nZl+HPI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707151423; c=relaxed/simple; bh=4GHUITov1D4E/JQZU7O2PuGsE/9LeCQp7fnZyPsU8lM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=SpbZ2M9NUW57QPCkiGzSPnjoW3NtFtE9IWtnXzOMCPh0zujQq0f7FEF0WknfIlke/w7IO72/8rFHjKgvtpaGYhQPLx+SNyUJtSFATFTlEQnwb0CX1qKlccyFXSt6l1VgfZ7kXNuvgwcf0FMbDOFPxLHhiaJxYn2UbXqOE9CHxFQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de Received: from dude02.red.stw.pengutronix.de ([2a0a:edc0:0:1101:1d::28]) by metis.whiteo.stw.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1rX240-0004Lp-Fe; Mon, 05 Feb 2024 17:43:20 +0100 From: Marco Felsch To: gregkh@linuxfoundation.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, linux@roeck-us.net, heikki.krogerus@linux.intel.com Cc: linux-usb@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 4/4] usb: typec: tcpci: add support to set connector orientation Date: Mon, 5 Feb 2024 17:43:16 +0100 Message-Id: <20240205164316.805408-5-m.felsch@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240205164316.805408-1-m.felsch@pengutronix.de> References: <20240205164316.805408-1-m.felsch@pengutronix.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a0a:edc0:0:1101:1d::28 X-SA-Exim-Mail-From: m.felsch@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" This add the support to set the optional connector orientation bit which is part of the optional CONFIG_STANDARD_OUTPUT register 0x18 [1]. This allows system designers to connect the tcpc orientation pin directly to the 2:1 ss-mux. [1] https://www.usb.org/sites/default/files/documents/usb-port_controller_s= pecification_rev2.0_v1.0_0.pdf Signed-off-by: Marco Felsch --- drivers/usb/typec/tcpm/tcpci.c | 43 ++++++++++++++++++++++++++++++++++ include/linux/usb/tcpci.h | 8 +++++++ 2 files changed, 51 insertions(+) diff --git a/drivers/usb/typec/tcpm/tcpci.c b/drivers/usb/typec/tcpm/tcpci.c index 7118551827f6..7ce9d4923bc7 100644 --- a/drivers/usb/typec/tcpm/tcpci.c +++ b/drivers/usb/typec/tcpm/tcpci.c @@ -67,6 +67,18 @@ static int tcpci_write16(struct tcpci *tcpci, unsigned i= nt reg, u16 val) return regmap_raw_write(tcpci->regmap, reg, &val, sizeof(u16)); } =20 +static bool tcpci_check_std_output_cap(struct regmap *regmap, u8 mask) +{ + unsigned int reg; + int ret; + + ret =3D regmap_read(regmap, TCPC_STD_OUTPUT_CAP, ®); + if (ret < 0) + return ret; + + return (reg & mask) =3D=3D mask; +} + static int tcpci_set_cc(struct tcpc_dev *tcpc, enum typec_cc_status cc) { struct tcpci *tcpci =3D tcpc_to_tcpci(tcpc); @@ -301,6 +313,27 @@ static int tcpci_set_polarity(struct tcpc_dev *tcpc, TCPC_TCPC_CTRL_ORIENTATION : 0); } =20 +static int tcpci_set_orientation(struct tcpc_dev *tcpc, + enum typec_orientation orientation) +{ + struct tcpci *tcpci =3D tcpc_to_tcpci(tcpc); + unsigned int reg; + + switch (orientation) { + case TYPEC_ORIENTATION_NONE: + /* We can't put a single output into high impedance */ + case TYPEC_ORIENTATION_NORMAL: + reg =3D TCPC_CONFIG_STD_OUTPUT_ORIENTATION_NORMAL; + break; + case TYPEC_ORIENTATION_REVERSE: + reg =3D TCPC_CONFIG_STD_OUTPUT_ORIENTATION_FLIPPED; + break; + } + + return regmap_update_bits(tcpci->regmap, TCPC_CONFIG_STD_OUTPUT, + TCPC_CONFIG_STD_OUTPUT_ORIENTATION_MASK, reg); +} + static void tcpci_set_partner_usb_comm_capable(struct tcpc_dev *tcpc, bool= capable) { struct tcpci *tcpci =3D tcpc_to_tcpci(tcpc); @@ -808,6 +841,9 @@ struct tcpci *tcpci_register_port(struct device *dev, s= truct tcpci_data *data) if (tcpci->data->vbus_vsafe0v) tcpci->tcpc.is_vbus_vsafe0v =3D tcpci_is_vbus_vsafe0v; =20 + if (tcpci->data->set_orientation) + tcpci->tcpc.set_orientation =3D tcpci_set_orientation; + err =3D tcpci_parse_config(tcpci); if (err < 0) return ERR_PTR(err); @@ -851,6 +887,13 @@ static int tcpci_probe(struct i2c_client *client) if (err < 0) return err; =20 + err =3D tcpci_check_std_output_cap(chip->data.regmap, + TCPC_STD_OUTPUT_CAP_ORIENTATION); + if (err < 0) + return err; + + chip->data.set_orientation =3D err; + chip->tcpci =3D tcpci_register_port(&client->dev, &chip->data); if (IS_ERR(chip->tcpci)) return PTR_ERR(chip->tcpci); diff --git a/include/linux/usb/tcpci.h b/include/linux/usb/tcpci.h index 467e8045e9f8..f2bfb4250366 100644 --- a/include/linux/usb/tcpci.h +++ b/include/linux/usb/tcpci.h @@ -47,6 +47,9 @@ #define TCPC_SINK_FAST_ROLE_SWAP BIT(0) =20 #define TCPC_CONFIG_STD_OUTPUT 0x18 +#define TCPC_CONFIG_STD_OUTPUT_ORIENTATION_MASK BIT(0) +#define TCPC_CONFIG_STD_OUTPUT_ORIENTATION_NORMAL 0 +#define TCPC_CONFIG_STD_OUTPUT_ORIENTATION_FLIPPED 1 =20 #define TCPC_TCPC_CTRL 0x19 #define TCPC_TCPC_CTRL_ORIENTATION BIT(0) @@ -127,6 +130,7 @@ #define TCPC_DEV_CAP_2 0x26 #define TCPC_STD_INPUT_CAP 0x28 #define TCPC_STD_OUTPUT_CAP 0x29 +#define TCPC_STD_OUTPUT_CAP_ORIENTATION BIT(0) =20 #define TCPC_MSG_HDR_INFO 0x2e #define TCPC_MSG_HDR_INFO_DATA_ROLE BIT(3) @@ -198,12 +202,16 @@ struct tcpci; * Chip level drivers are expected to check for contaminant and call * tcpm_clean_port when the port is clean to put the port back into * toggling state. + * @set_orientation: + * Optional; Enable setting the connector orientation + * CONFIG_STANDARD_OUTPUT (0x18) bit0. */ struct tcpci_data { struct regmap *regmap; unsigned char TX_BUF_BYTE_x_hidden:1; unsigned char auto_discharge_disconnect:1; unsigned char vbus_vsafe0v:1; + unsigned char set_orientation:1; =20 int (*init)(struct tcpci *tcpci, struct tcpci_data *data); int (*set_vconn)(struct tcpci *tcpci, struct tcpci_data *data, --=20 2.39.2