From patchwork Thu Dec 22 22:38:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Javier Martinez Canillas X-Patchwork-Id: 35981 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:e747:0:0:0:0:0 with SMTP id c7csp25520wrn; Thu, 22 Dec 2022 14:46:31 -0800 (PST) X-Google-Smtp-Source: AMrXdXtGq5cGtcLTI1yUszGOTLYnF3KzR1h6V/n0LmKklTyLL3SzRw76uPYLF/cWN1SwNrTBCjlM X-Received: by 2002:a17:906:11d9:b0:7ae:7c4e:195b with SMTP id o25-20020a17090611d900b007ae7c4e195bmr5606932eja.22.1671749191060; Thu, 22 Dec 2022 14:46:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671749191; cv=none; d=google.com; s=arc-20160816; b=L1MDCROwEP8jlYuKEt6dp1Q8absB/JIksHwb3a2bNrdRvff0OW3o0HDNgWgM0EviAJ UsKSWGgdCF9IskWCGZ7Y1e4O/tdXilZOHVsCIQVlvXLv1MWHQq0L14IsDG+XAaLuoOmD xPv0Oe7vdSILjoUfeAiy9teOKz/9S49CRt8cOarPwaTMa5Lzg60mSxK/2g0e3mxqVY7Q rBD9wwhG2B88CB6pKc2J3WB8dXNsQR9tYuWsvqDTlq7tGxWlB5O+DfoEVzOJQi3EorXo SbFXOt6jpC2d1vXmz+R/JDbhuB7Qy8xWLjhRO6uJ7wgKQ3zSiqOpRHOgzJmKIeslZzr8 XRrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=5VqO/oai3keL8dEjX/YRNHEFAUJ+v+2KFPvz+aMB4Ww=; b=uoBYlK7LJdY2bjJ9RN3hPhV+TG/8Yx361VloOMq8ZXKxiuz0vvFlfAKuq9dFU+w19K e+YcUGMegqU5QJKQKvHdxpY3XihaC9ywohsBlPTrCthB5TaXG/YEJlf5BkBFN2R7YD64 Sqg5O3qprk6VP8C9WYMMCNoRBB+yZGCcltEaMs7g+vccdrMT43aixa8xDi0vg8o9PQpc 9SV6Y7n/x9R7YY6rmaqLCdj9DcCP8wZSe+TQUbfdJineDf6hikn8ipf8+RuMHYGM3oKB mO0ib+QTK9JW1bTPYvcC2Sjpe/wt8DXsuUBoXIhEpPJB+speivqULET/llAw2JhQATRu XjXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=EXvEJb0B; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ae2-20020a17090725c200b007c16ef727a5si1172071ejc.824.2022.12.22.14.46.07; Thu, 22 Dec 2022 14:46:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=EXvEJb0B; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235813AbiLVWki (ORCPT + 99 others); Thu, 22 Dec 2022 17:40:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40066 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235843AbiLVWkV (ORCPT ); Thu, 22 Dec 2022 17:40:21 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C622627DC1 for ; Thu, 22 Dec 2022 14:38:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1671748730; 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: in-reply-to:in-reply-to:references:references; bh=5VqO/oai3keL8dEjX/YRNHEFAUJ+v+2KFPvz+aMB4Ww=; b=EXvEJb0BVKOalJA4pmJ0GT6zxU3nUVK7GB543+GBt+yLxOQ2ik3Kt/Km4ZnbQ1QBEcRFRZ vRDSFsQY2BmdeOLRheCnjgFlkWArM3x836zMhFPT7Z0HfNcAouYP+ptr+/9fogmmWS12ck OHVu85b4o+aAc8SD9Kr520bg4dVtfMk= 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_128_GCM_SHA256) id us-mta-509-SVSKqKboOpGp70LqCz94Ww-1; Thu, 22 Dec 2022 17:38:48 -0500 X-MC-Unique: SVSKqKboOpGp70LqCz94Ww-1 Received: by mail-wm1-f71.google.com with SMTP id bi19-20020a05600c3d9300b003cf9d6c4016so2892291wmb.8 for ; Thu, 22 Dec 2022 14:38:48 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=5VqO/oai3keL8dEjX/YRNHEFAUJ+v+2KFPvz+aMB4Ww=; b=716Q6FHYLi1n8q8bV5HvRHV2YAHqYWgYBAr6tSrNdyuGeJDrzZXABpc/DDGBaTTIRZ HlNJ37LoggslOTpMzyuPteOq6ymm8qd/l+L0it1xeIbVGAFa2v5Nvd70v9fKTvJUhDUq u6QI1xrqVDNM7G2xv/Cdf1H8F2wZZdLQecsbHjHeLULbjZm9Hzdqh8kf9GLtMogjcq8d Mv5W1QKmgRP0NVKZrDXP+LTNfwadyn+g2fz/jMexHwHGHljmgTSleUpiu0B741tynPEJ 21bZa819knGT/F0HnxYXwteeiABbe6u+ojw8XWoAeMn9kBSYpRf9Ng8uHQWWKNyYInhz Aj8A== X-Gm-Message-State: AFqh2koP3mFgGQcAZjV3JDvlNzy0jgxJhXMzPUTXbbGNIOshIiOek1WV kNownMWbRMBCJgSj4KfcTfQjqYSOmoAY+RS75cvGrEDfrktrS83OGQGEfpYq1b1hPEtrE3AFnjP bkn7gUkIsFBS81dzYpeO1WoT5gkELuf/DFmWIwHjPGtrBgKEPlDnXXGnhOVb6uWwDtkgSG7VOea w= X-Received: by 2002:a05:600c:2e44:b0:3d3:4406:8a3c with SMTP id q4-20020a05600c2e4400b003d344068a3cmr5381466wmf.32.1671748727411; Thu, 22 Dec 2022 14:38:47 -0800 (PST) X-Received: by 2002:a05:600c:2e44:b0:3d3:4406:8a3c with SMTP id q4-20020a05600c2e4400b003d344068a3cmr5381445wmf.32.1671748727160; Thu, 22 Dec 2022 14:38:47 -0800 (PST) Received: from minerva.home (205.pool92-176-231.dynamic.orange.es. [92.176.231.205]) by smtp.gmail.com with ESMTPSA id n25-20020a7bc5d9000000b003d969a595fbsm2386239wmk.10.2022.12.22.14.38.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Dec 2022 14:38:46 -0800 (PST) From: Javier Martinez Canillas To: linux-kernel@vger.kernel.org Cc: Ondrej Jirman , Robert Mader , Peter Robinson , =?utf-8?q?Kamil_Trzci=C5=84ski?= , Martijn Braam , Javier Martinez Canillas , Caleb Connolly , Heiko Stuebner , Krzysztof Kozlowski , Rob Herring , Tom Fitzhenry , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org Subject: [PATCH 4/4] arm64: dts: rk3399-pinephone-pro: Add internal display support Date: Thu, 22 Dec 2022 23:38:30 +0100 Message-Id: <20221222223830.2494900-5-javierm@redhat.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221222223830.2494900-1-javierm@redhat.com> References: <20221222223830.2494900-1-javierm@redhat.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1752956079471463286?= X-GMAIL-MSGID: =?utf-8?q?1752956079471463286?= From: Ondrej Jirman The phone's display is using Hannstar LCD panel, and Goodix based touchscreen. Support it. Signed-off-by: Ondrej Jirman Co-developed-by: Martijn Braam Signed-off-by: Martijn Braam Co-developed-by: Kamil Trzciński Signed-off-by: Kamil Trzciński Signed-off-by: Javier Martinez Canillas --- .../dts/rockchip/rk3399-pinephone-pro.dts | 124 ++++++++++++++++++ 1 file changed, 124 insertions(+) diff --git a/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts b/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts index 0e4442b59a55..a0439a60395e 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:1500000n8"; }; + backlight: backlight { + compatible = "pwm-backlight"; + pwms = <&pwm0 0 1000000 0>; + pwm-delay-us = <10000>; + }; + gpio-keys { compatible = "gpio-keys"; pinctrl-names = "default"; @@ -81,6 +87,32 @@ vcc1v8_codec: vcc1v8-codec-regulator { regulator-max-microvolt = <1800000>; vin-supply = <&vcc3v3_sys>; }; + + /* 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_l0 { @@ -111,6 +143,11 @@ &emmc_phy { status = "okay"; }; +&gpu { + mali-supply = <&vdd_gpu>; + status = "okay"; +}; + &i2c0 { clock-frequency = <400000>; i2c-scl-rising-time-ns = <168>; @@ -193,6 +230,9 @@ vcc3v0_touch: LDO_REG2 { regulator-name = "vcc3v0_touch"; regulator-min-microvolt = <3000000>; regulator-max-microvolt = <3000000>; + regulator-state-mem { + regulator-off-in-suspend; + }; }; vcca1v8_codec: LDO_REG3 { @@ -326,6 +366,26 @@ opp07 { }; }; +&i2c3 { + i2c-scl-rising-time-ns = <450>; + i2c-scl-falling-time-ns = <15>; + status = "okay"; + + touchscreen@14 { + compatible = "goodix,gt917s"; + reg = <0x14>; + interrupt-parent = <&gpio3>; + interrupts = ; + irq-gpios = <&gpio3 RK_PB5 GPIO_ACTIVE_HIGH>; + reset-gpios = <&gpio3 RK_PB4 GPIO_ACTIVE_HIGH>; + AVDD28-supply = <&vcc3v0_touch>; + VDDIO-supply = <&vcc3v0_touch>; + touchscreen-size-x = <720>; + touchscreen-size-y = <1440>; + poweroff-in-suspend; + }; +}; + &io_domains { bt656-supply = <&vcc1v8_dvp>; audio-supply = <&vcca1v8_codec>; @@ -334,6 +394,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"; @@ -360,6 +454,20 @@ vsel2_pin: vsel2-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>; + }; + }; + sound { vcc1v8_codec_en: vcc1v8-codec-en { rockchip,pins = <3 RK_PA4 RK_FUNC_GPIO &pcfg_pull_down>; @@ -367,6 +475,10 @@ vcc1v8_codec_en: vcc1v8-codec-en { }; }; +&pwm0 { + status = "okay"; +}; + &sdmmc { bus-width = <4>; cap-sd-highspeed; @@ -396,3 +508,15 @@ &tsadc { &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_CPLL>, <&cru DCLK_VOP0_FRAC>; +}; + +&vopb_mmu { + status = "okay"; +};