#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
#include "shima-pmic-overlay.dtsi"
#include "shima-thermal-overlay.dtsi"

&soc {
	gpio_keys {
		compatible = "gpio-keys";
		label = "gpio-keys";

		pinctrl-names = "default";
		pinctrl-0 = <&key_vol_up_default>;

		vol_up {
			label = "volume_up";
			gpios = <&pm8350_gpios 6 GPIO_ACTIVE_LOW>;
			linux,input-type = <1>;
			linux,code = <KEY_VOLUMEUP>;
			gpio-key,wakeup;
			debounce-interval = <15>;
			linux,can-disable;
		};
	};
};

&qupv3_se9_i2c {
	status = "ok";
	qcom,clk-freq-out = <1000000>;
	#address-cells = <1>;
	#size-cells = <0>;
	nq@28 {
		compatible = "qcom,sn-nci";
		reg = <0x28>;
		qcom,sn-irq = <&tlmm 87 0x00>;
		qcom,sn-ven = <&tlmm 62 0x00>;
		qcom,sn-firm = <&tlmm 86 0x00>;
		qcom,sn-clkreq = <&tlmm 63 0x00>;
		interrupt-parent = <&tlmm>;
		interrupts = <87 0>;
		interrupt-names = "nfc_irq";
		pinctrl-names = "nfc_active", "nfc_suspend";
		pinctrl-0 = <&nfc_int_active &nfc_enable_active>;
		pinctrl-1 = <&nfc_int_suspend &nfc_enable_suspend>;
	};
};

&sdhc_1 {
	status = "ok";

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

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

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

&sdhc_2 {
	status = "ok";

	pinctrl-names = "default", "sleep";
	pinctrl-0 = <&sdc2_on>;
	pinctrl-1 = <&sdc2_off>;

	vdd-supply = <&L9C>;
	qcom,vdd-voltage-level = <2960000 2960000>;
	qcom,vdd-current-level = <0 800000>;

	vdd-io-supply = <&L6C>;
	qcom,vdd-io-voltage-level = <1800000 2960000>;
	qcom,vdd-io-current-level = <0 22000>;

	cd-gpios = <&tlmm 92 GPIO_ACTIVE_LOW>;
};

&ufsphy_mem {
	compatible = "qcom,ufs-phy-qmp-v4-lahaina";

	vdda-phy-supply = <&L10C>;
	vdda-pll-supply = <&L6B>;
	vdda-phy-max-microamp = <97100>;
	vdda-pll-max-microamp = <19600>;

	status = "ok";
};

&ufshc_mem {
	vdd-hba-supply = <&gcc_ufs_phy_gdsc>;
	vdd-hba-fixed-regulator;

	vcc-supply = <&L7B>;
	vcc-voltage-level = <2950000 2960000>;
	vcc-low-voltage-sup;
	vcc-max-microamp = <800000>;

	vccq-supply = <&L9B>;
	vccq-max-microamp = <900000>;
	vccq-min-microamp = <0>;

	vccq2-supply = <&S10B>;
	vccq2-voltage-level = <1800000 1800000>;

	qcom,vddp-ref-clk-supply = <&L9B>;
	qcom,vddp-ref-clk-max-microamp = <100>;
	qcom,vddp-ref-clk-min-microamp = <0>;
	status = "ok";
};

&spmi_debug_bus {
	status = "ok";
};

&spmi_glink_debug {
	status = "ok";
};

&pm8350b_haptics {
	qcom,vmax-mv = <1300>;
	qcom,lra-period-us = <5880>;
	status = "ok";

	effect_0 {
		/* CLICK */
		qcom,wf-vmax-mv = <1800>;
		qcom,wf-pattern-period-us = <5880>;
	};

	effect_1 {
		/* DOUBLE_CLICK */
		qcom,wf-vmax-mv = <1800>;
		qcom,wf-pattern-period-us = <5880>;
	};

	effect_2 {
		/* TICK */
		qcom,wf-vmax-mv = <1800>;
		qcom,wf-pattern-period-us = <5880>;
	};

	effect_3 {
		/* THUD */
		qcom,wf-vmax-mv = <1800>;
		qcom,wf-pattern-period-us = <5880>;
	};

	effect_4 {
		/* POP */
		qcom,wf-vmax-mv = <1800>;
		qcom,wf-pattern-period-us = <5880>;
	};

	effect_5 {
		/* HEAVY CLICK */
		qcom,wf-vmax-mv = <1800>;
		qcom,wf-pattern-period-us = <5880>;
	};
};

&pm8350c_switch0 {
	qcom,led-mask = <9>; /* Channels 1 & 4 */
	qcom,symmetry-en;
};

&pm8350c_switch1 {
	qcom,led-mask = <6>; /* Channels 2 & 3 */
	qcom,symmetry-en;
};

&pm8350c_switch2 {
	qcom,led-mask = <15>; /* All Channels */
	qcom,symmetry-en;
};

&pm8350c_flash {
	status = "ok";
};

&battery_charger {
	qcom,thermal-mitigation = <10000000 9500000 9000000 8500000 8000000
				7500000 7000000 6500000 6000000 5500000
				5000000 4500000 4000000 3500000 3000000
				2500000 2000000 1500000 1000000 500000>;
};

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

	status = "ok";
	qcom,i2c-touch-active = "focaltech,fts_ts";

	focaltech@38 {
		compatible = "focaltech,fts_ts";
		reg = <0x38>;
		interrupt-parent = <&tlmm>;
		interrupts = <23 0x2008>;
		focaltech,reset-gpio = <&tlmm 22 0x00>;
		focaltech,irq-gpio = <&tlmm 23 0x2008>;
		focaltech,max-touch-number = <5>;
		focaltech,display-coords = <0 0 1080 2340>;

		vdd-supply = <&L3C>;

		pinctrl-names = "pmx_ts_active", "pmx_ts_suspend","pmx_ts_release";
		pinctrl-0 = <&ts_active>;
		pinctrl-1 = <&ts_int_suspend &ts_reset_suspend>;
		pinctrl-2 = <&ts_release>;

		panel = <&dsi_r66451_amoled_cmd
			 &dsi_r66451_amoled_video>;
	};
};

&wsa883x_0221 {
	status = "disabled";
};

&dai_mi2s2 {
	qcom,msm-mi2s-tx-lines = <1>;
	pinctrl-names = "default", "sleep";
	pinctrl-0 = <&tert_mi2s_sck_active &tert_mi2s_ws_active
			&tert_mi2s_sd0_active>;
	pinctrl-1 = <&tert_mi2s_sck_sleep &tert_mi2s_ws_sleep
			&tert_mi2s_sd0_sleep>;
};
