From patchwork Tue Dec 27 11:03:32 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: 637124 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 25D57C4167B for ; Tue, 27 Dec 2022 11:05:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229550AbiL0LE7 (ORCPT ); Tue, 27 Dec 2022 06:04:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53788 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231414AbiL0LEg (ORCPT ); Tue, 27 Dec 2022 06:04:36 -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 AD664A452 for ; Tue, 27 Dec 2022 03:03:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1672139025; 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=woUir0Lts/Iv/2E8U+LoYyfYL4VWI99Q3r6CZZFNa7I=; b=MrTefwFox8HEi0pMV3lYHx6I5M5/ZUXHasnWPONPmmgjlIPi4GG4bBOXbvrAM3oU6WGzOQ mK1CrU2zx73FyY4Pk7PbruBiHLTD5IddkU0pB13TdJ6Y9mhJjBmpP6RCx6+bOEohoqE6gy tkGdoW+58M8Bg5ms43muBmwX1r+eYpg= 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-224-It2v04OHOqOAyawxce8Siw-1; Tue, 27 Dec 2022 06:03:42 -0500 X-MC-Unique: It2v04OHOqOAyawxce8Siw-1 Received: by mail-wm1-f72.google.com with SMTP id c7-20020a1c3507000000b003d355c13ba8so6770320wma.6 for ; Tue, 27 Dec 2022 03:03:42 -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=woUir0Lts/Iv/2E8U+LoYyfYL4VWI99Q3r6CZZFNa7I=; b=xpVXXPvzD/GbOe8acIOYkrD18aho430o1w0/VV3McjejGBNlfBBg9JnmhQQWGiz/c7 efHX3bqVuiGGS69UKNQSw6pII5Pd8aD/Zfa/4m7EEFB0/uKxIDkcxAOyuRjXVUDnrs37 zHvYvm4h9QQOngDUJyi6Jm7v+E3s6m5cCygwxqoCTSL3JEvPcV81bON3ZYS7L5QYf2R/ rlGbn4QGeHrYWgo242Y5+SLSr3MgVZV+MfJMllW8ZLUeLNfHbihvclDMS3/xscase/ys ire9nMjFo6cQ3Lyp4tflzr3IfWjBV/xcbEgQAydbsAiIkjgJB3N63h5OzUfbTtMA8Lwr aiJw== X-Gm-Message-State: AFqh2ko1aHdeFFuiuChQUk6vfDHukkzaoOkum8w1tGcuP9I8Sq8NXLD7 tPyhrA1FcMokzVO/qx9D3iNGrC14DPZNC44Gkn5ubOqXTOLS6juXaZtBZMjuHpgWAuOcFBSQP57 GS9PvPh4yzdoP60lgqB7z8Q== X-Received: by 2002:adf:e283:0:b0:242:324e:b3d with SMTP id v3-20020adfe283000000b00242324e0b3dmr12664689wri.1.1672139021659; Tue, 27 Dec 2022 03:03:41 -0800 (PST) X-Google-Smtp-Source: AMrXdXu7zMUDKll3qV0ZETnVhuW7RvKZ8fTiq1amBtPxkYibGhjX8ph/GklBGnF4PA+Z7Kdki684zg== X-Received: by 2002:adf:e283:0:b0:242:324e:b3d with SMTP id v3-20020adfe283000000b00242324e0b3dmr12664672wri.1.1672139021448; Tue, 27 Dec 2022 03:03:41 -0800 (PST) Received: from minerva.home (205.pool92-176-231.dynamic.orange.es. [92.176.231.205]) by smtp.gmail.com with ESMTPSA id p18-20020a056000019200b00279d23574c4sm7374557wrx.13.2022.12.27.03.03.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Dec 2022 03:03:41 -0800 (PST) From: Javier Martinez Canillas To: linux-kernel@vger.kernel.org Cc: Peter Robinson , Martijn Braam , Maya Matuszczyk , Sam Ravnborg , Neal Gompa , =?utf-8?q?Kamil_Trzci=C5=84ski?= , Tom Fitzhenry , Krzysztof Kozlowski , Robert Mader , Onuralp Sezer , Ondrej Jirman , dri-devel@lists.freedesktop.org, Javier Martinez Canillas , Daniel Vetter , David Airlie , Krzysztof Kozlowski , Rob Herring , Thierry Reding , devicetree@vger.kernel.org Subject: [PATCH v3 1/4] dt-bindings: display: Add Himax HX8394 panel controller Date: Tue, 27 Dec 2022 12:03:32 +0100 Message-Id: <20221227110335.2923359-2-javierm@redhat.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221227110335.2923359-1-javierm@redhat.com> References: <20221227110335.2923359-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 --- Changes in v3: - Fix example snippet for `make dt_binding_check` to pass (Krzysztof Kozlowski). Changes in v2: - Drop redundant "bindings" in subject (Krzysztof Kozlowski). - Drop "device tree bindings" in title (Krzysztof Kozlowski). - Put port next to other "true" properties (Krzysztof Kozlowski). - Add Krzysztof Kozlowski's Reviewed-by tag. .../bindings/display/panel/himax,hx8394.yaml | 74 +++++++++++++++++++ 1 file changed, 74 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..fb1981cacfc8 --- /dev/null +++ b/Documentation/devicetree/bindings/display/panel/himax,hx8394.yaml @@ -0,0 +1,74 @@ +# 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 + +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 + + reg: true + + reset-gpios: true + + backlight: true + + port: true + + vcc-supply: + description: Panel power supply + + iovcc-supply: + description: I/O voltage supply + +required: + - compatible + - reg + - reset-gpios + - backlight + - port + - vcc-supply + - iovcc-supply + +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>; + + port { + mipi_in_panel: endpoint { + remote-endpoint = <&mipi_out_panel>; + }; + }; + }; + }; + +... From patchwork Tue Dec 27 11:03:35 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: 637411 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 E3DBAC4332F for ; Tue, 27 Dec 2022 11:05:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231289AbiL0LFA (ORCPT ); Tue, 27 Dec 2022 06:05:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53792 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230013AbiL0LEg (ORCPT ); Tue, 27 Dec 2022 06:04:36 -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 AA7F19FCB for ; Tue, 27 Dec 2022 03:03:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1672139029; 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=k8o9PJLZzeoyXagi9bjgA3sw56iv+c4Whqy1GxWqDbQ=; b=GP5PuLVeT+CAei/NbN5CkE0yrNZ8xqJug9jwdPI/FQ16KvbntayB1nXvEnINOEZR0IOFhK O6TdP5yQjVA+6mQ+LJma4/EzDF5wWIuQ6J8+ztmDJYNx2eAdMzKq6lWoK2b3rTbLSruaRA HyjJmJoc3DvMhFAmaftlMwNY9pEcxOU= Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-126-OonW76FfNo6S0NUtNuylvQ-1; Tue, 27 Dec 2022 06:03:48 -0500 X-MC-Unique: OonW76FfNo6S0NUtNuylvQ-1 Received: by mail-wr1-f69.google.com with SMTP id e23-20020adfa457000000b0026e7cf45583so1744851wra.23 for ; Tue, 27 Dec 2022 03:03:47 -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=k8o9PJLZzeoyXagi9bjgA3sw56iv+c4Whqy1GxWqDbQ=; b=EOqBjUBHw3g72W85uLaqzSJitzrSYYr0RLlMD1EQPOb9e1nT9e+F5XRvb44BbbiN+A jlyrRT1hqu+ASoJfRs30VqlOCtGmWT1b3vTCinJfihwI0eF6DQxnxa6QrdyWJApbqK5p 2gC1N5j11UQzroLtwz+G9xG//zPhP41QVTJRXHKR/zAwEHdfWpAfkOQ+FWTAwkln+ZP6 bYD6xfls9TDEB/r3dlYISQTbI/3cWtn5s3b5oF1EP4+O7uZn3mKqIOWxDmx+nbVHGUj5 f3FxePnqvDWytsiQ4BwkXhynMhBHVxy1A6yzZs1ePMeIHLo6wa5ynW+URqnR8N8fpNc0 208g== X-Gm-Message-State: AFqh2kr+BpuZFT79yC6uLZ2w19bLkLeIZxdoGwXLMeeCbXcwyPDFQ5Iy cVIFdTwfLQothIJt1aLl5rYHKJqCJb0BUHxbBN/zQckcxDXmoAmRsK8vl0OtqrmeihKlwBwP2BX iOjm6FwAktZuSj6GYndpU6Q== X-Received: by 2002:a5d:54d0:0:b0:242:1926:ea3d with SMTP id x16-20020a5d54d0000000b002421926ea3dmr13199588wrv.35.1672139026761; Tue, 27 Dec 2022 03:03:46 -0800 (PST) X-Google-Smtp-Source: AMrXdXvnIgdyH1lmfSWD9DSg9V3c69rU+g3lIXactnn+N1hq0KOYIrOqFll72xwpaQL0a49eaqo01A== X-Received: by 2002:a5d:54d0:0:b0:242:1926:ea3d with SMTP id x16-20020a5d54d0000000b002421926ea3dmr13199559wrv.35.1672139026482; Tue, 27 Dec 2022 03:03:46 -0800 (PST) Received: from minerva.home (205.pool92-176-231.dynamic.orange.es. [92.176.231.205]) by smtp.gmail.com with ESMTPSA id p18-20020a056000019200b00279d23574c4sm7374557wrx.13.2022.12.27.03.03.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Dec 2022 03:03:45 -0800 (PST) From: Javier Martinez Canillas To: linux-kernel@vger.kernel.org Cc: Peter Robinson , Martijn Braam , Maya Matuszczyk , Sam Ravnborg , Neal Gompa , =?utf-8?q?Kamil_Trzci=C5=84ski?= , Tom Fitzhenry , Krzysztof Kozlowski , Robert Mader , Onuralp Sezer , Ondrej Jirman , dri-devel@lists.freedesktop.org, 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 v3 4/4] arm64: dts: rk3399-pinephone-pro: Add internal display support Date: Tue, 27 Dec 2022 12:03:35 +0100 Message-Id: <20221227110335.2923359-5-javierm@redhat.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221227110335.2923359-1-javierm@redhat.com> References: <20221227110335.2923359-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 --- (no changes since v2) 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"; +};