// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
/*
 * Copyright (c) 2020 Martijn Braam <martijn@brixit.nl>
 * Copyright (c) 2021 Kamil TrzciƄski <ayufan@ayufan.eu>
 */

/*
 * PinePhone Pro datasheet:
 * https://files.pine64.org/doc/PinePhonePro/PinephonePro-Schematic-V1.0-20211127.pdf
 */

/dts-v1/;
#include <dt-bindings/input/gpio-keys.h>
#include <dt-bindings/input/linux-event-codes.h>
#include <dt-bindings/leds/common.h>
#include <dt-bindings/media/video-interface-devices.h>
#include "rk3399-s.dtsi"

/ {
	model = "Pine64 PinePhone Pro";
	compatible = "pine64,pinephone-pro", "rockchip,rk3399";
	chassis-type = "handset";

	aliases {
		mmc0 = &sdio0;
		mmc1 = &sdmmc;
		mmc2 = &sdhci;
	};

	chosen {
		stdout-path = "serial2:115200n8";
	};

	adc-keys {
		compatible = "adc-keys";
		io-channels = <&saradc 1>;
		io-channel-names = "buttons";
		keyup-threshold-microvolt = <1600000>;
		poll-interval = <100>;

		button-up {
			label = "Volume Up";
			linux,code = <KEY_VOLUMEUP>;
			press-threshold-microvolt = <2000>;
		};

		button-down {
			label = "Volume Down";
			linux,code = <KEY_VOLUMEDOWN>;
			press-threshold-microvolt = <300000>;
		};
	};

	backlight: backlight {
		compatible = "pwm-backlight";
		pwms = <&pwm0 0 50000 0>;
	};

	gpio-keys {
		compatible = "gpio-keys";
		pinctrl-names = "default";
		pinctrl-0 = <&pwrbtn_pin>;

		key-power {
			debounce-interval = <20>;
			gpios = <&gpio0 RK_PA5 GPIO_ACTIVE_LOW>;
			label = "Power";
			linux,code = <KEY_POWER>;
			wakeup-source;
		};
	};

	leds {
		compatible = "gpio-leds";
		pinctrl-names = "default";
		pinctrl-0 = <&red_led_pin &green_led_pin &blue_led_pin>;

		led_red: led-0 {
			color = <LED_COLOR_ID_RED>;
			gpios = <&gpio4 RK_PD2 GPIO_ACTIVE_HIGH>;
		};

		led_green: led-1 {
			color = <LED_COLOR_ID_GREEN>;
			gpios = <&gpio4 RK_PD5 GPIO_ACTIVE_HIGH>;
		};

		led_blue: led-2 {
			color = <LED_COLOR_ID_BLUE>;
			gpios = <&gpio4 RK_PD6 GPIO_ACTIVE_HIGH>;
		};
	};

	multi-led {
		compatible = "leds-group-multicolor";
		color = <LED_COLOR_ID_RGB>;
		function = LED_FUNCTION_INDICATOR;
		leds = <&led_red>, <&led_green>, <&led_blue>;
	};

	vcc_sys: regulator-vcc-sys {
		compatible = "regulator-fixed";
		regulator-name = "vcc_sys";
		regulator-always-on;
		regulator-boot-on;
	};

	avdd2v8_dvp: regulator-avdd2v8-dvp {
		compatible = "regulator-fixed";
		regulator-name = "avdd2v8_dvp";
		regulator-always-on;
		regulator-boot-on;
		regulator-min-microvolt = <2800000>;
		regulator-max-microvolt = <2800000>;
		vin-supply = <&vcc3v3_sys>;
	};

	vcc3v3_sys: regulator-vcc3v3-sys {
		compatible = "regulator-fixed";
		regulator-name = "vcc3v3_sys";
		regulator-always-on;
		regulator-boot-on;
		regulator-min-microvolt = <3300000>;
		regulator-max-microvolt = <3300000>;
		vin-supply = <&vcc_sys>;
	};

	vcca1v8_s3: regulator-vcc1v8-s3 {
		compatible = "regulator-fixed";
		regulator-name = "vcca1v8_s3";
		regulator-min-microvolt = <1800000>;
		regulator-max-microvolt = <1800000>;
		vin-supply = <&vcc3v3_sys>;
		regulator-always-on;
		regulator-boot-on;
	};

	vcc1v8_codec: regulator-vcc1v8-codec {
		compatible = "regulator-fixed";
		enable-active-high;
		gpio = <&gpio3 RK_PA4 GPIO_ACTIVE_HIGH>;
		pinctrl-names = "default";
		pinctrl-0 = <&vcc1v8_codec_en>;
		regulator-name = "vcc1v8_codec";
		regulator-min-microvolt = <1800000>;
		regulator-max-microvolt = <1800000>;
		vin-supply = <&vcc3v3_sys>;
	};

	vcc1v2_dvp: regulator-vcc1v2-dvp {
		compatible = "regulator-fixed";
		regulator-name = "vcc1v2_dvp";
		regulator-always-on;
		regulator-boot-on;
		regulator-min-microvolt = <1200000>;
		regulator-max-microvolt = <1200000>;
		vin-supply = <&vcca1v8_s3>;
	};

	wifi_pwrseq: sdio-wifi-pwrseq {
		compatible = "mmc-pwrseq-simple";
		clocks = <&rk818 1>;
		clock-names = "ext_clock";
		pinctrl-names = "default";
		pinctrl-0 = <&wifi_enable_h_pin>;
		/*
		 * Wait between power-on and SDIO access for CYP43455
		 * POR circuit.
		 */
		post-power-on-delay-ms = <110>;
		/*
		 * Wait between consecutive toggles for CYP43455 CBUCK
		 * regulator discharge.
		 */
		power-off-delay-us = <10000>;

		/* WL_REG_ON on module */
		reset-gpios = <&gpio0 RK_PB2 GPIO_ACTIVE_LOW>;
	};

	/* MIPI DSI panel 1.8v supply */
	vcc1v8_lcd: regulator-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>;
	};

	/* MIPI DSI panel 2.8v supply */
	vcc2v8_lcd: regulator-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>;
	};

	vibrator {
		compatible = "gpio-vibrator";
		enable-gpios = <&gpio3 RK_PB1 GPIO_ACTIVE_HIGH>;
		vcc-supply = <&vcc3v3_sys>;
	};
};

