devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] arm64: dts: rockchip: Enable TYPE-C PD for ROC-RK3399-PC
@ 2023-07-19 12:21 Jagan Teki
  2023-07-24 13:55 ` Christopher Obbard
  0 siblings, 1 reply; 10+ messages in thread
From: Jagan Teki @ 2023-07-19 12:21 UTC (permalink / raw)
  To: Heiko Stuebner, Rob Herring, Krzysztof Kozlowski, Conor Dooley
  Cc: linux-rockchip, linux-arm-kernel, devicetree, Jagan Teki,
	Corentin Labbe

The power supply circuit in ROC-RK3399-PC is

Power Supply (or PPS) => FUSB => MP8859

VUBS pin of FUSB and IN pin of MP8859 is supplied via TYPEC_IN.

The MP8859 operated with 2.8V to 22V supply voltage and typical
applications this supply can be 12V.

This patch is trying to support the PD by changing the FUSB VBUS supply
to 12V and tune the I2C7 timings from downstream kernel.

Tested with PD3.0 PPS with supply voltages of 12V/3A and 20V/5A.

Cc: Corentin Labbe <clabbe@baylibre.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
---
 .../boot/dts/rockchip/rk3399-roc-pc.dtsi      | 19 ++++++++++++++++---
 1 file changed, 16 insertions(+), 3 deletions(-)

diff --git a/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dtsi b/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dtsi
index c32913df93c3..8963b3858eae 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dtsi
@@ -6,6 +6,7 @@
 /dts-v1/;
 #include <dt-bindings/input/linux-event-codes.h>
 #include <dt-bindings/pwm/pwm.h>
+#include "dt-bindings/usb/pd.h"
 #include "rk3399.dtsi"
 #include "rk3399-opp.dtsi"
 
@@ -524,8 +525,9 @@ &i2c3 {
 };
 
 &i2c4 {
-	i2c-scl-rising-time-ns = <600>;
-	i2c-scl-falling-time-ns = <20>;
+	clock-frequency = <400000>;
+	i2c-scl-rising-time-ns = <345>;
+	i2c-scl-falling-time-ns = <11>;
 	status = "okay";
 
 	fusb1: usb-typec@22 {
@@ -552,8 +554,19 @@ fusb0: usb-typec@22 {
 		interrupts = <2 IRQ_TYPE_LEVEL_LOW>;
 		pinctrl-names = "default";
 		pinctrl-0 = <&fusb0_int>;
-		vbus-supply = <&vcc_vbus_typec0>;
+		vbus-supply = <&dc_12v>;
 		status = "okay";
+
+		connector {
+			compatible = "usb-c-connector";
+			data-role = "dual";
+			label = "USB-C";
+			power-role = "sink";
+			try-power-role = "sink";
+			op-sink-microwatt = <10000000>;
+			sink-pdos = <PDO_FIXED(5000, 3000, PDO_FIXED_USB_COMM)
+				     PDO_VAR(5000, 20000, 5000)>;
+		};
 	};
 
 	mp8859: regulator@66 {
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2023-09-22 23:14 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-19 12:21 [PATCH] arm64: dts: rockchip: Enable TYPE-C PD for ROC-RK3399-PC Jagan Teki
2023-07-24 13:55 ` Christopher Obbard
2023-07-25  7:39   ` Da Xue
2023-07-25  8:02     ` Christopher Obbard
2023-07-28 18:30       ` Heiko Stuebner
2023-07-28 18:45         ` Jagan Teki
2023-07-29  2:30           ` Frank Wang
2023-08-30 21:07             ` Da Xue
2023-09-22 23:14               ` Da Xue
2023-07-28 18:52   ` Jagan Teki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).