/dts-v1/;
/*
 * Copyright (c) 2019, The Linux Foundation. All rights reserved.
 *
 * Permission to use, copy, modify, and/or distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice appear in all copies.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 */

#include "qcom-ipq6018-gl-ax1800.dtsi"

/ {
	model = "GL Technologies, Inc. AXT1800";
	compatible = "glinet,axt1800", "qcom,ipq6018-cp03", "qcom,ipq6018";

	aliases {
		sdhc0 = &sdhc_2;
	};
};

&tlmm {
	sd_pins: sd_pins {
		sd {
			pins = "gpio62";
			function = "sd_card";
			bias-pull-up;
		};
		ldo {
			pins = "gpio66";
			function = "gpio";
			bias-pull-up;
		};
	};

	pwm_pins: pwm_pinmux {
		pwm {
			pins = "gpio30";
			function = "pwm13";
			drive-strength = <8>;
		};
	};

	fan_pins: fan_pins {
		pwr {
			pins = "gpio29";
			function = "gpio";
			bias-pull-up;
			output-high;
		};
		speed {
			pins = "gpio31";
			function = "gpio";
			drive-strength = <8>;
			bias-pull-down;
		};
	};
};

&soc {
	pwm:pwm {
		#pwm-cells = <2>;
		pinctrl-0 = <&pwm_pins>;
		pinctrl-names = "default";
		used-pwm-indices = <0>, <1>, <0>, <0>;
		status = "ok";
	};

	pwm-fan {
		compatible = "pwm-fan";
		pinctrl-0 = <&fan_pins>;
		pinctrl-names = "default";
		cooling-min-state = <0>;
		cooling-max-state = <3>;
		#cooling-cells = <2>;
		pwms = <&pwm 1 255>;
		cooling-levels = <0 150 200 255>;
	};
};

&sdhc_2 {
	pinctrl-0 = <&sd_pins>;
	pinctrl-names = "default";
	cd-gpios = <&tlmm 62 1>;
	sd-ldo-gpios = <&tlmm 66 1>;
	status = "ok";
};