&cpu_alert0 {
	temperature = <65000>;
};
&cpu_alert1 {
	temperature = <68000>;
};

&cpu_l0 {
	cpu-supply = <&vdd_cpu_l>;
};

&cpu_l1 {
	cpu-supply = <&vdd_cpu_l>;
};

&cpu_l2 {
	cpu-supply = <&vdd_cpu_l>;
};

&cpu_l3 {
	cpu-supply = <&vdd_cpu_l>;
};

&cpu_b0 {
	cpu-supply = <&vdd_cpu_b>;
};

&cpu_b1 {
	cpu-supply = <&vdd_cpu_b>;
};

&emmc_phy {
	status = "okay";
};

&gpu {
	mali-supply = <&vdd_gpu>;
	status = "okay";
};

&i2c0 {
	clock-frequency = <400000>;
	i2c-scl-rising-time-ns = <168>;
	i2c-scl-falling-time-ns = <4>;
	status = "okay";

	rk818: pmic@1c {
		compatible = "rockchip,rk818";
		reg = <0x1c>;
		interrupt-parent = <&gpio1>;
		interrupts = <RK_PC5 IRQ_TYPE_LEVEL_LOW>;
		#clock-cells = <1>;
		clock-output-names = "xin32k", "rk808-clkout2";
		pinctrl-names = "default";
		pinctrl-0 = <&pmic_int_l>;
		system-power-controller;
		wakeup-source;

		vcc1-supply = <&vcc_sys>;
		vcc2-supply = <&vcc_sys>;
		vcc3-supply = <&vcc_sys>;
		vcc4-supply = <&vcc_sys>;
		vcc6-supply = <&vcc_sys>;
		vcc7-supply = <&vcc3v3_sys>;
		vcc8-supply = <&vcc_sys>;
		vcc9-supply = <&vcc3v3_sys>;

		regulators {
			vdd_cpu_l: DCDC_REG1 {
				regulator-name = "vdd_cpu_l";
				regulator-always-on;
				regulator-boot-on;
				regulator-min-microvolt = <875000>;
				regulator-max-microvolt = <975000>;
				regulator-ramp-delay = <6001>;
				regulator-state-mem {
					regulator-off-in-suspend;
				};
			};

			vdd_center: DCDC_REG2 {
				regulator-name = "vdd_center";
				regulator-always-on;
				regulator-boot-on;
				regulator-min-microvolt = <800000>;
				regulator-max-microvolt = <1000000>;
				regulator-ramp-delay = <6001>;
				regulator-state-mem {
					regulator-off-in-suspend;
				};
			};

			vcc_ddr: DCDC_REG3 {
				regulator-name = "vcc_ddr";
				regulator-always-on;
				regulator-boot-on;
				regulator-state-mem {
					regulator-on-in-suspend;
				};
			};

			vcc_1v8: DCDC_REG4 {
				regulator-name = "vcc_1v8";
				regulator-always-on;
				regulator-boot-on;
				regulator-min-microvolt = <1800000>;
				regulator-max-microvolt = <1800000>;
				regulator-state-mem {
					regulator-on-in-suspend;
				};
			};

			vcca3v0_codec: LDO_REG1 {
				regulator-name = "vcca3v0_codec";
				regulator-min-microvolt = <3000000>;
				regulator-max-microvolt = <3000000>;
			};

			vcc3v0_touch: LDO_REG2 {
				regulator-name = "vcc3v0_touch";
				regulator-min-microvolt = <3000000>;
				regulator-max-microvolt = <3000000>;
			};

			vcca1v8_codec: LDO_REG3 {
				regulator-name = "vcca1v8_codec";
				regulator-always-on;
				regulator-boot-on;
				regulator-min-microvolt = <1800000>;
				regulator-max-microvolt = <1800000>;
			};

			rk818_pwr_on: LDO_REG4 {
				regulator-name = "rk818_pwr_on";
				regulator-always-on;
				regulator-boot-on;
				regulator-min-microvolt = <3300000>;
				regulator-max-microvolt = <3300000>;
				regulator-state-mem {
					regulator-on-in-suspend;
				};
			};

			vcc_3v0: LDO_REG5 {
				regulator-name = "vcc_3v0";
				regulator-always-on;
				regulator-boot-on;
				regulator-min-microvolt = <3000000>;
				regulator-max-microvolt = <3000000>;
				regulator-state-mem {
					regulator-on-in-suspend;
				};
			};

			vcc_1v5: LDO_REG6 {
				regulator-name = "vcc_1v5";
				regulator-always-on;
				regulator-boot-on;
				regulator-min-microvolt = <1500000>;
				regulator-max-microvolt = <1500000>;
				regulator-state-mem {
					regulator-on-in-suspend;
				};
			};

			vcc1v8_dvp: LDO_REG7 {
				regulator-name = "vcc1v8_dvp";
				regulator-min-microvolt = <1800000>;
				regulator-max-microvolt = <1800000>;
			};

			vcc3v3_s3: LDO_REG8 {
				regulator-name = "vcc3v3_s3";
				regulator-always-on;
				regulator-boot-on;
				regulator-min-microvolt = <3300000>;
				regulator-max-microvolt = <3300000>;
				regulator-state-mem {
					regulator-off-in-suspend;
				};
			};

			vccio_sd: LDO_REG9 {
				regulator-name = "vccio_sd";
				regulator-min-microvolt = <1800000>;
				regulator-max-microvolt = <3300000>;
			};

			vcc3v3_s0: SWITCH_REG {
				regulator-name = "vcc3v3_s0";
				regulator-always-on;
				regulator-boot-on;
				regulator-state-mem {
					regulator-on-in-suspend;
				};
			};
		};
	};

	vdd_cpu_b: regulator@40 {
		compatible = "silergy,syr827";
		reg = <0x40>;
		fcs,suspend-voltage-selector = <1>;
		pinctrl-names = "default";
		pinctrl-0 = <&vsel1_pin>;
		regulator-name = "vdd_cpu_b";
		regulator-min-microvolt = <875000>;
		regulator-max-microvolt = <1150000>;
		regulator-ramp-delay = <1000>;
		regulator-always-on;
		regulator-boot-on;

		regulator-state-mem {
			regulator-off-in-suspend;
		};
	};

	vdd_gpu: regulator@41 {
		compatible = "silergy,syr828";
		reg = <0x41>;
		fcs,suspend-voltage-selector = <1>;
		pinctrl-names = "default";
		pinctrl-0 = <&vsel2_pin>;
		regulator-name = "vdd_gpu";
		regulator-min-microvolt = <875000>;
		regulator-max-microvolt = <975000>;
		regulator-ramp-delay = <1000>;
		regulator-always-on;
		regulator-boot-on;

		regulator-state-mem {
			regulator-off-in-suspend;
		};
	};
};

