// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
/* Copyright (c) 2021, Robert Marko <robimarko@gmail.com> */

/dts-v1/;

#include "ipq8071-ax3600.dtsi"
#include <dt-bindings/leds/common.h>

/ {
	model = "Xiaomi AX3600";
	compatible = "xiaomi,ax3600", "qcom,ipq8074";

	leds {
		compatible = "gpio-leds";

		led_system_blue: system-blue {
			label = "blue:system";
			gpios = <&tlmm 42 GPIO_ACTIVE_HIGH>;
		};

		led_system_yellow: system-yellow {
			label = "yellow:system";
			gpios = <&tlmm 43 GPIO_ACTIVE_HIGH>;
		};

		network-yellow {
			label = "yellow:network";
			gpios = <&tlmm 22 GPIO_ACTIVE_HIGH>;
		};

		network-blue {
			label = "blue:network";
			gpios = <&tlmm 21 GPIO_ACTIVE_HIGH>;
		};

		aiot {
			label = "blue:aiot";
			gpios = <&tlmm 51 GPIO_ACTIVE_HIGH>;
			linux,default-trigger = "phy0tpt";
		};
	};
};

&pcie_qmp0 {
	status = "okay";
};

&pcie0 {
	status = "okay";

	perst-gpios = <&tlmm 52 GPIO_ACTIVE_HIGH>;

	pcie@0 {
		wifi0: wifi@0,0 {
			status = "okay";

			compatible = "qcom,ath10k";
			reg = <0x00010000 0 0 0 0>;

			qcom,ath10k-calibration-variant = "Xiaomi-AX3600";
			nvmem-cell-names = "calibration";
			nvmem-cells = <&caldata_qca9889>;
		};
	};
};

&wifi {
	qcom,ath11k-calibration-variant = "Xiaomi-AX3600";
};

&qca8075_1 {
	leds {
		#address-cells = <1>;
		#size-cells = <0>;

		led@0 {
			reg = <0>;
			color = <LED_COLOR_ID_GREEN>;
			function = LED_FUNCTION_WAN;
			default-state = "keep";
		};
	};
};

&qca8075_2 {
	leds {
		#address-cells = <1>;
		#size-cells = <0>;

		led@0 {
			reg = <0>;
			color = <LED_COLOR_ID_GREEN>;
			function = LED_FUNCTION_LAN;
			default-state = "keep";
		};
	};
};

&qca8075_3 {
	leds {
		#address-cells = <1>;
		#size-cells = <0>;

		led@0 {
			reg = <0>;
			color = <LED_COLOR_ID_GREEN>;
			function = LED_FUNCTION_LAN;
			default-state = "keep";
		};
	};
};

&qca8075_4 {
	leds {
		#address-cells = <1>;
		#size-cells = <0>;

		led@0 {
			reg = <0>;
			color = <LED_COLOR_ID_GREEN>;
			function = LED_FUNCTION_LAN;
			default-state = "keep";
		};
	};
};
