From patchwork Tue Mar 28 07:33:08 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: 13190628 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 9C91EC76196 for ; Tue, 28 Mar 2023 07:34:24 +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:References:In-Reply-To: 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: List-Owner; bh=jUY1saFHSYyHISzVLWTLQvlH+YUE5l5+wkploXmAdkc=; b=lQwdr1QeRphoZ1 Pigi0TjBXfI7+hbaNjfMW2+UMYJCvc8AQeumhxJvritc09h1AvsSOD2V7qhzPh0W7QbPbBp+qTQD+ XNn1p3Ivq/IXuRvDsj+VNNQeffrHoZXd7WRrXvvdbgWxT6Gagn2tHA1HC/B88+ZDBtXLBuNHYiK8c E7D2PWLuFH75iCSi3YteLQ+HQ4WwXQBo5ykdffLKHnWRq33ffGDlIEjiTrIxTqs5suPb5dFUE33bU 6mv+hJWPWCptgR1wcuLXqAbO6c1gfF5Emnjy0ptOY33UWrOIz6XgK33H7+Qc2YOxP3tTERKDqY5q2 C5KQNWjPqZW0vjnFrrzg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1ph3ph-00DSJZ-2Q; Tue, 28 Mar 2023 07:33:29 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1ph3pY-00DSEw-03 for linux-arm-kernel@lists.infradead.org; Tue, 28 Mar 2023 07:33:22 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1679988799; 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=3RKROZr4GzDPgqMOFWqSLDrRs2RHwcu0c+oEbFcDZ1s=; b=VXLxhGwmdRMsdQ5YLXj/5mWi/XBO22/+EIiJ/GDTKvAHpnW5+rDn3S7rak9Ils/OnODCT7 jXlFRJkKJ+2aBYPMtyXUyeJWSS6nR/iPtWpObpFGB3cTp2uqIGSV7B04fMVhRwEZarZBJp rrYFw9MO9cS+ULOxXaa02BNTokD45Cs= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-638-XYsQKqsiPK2GMjMVnZ4-cw-1; Tue, 28 Mar 2023 03:33:17 -0400 X-MC-Unique: XYsQKqsiPK2GMjMVnZ4-cw-1 Received: by mail-wm1-f69.google.com with SMTP id o28-20020a05600c511c00b003ef69894934so2929847wms.6 for ; Tue, 28 Mar 2023 00:33:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679988796; 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=3RKROZr4GzDPgqMOFWqSLDrRs2RHwcu0c+oEbFcDZ1s=; b=50S1dqf7Of152VNNvuo96oWFBS2lBmLysHD/FhQ1KBTcFcp3Pqur7W4Q+7F4tfa+O4 3b6peTXtdRQLbxBPCuARQ9ZJNkP6xGGwFnlNxvVJvXKIM5l6sdvr/BPZG4HmTNqMWj3h x2GM5lUUT3lGScdFj5q1UXDz2l0m/i/SscBM7lRCGZI3Og1g9bdpPDXmYRIiTA2p+fYB EDE8zQDtNEfV+FLOfBEBt21YVrEymysWPm1jeykEezULNDRpGYkuiQvRVn1SYe2IntTX lkTdbUyY9JJm5Zkm/22S4e+/7s88ClfgObSwcxm6tNDGdSoZV1tJDIsh8fyXxq2sygkQ ckHA== X-Gm-Message-State: AO0yUKVW36gvHMhVbHfGEpnmBzmHdggC5NvAMEpIZwtngtvxrn/KFRIm Y+YPbc6L8Kqxq+ra6eXiB1GPBsujcDmd0fYlWRRzWo3AdyV9v2BYzxuApFDkqxwXA/IsrsnpK7o KujJd9DbFTi+naN3+WlvBPk9DQ7+bipyRZ3c= X-Received: by 2002:a05:600c:287:b0:3ed:cc22:23db with SMTP id 7-20020a05600c028700b003edcc2223dbmr11833337wmk.3.1679988796652; Tue, 28 Mar 2023 00:33:16 -0700 (PDT) X-Google-Smtp-Source: AK7set+E7Hunz2KKt4RZvQ903yvOLNFadeK9bEOzN8DCEVH3HEHCePFn8XpKOb8OMCb77RgGdWB2qw== X-Received: by 2002:a05:600c:287:b0:3ed:cc22:23db with SMTP id 7-20020a05600c028700b003edcc2223dbmr11833309wmk.3.1679988796327; Tue, 28 Mar 2023 00:33:16 -0700 (PDT) Received: from minerva.home (205.pool92-176-231.dynamic.orange.es. [92.176.231.205]) by smtp.gmail.com with ESMTPSA id j6-20020a05600c190600b003ef6bc71cccsm7527075wmq.27.2023.03.28.00.33.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Mar 2023 00:33:16 -0700 (PDT) From: Javier Martinez Canillas To: linux-kernel@vger.kernel.org Cc: Peter Robinson , Tom , Robert Mader , Laurent Pinchart , Martijn Braam , Ondrej Jirman , Jacopo Mondi , =?utf-8?q?Kamil_Trzci=C5=84sk?= =?utf-8?q?i?= , Javier Martinez Canillas , Heiko Stuebner , Jarrah Gosbell , Krzysztof Kozlowski , Rob Herring , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org Subject: [PATCH v3 1/2] arm64: dts: rk3399-pinephone-pro: Add internal display support Date: Tue, 28 Mar 2023 09:33:08 +0200 Message-Id: <20230328073309.1743112-2-javierm@redhat.com> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230328073309.1743112-1-javierm@redhat.com> References: <20230328073309.1743112-1-javierm@redhat.com> 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-20230328_003320_129145_0C862209 X-CRM114-Status: GOOD ( 16.19 ) 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: Martijn Braam 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: Martijn Braam Co-developed-by: Kamil Trzciński Signed-off-by: Kamil Trzciński Co-developed-by: Ondrej Jirman Signed-off-by: Ondrej Jirman Signed-off-by: Javier Martinez Canillas Tested-by: Ondrej Jirman --- Changes in v3: - Fix some ./scripts/checkpatch.pl --strict warnings. - Add Ondrej Jirman Tested-by tag. - Change PWM period to 50000 since 20 kHz is recommended (Ondrej Jirman). - Remove useless comments for the panel regulators (Ondrej Jirman). - Drop unneeded pinctrl pull down conf for pins that either already have a pull-down resistor or are already driven by the SoC (Ondrej Jirman). - Remove "pwm-delay-us" property not supported in mainline (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 | 95 +++++++++++++++++++ 1 file changed, 95 insertions(+) diff --git a/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts b/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts index a0795a2b1cb1..539b36e8bff5 100644 --- a/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts +++ b/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts @@ -29,6 +29,11 @@ chosen { stdout-path = "serial2:115200n8"; }; + backlight: backlight { + compatible = "pwm-backlight"; + pwms = <&pwm0 0 50000 0>; + }; + gpio-keys { compatible = "gpio-keys"; pinctrl-names = "default"; @@ -102,6 +107,30 @@ 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"; + }; + + /* 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"; + }; }; &cpu_alert0 { @@ -139,6 +168,11 @@ &emmc_phy { status = "okay"; }; +&gpu { + mali-supply = <&vdd_gpu>; + status = "okay"; +}; + &i2c0 { clock-frequency = <400000>; i2c-scl-rising-time-ns = <168>; @@ -362,6 +396,39 @@ &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>; + iovcc-supply = <&vcc1v8_lcd>; + pinctrl-names = "default"; + + port { + mipi_in_panel: endpoint { + remote-endpoint = <&mipi_out_panel>; + }; + }; + }; +}; + &pmu_io_domains { pmu1830-supply = <&vcc_1v8>; status = "okay"; @@ -429,6 +496,10 @@ &sdio0 { status = "okay"; }; +&pwm0 { + status = "okay"; +}; + &sdmmc { bus-width = <4>; cap-sd-highspeed; @@ -479,3 +550,27 @@ 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"; +};