&i2c1 {
	assigned-clocks = <&cru SCLK_CIF_OUT>;
	assigned-clock-rates = <24000000>;
	clock-frequency = <400000>;
	pinctrl-names = "default";
	pinctrl-0 = <&i2c1_xfer &cif_clkouta>;
	status = "okay";

	wcam: camera@1a {
		compatible = "sony,imx258-pdaf";
		reg = <0x1a>;
		clocks = <&cru SCLK_CIF_OUT>; /* MIPI_MCLK0, derived from CIF_CLKO */
		lens-focus = <&wcam_lens>;
		orientation = <MEDIA_ORIENTATION_BACK>;
		pinctrl-names = "default";
		pinctrl-0 = <&camera_rst_l>;
		reset-gpios = <&gpio1 RK_PA0 GPIO_ACTIVE_LOW>;
		rotation = <270>;
		/* Note: both cameras also depend on vcca1v8_codec to power the I2C bus. */
		vif-supply = <&vcc1v8_dvp>;
		vana-supply = <&avdd2v8_dvp>;
		vdig-supply = <&vcc1v2_dvp>; /* DVDD_DVP is the same as VCC1V2_DVP */

		port {
			wcam_out: endpoint {
				data-lanes = <1 2 3 4>;
				link-frequencies = /bits/ 64 <636000000>;
				remote-endpoint = <&mipi_in_wcam>;
			};
		};
	};

	wcam_lens: camera-lens@c {
		compatible = "dongwoon,dw9714";
		reg = <0x0c>;
		/* Same I2c bus as both cameras, depends on vcca1v8_codec for power. */
		vcc-supply = <&vcc1v8_dvp>;
	};

	ucam: camera@36 {
		compatible = "ovti,ov8858";
		reg = <0x36>;
		clocks = <&cru SCLK_CIF_OUT>; /* MIPI_MCLK1, derived from CIF_CLK0 */
		clock-names = "xvclk";
		dovdd-supply = <&vcc1v8_dvp>;
		orientation = <MEDIA_ORIENTATION_FRONT>;
		pinctrl-names = "default";
		pinctrl-0 = <&camera2_rst_l &dvp_pdn0_h>;
		powerdown-gpios = <&gpio2 RK_PB4 GPIO_ACTIVE_LOW>;
		reset-gpios = <&gpio1 RK_PA4 GPIO_ACTIVE_LOW>;
		rotation = <90>;

		port {
			ucam_out: endpoint {
				data-lanes = <1 2 3 4>;
				remote-endpoint = <&mipi_in_ucam>;
			};
		};
	};
};

