From patchwork Mon Mar 27 07:41:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Javier Martinez Canillas X-Patchwork-Id: 13188684 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 1DE25C7619A for ; Mon, 27 Mar 2023 07:42:27 +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=HoWZvsxAHHfh853fOl1QFEPVLIs60tlPHVLv8ewiVWk=; b=FvfDzHD3V8KeNO U52eiYqA8toPAz4cwt+0nVImoz8f2u1RWR1R3vdS9V8uU3P+BLsnhAPJJKJkGTLKiDwEPm6kPdUlN 9hkOAt2Yh++9n9kS+JtrOVnF3HK2VZ8eGX5QPB6HXqXnq6dijhYncsH7gHQ6DP3dIHV7R1hp33+kj /kho2EolOY9mE5cTMRE6lamh4siZTQ8ADSWwfD0RrLtXzV4aMW257gZBaA7F77dQDXJbilXhp3j+S Re4lcm2KpA4OWwfySIILX56S1Fso/x6M/UeBo+Rr6MFkFefREh+sR4rP2WSa1Vtz4g3WucrgR6nDw ieCNEu8UCRERDOVkAX5Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pghUg-00A5yz-2l; Mon, 27 Mar 2023 07:42:18 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pghUd-00A5xX-1y for linux-rockchip@lists.infradead.org; Mon, 27 Mar 2023 07:42:17 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1679902931; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9gEvGzO/t3GSZzHhYPQWJ5afaAW4baouQV1YxDz4Oxo=; b=drdIsxQAgkqsxMO8fxCJLEhCocHP8AjsXecTE4UHGMyk4g6wRoQ/9EcbnFwSZod9NtWDlv AEnxMAt6sY2F/gQY8tuPYfiYfjFBPAUhooIGHAZxJzVBPP7mZREwWgICDHk9kSJXTiu3Zv p2qbxmMmmgRI1VgLoUp0NcaWLlE/QX0= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-423-2jTCsQwXM6uv3rB0bhRRjw-1; Mon, 27 Mar 2023 03:42:09 -0400 X-MC-Unique: 2jTCsQwXM6uv3rB0bhRRjw-1 Received: by mail-wm1-f71.google.com with SMTP id bg33-20020a05600c3ca100b003ef6d684105so1010520wmb.1 for ; Mon, 27 Mar 2023 00:42:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679902928; 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=9gEvGzO/t3GSZzHhYPQWJ5afaAW4baouQV1YxDz4Oxo=; b=BLDjJpgd0ZWaVcSrp379dZGMSaK/glkKAqjWpNfjAJ5cxwewS/nl5T3qgLNCUgo6ex azRVlaLpnOKFrFi5msy6G3hdF6Obor8jcGbN2reVU25CfFmRxiYq/5wsGsK9OF/nHj3K 6xU6xVJTQjDchT2hciBL0iVdIAJERoJJsCctIZ007HsAUP7FOgJ1pkNMxNy2/i8proh2 I8kA0Q3P9Y9xfg935eyrsmgOBDbuDSimGQ6YZwXa+MXZEEcsuqHfRYlr5UIazMfi/T3O geQDt/ZOIyawey+bt8m69m1gYJlyHXCgceLpmFzCgmugME2HEGNkDfl7ws3DPlWaBImC gXpA== X-Gm-Message-State: AO0yUKVU9Y8Vj/pIkOzvS8H5HE16APdJ7X/rU7ZZ3XDuYEZDILUy7bnI PRel5pFxE05PWu/lxWuFLlatfwzURXV7/Qngf8K/xbwcX/mFqoe0PzE0z+wzHoLvJCxVyliLu4G BNZlnRBsu82RB1ZgybwGcgP+3O2vWfNkV X-Received: by 2002:a05:600c:b42:b0:3ee:6cdf:c357 with SMTP id k2-20020a05600c0b4200b003ee6cdfc357mr7727985wmr.20.1679902928474; Mon, 27 Mar 2023 00:42:08 -0700 (PDT) X-Google-Smtp-Source: AK7set9/tMR3AjsxF/BVjZ53UH5flNgkScCgYAEe7XzL7RWa18N1EYtYJbvZivLJq7GDux7Kr9leMA== X-Received: by 2002:a05:600c:b42:b0:3ee:6cdf:c357 with SMTP id k2-20020a05600c0b4200b003ee6cdfc357mr7727965wmr.20.1679902928101; Mon, 27 Mar 2023 00:42:08 -0700 (PDT) Received: from minerva.home (205.pool92-176-231.dynamic.orange.es. [92.176.231.205]) by smtp.gmail.com with ESMTPSA id z8-20020a05600c0a0800b003edc4788fa0sm7902247wmp.2.2023.03.27.00.42.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Mar 2023 00:42:07 -0700 (PDT) From: Javier Martinez Canillas To: linux-kernel@vger.kernel.org Cc: Robert Mader , Laurent Pinchart , Peter Robinson , Jacopo Mondi , Ondrej Jirman , Martijn Braam , =?utf-8?q?Kamil_Trzci=C5=84ski?= , Javier Martinez Canillas , Caleb Connolly , Heiko Stuebner , Jarrah Gosbell , Krzysztof Kozlowski , Rob Herring , Tom Fitzhenry , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org Subject: [PATCH v2] arm64: dts: rk3399-pinephone-pro: Add internal display support Date: Mon, 27 Mar 2023 09:41:35 +0200 Message-Id: <20230327074136.1459212-1-javierm@redhat.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230327_004215_743992_DD88C669 X-CRM114-Status: GOOD ( 12.38 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org From: Ondrej Jirman The phone's display is using a Hannstar LCD panel. Support it by adding a panel DT node and all needed nodes (backlight, MIPI DSI, regulators, etc). Signed-off-by: Ondrej Jirman Co-developed-by: Martijn Braam Co-developed-by: Kamil TrzciƄski Signed-off-by: Javier Martinez Canillas Tested-by: Ondrej Jirman --- Changes in v2: - Drop touchscreen node because used the wrong compatible (Ondrej Jirman). - Fix assigned-clock-parents in vopb node (Ondrej Jirman). - Add vopl and vopl nodes. .../dts/rockchip/rk3399-pinephone-pro.dts | 111 ++++++++++++++++++ 1 file changed, 111 insertions(+) base-commit: da8e7da11e4ba758caf4c149cc8d8cd555aefe5f diff --git a/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts b/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts index a0795a2b1cb1..5116f156d548 100644 --- a/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts +++ b/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts @@ -29,6 +29,12 @@ chosen { stdout-path = "serial2:115200n8"; }; + backlight: backlight { + compatible = "pwm-backlight"; + pwms = <&pwm0 0 1000000 0>; + pwm-delay-us = <10000>; + }; + gpio-keys { compatible = "gpio-keys"; pinctrl-names = "default"; @@ -102,6 +108,32 @@ wifi_pwrseq: sdio-wifi-pwrseq { /* WL_REG_ON on module */ reset-gpios = <&gpio0 RK_PB2 GPIO_ACTIVE_LOW>; }; + + /* MIPI DSI panel 1.8v supply */ + vcc1v8_lcd: vcc1v8-lcd { + compatible = "regulator-fixed"; + enable-active-high; + regulator-name = "vcc1v8_lcd"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + vin-supply = <&vcc3v3_sys>; + gpio = <&gpio3 RK_PA5 GPIO_ACTIVE_HIGH>; + pinctrl-names = "default"; + pinctrl-0 = <&display_pwren1>; + }; + + /* MIPI DSI panel 2.8v supply */ + vcc2v8_lcd: vcc2v8-lcd { + compatible = "regulator-fixed"; + enable-active-high; + regulator-name = "vcc2v8_lcd"; + regulator-min-microvolt = <2800000>; + regulator-max-microvolt = <2800000>; + vin-supply = <&vcc3v3_sys>; + gpio = <&gpio3 RK_PA1 GPIO_ACTIVE_HIGH>; + pinctrl-names = "default"; + pinctrl-0 = <&display_pwren>; + }; }; &cpu_alert0 { @@ -139,6 +171,11 @@ &emmc_phy { status = "okay"; }; +&gpu { + mali-supply = <&vdd_gpu>; + status = "okay"; +}; + &i2c0 { clock-frequency = <400000>; i2c-scl-rising-time-ns = <168>; @@ -362,6 +399,40 @@ &io_domains { status = "okay"; }; +&mipi_dsi { + status = "okay"; + clock-master; + + ports { + mipi_out: port@1 { + #address-cells = <0>; + #size-cells = <0>; + reg = <1>; + + mipi_out_panel: endpoint { + remote-endpoint = <&mipi_in_panel>; + }; + }; + }; + + panel@0 { + compatible = "hannstar,hsd060bhw4"; + reg = <0>; + backlight = <&backlight>; + reset-gpios = <&gpio4 RK_PD1 GPIO_ACTIVE_LOW>; + vcc-supply = <&vcc2v8_lcd>; // 2v8 + iovcc-supply = <&vcc1v8_lcd>; // 1v8 + pinctrl-names = "default"; + pinctrl-0 = <&display_rst_l>; + + port { + mipi_in_panel: endpoint { + remote-endpoint = <&mipi_out_panel>; + }; + }; + }; +}; + &pmu_io_domains { pmu1830-supply = <&vcc_1v8>; status = "okay"; @@ -374,6 +445,20 @@ pwrbtn_pin: pwrbtn-pin { }; }; + dsi { + display_rst_l: display-rst-l { + rockchip,pins = <4 RK_PD1 RK_FUNC_GPIO &pcfg_pull_down>; + }; + + display_pwren: display-pwren { + rockchip,pins = <3 RK_PA1 RK_FUNC_GPIO &pcfg_pull_down>; + }; + + display_pwren1: display-pwren1 { + rockchip,pins = <3 RK_PA5 RK_FUNC_GPIO &pcfg_pull_down>; + }; + }; + pmic { pmic_int_l: pmic-int-l { rockchip,pins = <1 RK_PC5 RK_FUNC_GPIO &pcfg_pull_up>; @@ -429,6 +514,10 @@ &sdio0 { status = "okay"; }; +&pwm0 { + status = "okay"; +}; + &sdmmc { bus-width = <4>; cap-sd-highspeed; @@ -479,3 +568,25 @@ bluetooth { &uart2 { status = "okay"; }; + +&vopb { + status = "okay"; + assigned-clocks = <&cru DCLK_VOP0_DIV>, <&cru DCLK_VOP0>, <&cru ACLK_VOP0>, <&cru HCLK_VOP0>; + assigned-clock-rates = <0>, <0>, <400000000>, <100000000>; + assigned-clock-parents = <&cru PLL_GPLL>, <&cru DCLK_VOP0_DIV>; +}; + +&vopb_mmu { + status = "okay"; +}; + +&vopl { + status = "okay"; + assigned-clocks = <&cru DCLK_VOP1_DIV>, <&cru DCLK_VOP1>, <&cru ACLK_VOP1>, <&cru HCLK_VOP1>; + assigned-clock-rates = <0>, <0>, <400000000>, <100000000>; + assigned-clock-parents = <&cru PLL_GPLL>, <&cru DCLK_VOP1_DIV>; +}; + +&vopl_mmu { + status = "okay"; +};