From patchwork Fri Dec 30 11:31:51 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: 638031 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 3EBA5C3DA7C for ; Fri, 30 Dec 2022 11:33:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229571AbiL3LdG (ORCPT ); Fri, 30 Dec 2022 06:33:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38524 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229456AbiL3LdE (ORCPT ); Fri, 30 Dec 2022 06:33:04 -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 5794B1AD94 for ; Fri, 30 Dec 2022 03:32:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1672399941; 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=c32qrgWmsjRJO1IBGWxTMshwA3bwdd46Bo/ATwGKrQ0=; b=M3l5jAMkQ69EMarAXpviqCPaiQkZggW38FMGvw4eKUPP6EdxRm2gZnwz9hT/WdWhimCUzx ACFC0DF+4WL6KCSFI+JUFxHSbgd41/RFf0MwJ7iu2zyjsrSQwM9+Wjam+OJgQAo6cIOnxV i+a7iqB/c0CDZMu7TUObc2u4jXgmTYA= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-94-ybLviLlWPw2XLly37I2ROw-1; Fri, 30 Dec 2022 06:32:20 -0500 X-MC-Unique: ybLviLlWPw2XLly37I2ROw-1 Received: by mail-wr1-f72.google.com with SMTP id j27-20020adfa55b000000b0027f710a6ceeso1165518wrb.14 for ; Fri, 30 Dec 2022 03:32:19 -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=c32qrgWmsjRJO1IBGWxTMshwA3bwdd46Bo/ATwGKrQ0=; b=mMck4Elds5FrzoexztDlYfmxKbSNPx0uEkKcfvNNHT/s611kAqG2u+7DKDHnxHC7Mc MZNjumw2nnMsQ6yNs+8jxzbXJl92QIm3gS60jtnR8Z+lvR2GCJk2R5g96Zi5UZp4gtlb 1LcNVGLwkydUeZF2xSUcdf0NWrL3jFETTvgsN209NDd0B+5n8jf1RrCLFAfQURxmgbZk GjpSCmrYb1RVk3wXJhjDGuF/CAUaUer7bFTJGZ4Nn1hhA5c1KXRISw93OoFXItxush0b 1BrQQ8ZQt3Rsh8900hXb5SeIG0Xm6cR2BAebyNt+WlzT4V40b1WRsO2bwJj1YbF8zvn9 58Fg== X-Gm-Message-State: AFqh2kpFZyXlYbQm7xAt2kr+nfwhqVcmb5i/pjrcFE98nwxs9ai8iJhP xcmrS/h064GXG0n+3Yxp+pD07YQc0mMYMsapGLwvyDPtT/LwaFNWMQDBwVBRbvOme6sTa2qEUha RNmgno2tanlhfI+F9847jtQ== X-Received: by 2002:a05:600c:214a:b0:3cf:6910:51d4 with SMTP id v10-20020a05600c214a00b003cf691051d4mr22097921wml.29.1672399938999; Fri, 30 Dec 2022 03:32:18 -0800 (PST) X-Google-Smtp-Source: AMrXdXuyvNz4H4CAUhlF4mxnZIIIX/2FxJMl1v41S8jUhr1TFV0zd/ZnoTK01haVO0OFBOoUnJaEbQ== X-Received: by 2002:a05:600c:214a:b0:3cf:6910:51d4 with SMTP id v10-20020a05600c214a00b003cf691051d4mr22097907wml.29.1672399938744; Fri, 30 Dec 2022 03:32:18 -0800 (PST) Received: from minerva.home (205.pool92-176-231.dynamic.orange.es. [92.176.231.205]) by smtp.gmail.com with ESMTPSA id y22-20020a1c4b16000000b003d01b84e9b2sm27638432wma.27.2022.12.30.03.32.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Dec 2022 03:32:18 -0800 (PST) From: Javier Martinez Canillas To: linux-kernel@vger.kernel.org Cc: =?utf-8?q?Kamil_Trzci=C5=84ski?= , Martijn Braam , Sam Ravnborg , Robert Mader , Tom Fitzhenry , Peter Robinson , Onuralp Sezer , dri-devel@lists.freedesktop.org, Ondrej Jirman , Maya Matuszczyk , Neal Gompa , linux-arm-kernel@lists.infradead.org, Krzysztof Kozlowski , Jagan Teki , Javier Martinez Canillas , Daniel Vetter , David Airlie , Krzysztof Kozlowski , Rob Herring , Thierry Reding , devicetree@vger.kernel.org Subject: [PATCH v4 1/4] dt-bindings: display: Add Himax HX8394 panel controller Date: Fri, 30 Dec 2022 12:31:51 +0100 Message-Id: <20221230113155.3430142-2-javierm@redhat.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221230113155.3430142-1-javierm@redhat.com> References: <20221230113155.3430142-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 v4: - Add fallback "himax,hx8394" compatible for the panel controller (Jagan Teki). 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 | 75 +++++++++++++++++++ 1 file changed, 75 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..058b4eae68a1 --- /dev/null +++ b/Documentation/devicetree/bindings/display/panel/himax,hx8394.yaml @@ -0,0 +1,75 @@ +# 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: + items: + - enum: + - hannstar,hsd060bhw4 + - const: himax,hx8394 + + 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", "himax,hx8394"; + 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 Fri Dec 30 11:31:54 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: 638272 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 B31FBC4167B for ; Fri, 30 Dec 2022 11:34:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234877AbiL3LeD (ORCPT ); Fri, 30 Dec 2022 06:34:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38578 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234981AbiL3Ldr (ORCPT ); Fri, 30 Dec 2022 06:33:47 -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 EFC831AD9E for ; Fri, 30 Dec 2022 03:32:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1672399946; 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=w4EOTaScDiWLOjXXokoUDPMj1ubuks55AAvOUz+Vx7M=; b=MQ/AWFJulqeiMCXqt8Rntl9/bVSZ/uDuWmjE7SDIghg25FfkEeAk411OINlHnXtaXL1npv 24sX+xJJD/PZjz0Ymadzf4UjO9JNpz8k0u6f6hAa//Q4kvBChCP0aUaonZvMQg/oFsz/AT yAzpnNNyI430CoGfUMB/CqE+fyzu+pk= 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-203-p9j9FpLYNMSjpA4_PEqeuQ-1; Fri, 30 Dec 2022 06:32:24 -0500 X-MC-Unique: p9j9FpLYNMSjpA4_PEqeuQ-1 Received: by mail-wm1-f71.google.com with SMTP id j1-20020a05600c1c0100b003d99070f529so4872810wms.9 for ; Fri, 30 Dec 2022 03:32:24 -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=w4EOTaScDiWLOjXXokoUDPMj1ubuks55AAvOUz+Vx7M=; b=2qhh7CjCrd+ATjoTtX7xGY0ZpFr1EBgCRTkXnocRAkRtT0kRW9+siQ7iE+0tdPY+yc qP1hVa9EdmnSv42CraWUE8R7MK2d+ds2sqhvng2V6dkJR/uCW5eI1KiCi75sbiJz7q/k d7i/WtldbbcchFZ9aMMlR42jXCK10/B8Gcy0LcXkZUmGXV4r7P0GoeKLtGdLttKGWEOV y/kMfNw+DM0A239jRNQpnStmuGhv3VsIVlmh4l8ppQDVM2+SJaozCyZa3RREZapnm97p fIixsSIxTgPSKS63d0a0MlZZ5uHZQzCpfuSHwjaTWZHUbxTBBIyo0IlF42nlJIs2+fUf zZZw== X-Gm-Message-State: AFqh2kqVd8R61KGiF6VjoLhO9TTrWPhJrLviZKdvF/MQRt3TsxBSihjt 0JRy9b3P2AoWJ++Fw6LeXqdqGdgNnUe1AQxHYZ/uKjWtfQfXpt+XutHFDvtP1JEwkto+cRXXni0 d6teI6yk50sV7EgB5dmEseg== X-Received: by 2002:a05:600c:b4d:b0:3d3:49db:d84 with SMTP id k13-20020a05600c0b4d00b003d349db0d84mr21984088wmr.20.1672399943521; Fri, 30 Dec 2022 03:32:23 -0800 (PST) X-Google-Smtp-Source: AMrXdXszsZjoNFeeeWYKKgDciXJIvKKmm+zGF6f73kyyeBdYo9aUbjRSrQkAKNWWoxHRxaiR62Fjaw== X-Received: by 2002:a05:600c:b4d:b0:3d3:49db:d84 with SMTP id k13-20020a05600c0b4d00b003d349db0d84mr21984072wmr.20.1672399943254; Fri, 30 Dec 2022 03:32:23 -0800 (PST) Received: from minerva.home (205.pool92-176-231.dynamic.orange.es. [92.176.231.205]) by smtp.gmail.com with ESMTPSA id y22-20020a1c4b16000000b003d01b84e9b2sm27638432wma.27.2022.12.30.03.32.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Dec 2022 03:32:22 -0800 (PST) From: Javier Martinez Canillas To: linux-kernel@vger.kernel.org Cc: =?utf-8?q?Kamil_Trzci=C5=84ski?= , Martijn Braam , Sam Ravnborg , Robert Mader , Tom Fitzhenry , Peter Robinson , Onuralp Sezer , dri-devel@lists.freedesktop.org, Ondrej Jirman , Maya Matuszczyk , Neal Gompa , linux-arm-kernel@lists.infradead.org, Krzysztof Kozlowski , Jagan Teki , Javier Martinez Canillas , Caleb Connolly , Heiko Stuebner , Krzysztof Kozlowski , Rob Herring , devicetree@vger.kernel.org, linux-rockchip@lists.infradead.org Subject: [PATCH v4 4/4] arm64: dts: rk3399-pinephone-pro: Add internal display support Date: Fri, 30 Dec 2022 12:31:54 +0100 Message-Id: <20221230113155.3430142-5-javierm@redhat.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221230113155.3430142-1-javierm@redhat.com> References: <20221230113155.3430142-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 Tested-by: Tom Fitzhenry --- Changes in v4: - Add Tom Fitzhenry's Tested-by tag. - Keep the DTS nodes sorted alphabetically (Tom Fitzhenry). 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 04403a76238b..0d48fbc5dbe4 100644 --- a/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts +++ b/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts @@ -25,6 +25,12 @@ aliases { mmc2 = &sdhci; }; + backlight: backlight { + compatible = "pwm-backlight"; + pwms = <&pwm0 0 1000000 0>; + pwm-delay-us = <10000>; + }; + chosen { stdout-path = "serial2:115200n8"; }; @@ -82,6 +88,32 @@ vcc1v8_codec: vcc1v8-codec-regulator { 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>; + }; + wifi_pwrseq: sdio-wifi-pwrseq { compatible = "mmc-pwrseq-simple"; clocks = <&rk818 1>; @@ -132,6 +164,11 @@ &emmc_phy { status = "okay"; }; +&gpu { + mali-supply = <&vdd_gpu>; + status = "okay"; +}; + &i2c0 { clock-frequency = <400000>; i2c-scl-rising-time-ns = <168>; @@ -214,6 +251,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 { @@ -347,6 +387,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>; @@ -355,6 +414,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", "himax,hx8394"; + 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"; @@ -367,6 +460,20 @@ pwrbtn_pin: pwrbtn-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>; + }; + }; + pmic { pmic_int_l: pmic-int-l { rockchip,pins = <1 RK_PC5 RK_FUNC_GPIO &pcfg_pull_up>; @@ -408,6 +515,10 @@ bt_reset_pin: bt-reset-pin { }; }; +&pwm0 { + status = "okay"; +}; + &sdio0 { bus-width = <4>; cap-sd-highspeed; @@ -472,3 +583,15 @@ 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_CPLL>, <&cru DCLK_VOP0_FRAC>; +}; + +&vopb_mmu { + status = "okay"; +};