&i2c3 {
	i2c-scl-rising-time-ns = <450>;
	i2c-scl-falling-time-ns = <15>;
	status = "okay";

	touchscreen@14 {
		compatible = "goodix,gt1158";
		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>;
	};

	light-sensor@48 {
		compatible = "sensortek,stk3311";
		reg = <0x48>;
		interrupt-parent = <&gpio4>;
		interrupts = <RK_PD3 IRQ_TYPE_EDGE_FALLING>;
		pinctrl-names = "default";
		pinctrl-0 = <&light_int_l>;
		proximity-near-level = <300>;
	};
};

&i2c4 {
	i2c-scl-rising-time-ns = <600>;
	i2c-scl-falling-time-ns = <20>;
	status = "okay";

	/* Accelerometer/gyroscope */
	mpu6500@68 {
		compatible = "invensense,mpu6500";
		reg = <0x68>;
		interrupt-parent = <&gpio1>;
		interrupts = <RK_PC6 IRQ_TYPE_LEVEL_LOW>;
		vdd-supply = <&vcc_1v8>;
		vddio-supply = <&vcc_1v8>;

		mount-matrix =
			"1", "0", "0",
			"0", "-1", "0",
			"0", "0", "-1";
	};
};

&i2c4 {
	af8133j: compass@1c {
		compatible = "voltafield,af8133j";
		reg = <0x1c>;
		avdd-supply = <&vcc_3v0>;
		dvdd-supply = <&vcc_1v8>;
		pinctrl-names = "default";
		pinctrl-0 = <&compass_rst_l>;
		reset-gpios = <&gpio1 RK_PA1 GPIO_ACTIVE_LOW>;

		mount-matrix =
			"0", "1", "0",
			"-1", "0", "0",
			"0", "0", "1";
	};
};

