From patchwork Mon Dec 26 13:49:08 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: 13081820 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 1535FC3DA79 for ; Mon, 26 Dec 2022 13:50:13 +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=RFMYlRWKt5tBXaSxnZKt26eCLg7vrlnrxK1siRdDCCI=; b=LLj64YhZF5caG0 Z/1PSPVeYwvo4Nj0eUSWwmtUccdCGdUVv5r6Rr39fI6rssA4YbH5IEiwkmDUvI+8/mM7CCrYGIxB3 aeT5jEV3E1+dppVBzUaf7apilW0a432ZLtxPX5sWwTq9iqpfbVs/adxZg5C7QKwnA1Z3W5TL8lWiD F86HPeObdEFZoLSTWfJ+aE7N5JeKJAjr3imiaKMNqBMN8wONg7GMFx4NMKdfUbHMph5dRoie9dYhm IWsTicSrnDVH7Wxm6luO95st81xvytC1UwgJYdOseXohwmVix8+bDwTwemcLHF5opoird6F7qi9Gs oTcdQBkimxaa2W+M8XGw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p9nrT-004MO3-DY; Mon, 26 Dec 2022 13:49:51 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1p9nrA-004ME5-Pq for linux-rockchip@lists.infradead.org; Mon, 26 Dec 2022 13:49:34 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1672062572; 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=gw4YKyE6m3dvm+AI9a6ZkGYjDJAM63OXGslSUuAlLo8=; b=bCoukQf5gUaenFoUq2U4x70Q6oWs6EMLCuMPPsVpi4KDMkZNeQpljA9aCEIedfwZ83KsjL C+qRT599T7kuDj9kDknU++1MdeW9U2sEb2mj+VpBGLMKa/nDCIgTNHYBrCW7TNr6WxuLaF PM1J7zDnTHjeax7uKEH8pESEwVLRT2A= 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_128_GCM_SHA256) id us-mta-490-AJacGok6OFyMMfgOaFzkCA-1; Mon, 26 Dec 2022 08:49:28 -0500 X-MC-Unique: AJacGok6OFyMMfgOaFzkCA-1 Received: by mail-wm1-f72.google.com with SMTP id k20-20020a05600c1c9400b003d9717c8b11so3664398wms.7 for ; Mon, 26 Dec 2022 05:49:27 -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=gw4YKyE6m3dvm+AI9a6ZkGYjDJAM63OXGslSUuAlLo8=; b=QvCGdxTTI8NOEW7sdchoDAvyhGWfRhdLmiIcjxRieb+mxVqhpPOYk8YcHge3PAncq5 mSnR5NOCGAFqNvrwwf/0G0FKRt/jR2oUoy01JRzAZL0yFjSrMDQNfh9cUPInrb89HprV ntq2Oo1YJGtYEenAIhTBa+pITq5AbBremvXXw+dohEtNz8sj3jg7Gfq/eG+5WHYqEhzI KTGr+tQ4F8Ijc8hlnxpA8Vfo5GkMRE6Fx+9cerYOWgWnz+nDE6gQ3LLWXT7nlYUabXZt yDwg2F5nLgDSvAouRKf0dSHrx+TJSEQf6rSSL0C7E6C9oi4hV5aWpQIT+TbNzjbd4Z1j Q41w== X-Gm-Message-State: AFqh2krV/4gycmuaIlLawBRpdAdZRx7X3eXexGZbX/s/qQte006qNo6z ykxiIkhumBEbHqwiCOitJHcKrQzZOmll8iIFP4MmreZxH0gIzFkV7i5y5wv6zv4AiDlhrytJOiP E3An9axywbufOnfMB9D1EgWm/5SyAHUJ9 X-Received: by 2002:a7b:c7d6:0:b0:3d1:ee3a:62ae with SMTP id z22-20020a7bc7d6000000b003d1ee3a62aemr15855528wmk.8.1672062567021; Mon, 26 Dec 2022 05:49:27 -0800 (PST) X-Google-Smtp-Source: AMrXdXsSXL0Ns8UFml4pgFquWr3xql1Chfes3jlMi8ynWpv2K9/OhcnWWzORV78VW6XaRzrrIKwXrg== X-Received: by 2002:a7b:c7d6:0:b0:3d1:ee3a:62ae with SMTP id z22-20020a7bc7d6000000b003d1ee3a62aemr15855517wmk.8.1672062566819; Mon, 26 Dec 2022 05:49:26 -0800 (PST) Received: from minerva.home (205.pool92-176-231.dynamic.orange.es. [92.176.231.205]) by smtp.gmail.com with ESMTPSA id a18-20020adfed12000000b0027cfd9463d7sm3340947wro.110.2022.12.26.05.49.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Dec 2022 05:49:26 -0800 (PST) From: Javier Martinez Canillas To: linux-kernel@vger.kernel.org Cc: Ondrej Jirman , Krzysztof Kozlowski , Robert Mader , Sam Ravnborg , Maya Matuszczyk , =?utf-8?q?Kamil_Trzci=C5=84ski?= , Martijn Braam , Peter Robinson , Tom Fitzhenry , Javier Martinez Canillas , Heiko Stuebner , Krzysztof Kozlowski , Rob Herring , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org Subject: [PATCH v2 4/4] arm64: dts: rk3399-pinephone-pro: Add internal display support Date: Mon, 26 Dec 2022 14:49:08 +0100 Message-Id: <20221226134909.2822179-5-javierm@redhat.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221226134909.2822179-1-javierm@redhat.com> References: <20221226134909.2822179-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-20221226_054932_920556_179DAC49 X-CRM114-Status: GOOD ( 12.16 ) 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 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 --- Changes in v2: - Fix regulator node names (Maya Matuszczyk). - Drop non-existent "poweroff-in-suspend" property (Maya Matuszczyk). - Remove unnecessary comments in panel node (Maya Matuszczyk). .../dts/rockchip/rk3399-pinephone-pro.dts | 123 ++++++++++++++++++ 1 file changed, 123 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..55048236eef7 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-regulator { + 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-regulator { + 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,25 @@ 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>; + }; +}; + &io_domains { bt656-supply = <&vcc1v8_dvp>; audio-supply = <&vcca1v8_codec>; @@ -334,6 +393,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>; + iovcc-supply = <&vcc1v8_lcd>; + 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 +453,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 +474,10 @@ vcc1v8_codec_en: vcc1v8-codec-en { }; }; +&pwm0 { + status = "okay"; +}; + &sdmmc { bus-width = <4>; cap-sd-highspeed; @@ -396,3 +507,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"; +};