From patchwork Thu Dec 22 22:38:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Javier Martinez Canillas X-Patchwork-Id: 636075 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1CD0DC4332F for ; Thu, 22 Dec 2022 22:39:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235771AbiLVWjh (ORCPT ); Thu, 22 Dec 2022 17:39:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40004 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235773AbiLVWjf (ORCPT ); Thu, 22 Dec 2022 17:39:35 -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 9EE9E22BF8 for ; Thu, 22 Dec 2022 14:38:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1671748726; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=bwxYSowsUOVXzzYlhvfbTb6mQSaIuo8BKUhLeaVJXnY=; b=BxBcJJi8/bdUh00PppcPRFjfJg9QPPvonb5Uin2qRfgKh0qswGm6NenmWibk96Lmo+bvSj TPfDv/zdasbLibDGdE0xLVeT5RPliUXy3Jfw2wDPQM1om32dXR/3mMNKvjLYUxcSVUEp4H kyZDwYBt1Qd8z0gg5Ka+GFd9+bnpvRw= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-61-Yb6u4u_9OTqbRMfsqmF98g-1; Thu, 22 Dec 2022 17:38:45 -0500 X-MC-Unique: Yb6u4u_9OTqbRMfsqmF98g-1 Received: by mail-wr1-f70.google.com with SMTP id u9-20020adfa189000000b00242121eebe2so744019wru.3 for ; Thu, 22 Dec 2022 14:38:45 -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=bwxYSowsUOVXzzYlhvfbTb6mQSaIuo8BKUhLeaVJXnY=; b=rHdlhT3RPjWPoZc8DplrrDjRpG8KpUi042Nd4YRV3wMNtQU5/QPyRkUupmMWXYPmMl Y1lr9aeVCQ6o73FSlCMbpSONzjN4kBPZn1DfjuW1ALPSe0NQDOpzE/YI2v9QsawFcyav zee4M1q0aDqRTJzA1g156YBmD3/XlX0u8YZrzUVPyZvLYCOcQCXFoWfL2Pfu6EM1Vw8P N86z0nasaOAXK6QDUh+k1Gmo0lbN00NaXO8LQy5FHi/Mm2/H/Plzr9/S5ZnEwjnBANdL nJouTUSqEEM0ypmRQN4UH6Uq2O3KYKex5bsLEC32/mbL2VjldSN8OtWHHujOvOIrFnho M5NA== X-Gm-Message-State: AFqh2koRUQMVxrXJilsA/3hTssA7PRdyuWePr0CO0smejIHODkPQUadC e0ThTPO4H5q91tYd87NXcq5JUpdhsASc54OyOnJWn+7EYXkT0HcP7bIiPv3f87bR7aMdLxZ3HoT gVO7orHbDbjlEhPsqpWBzEw== X-Received: by 2002:a05:600c:1f12:b0:3d2:267d:64bd with SMTP id bd18-20020a05600c1f1200b003d2267d64bdmr6313204wmb.3.1671748724360; Thu, 22 Dec 2022 14:38:44 -0800 (PST) X-Google-Smtp-Source: AMrXdXtj1GOClBqgj08o5W4U34PiMnriSuW9A874fwaAVPy8exsgnTQ+N7dR0zR/XVRxgoDUmZD9nw== X-Received: by 2002:a05:600c:1f12:b0:3d2:267d:64bd with SMTP id bd18-20020a05600c1f1200b003d2267d64bdmr6313197wmb.3.1671748724177; Thu, 22 Dec 2022 14:38:44 -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.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Dec 2022 14:38:43 -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 , Daniel Vetter , David Airlie , Krzysztof Kozlowski , Rob Herring , Sam Ravnborg , Thierry Reding , devicetree@vger.kernel.org, dri-devel@lists.freedesktop.org Subject: [PATCH 2/4] dt-bindings: display: Add Himax HX8394 panel controller bindings Date: Thu, 22 Dec 2022 23:38:28 +0100 Message-Id: <20221222223830.2494900-3-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 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Add device tree bindings for panels based on the Himax HX8394 controller, such as the HannStar HSD060BHW4 720x1440 TFT LCD panel that is connected through a MIPI-DSI video interface. Signed-off-by: Javier Martinez Canillas Reviewed-by: Krzysztof Kozlowski --- .../bindings/display/panel/himax,hx8394.yaml | 68 +++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 Documentation/devicetree/bindings/display/panel/himax,hx8394.yaml diff --git a/Documentation/devicetree/bindings/display/panel/himax,hx8394.yaml b/Documentation/devicetree/bindings/display/panel/himax,hx8394.yaml new file mode 100644 index 000000000000..a8084e95f2fe --- /dev/null +++ b/Documentation/devicetree/bindings/display/panel/himax,hx8394.yaml @@ -0,0 +1,68 @@ +# SPDX-License-Identifier: (GPL-2.0-only or BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/display/panel/himax,hx8394.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Himax HX8394 MIPI-DSI LCD panel controller device tree bindings + +maintainers: + - Javier Martinez Canillas + +description: + Device tree bindings for panels based on the Himax HX8394 controller, + such as the HannStar HSD060BHW4 720x1440 TFT LCD panel connected with + a MIPI-DSI video interface. + +allOf: + - $ref: panel-common.yaml# + +properties: + compatible: + enum: + # HannStar HSD060BHW4 5.99" 720x1440 TFT LCD panel + - hannstar,hsd060bhw4 + + port: true + reg: + maxItems: 1 + description: DSI virtual channel + + vcc-supply: + description: Panel power supply + + iovcc-supply: + description: I/O voltage supply + + reset-gpios: true + + backlight: true + +required: + - compatible + - reg + - vcc-supply + - iovcc-supply + - reset-gpios + - backlight + +additionalProperties: false + +examples: + - | + #include + + dsi { + #address-cells = <1>; + #size-cells = <0>; + panel@0 { + compatible = "hannstar,hsd060bhw4"; + reg = <0>; + vcc-supply = <®_2v8_p>; + iovcc-supply = <®_1v8_p>; + reset-gpios = <&gpio3 13 GPIO_ACTIVE_LOW>; + backlight = <&backlight>; + }; + }; + +... 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: 636074 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 64155C3DA7A for ; Thu, 22 Dec 2022 22:40:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235525AbiLVWkh (ORCPT ); Thu, 22 Dec 2022 17:40:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40064 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235845AbiLVWkV (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.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9A68D27CF8 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=1671748729; 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=NrOk118NASsBtx3pk55/srrWkkeukdN1SlprOmtK0ygFRxxRhA8EAPr8hjmMAJcw5tGC1z G+Pg0PuKwzl5kpgAJ3XAl1QAhFvznZlBcwOc7Qv3fE4aTnJUztIZ4F3ALWMVHjchvPG4uE Kb1OwRadxJTDafQQC2r9DuYQtvPs5Hg= 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-596-mP4D20_aPoiAPUGfZ-0zCw-1; Thu, 22 Dec 2022 17:38:48 -0500 X-MC-Unique: mP4D20_aPoiAPUGfZ-0zCw-1 Received: by mail-wm1-f71.google.com with SMTP id h64-20020a1c2143000000b003d65ff910e1so2901639wmh.2 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=GMGyGzoyG0jhH8DKrjtVJEWjVeHGlRT6yiZCLHSFWMyxemYcqX0Q2cQo/bV+QrZTOK tbN6Ob+qGuzmz/3n96x8r5adeaOZZ1NTT7mpgGIK0f511N4mB8AMxy69TOUTleBk+VCp J2g9E8cqztUKhpXkg89CF6MbXv3b0dzsNlGeHcXUyuSt77AqSB0XZAm8FnW/cIQd2wax iYHPnpfamRM/BU9ArvvLmikL5p/6To2HgKmi2qhnO8bbqXj1I+WsFI7f+7dPg3WP32TN G0Of6UxPRVvg4gMR05++23aRjyrwXbHm+1/MkNsbqzmVy40RIYuXMdjFUPtgqweVEIhO tLvw== X-Gm-Message-State: AFqh2kpTAPOWB3Z4Q1qakOQPAAdGXxT/C94BuoDDPLo0Z7ZdB4VcdprE XO6hInQB7Vuzlm6k4g2rcVRCSSf3D0MhH94Iy25cP6em+BMnbOGuPp0RAQ31MYSN1CgJqOMAdr2 UH1RDMndw80mwv/IwM9Dhpw== X-Received: by 2002:a05:600c:2e44:b0:3d3:4406:8a3c with SMTP id q4-20020a05600c2e4400b003d344068a3cmr5381451wmf.32.1671748727351; Thu, 22 Dec 2022 14:38:47 -0800 (PST) X-Google-Smtp-Source: AMrXdXujTp/r+Z9BJodxOP+KL4VFiH6woCgGKOUx1Gqbs/viGQvmDG3JnCj2av/xH0vD5gJtdWRlwA== 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 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.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 --- .../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"; +};