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: 13188685 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 E7327C7619A for ; Mon, 27 Mar 2023 07:43:17 +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=hHoPixCPoq0ehL1GJ+24Vly+Ant0s6qNv97Imy6IhqE=; b=yXAp+Kfcoiv8dJ FavTtAU6VqjIqPKH6TwUYDw1GTXqZGqmdAmjkyFjZlf04qWgIL41OOlNhG4JXWoh6PzrYxiq201BZ XRtoui49LyU9KSwHV+hTsyc6cWP4AgwUaBfZ51j0UGD/vwfVVz0nfFvZoL+Pt7w+jp5Qdnuf88qGA FhAoCujImQeRpWmsbVjSeP6Tz93sJRThYmr337ZEJI7weTrHCUm9Y224vL8dCbHryIxDnv0wE6TbE MBgZRnJG+mhddn5EqzKbsTsUDfcU7ufP7BRAIJZWp+/WTrldfAexnaD4cfwvL3T2Cho8olswHk5J6 LlqG1TWkN8vcAtC55ICw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pghUh-00A5zH-1A; Mon, 27 Mar 2023 07:42:19 +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-00A5xY-22 for linux-arm-kernel@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-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-591-q9JMHdmlOG2e5AicSap2WQ-1; Mon, 27 Mar 2023 03:42:09 -0400 X-MC-Unique: q9JMHdmlOG2e5AicSap2WQ-1 Received: by mail-wm1-f72.google.com with SMTP id v11-20020a05600c444b00b003ef6803b3cdso2208510wmn.4 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=DU2/ECGNZrdx7jPtDAXXVo2C5Yg8alPSqQ8BuyUNTURPOfJgPtcQTKetEzO22tg3k2 6XjC86YgFf5b+Pta5kLUQZwMdjh0ApqIbA/252lrzZwcAqPveNtC1QR2JGgc4H8UZAkm Xl5BuLEg6E26STFtPGw0T6Wz/xtd36bbNVPIj5CaAy6XVD9QNgIe5gu915oN3GoBVFyX ZH7kQkLL+x2Hls6y7JTeIaA+Clp3p00uJswEqge9C7+5/9PKs54KwE22vd2ErbWE3X4m QRP6QOVGixuJDuKCKwuSbWYpWi9ghpkspz7ABJT8zfV2qvcQlzEZEn6/FN0YeG0LWqmZ qjhw== X-Gm-Message-State: AO0yUKWrUIQiR3nkhMpZ2uw+a0voAQd0cH7g5+XHGN02E2eWgOR+V5tb 9tzs41ajqXsXZvxt3ZIU3vwvOU/meVuwSztpvGSNfN4IFKEiH4tAPCxkcP0E1RsnB3O/PEtRd6a pJ7Cf5KKTjuReRqdp8T3OCKaoxr11WF5wiIS6KPgIKr8= X-Received: by 2002:a05:600c:b42:b0:3ee:6cdf:c357 with SMTP id k2-20020a05600c0b4200b003ee6cdfc357mr7727977wmr.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_745880_D2C49546 X-CRM114-Status: GOOD ( 13.69 ) 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 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"; +};