2022-12-27 11:15:50

by Javier Martinez Canillas

[permalink] [raw]
Subject: [PATCH v3 0/4] Add PinePhone Pro display support

This series add support for the display present in the PinePhone Pro.

Patch #1 adds a driver for panels using the Himax HX8394 panel controller,
such as the HSD060BHW4 720x1440 TFT LCD panel present in the PinePhone Pro.

Patch #2 adds a devicetree binding schema for this driver and patch #3 adds
an entry for the driver in the MAINTAINERS file.

Finally patch #4 adds the needed devicetree nodes in the PinePhone Pro DTS,
to enable both the display and the touchscreen. This makes the upstream DTS
much more usable and will allow for example to enable support for the phone
in the Fedora distribution.

I only added myself as the maintainer for the driver because I don't know
if Kamil and Ondrej that worked in the driver would be interested. Please
let me know folks if you are, and I can add you too in the next revision.

This is a v3 of the patch-set that addresses issues pointed out in v2:

https://lists.freedesktop.org/archives/dri-devel/2022-December/384513.html

The patches were tested on a PinePhone Pro Explorer Edition using a Fedora
37 Workstation image.

Best regards,
Javier

Changes in v3:
- Fix example snippet for `make dt_binding_check` to pass (Krzysztof Kozlowski).
- Add Sam Ravnborg's reviwed-by tag.
- Move driver patch after one introducing the DT binding (Sam Ravnborg).

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.
- Add year to driver's copyright notice (Sam Ravnborg)
- Remove unused <video/display_timing.h> header include (Sam Ravnborg).
- Use mipi_dsi_dcs_write_seq() helper and drop custom macro (Sam Ravnborg).
- Drop unnecessary info messages and move useful one to debug (Sam Ravnborg).
- Fix regulator node names (Maya Matuszczyk).
- Drop non-existent "poweroff-in-suspend" property (Maya Matuszczyk).
- Remove unnecessary comments in panel node (Maya Matuszczyk).

Javier Martinez Canillas (2):
dt-bindings: display: Add Himax HX8394 panel controller
MAINTAINERS: Add entry for Himax HX8394 panel controller driver

Kamil Trzciński (1):
drm: panel: Add Himax HX8394 panel controller driver

Ondrej Jirman (1):
arm64: dts: rk3399-pinephone-pro: Add internal display support

.../bindings/display/panel/himax,hx8394.yaml | 74 +++
MAINTAINERS | 7 +
.../dts/rockchip/rk3399-pinephone-pro.dts | 123 +++++
drivers/gpu/drm/panel/Kconfig | 12 +
drivers/gpu/drm/panel/Makefile | 1 +
drivers/gpu/drm/panel/panel-himax-hx8394.c | 446 ++++++++++++++++++
6 files changed, 663 insertions(+)
create mode 100644 Documentation/devicetree/bindings/display/panel/himax,hx8394.yaml
create mode 100644 drivers/gpu/drm/panel/panel-himax-hx8394.c

--
2.38.1


2022-12-27 11:23:07

by Javier Martinez Canillas

[permalink] [raw]
Subject: [PATCH v3 3/4] MAINTAINERS: Add entry for Himax HX8394 panel controller driver

Add myself as maintainer for the driver and devicetree bindings schema.

Signed-off-by: Javier Martinez Canillas <[email protected]>
---

(no changes since v1)

MAINTAINERS | 7 +++++++
1 file changed, 7 insertions(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index 2e832cf29bec..175d72203fb6 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -6480,6 +6480,13 @@ S: Maintained
T: git git://anongit.freedesktop.org/drm/drm-misc
F: drivers/gpu/drm/tiny/gm12u320.c

+DRM DRIVER FOR HIMAX HX8394 MIPI-DSI LCD panels
+M: Javier Martinez Canillas <[email protected]>
+S: Maintained
+T: git git://anongit.freedesktop.org/drm/drm-misc
+F: Documentation/devicetree/bindings/display/panel/himax,hx8394.yaml
+F: drivers/gpu/drm/panel/panel-himax-hx8394.c
+
DRM DRIVER FOR HX8357D PANELS
M: Emma Anholt <[email protected]>
S: Maintained
--
2.38.1

2022-12-27 11:52:16

by Javier Martinez Canillas

[permalink] [raw]
Subject: [PATCH v3 4/4] arm64: dts: rk3399-pinephone-pro: Add internal display support

From: Ondrej Jirman <[email protected]>

The phone's display is using Hannstar LCD panel, and Goodix based
touchscreen. Support it.

Signed-off-by: Ondrej Jirman <[email protected]>
Co-developed-by: Martijn Braam <[email protected]>
Signed-off-by: Martijn Braam <[email protected]>
Co-developed-by: Kamil Trzciński <[email protected]>
Signed-off-by: Kamil Trzciński <[email protected]>
Signed-off-by: Javier Martinez Canillas <[email protected]>
---

(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 = <RK_PB5 IRQ_TYPE_EDGE_RISING>;
+ 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";
+};
--
2.38.1

2022-12-27 18:30:58

by Sam Ravnborg

[permalink] [raw]
Subject: Re: [PATCH v3 3/4] MAINTAINERS: Add entry for Himax HX8394 panel controller driver

On Tue, Dec 27, 2022 at 12:03:34PM +0100, Javier Martinez Canillas wrote:
> Add myself as maintainer for the driver and devicetree bindings schema.
>
> Signed-off-by: Javier Martinez Canillas <[email protected]>
Acked-by: Sam Ravnborg <[email protected]>
> ---
>
> (no changes since v1)
>
> MAINTAINERS | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 2e832cf29bec..175d72203fb6 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -6480,6 +6480,13 @@ S: Maintained
> T: git git://anongit.freedesktop.org/drm/drm-misc
> F: drivers/gpu/drm/tiny/gm12u320.c
>
> +DRM DRIVER FOR HIMAX HX8394 MIPI-DSI LCD panels
> +M: Javier Martinez Canillas <[email protected]>
> +S: Maintained
> +T: git git://anongit.freedesktop.org/drm/drm-misc
> +F: Documentation/devicetree/bindings/display/panel/himax,hx8394.yaml
> +F: drivers/gpu/drm/panel/panel-himax-hx8394.c
> +
> DRM DRIVER FOR HX8357D PANELS
> M: Emma Anholt <[email protected]>
> S: Maintained
> --
> 2.38.1

2022-12-28 13:33:25

by Tom Fitzhenry

[permalink] [raw]
Subject: Re: [PATCH v3 4/4] arm64: dts: rk3399-pinephone-pro: Add internal display support

On 27/12/22 22:03, Javier Martinez Canillas wrote:
> From: Ondrej Jirman <[email protected]>
>
> The phone's display is using Hannstar LCD panel, and Goodix based
> touchscreen. Support it.
>
> Signed-off-by: Ondrej Jirman <[email protected]>
> Co-developed-by: Martijn Braam <[email protected]>
> Signed-off-by: Martijn Braam <[email protected]>
> Co-developed-by: Kamil Trzciński <[email protected]>
> Signed-off-by: Kamil Trzciński <[email protected]>
> Signed-off-by: Javier Martinez Canillas <[email protected]>

Tested-by: Tom Fitzhenry <[email protected]>

Display and touchscreen works on my Pinephone Pro, thanks for the
mainlining!

> @@ -367,6 +474,10 @@ vcc1v8_codec_en: vcc1v8-codec-en {
> };
> };
>
> +&pwm0 {
> + status = "okay";
> +};

Please move &pwm0 before &sdio0, to keep this ~alphabetical.