&io_domains {
	bt656-supply = <&vcc1v8_dvp>;
	audio-supply = <&vcca1v8_codec>;
	sdmmc-supply = <&vccio_sd>;
	gpio1830-supply = <&vcc_3v0>;
	status = "okay";
};

&isp0 {
	status = "okay";

	ports {
		port@0 {
			mipi_in_ucam: endpoint@0 {
				reg = <0>;
				data-lanes = <1 2 3 4>;
				remote-endpoint = <&ucam_out>;
			};
		};
	};
};

&isp0_mmu {
	status = "okay";
};

&isp1 {
	status = "okay";

	ports {
		port@0 {
			mipi_in_wcam: endpoint@0 {
				reg = <0>;
				data-lanes = <1 2 3 4>;
				remote-endpoint = <&wcam_out>;
			};
		};
	};
};

&mipi_dphy_rx0 {
	status = "okay";
};

&isp1_mmu {
	status = "okay";
};

&mipi_dsi {
	clock-master;
	#address-cells = <1>;
	#size-cells = <0>;
	status = "okay";

	panel@0 {
		compatible = "hannstar,hsd060bhw4", "himax,hx8394";
		reg = <0>;
		backlight = <&backlight>;
		iovcc-supply = <&vcc1v8_lcd>;
		pinctrl-names = "default";
		pinctrl-0 = <&lcd1_rst_pin>;
		reset-gpios = <&gpio4 RK_PD1 GPIO_ACTIVE_LOW>;
		vcc-supply = <&vcc2v8_lcd>;

		port {
			mipi_in_panel: endpoint {
				remote-endpoint = <&mipi_out_panel>;
			};
		};
	};
};

&mipi_out {
	mipi_out_panel: endpoint {
		remote-endpoint = <&mipi_in_panel>;
	};
};

&mipi_dsi1 {
	status = "okay";
};

&pmu_io_domains {
	pmu1830-supply = <&vcc_1v8>;
	status = "okay";
};

