// SPDX-License-Identifier: BSD-3-Clause
/*
 * Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
 */
/dts-v1/;
/plugin/;

#include <dt-bindings/gpio/gpio.h>

&{/} {
	backlight: backlight {
		compatible = "gpio-backlight";
		gpios = <&tlmm 115 GPIO_ACTIVE_HIGH>;
		default-on;
	};

	panel-lvds {
		compatible = "auo,g133han01";
		power-supply = <&vreg_v3p3>;

		ports {
			#address-cells = <1>;
			#size-cells = <0>;

			/* LVDS A (Odd pixels) */
			port@0 {
				reg = <0>;
				dual-lvds-odd-pixels;

				lvds_panel_out_a: endpoint {
					remote-endpoint = <&sn65dsi84_out_a>;
				};
			};

			/* LVDS B (Even pixels) */
			port@1 {
				reg = <1>;
				dual-lvds-even-pixels;

				lvds_panel_out_b: endpoint {
					remote-endpoint = <&sn65dsi84_out_b>;
				};
			};
		};
	};

	vreg_v3p3: regulator-v3p3 {
		compatible = "regulator-fixed";
		regulator-name = "vdd-3v3";
		regulator-min-microvolt = <3300000>;
		regulator-max-microvolt = <3300000>;
	};
};

&hdmi_connector {
	status = "disabled";
};

&i2c1 {
	clock-frequency = <400000>;
	status = "okay";

	#address-cells = <1>;
	#size-cells = <0>;

	hdmi_bridge: bridge@3d {
		reg = <0x3d>;
		status = "disabled";
	};

	lvds_bridge: bridge@2c {
		compatible = "ti,sn65dsi84";
		reg = <0x2c>;
		enable-gpios = <&tlmm 42 GPIO_ACTIVE_HIGH>;

		ports {
			#address-cells = <1>;
			#size-cells = <0>;

			port@0 {
				reg = <0>;

				sn65dsi84_in: endpoint {
					data-lanes = <1 2 3 4>;
					remote-endpoint = <&mdss_dsi0_out>;
				};
			};

			port@2 {
				reg = <2>;

				sn65dsi84_out_a: endpoint {
					data-lanes = <1 2 3 4>;
					remote-endpoint = <&lvds_panel_out_a>;
				};
			};

			port@3 {
				reg = <3>;

				sn65dsi84_out_b: endpoint {
					data-lanes = <1 2 3 4>;
					remote-endpoint = <&lvds_panel_out_b>;
				};
			};
		};
	};
};

&mdss_dsi0 {
	vdda-supply = <&vreg_l11a>;

	status = "okay";
};

&mdss_dsi0_out {
	remote-endpoint = <&sn65dsi84_in>;
	data-lanes = <0 1 2 3>;
};

&tlmm {
	lcd_bklt_en: lcd-bklt-en-state {
		pins = "gpio115";
		function = "gpio";
		bias-disable;
	};
};