#include "neo-pmic-overlay.dtsi"
#include "neo-thermal-overlay.dtsi"

&sdhc_1 {
	status = "ok";

	vdd-supply = <&L10A>;
	qcom,vdd-voltage-level = <2960000 2960000>;
	qcom,vdd-current-level = <0 570000>;

	vdd-io-supply = <&L7A>;
	qcom,vdd-io-always-on;
	qcom,vdd-io-lpm-sup;
	qcom,vdd-io-voltage-level = <1800000 1800000>;
	qcom,vdd-io-current-level = <0 325000>;

	pinctrl-names = "default", "sleep";
	pinctrl-0 = <&sdc1_on>;
	pinctrl-1 = <&sdc1_off>;
};

&pm8150_gpios {
	wlan_pon_en: wlan_pon_en {
		pins = "gpio9";
		function = "normal";
		input-disable;
		output-high;
		bias-pull-up;
		power-source = <1>;     /* 1.8V */
		qcom,drive-strength = <2>;
	};

	wlan_pon_dis: wlan_pon_dis {
		pins = "gpio9";
		function = "normal";
		input-disable;
		output-low;
		bias-pull-down;
		power-source = <1>;     /* 1.8V */
		qcom,drive-strength = <2>;
	};

	wlan_poff_en: wlan_poff_en {
		pins = "gpio6";
		function = "normal";
		input-disable;
		output-low;
		bias-pull-down;
		power-source = <1>;     /* 1.8V */
		qcom,drive-strength = <2>;
	};

	wlan_poff_dis: wlan_poff_dis {
		pins = "gpio6";
		function = "normal";
		input-disable;
		output-high;
		bias-pull-up;
		power-source = <1>;     /* 1.8V */
		qcom,drive-strength = <2>;
	};

	bt_pon_en: bt_pon_en {
		pins = "gpio9";
		function = "pon_en";
		input-disable;
		output-high;
		bias-pull-up;
		power-source = <1>;     /* 1.8V */
		qcom,drive-strength = <2>;
	};

	bt_pon_dis: bt_pon_dis {
		pins = "gpio9";
		function = "pon_dis";
		input-disable;
		output-low;
		bias-pull-down;
		power-source = <1>;     /* 1.8V */
		qcom,drive-strength = <2>;
	};

	bt_poff_en: bt_poff_en {
		pins = "gpio6";
		function = "poff_en";
		input-disable;
		output-low;
		bias-pull-down;
		power-source = <1>;     /* 1.8V */
		qcom,drive-strength = <2>;
	};

	bt_poff_dis: bt_poff_dis {
		pins = "gpio6";
		function = "poff_dis";
		input-disable;
		output-high;
		bias-pull-up;
		power-source = <1>;     /* 1.8V */
		qcom,drive-strength = <2>;
	};
};


&icnss2 {
	pinctrl-names = "wlan_pon_en", "wlan_pon_dis", "wlan_poff_en", "wlan_poff_dis";
	pinctrl-0 = <&wlan_pon_en>;
	pinctrl-1 = <&wlan_pon_dis>;
	pinctrl-2 = <&wlan_poff_en>;
	pinctrl-3 = <&wlan_poff_dis>;
};

&bluetooth {
	pinctrl-names = "default", "bt_pon_en", "bt_pon_dis", "bt_poff_en", "bt_poff_dis";
	pinctrl-0 = <&bt_en_sleep>;
	pinctrl-1 = <&bt_pon_en>;
	pinctrl-2 = <&bt_pon_dis>;
	pinctrl-3 = <&bt_poff_en>;
	pinctrl-4 = <&bt_poff_dis>;
};

&qupv3_se8_i2c {
	awinic@64 {
		compatible = "awinic,aw2016_led";
		reg = <0x64>;

		awinic,red {
			awinic,name = "red";
			awinic,id = <0>;
			awinic,imax = <2>;
			awinic,led-current = <3>;
			awinic,max-brightness = <255>;
			awinic,rise-time-ms = <6>;
			awinic,hold-time-ms = <0>;
			awinic,fall-time-ms = <6>;
			awinic,off-time-ms = <4>;
		};

		awinic,green {
			awinic,name = "green";
			awinic,id = <1>;
			awinic,imax = <2>;
			awinic,led-current = <3>;
			awinic,max-brightness = <255>;
			awinic,rise-time-ms = <6>;
			awinic,hold-time-ms = <0>;
			awinic,fall-time-ms = <6>;
			awinic,off-time-ms = <4>;
		};

		awinic,blue {
			awinic,name = "blue";
			awinic,id = <2>;
			awinic,imax = <2>;
			awinic,led-current = <3>;
			awinic,max-brightness = <255>;
			awinic,rise-time-ms = <6>;
			awinic,hold-time-ms = <0>;
			awinic,fall-time-ms = <6>;
			awinic,off-time-ms = <4>;
		};
	};
};

&battery {
	voltage-min-design-microvolt = <3100000>;
	energy-full-design-microwatt-hours = <2438000>;
	charge-full-design-microamp-hours = <630000>;
	over-voltage-threshold-microvolt = <4500000>;
	re-charge-voltage-microvolt = <250000>;
	/* bq256xx's termination current setting has a min limit of 60mA */
	charge-term-current-microamp = <60000>;
	constant-charge-current-max-microamp = <500000>;
	constant-charge-voltage-max-microvolt = <4450000>;
	voltage-max-design-microvolt = <4450000>;
	precharge-current-microamp = <128000>;
	factory-internal-resistance-micro-ohms = <250000>;
};

&charger {
	input-voltage-limit-microvolt = <4450000>;
};

&bq27421 {
	bat-resist-table = <&battery_630mAh>;
};
