All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jagan Teki <jagan@amarulasolutions.com>
To: Heiko Stuebner <heiko@sntech.de>,
	Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Conor Dooley <conor+dt@kernel.org>
Cc: linux-rockchip@lists.infradead.org,
	linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org,
	Jagan Teki <jagan@amarulasolutions.com>,
	Corentin Labbe <clabbe@baylibre.com>
Subject: [PATCH] arm64: dts: rockchip: Enable TYPE-C PD for ROC-RK3399-PC
Date: Wed, 19 Jul 2023 17:51:23 +0530	[thread overview]
Message-ID: <20230719122123.3702588-1-jagan@amarulasolutions.com> (raw)

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


WARNING: multiple messages have this Message-ID (diff)
From: Jagan Teki <jagan@amarulasolutions.com>
To: Heiko Stuebner <heiko@sntech.de>,
	Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Conor Dooley <conor+dt@kernel.org>
Cc: linux-rockchip@lists.infradead.org,
	linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org,
	Jagan Teki <jagan@amarulasolutions.com>,
	Corentin Labbe <clabbe@baylibre.com>
Subject: [PATCH] arm64: dts: rockchip: Enable TYPE-C PD for ROC-RK3399-PC
Date: Wed, 19 Jul 2023 17:51:23 +0530	[thread overview]
Message-ID: <20230719122123.3702588-1-jagan@amarulasolutions.com> (raw)

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


_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

WARNING: multiple messages have this Message-ID (diff)
From: Jagan Teki <jagan@amarulasolutions.com>
To: Heiko Stuebner <heiko@sntech.de>,
	Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Conor Dooley <conor+dt@kernel.org>
Cc: linux-rockchip@lists.infradead.org,
	linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org,
	Jagan Teki <jagan@amarulasolutions.com>,
	Corentin Labbe <clabbe@baylibre.com>
Subject: [PATCH] arm64: dts: rockchip: Enable TYPE-C PD for ROC-RK3399-PC
Date: Wed, 19 Jul 2023 17:51:23 +0530	[thread overview]
Message-ID: <20230719122123.3702588-1-jagan@amarulasolutions.com> (raw)

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


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

             reply	other threads:[~2023-07-19 12:22 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-19 12:21 Jagan Teki [this message]
2023-07-19 12:21 ` [PATCH] arm64: dts: rockchip: Enable TYPE-C PD for ROC-RK3399-PC Jagan Teki
2023-07-19 12:21 ` Jagan Teki
2023-07-24 13:55 ` Christopher Obbard
2023-07-24 13:55   ` Christopher Obbard
2023-07-25  7:39   ` Da Xue
2023-07-25  7:39     ` Da Xue
2023-07-25  8:02     ` Christopher Obbard
2023-07-25  8:02       ` Christopher Obbard
2023-07-28 18:30       ` Heiko Stuebner
2023-07-28 18:30         ` Heiko Stuebner
2023-07-28 18:30         ` Heiko Stuebner
2023-07-28 18:45         ` Jagan Teki
2023-07-28 18:45           ` Jagan Teki
2023-07-28 18:45           ` Jagan Teki
2023-07-29  2:30           ` Frank Wang
2023-07-29  2:30             ` Frank Wang
2023-07-29  2:30             ` Frank Wang
2023-08-30 21:07             ` Da Xue
2023-08-30 21:07               ` Da Xue
2023-08-30 21:07               ` Da Xue
2023-09-22 23:14               ` Da Xue
2023-09-22 23:14                 ` Da Xue
2023-09-22 23:14                 ` Da Xue
2023-07-28 18:52   ` Jagan Teki
2023-07-28 18:52     ` Jagan Teki
2023-07-28 18:52     ` Jagan Teki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230719122123.3702588-1-jagan@amarulasolutions.com \
    --to=jagan@amarulasolutions.com \
    --cc=clabbe@baylibre.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=heiko@sntech.de \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=robh+dt@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.