#include <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/spmi/spmi.h>

#define PMK8350_SID	6

#include <dt-bindings/iio/qcom,spmi-adc7-pmk8350.h>

&spmi_bus {
	#address-cells = <2>;
	#size-cells = <0>;
	interrupt-controller;
	#interrupt-cells = <4>;

	qcom,pmk8350@6 {
		compatible = "qcom,spmi-pmic";
		reg = <6 SPMI_USID>;
		#address-cells = <1>;
		#size-cells = <1>;

		pmk8350_revid: qcom,revid@100 {
			compatible = "qcom,qpnp-revid";
			reg = <0x100 0x100>;
		};

		pmk8350_vadc: vadc@3100 {
			compatible = "qcom,spmi-adc7";
			reg = <0x3100 0x100>;
			#address-cells = <1>;
			#size-cells = <0>;
			interrupts = <0x6 0x31 0x0 IRQ_TYPE_EDGE_RISING>;
			interrupt-names = "eoc-int-en-set";
			#io-channel-cells = <1>;
			io-channel-ranges;

			/* Channel nodes */
			ref_gnd {
				reg = <PMK8350_ADC7_REF_GND>;
				label = "ref_gnd";
				qcom,pre-scaling = <1 1>;
			};

			vref_1p25 {
				reg = <PMK8350_ADC7_1P25VREF>;
				label = "vref_1p25";
				qcom,pre-scaling = <1 1>;
			};

			die_temp {
				reg = <PMK8350_ADC7_DIE_TEMP>;
				label = "die_temp";
				qcom,pre-scaling = <1 1>;
			};

			xo_therm {
				reg = <PMK8350_ADC7_AMUX_THM1_100K_PU>;
				label = "xo_therm";
				qcom,ratiometric;
				qcom,hw-settle-time = <200>;
				qcom,pre-scaling = <1 1>;
			};
		};

		pmk8350_adc_tm: adc_tm@3400 {
			compatible = "qcom,adc-tm7";
			reg = <0x3400>;
			interrupts = <0x6 0x34 0x0 IRQ_TYPE_EDGE_RISING>;
			interrupt-names = "thr-int-en";
			#address-cells = <1>;
			#size-cells = <0>;
			#thermal-sensor-cells = <1>;
		};

		pmk8350_rtc: rtc@6100 {
			compatible = "qcom,pmk8350-rtc";
			reg = <0x6100>, <0x6200>;
			reg-names = "rtc", "alarm";
			interrupts = <0x6 0x62 0x1 IRQ_TYPE_EDGE_RISING>;
		};

		pmk8350_gpios: pinctrl@b000 {
			compatible = "qcom,spmi-gpio";
			reg = <0xb000 0x400>;
			interrupts = <0x6 0xb0 0x0 IRQ_TYPE_NONE>,
				     <0x6 0xb1 0x0 IRQ_TYPE_NONE>,
				     <0x6 0xb2 0x0 IRQ_TYPE_NONE>,
				     <0x6 0xb3 0x0 IRQ_TYPE_NONE>;
			interrupt-names = "pmk8350_gpio1", "pmk8350_gpio2",
					"pmk8350_gpio3", "pmk8350_gpio4";
			gpio-controller;
			#gpio-cells = <2>;
		};
	};
};
