From patchwork Wed Jul 19 12:21:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 13318890 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9076BEB64DA for ; Wed, 19 Jul 2023 12:22:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=oEu5AYAtQOPh+TARe7Xcc5fRo2whvxPlW/6Pul5Vmp8=; b=iqZo0jeKyh/2+r /kaOQcgfYEdrYo/6UzGVrCFOO4xnB+1bmqWgm4xDGFIcYQ7edy8SjDHy2H9Q94ZqSrcDFdyEXJ/2c LXQrusOU1uZUUylr9rtCym54F6NCW3L6wupKgVAvgqyG12wLnEnT+xiltbq8JHjnJMNV3S/O1mEs6 cPCai6CA351xHTunwjcaDEecXs8NtjUB1tv7RhJGI2jkhBXI0qBsDFSFzeoT7HSWZLr7uKg83oSdk C8ZZIdYa+qw0NjjDYm/5UCCruCHv1l5jA3uOpyW/tMqJnh7Cnp6mykQNM9Q77izet6ToDOST51Yg4 v4JDHjZfy2VN9THuTSmg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qM6BY-007OpG-2Y; Wed, 19 Jul 2023 12:21:40 +0000 Received: from mail-pf1-x430.google.com ([2607:f8b0:4864:20::430]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qM6BV-007Onu-1l for linux-arm-kernel@lists.infradead.org; Wed, 19 Jul 2023 12:21:38 +0000 Received: by mail-pf1-x430.google.com with SMTP id d2e1a72fcca58-666eba6f3d6so4544525b3a.3 for ; Wed, 19 Jul 2023 05:21:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1689769296; x=1692361296; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=9xcCLpmftHeGeQfoD14ubT9Bi8tdJw0Jz86kdTTP9jk=; b=N1vPVKH1XV02F4rt3itG2s4UdBXz1J1+d5A4tHtBnamSb27U82FLXEEk3Qrv4CNolx CWySiduSwSZX8JZpfeyJ9Mz5fDs8M8WqFoOjk1gDz8qS4KDuMAYKKLryD+kgG3sRgEIf /l2TGQ8SYgiIggC+Ad/kN6WXy7xuVnpBAK6Vw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689769296; x=1692361296; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=9xcCLpmftHeGeQfoD14ubT9Bi8tdJw0Jz86kdTTP9jk=; b=KIonmhV9NV2oJ6IEVCmyI+oOvHrYNKV81TI4e6coLN+SgZRPEBlLKNDvy6l2I4uDwa i/6xAV62n6yznjXaUEdKfC6m4PsIzwA3RuxUdNB0X9wmyRaQriiADIq6LL6tTCyItRmy KOwjbnPA1vK1JJf4SX8yijnN5v7w3ipO0e9lVfWVk7FpkhsG4WItC3U5aoeMwRk56JBZ vM+OHvjQUHG4eg7fpu4mpUP0PVGkOgw56Npeu0bV/AxUhb8Jyz1aviypv9QYkVl2VVUW g79bpuQ6pEzIxuiA1RrBvFgrxNfmTvitOihR7iAftv6mHD4ksuJC/kM/a/HNd4exgYD7 x5Fw== X-Gm-Message-State: ABy/qLZoWNjyDZSF+y7K0fWM5h/2L6TYu1/7QUPO9TsI90NelyQcG9nG jDt/ZXyxToJhfByB43m5WBpZqQ== X-Google-Smtp-Source: APBJJlF0jPy1ajqwBXDOriWABI0+r/gQfRfllY+z9iV0HlUvAyrGG6o+K5F6n8FGBq2zdGWS0U8/8g== X-Received: by 2002:a05:6a21:328a:b0:130:d84b:eb91 with SMTP id yt10-20020a056a21328a00b00130d84beb91mr19548092pzb.49.1689769296577; Wed, 19 Jul 2023 05:21:36 -0700 (PDT) Received: from localhost.localdomain ([49.205.243.15]) by smtp.gmail.com with ESMTPSA id i3-20020aa78b43000000b005d22639b577sm3166773pfd.165.2023.07.19.05.21.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Jul 2023 05:21:35 -0700 (PDT) From: Jagan Teki To: Heiko Stuebner , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: linux-rockchip@lists.infradead.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, Jagan Teki , Corentin Labbe Subject: [PATCH] arm64: dts: rockchip: Enable TYPE-C PD for ROC-RK3399-PC Date: Wed, 19 Jul 2023 17:51:23 +0530 Message-Id: <20230719122123.3702588-1-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230719_052137_621066_C17ADCA6 X-CRM114-Status: GOOD ( 13.81 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 Signed-off-by: Jagan Teki --- .../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 #include +#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 = ; + }; }; mp8859: regulator@66 {