arm64: dts: rockchip: Add internal display support to rk3399-pinephone-pro
authorMartijn Braam <martijn@brixit.nl>
Tue, 28 Mar 2023 07:33:08 +0000 (09:33 +0200)
committerHeiko Stuebner <heiko@sntech.de>
Thu, 30 Mar 2023 11:24:02 +0000 (13:24 +0200)
The phone's display is using a Hannstar LCD panel. Support it by adding a
panel DT node and all needed nodes (backlight, MIPI DSI, regulators, etc).

Signed-off-by: Martijn Braam <martijn@brixit.nl>
Co-developed-by: Kamil Trzciński <ayufan@ayufan.eu>
Signed-off-by: Kamil Trzciński <ayufan@ayufan.eu>
Co-developed-by: Ondrej Jirman <megi@xff.cz>
Signed-off-by: Ondrej Jirman <megi@xff.cz>
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Tested-by: Ondrej Jirman <megi@xff.cz>
Link: https://lore.kernel.org/r/20230328073309.1743112-2-javierm@redhat.com
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts

index a0795a2..539b36e 100644 (file)
                stdout-path = "serial2:115200n8";
        };
 
+       backlight: backlight {
+               compatible = "pwm-backlight";
+               pwms = <&pwm0 0 50000 0>;
+       };
+
        gpio-keys {
                compatible = "gpio-keys";
                pinctrl-names = "default";
                /* WL_REG_ON on module */
                reset-gpios = <&gpio0 RK_PB2 GPIO_ACTIVE_LOW>;
        };
+
+       /* 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";
+       };
+
+       /* 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";
+       };
 };
 
 &cpu_alert0 {
        status = "okay";
 };
 
+&gpu {
+       mali-supply = <&vdd_gpu>;
+       status = "okay";
+};
+
 &i2c0 {
        clock-frequency = <400000>;
        i2c-scl-rising-time-ns = <168>;
        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";
+
+               port {
+                       mipi_in_panel: endpoint {
+                               remote-endpoint = <&mipi_out_panel>;
+                       };
+               };
+       };
+};
+
 &pmu_io_domains {
        pmu1830-supply = <&vcc_1v8>;
        status = "okay";
        status = "okay";
 };
 
+&pwm0 {
+       status = "okay";
+};
+
 &sdmmc {
        bus-width = <4>;
        cap-sd-highspeed;
 &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_GPLL>, <&cru DCLK_VOP0_DIV>;
+};
+
+&vopb_mmu {
+       status = "okay";
+};
+
+&vopl {
+       status = "okay";
+       assigned-clocks = <&cru DCLK_VOP1_DIV>, <&cru DCLK_VOP1>,
+                         <&cru ACLK_VOP1>, <&cru HCLK_VOP1>;
+       assigned-clock-rates = <0>, <0>, <400000000>, <100000000>;
+       assigned-clock-parents = <&cru PLL_GPLL>, <&cru DCLK_VOP1_DIV>;
+};
+
+&vopl_mmu {
+       status = "okay";
+};