&pinctrl {
	buttons {
		pwrbtn_pin: pwrbtn-pin {
			rockchip,pins = <0 RK_PA5 RK_FUNC_GPIO &pcfg_pull_up>;
		};
	};

	lcd {
		lcd1_rst_pin: lcd1-rst-pin {
			rockchip,pins = <4 RK_PD1 RK_FUNC_GPIO &pcfg_pull_none>;
		};
	};

	cameras {
		camera_rst_l: camera-rst-l {
			rockchip,pins = <1 RK_PA0 RK_FUNC_GPIO &pcfg_pull_none>;
		};
		camera2_rst_l: camera2-rst-l {
			rockchip,pins = <1 RK_PA4 RK_FUNC_GPIO &pcfg_pull_none>;
		};
		dvp_pdn0_h: dvp-pdn0-h {
			rockchip,pins = <2 RK_PB4 RK_FUNC_GPIO &pcfg_pull_none>;
		};
	};

	compass {
		compass_rst_l: compass-rst-l {
			rockchip,pins = <1 RK_PA1 RK_FUNC_GPIO &pcfg_pull_none>;
		};
	};

	leds {
		red_led_pin: red-led-pin {
			rockchip,pins = <4 RK_PD2 RK_FUNC_GPIO &pcfg_pull_none>;
		};

		green_led_pin: green-led-pin {
			rockchip,pins = <4 RK_PD5 RK_FUNC_GPIO &pcfg_pull_none>;
		};

		blue_led_pin: blue-led-pin {
			rockchip,pins = <4 RK_PD6 RK_FUNC_GPIO &pcfg_pull_none>;
		};
	};

	pmic {
		pmic_int_l: pmic-int-l {
			rockchip,pins = <1 RK_PC5 RK_FUNC_GPIO &pcfg_pull_up>;
		};

		vsel1_pin: vsel1-pin {
			rockchip,pins = <1 RK_PC1 RK_FUNC_GPIO &pcfg_pull_down>;
		};

		vsel2_pin: vsel2-pin {
			rockchip,pins = <1 RK_PB6 RK_FUNC_GPIO &pcfg_pull_down>;
		};
	};

	sdio-pwrseq {
		wifi_enable_h_pin: wifi-enable-h-pin {
			rockchip,pins = <0 RK_PB2 RK_FUNC_GPIO &pcfg_pull_none>;
		};
	};

	sound {
		vcc1v8_codec_en: vcc1v8-codec-en {
			rockchip,pins = <3 RK_PA4 RK_FUNC_GPIO &pcfg_pull_down>;
		};
	};

	stk3311 {
		light_int_l: light-int-l {
			rockchip,pins = <4 RK_PD3 RK_FUNC_GPIO &pcfg_input_pull_up>;
		};
	};

	wireless-bluetooth {
		bt_wake_pin: bt-wake-pin {
			rockchip,pins = <2 RK_PD2 RK_FUNC_GPIO &pcfg_pull_none>;
		};

		bt_host_wake_pin: bt-host-wake-pin {
			rockchip,pins = <0 RK_PA4 RK_FUNC_GPIO &pcfg_pull_none>;
		};

		bt_reset_pin: bt-reset-pin {
			rockchip,pins = <0 RK_PB1 RK_FUNC_GPIO &pcfg_pull_none>;
		};
	};
};

&sdio0 {
	bus-width = <4>;
	cap-sd-highspeed;
	cap-sdio-irq;
	disable-wp;
	keep-power-in-suspend;
	mmc-pwrseq = <&wifi_pwrseq>;
	non-removable;
	pinctrl-names = "default";
	pinctrl-0 = <&sdio0_bus4 &sdio0_cmd &sdio0_clk>;
	sd-uhs-sdr104;
	status = "okay";
};

&pwm0 {
	status = "okay";
};

&saradc {
	vref-supply = <&vcca1v8_s3>;
	status = "okay";
};

&sdmmc {
	bus-width = <4>;
	cap-sd-highspeed;
	cd-gpios = <&gpio0 RK_PA7 GPIO_ACTIVE_LOW>;
	disable-wp;
	max-frequency = <150000000>;
	pinctrl-names = "default";
	pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_cd &sdmmc_bus4>;
	vmmc-supply = <&vcc3v3_sys>;
	vqmmc-supply = <&vccio_sd>;
	status = "okay";
};

&sdhci {
	bus-width = <8>;
	mmc-hs200-1_8v;
	non-removable;
	status = "okay";
};

&spi1 {
	status = "okay";

	flash@0 {
		compatible = "jedec,spi-nor";
		reg = <0>;
		spi-max-frequency = <10000000>;
		vcc-supply = <&vcc_1v8>;
	};
};

&tsadc {
	rockchip,hw-tshut-mode = <1>;
	rockchip,hw-tshut-polarity = <1>;
	status = "okay";
};

&uart0 {
	pinctrl-names = "default";
	pinctrl-0 = <&uart0_xfer &uart0_cts &uart0_rts>;
	uart-has-rtscts;
	status = "okay";

	bluetooth {
		compatible = "brcm,bcm4345c5";
		clocks = <&rk818 1>;
		clock-names = "lpo";
		device-wakeup-gpios = <&gpio2 RK_PD2 GPIO_ACTIVE_HIGH>;
		host-wakeup-gpios = <&gpio0 RK_PA4 GPIO_ACTIVE_HIGH>;
		max-speed = <1500000>;
		pinctrl-names = "default";
		pinctrl-0 = <&bt_host_wake_pin &bt_wake_pin &bt_reset_pin>;
		shutdown-gpios = <&gpio0 RK_PB1 GPIO_ACTIVE_HIGH>;
		vbat-supply = <&vcc3v3_sys>;
		vddio-supply = <&vcc_1v8>;
	};
};

&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";
};