From nobody Sun Feb 8 15:53:50 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 97373145320 for ; Thu, 15 Feb 2024 21:29:11 +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=1708032553; cv=none; b=d3XtAapCagsLOSt3sv054paMWmzKYV68uBqSlsI9/7QAdRGoc/lNxRuJSc4vnZd+XW2F5I6w4vQs8TXsyEIm2+NgFKyXoLACGHQ0E+XEuxJZBfWoejwfBqDLVTCa3t1CP8PbtiehFxSr5RyX4y4Bmm6jZ88jeMJ/w6RJrj66K5Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708032553; c=relaxed/simple; bh=Pp1gNDwQrjYX8JdcQvv3H9tjki5TYsWrM8W3/pzFDaw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Iq762umvpRxBOT36G4mfvqUjQPQRPirh7CHVZcmsbLvafDwGJJ0HdnEJ9OwmLlS2Qg+XlJZLlavydamXnxD6zblIfOYrj14bUfh9dc4/mFe5b4BqdegIixx/h6jkEfPEffQBY25m2HIamHaBgZkup+0BYojhH2fmHhHybpjl+xU= 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 1rajHr-0001xh-Du; Thu, 15 Feb 2024 22:28:55 +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, jun.li@nxp.com Cc: linux-usb@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH v2 1/4] dt-bindings: usb: typec-tcpci: add tcpci fallback binding Date: Thu, 15 Feb 2024 22:28:49 +0100 Message-Id: <20240215212852.1202339-2-m.felsch@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240215212852.1202339-1-m.felsch@pengutronix.de> References: <20240215212852.1202339-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 NXP PTN5110 [1] is an TCPCI [2] compatible chip, so add the fallback binding. [1] https://www.nxp.com/docs/en/data-sheet/PTN5110.pdf [2] https://www.usb.org/sites/default/files/documents/usb-port_controller_s= pecification_rev2.0_v1.0_0.pdf Signed-off-by: Marco Felsch --- v2: - rephrase commit message 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 15:53:50 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 C293F1419B1 for ; Thu, 15 Feb 2024 21:29:12 +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=1708032554; cv=none; b=dgdpSxBalK+VJ19PNZb7HHPu8Q5Rr1JaJlWMkvA9/8Fp6xH/R564dDRveLw5H+fp+S/4Xm4FJ23JmdeYibtIJstFG0mVaDQb9GxXqnlqqadXBtpSxEBd+O1LJvWwYo9jvRQ4xYJ39ktmS7ouA67E65R87Ml1z0Nv/rH46pY0I9I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708032554; c=relaxed/simple; bh=sCfsnKhY2IDm3v288y5GnenUdGuz2YCuAJ4RqWsCZlo=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=rJ1Hz844yPratctP4qHuXuOLqPcDyNZ3K5r6wTjkl49+QKJC8HlcgB9Jw93M7wMMM197cVGUzEOAARYdpFRMF9vRelEQiQzE3+SVVYAMgGCIiBZxjLgadRcMlstkQL0vBhToqSj6923R/jZNW2HezIgZk4gtQpDLkL/Qva23t10= 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 1rajHr-0001xh-Gx; Thu, 15 Feb 2024 22:28:55 +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, jun.li@nxp.com Cc: linux-usb@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH v2 2/4] usb: typec: tcpci: add generic tcpci fallback compatible Date: Thu, 15 Feb 2024 22:28:50 +0100 Message-Id: <20240215212852.1202339-3-m.felsch@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240215212852.1202339-1-m.felsch@pengutronix.de> References: <20240215212852.1202339-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 --- v2: - no changes 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 15:53:50 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 6723A13DB87 for ; Thu, 15 Feb 2024 21:29:12 +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=1708032553; cv=none; b=TsostEogm+Sjpeg5wSRXhv4bWcnhrnkrLRX+1ob7NzjcNVKq9iqJhshdBXjevuJ94ISQS+e1j7UW7KH3vZ258lw9+bJJQqKt1v0rZ0TDQ/7QaVcy1nIoHTXvHn/OE8JHiDtmgvJrEginjGrseOLq2Icgg5TSivjzVEm9pVzih/A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708032553; c=relaxed/simple; bh=vck8aRHuxSoYaBFUbbPNie10ullAPmiqdjueyrw4+/c=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=IWopR9lJNm0RttN7xCGrP6wqQeslnlMzVgxkObuAR84DPRcM/BfUXQJzwwkG6ZAeLPqr1H2OHu0qD4aHdJZTRIf2kXngP7LNTJNcdhvT2J5ybn0nOlonZMJhyTjI9xRGgzkDyGJrJ5HrElj0lkQbvZGCKbcYRY89K22vM/xPwNs= 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 1rajHr-0001xh-IV; Thu, 15 Feb 2024 22:28:55 +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, jun.li@nxp.com Cc: linux-usb@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH v2 3/4] usb: typec: tcpm: add support to set tcpc connector orientatition Date: Thu, 15 Feb 2024 22:28:51 +0100 Message-Id: <20240215212852.1202339-4-m.felsch@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240215212852.1202339-1-m.felsch@pengutronix.de> References: <20240215212852.1202339-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 --- v2: - no changes 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 15:53:50 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 51E73145336 for ; Thu, 15 Feb 2024 21:29:13 +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=1708032554; cv=none; b=TIQtMGfWq9Kz3ZmTicoCcnePOQOLik11N7dm+vbSMO+5HXUlUhMiDCx5KtxAsSVfgbsCCgeoir7I5tJ7Wn3YTxOGahv0axCntE76I/DDj83jJ513KMuGXmpcvqJUVRLFZ+bPYzWNoJpcYbVc+XNsDD6hF/fQI7NQvvY8MY/pBI0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708032554; c=relaxed/simple; bh=wdfDYbwXdmf30ZCyxHt+C8YT25tN2OJ3GnO7DFGD1Uk=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=a25ORLcrL+3sGExs+hKrIQFPq5J8iymqwSC9uz96bJA2rz7EzNVjv0HQWR2Lf3T+BxWKV0F6r+GlKeWAI1N5yttzvbGAR6wgm/2YT9kOxAD1X77VtdOjCAmtBh2095pr22YDsVaWb7ubl87tytvyZr203NIIreiA0tzsOIyXNLI= 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 1rajHr-0001xh-K9; Thu, 15 Feb 2024 22:28:55 +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, jun.li@nxp.com Cc: linux-usb@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH v2 4/4] usb: typec: tcpci: add support to set connector orientation Date: Thu, 15 Feb 2024 22:28:52 +0100 Message-Id: <20240215212852.1202339-5-m.felsch@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240215212852.1202339-1-m.felsch@pengutronix.de> References: <20240215212852.1202339-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 --- v2: - Make use of fallthrough drivers/usb/typec/tcpm/tcpci.c | 44 ++++++++++++++++++++++++++++++++++ include/linux/usb/tcpci.h | 8 +++++++ 2 files changed, 52 insertions(+) diff --git a/drivers/usb/typec/tcpm/tcpci.c b/drivers/usb/typec/tcpm/tcpci.c index 7118551827f6..73a52e7f95c2 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,28 @@ 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 */ + fallthrough; + 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 +842,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 +888,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