code:
// SPDX-License-Identifier: GPL-2.0-only
/*
 * Devicetree for the Samsung Galaxy S Advance GT-I9070 also known as Janice.
 */

/dts-v1/;
#include "ste-db8500.dtsi"
#include "ste-ab8500.dtsi"
#include "ste-dbx5x0-pinctrl.dtsi"
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/leds/common.h>
#include <dt-bindings/input/input.h>
#include <dt-bindings/interrupt-controller/irq.h>

/ {
	model = "Samsung Galaxy S Advance (GT-I9070)";
	compatible = "samsung,janice", "st-ericsson,u8500";

	chosen {
		stdout-path = &serial2;
	};

	battery: battery {
		compatible = "samsung,eb535151vu";
	};

	thermal-zones {
		battery-thermal {
			/* This zone will be polled by the battery temperature code */
			polling-delay = <0>;
			polling-delay-passive = <0>;
			thermal-sensors = <&bat_therm>;

			trips {
				battery-crit-hi {
					temperature = <70000>;
					hysteresis = <2000>;
					type = "critical";
				};
			};
		};
	};

	bat_therm: thermistor {
		compatible = "samsung,1404-001221";
		io-channels = <&gpadc 0x02>; /* BatTemp */
		pullup-uv = <1800000>;
		pullup-ohm = <230000>;
		pulldown-ohm = <0>;
		#thermal-sensor-cells = <0>;
	};

	/* External LDO for eMMC LDO VMEM_3V3 controlled by GPIO6 */
	ldo_3v3_reg: regulator-gpio-ldo-3v3 {
		compatible = "regulator-fixed";
		/* Supplied in turn by VBAT */
		regulator-name = "VMEM_3V3";
		regulator-min-microvolt = <3300000>;
		regulator-max-microvolt = <3300000>;
		gpio = <&gpio0 6 GPIO_ACTIVE_HIGH>;
		startup-delay-us = <5000>; // FIXME
		enable-active-high;
		pinctrl-names = "default";
		pinctrl-0 = <&emmc_ldo_en_default_mode>;
	};

	/*
	 * External Ricoh "TSP" regulator for the touchscreen.
	 * One GPIO line controls two voltages of 3.3V and 1.8V
	 * this line is known as "TSP_LDO_ON1" in the schematics.
	 */
	ldo_tsp_3v3_reg: regulator-gpio-tsp-ldo-3v3 {
		compatible = "regulator-fixed";
		/* Supplied in turn by VBAT */
		regulator-name = "LDO_TSP_A3V3";
		regulator-min-microvolt = <3300000>;
		regulator-max-microvolt = <3300000>;
		/* GPIO94 controls this regulator */
		gpio = <&gpio2 30 GPIO_ACTIVE_HIGH>;
		/* 70 ms power-on delay */
		startup-delay-us = <70000>;
		enable-active-high;
		pinctrl-names = "default";
		pinctrl-0 = <&tsp_ldo_en_default_mode>;
	};
	ldo_tsp_1v8_reg: regulator-gpio-tsp-ldo-1v8 {
		compatible = "regulator-fixed";
		/* Supplied in turn by VBAT */
		regulator-name = "VREG_TSP_1V8";
		regulator-min-microvolt = <1800000>;
		regulator-max-microvolt = <1800000>;
		/* GPIO94 controls this regulator */
		gpio = <&gpio2 30 GPIO_ACTIVE_HIGH>;
		/* 70 ms power-on delay */
		startup-delay-us = <70000>;
		enable-active-high;
		pinctrl-names = "default";
		pinctrl-0 = <&tsp_ldo_en_default_mode>;
	};

	/*
	 * External Ricoh "TSP" regulator for the touchkeys.
	 * Two GPIO lines controls two voltages of 3.3V and 1.8V
	 * TSP_LDO_ON2 controls VREG_TOUCHKEY_1V8
	 * EN_LED_LDO controls VREG_KLED_3V3 (key LED)
	 */
	ldo_kled_3v3_reg: regulator-gpio-vreg-kled-3v3 {
		compatible = "regulator-fixed";
		/* Supplied in turn by VBAT */
		regulator-name = "VREG_KLED_3V3";
		regulator-min-microvolt = <3300000>;
		regulator-max-microvolt = <3300000>;
		/* GPIO68 controls this regulator */
		gpio = <&gpio2 4 GPIO_ACTIVE_HIGH>;
		/* 70 ms power-on delay */
		startup-delay-us = <70000>;
		enable-active-high;
		pinctrl-names = "default";
		pinctrl-0 = <&en_led_ldo_default_mode>;
	};
	ldo_touchkey_1v8_reg: regulator-gpio-vreg-touchkey-1v8 {
		compatible = "regulator-fixed";
		/* Supplied in turn by VBAT */
		regulator-name = "VREG_TOUCHKEY_1V8";
		regulator-min-microvolt = <1800000>;
		regulator-max-microvolt = <1800000>;
		/* GPIO89 controls this regulator */
		gpio = <&gpio2 25 GPIO_ACTIVE_HIGH>;
		/* 70 ms power-on delay */
		startup-delay-us = <70000>;
		enable-active-high;
		pinctrl-names = "default";
		pinctrl-0 = <&tsp_ldo_on2_default_mode>;
	};

	/*
	 * External Ricoh RP152L010B-TR LCD LDO regulator for the display.
	 * LCD_PWR_EN controls a 3.0V and 1.8V output.
	 */
	lcd_3v0_reg: regulator-gpio-lcd-3v0 {
		compatible = "regulator-fixed";
		/* Supplied in turn by VBAT */
		regulator-name = "VREG_LCD_3V0";
		regulator-min-microvolt = <3000000>;
		regulator-max-microvolt = <3000000>;
		/* GPIO219 controls this regulator */
		gpio = <&gpio6 27 GPIO_ACTIVE_HIGH>;
		enable-active-high;
		pinctrl-names = "default";
		pinctrl-0 = <&lcd_pwr_en_default_mode>;
	};
	lcd_1v8_reg: regulator-gpio-lcd-1v8 {
		compatible = "regulator-fixed";
		/* Supplied in turn by VBAT */
		regulator-name = "VREG_LCD_1V8";
		regulator-min-microvolt = <1800000>;
		regulator-max-microvolt = <1800000>;
		/* GPIO219 controls this regulator */
		gpio = <&gpio6 27 GPIO_ACTIVE_HIGH>;
		enable-active-high;
		pinctrl-names = "default";
		pinctrl-0 = <&lcd_pwr_en_default_mode>;
	};

	/*
	 * This regulator is a GPIO line that drives the Broadcom WLAN
	 * line WL_REG_ON high and enables the internal regulators
	 * inside the chip. Unfortunatley it is erroneously named
	 * WLAN_RST_N on the schematic but it is not a reset line.
	 *
	 * The voltage specified here is only used to determine the OCR mask,
	 * the for the SDIO connector, the chip is actually connected
	 * directly to VBAT.
	 */
	wl_reg: regulator-gpio-wlan {
		compatible = "regulator-fixed";
		regulator-name = "WL_REG_ON";
		regulator-min-microvolt = <3000000>;
		regulator-max-microvolt = <3000000>;
		startup-delay-us = <100000>;
		/* GPIO215 (WLAN_RST_N to WL_REG_ON) */
		gpio = <&gpio6 23 GPIO_ACTIVE_HIGH>;
		enable-active-high;
		pinctrl-names = "default";
		pinctrl-0 = <&wlan_ldo_en_default>;
	};

	gpio-keys {
		compatible = "gpio-keys";
		pinctrl-names = "default";
		pinctrl-0 = <&gpio_keys_default_mode>;

		button-home {
			linux,code = <KEY_HOME>;
			label = "HOME";
			/* GPIO91 */
			gpios = <&gpio2 27 GPIO_ACTIVE_LOW>;
		};
		button-volup {
			linux,code = <KEY_VOLUMEUP>;
			label = "VOL+";
			/* GPIO67 */
			gpios = <&gpio2 3 GPIO_ACTIVE_LOW>;
		};
		button-voldown {
			linux,code = <KEY_VOLUMEDOWN>;
			label = "VOL-";
			/* GPIO92 */
			gpios = <&gpio2 28 GPIO_ACTIVE_LOW>;
		};
	};

	/* Richtek RT8515GQW Flash LED Driver IC */
	flash {
		compatible = "richtek,rt8515";
		/* GPIO 140 */
		enf-gpios = <&gpio4 12 GPIO_ACTIVE_HIGH>;
		/* GPIO 141 */
		ent-gpios = <&gpio4 13 GPIO_ACTIVE_HIGH>;
		/*
		 * RFS is 16 kOhm and RTS is 100 kOhm giving
		 * the flash max current 343mA and torch max
		 * current 55 mA.
		 */
		richtek,rfs-ohms = <16000>;
		richtek,rts-ohms = <100000>;
		pinctrl-names = "default";
		pinctrl-0 = <&gpio_flash_default_mode>;

		led {
			function = LED_FUNCTION_FLASH;
			color = <LED_COLOR_ID_WHITE>;
			flash-max-timeout-us = <250000>;
			flash-max-microamp = <343750>;
			led-max-microamp = <55000>;
		};
	};

	/* Bit-banged I2C on GPIO143 and GPIO144 also called "SUBPMU I2C" */
	i2c-gpio-0 {
		compatible = "i2c-gpio";
		sda-gpios = <&gpio4 16 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
		scl-gpios = <&gpio4 15 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
		pinctrl-names = "default";
		pinctrl-0 = <&i2c_gpio_0_default>;
		#address-cells = <1>;
		#size-cells = <0>;

		/* Yamaha YAS530 magnetometer */
		magnetometer@2e {
			compatible = "yamaha,yas530";
			reg = <0x2e>;
			/* VDD 3V */
			vdd-supply = <&ab8500_ldo_aux1_reg>;
			/* IOVDD 1.8V */
			iovdd-supply = <&ab8500_ldo_aux2_reg>;
			/* GPIO204 COMPASS_RST_N */
			reset-gpios = <&gpio6 12 GPIO_ACTIVE_LOW>;
			pinctrl-names = "default";
			pinctrl-0 = <&yas529_default>;
		};
		/* TODO: this should also be used by the NCP6914 Camera power management unit */
	};

	/*
	 * These pins do have an spi controller, however the controller on
	 * these pins is not the fully featured PL022 SSP/SPI block but the
	 * ST Micro diet "PL023" version. One of the lacking features in
	 * this derivative is 3wire support, so it cannot be used to drive
	 * this panel interface. We have to use GPIO bit-banging instead.
	 */
	spi {
		compatible = "spi-gpio";
		/* Clock on GPIO220 */
		sck-gpios = <&gpio6 28 GPIO_ACTIVE_HIGH>;
		/* MISO/MOSI on GPIO224 (no separate MISO pin) */
		mosi-gpios = <&gpio7 0 GPIO_ACTIVE_HIGH>;
		/* Chip select on GPIO223 */
		cs-gpios = <&gpio6 31 GPIO_ACTIVE_LOW>;
		num-chipselects = <1>;

		pinctrl-names = "default";
		pinctrl-0 = <&spi_gpio_0_default>;
		#address-cells = <1>;
		#size-cells = <0>;

		panel@0 {
			compatible = "samsung,s6e63m0";
			reg = <0>;
			vdd3-supply = <&lcd_3v0_reg>;
			vci-supply = <&lcd_1v8_reg>;
			/* Reset on GPIO139 */
			reset-gpios = <&gpio4 11 GPIO_ACTIVE_LOW>;
			pinctrl-names = "default";
			pinctrl-0 = <&panel_default_mode>;
			spi-3wire;
			/* TYPE 3: inverse clock polarity and phase */
			spi-cpha;
			spi-cpol;

			port {
				panel_in: endpoint {
					remote-endpoint = <&display_out>;
				};
			};
		};
	};

	/*
	 * Current sense amplifier on the light sensor to convert current to
	 * voltage. We do not know if this is the actual configuration. The
	 * sense resistor value was found by calibrating in a room ambient
	 * light with a second mobile phone light sensor as reference. If you
	 * pry a Janice phone apart and inspect it you may figure this out.
	 */
	gp2a_shunt: current-sense-shunt {
		compatible = "current-sense-shunt";
		io-channels = <&gpadc 0x07>;
		shunt-resistor-micro-ohms = <15000000>; /* 15 ohms c:a */
		#io-channel-cells = <0>;
		io-channel-ranges;
	};

	/* Bit-banged I2C on GPIO196 and GPIO197 also called "TOUCHKEY_I2C" */
	i2c-gpio-1 {
		compatible = "i2c-gpio";
		sda-gpios = <&gpio6 5 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
		scl-gpios = <&gpio6 4 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
		clock-frequency = <400000>;
		pinctrl-names = "default";
		pinctrl-0 = <&i2c_gpio_1_default>;
		#address-cells = <1>;
		#size-cells = <0>;

		touchkey@20 {
			compatible = "coreriver,tc360-touchkey";
			reg = <0x20>;
			vdd-supply = <&ldo_kled_3v3_reg>;
			vcc-supply = <&ldo_touchkey_1v8_reg>;
			vddio-supply = <&ldo_touchkey_1v8_reg>;

			/* Interrupt on GPIO 198 */
			interrupt-parent = <&gpio6>;
			interrupts = <6 IRQ_TYPE_EDGE_RISING>;

			pinctrl-names = "default";
			pinctrl-0 = <&touchkey_default_mode>;
			linux,keycodes = <KEY_MENU KEY_BACK>;
		};
	};

	/* Bit-banged I2C on GPIO201 and GPIO202 also called "MOT_I2C" */
	i2c-gpio-2 {
		compatible = "i2c-gpio";
		sda-gpios = <&gpio6 10 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
		scl-gpios = <&gpio6 9 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
		pinctrl-names = "default";
		pinctrl-0 = <&i2c_gpio_2_default>;
		#address-cells = <1>;
		#size-cells = <0>;
		/* TODO: add the Immersion ISA1200 I2C device here */
	};

	/* Bit-banged I2C on GPIO151 and GPIO152 also called "NFC_I2C" */
	i2c-gpio-3 {
		compatible = "i2c-gpio";
		sda-gpios = <&gpio4 24 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
		scl-gpios = <&gpio4 23 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
		pinctrl-names = "default";
		pinctrl-0 = <&i2c_gpio_3_default>;
		#address-cells = <1>;
		#size-cells = <0>;

		/* This is only mounted on the GT-I9070P */
		nfc@2b { /* 0x30? */
			/* NXP NFC circuit PN544 C1 marked NXP 44501  */
			compatible = "nxp,pn544-i2c";
			/* IF0, IF1 high, gives I2C address 0x2B */
			reg = <0x2b>;
			clock-frequency = <400000>;
			/* NFC IRQ on GPIO32 */
			interrupt-parent = <&gpio1>;
			interrupts = <0 IRQ_TYPE_EDGE_FALLING>;
			/* GPIO 31 */
			firmware-gpios = <&gpio0 31 GPIO_ACTIVE_HIGH>;
			/* GPIO88 */
			enable-gpios = <&gpio2 24 GPIO_ACTIVE_HIGH>;
			pinctrl-names = "default";
			pinctrl-0 = <&pn544_janice_default>;
		};
	};

	soc {
		/* External Micro SD slot */
		mmc@80126000 {
			arm,primecell-periphid = <0x10480180>;
			max-frequency = <50000000>;
			bus-width = <4>;
			cap-sd-highspeed;
			cap-mmc-highspeed;
			st,sig-dir-cmd;
			st,sig-dir-dat0;
			st,sig-dir-dat2;
			st,sig-pin-fbclk;
			full-pwr-cycle;
			/* MMC is powered by AUX3 1.2V .. 2.91V */
			vmmc-supply = <&ab8500_ldo_aux3_reg>;
			/* 2.9 V level translator is using AUX3 at 2.9 V as well */
			vqmmc-supply = <&ab8500_ldo_aux3_reg>;
			pinctrl-names = "default", "sleep";
			pinctrl-0 = <&mc0_a_2_default>;
			pinctrl-1 = <&mc0_a_2_sleep>;
			cd-gpios  = <&gpio6 25 GPIO_ACTIVE_LOW>; // GPIO217
			status = "okay";
		};

		/* WLAN SDIO channel */
		mmc@80118000 {
			arm,primecell-periphid = <0x10480180>;
			max-frequency = <50000000>;
			bus-width = <4>;
			non-removable;
			cap-sd-highspeed;
			pinctrl-names = "default", "sleep";
			pinctrl-0 = <&mc1_a_2_default>;
			pinctrl-1 = <&mc1_a_2_sleep>;
			/*
			 * GPIO-controlled voltage enablement: this drives
			 * the WL_REG_ON line high when we use this device.
			 * Represented as regulator to fill OCR mask.
			 */
			vmmc-supply = <&wl_reg>;

			#address-cells = <1>;
			#size-cells = <0>;
			status = "okay";

			wifi@1 {
				compatible = "brcm,bcm4330-fmac", "brcm,bcm4329-fmac";
				reg = <1>;
				/* GPIO216 WL_HOST_WAKE */
				interrupt-parent = <&gpio6>;
				interrupts = <24 IRQ_TYPE_EDGE_FALLING>;
				interrupt-names = "host-wake";
				pinctrl-names = "default";
				pinctrl-0 = <&wlan_default_mode>;
			};
		};

		/* eMMC */
		mmc@80005000 {
			arm,primecell-periphid = <0x10480180>;
		        max-frequency = <50000000>;
			bus-width = <8>;
			non-removable;
			cap-mmc-highspeed;
			mmc-ddr-1_8v;
			no-sdio;
			no-sd;
			vmmc-supply = <&ldo_3v3_reg>;
			pinctrl-names = "default", "sleep";
			pinctrl-0 = <&mc2_a_1_default>;
			pinctrl-1 = <&mc2_a_1_sleep>;
			status = "okay";
		};

		/* GBF (Bluetooth) UART */
		uart@80120000 {
			pinctrl-names = "default", "sleep";
			pinctrl-0 = <&u0_a_1_default>;
			pinctrl-1 = <&u0_a_1_sleep>;
			status = "okay";

			bluetooth {
				/* BCM4330B1 actually */
				compatible = "brcm,bcm4330-bt";
				/* GPIO222 rail BT_VREG_EN to BT_REG_ON */
				shutdown-gpios = <&gpio6 30 GPIO_ACTIVE_HIGH>;
				/* BT_WAKE on GPIO199 */
				device-wakeup-gpios = <&gpio6 7 GPIO_ACTIVE_HIGH>;
				/* BT_HOST_WAKE on GPIO97 */
				/* FIXME: convert to interrupt */
				host-wakeup-gpios = <&gpio3 1 GPIO_ACTIVE_HIGH>;
				/* BT_RST_N on GPIO209 */
				reset-gpios = <&gpio6 17 GPIO_ACTIVE_LOW>;
				pinctrl-names = "default";
				pinctrl-0 = <&bluetooth_default_mode>;
			};
		};

		/* GPS UART */
		uart@80121000 {
			status = "okay";
			pinctrl-names = "default", "sleep";
			/* CTS/RTS is not used, CTS is repurposed as GPIO */
			pinctrl-0 = <&u1rxtx_a_1_default>;
			pinctrl-1 = <&u1rxtx_a_1_sleep>;

			gnss {
				/*
				 * The Low Noise Amplifier (LNA) power and enablement is controlled
				 * autonomously by the GSD4t.
				 * Janice has a SiRFstarIV-based GSD4t
				 * Golden has a SiRFstarV 5t-based CSRG05TA03-ICJE-R.
				 */
				compatible = "csr,gsd4t";
				/* GPS_RSTN on GPIO21 */
				reset-gpios = <&gpio0 21 GPIO_ACTIVE_LOW>;
				/* GPS_ON_OFF on GPIO96 */
				sirf,onoff-gpios = <&gpio3 0 GPIO_ACTIVE_HIGH>;
				/* GPS_1V8 (VSMPS2) */
				vcc-supply = <&db8500_vsmps2_reg>;
				pinctrl-names = "default";
				pinctrl-0 = <&gsd4t_janice_default>;
				/* According to /etc/sirfgps.conf */
				current-speed = <460800>;
			};
		};

		/* Debugging console UART connected to TSU6111RSVR (FSA880) */
		uart@80007000 {
			status = "okay";
			pinctrl-names = "default", "sleep";
			pinctrl-0 = <&u2rxtx_c_1_default>;
			pinctrl-1 = <&u2rxtx_c_1_sleep>;
		};

		prcmu@80157000 {
			ab8500 {
				phy {
					pinctrl-names = "default", "sleep";
					pinctrl-0 = <&usb_a_1_default>;
					pinctrl-1 = <&usb_a_1_sleep>;
				};

				ab8500_fg {
					line-impedance-micro-ohms = <15000>;
				};

				regulator {
					ab8500_ldo_aux1 {
						/* Used for VDD for sensors */
						regulator-name = "V-SENSORS-VDD";
						regulator-min-microvolt = <3000000>;
						regulator-max-microvolt = <3000000>;
					};

					ab8500_ldo_aux2 {
						/* Used for VIO for sensors */
						regulator-name = "V-SENSORS-VIO";
						regulator-min-microvolt = <1800000>;
						regulator-max-microvolt = <1800000>;
					};

					ab8500_ldo_aux3 {
						/* Used for voltage for external MMC/SD card */
						regulator-name = "V-MMC-SD";
						regulator-min-microvolt = <1200000>;
						regulator-max-microvolt = <2910000>;
					};
				};
			};
		};

		/* I2C0 */
		i2c@80004000 {
			status = "okay";
			pinctrl-names = "default", "sleep";
			pinctrl-0 = <&i2c0_a_1_default>;
			pinctrl-1 = <&i2c0_a_1_sleep>;

			proximity@44 {
				/* Janice has the GP2AP002A00F with light sensor */
				compatible = "sharp,gp2ap002a00f";
				clock-frequency = <400000>;
				reg = <0x44>;

				interrupt-parent = <&gpio4>;
				interrupts = <18 IRQ_TYPE_EDGE_FALLING>;
				vdd-supply = <&ab8500_ldo_aux1_reg>;
				vio-supply = <&ab8500_ldo_aux2_reg>;
				/* ADC channel AUX2 to read ALSOUT ambient light sensor out */
				io-channels = <&gp2a_shunt>;
				io-channel-names = "alsout";
				pinctrl-names = "default";
				pinctrl-0 = <&gp2ap002_janice_default>;
				/* B1 mode (arch/arm/mach-ux500/include/mach/gp2a.h) */
				sharp,proximity-far-hysteresis = /bits/ 8 <0x40>;
				sharp,proximity-close-hysteresis = /bits/ 8 <0x0f>;
			};
		};

		/* I2C1 on GPIO16 and GPIO17 also called "MUS I2C" */
		i2c@80122000 {
			status = "okay";
			pinctrl-names = "default","sleep";
			pinctrl-0 = <&i2c1_b_2_default>;
			pinctrl-1 = <&i2c1_b_2_sleep>;

			/* Texas Instruments TSU6111 micro USB switch */
			usb-switch@25 {
				compatible = "ti,tsu6111";
				reg = <0x25>;
				/* Interrupt JACK_INT_N on GPIO95 */
				interrupt-parent = <&gpio2>;
				interrupts = <31 IRQ_TYPE_EDGE_FALLING>;
				pinctrl-names = "default";
				pinctrl-0 = <&tsu6111_janice_default>;
			};
		};

		/* I2C2 on GPIO10 and GPIO11 also called "SENSORS I2C" */
		i2c@80128000 {
			status = "okay";
			pinctrl-names = "default", "sleep";
			pinctrl-0 = <&i2c2_b_2_default>;
			pinctrl-1 = <&i2c2_b_2_sleep>;

			gyroscope@68 {
				compatible = "invensense,mpu3050";
				reg = <0x68>;
				/* GPIO226 interrupt */
				interrupt-parent = <&gpio7>;
				interrupts = <2 IRQ_TYPE_EDGE_FALLING>;
				/* FIXME: no idea about this */
				mount-matrix = "1", "0", "0",
					       "0", "1", "0",
					       "0", "0", "1";
				vlogic-supply = <&ab8500_ldo_aux2_reg>; // 1.8V
				vdd-supply = <&ab8500_ldo_aux1_reg>; // 3V
				pinctrl-names = "default";
				pinctrl-0 = <&mpu3050_janice_default>;

				/*
				 * The MPU-3050 acts as a hub for the
				 * accelerometer.
				 */
				i2c-gate {
					#address-cells = <1>;
					#size-cells = <0>;

					/* Bosch BMA222 accelerometer */
					accelerometer@8 {
						compatible = "bosch,bma222";
						reg = <0x08>;
						mount-matrix = "0", "-1", "0",
							       "1", "0", "0",
							       "0", "0", "1";
						vddio-supply = <&ab8500_ldo_aux2_reg>; // 1.8V
						vdd-supply = <&ab8500_ldo_aux1_reg>; // 3V
					};
				};
			};
		};

		/* I2C3 */
		i2c@80110000 {
			status = "okay";

			pinctrl-names = "default", "sleep";
			pinctrl-0 = <&i2c3_c_2_default>;
			pinctrl-1 = <&i2c3_c_2_sleep>;

			/* Atmel mXT224E touchscreen */
			touchscreen@4a {
				compatible = "atmel,maxtouch";
				reg = <0x4a>;
				/* GPIO218 (TSP_INT_1V8) */
				interrupt-parent = <&gpio6>;
				interrupts = <26 IRQ_TYPE_EDGE_FALLING>;
				/* VDDA is "analog supply", 2.57-3.47 V */
				vdda-supply = <&ldo_tsp_3v3_reg>;
				/* VDD is "digital supply" 1.71-3.47V */
				vdd-supply = <&ldo_tsp_1v8_reg>;
				pinctrl-names = "default";
				pinctrl-0 = <&tsp_default>;
			};
		};

		mcde@a0350000 {
			status = "okay";
			pinctrl-names = "default";
			pinctrl-0 = <&dpi_default_mode>;

			port {
				display_out: endpoint {
					remote-endpoint = <&panel_in>;
				};
			};
		};
	};
};

&pinctrl {
	/*
	 * This extends the MC0_A_2 default config to include
	 * the card detect GPIO217 line.
	 */
	sdi0 {
		mc0_a_2_default {
			default_cfg4 {
				pins = "GPIO217_AH12"; /* card detect */
				ste,config = <&gpio_in_pd>;
			};
		};
	};
	mcde {
		dpi_default_mode: dpi_default {
			default_mux1 {
				/* Mux in all the data lines */
				function = "lcd";
				groups =
					/* Data lines D0-D7 GPIO70..GPIO77 */
					"lcd_d0_d7_a_1",
					/* Data lines D8-D11 GPIO78..GPIO81 */
					"lcd_d8_d11_a_1",
					/* Data lines D12-D15 GPIO82..GPIO85 */
					"lcd_d12_d15_a_1",
					/* Data lines D16-D23 GPIO161..GPIO168 */
					"lcd_d16_d23_b_1";
			};
			default_mux2 {
				function = "lcda";
				/* Clock line on GPIO150, DE, VSO, HSO on GPIO169..GPIO171 */
				groups = "lcdaclk_b_1", "lcda_b_1";
			};
			/* Input, no pull-up is the default state for pins used for an alt function */
			default_cfg1 {
				pins = "GPIO150_C14", "GPIO169_D22", "GPIO170_C23", "GPIO171_D23";
				ste,config = <&in_nopull>;
			};
		};
	};
	/* GPIO for panel reset control */
	panel {
		panel_default_mode: panel_default {
			janice_cfg1 {
				/* Reset line */
				pins = "GPIO139_C9";
				ste,config = <&gpio_out_lo>;
			};
		};
	};
	/* GPIO that enables the LDO regulator for the eMMC */
	emmc-ldo {
		emmc_ldo_en_default_mode: emmc_ldo_default {
			/* LDO enable on GPIO6 */
			janice_cfg1 {
				pins = "GPIO6_AF6";
				ste,config = <&gpio_out_hi>;
			};
		};
	};
	/* GPIO that enables the LDO regulator for the touchscreen */
	tsp-ldo {
		tsp_ldo_en_default_mode: tsp_ldo_default {
			/* LDO enable on GPIO94 */
			janice_cfg1 {
				pins = "GPIO94_D7";
				ste,config = <&gpio_out_hi>;
			};
		};
	};
	/* GPIO that enables the LDO regulator for the key LED */
	key-led {
		en_led_ldo_default_mode: en_led_ldo_default {
			/* EN_LED_LDO on GPIO68 */
			janice_cfg1 {
				pins = "GPIO68_E1";
				ste,config = <&gpio_out_hi>;
			};
		};
	};
	/* GPIO that enables the LDO regulator for the touchkeys */
	touchkey-ldo {
		tsp_ldo_on2_default_mode: tsp_ldo_on2_default {
			/* TSP_LDO_ON2 on GPIO89 */
			janice_cfg1 {
				pins = "GPIO89_E6";
				ste,config = <&gpio_out_lo>;
			};
		};
	};
	touchkey {
		touchkey_default_mode: touchkey_default {
			janice_cfg1 {
				/* Interrupt */
				pins = "GPIO198_AG25";
				ste,config = <&gpio_in_nopull>;
			};
			janice_cfg2 {
				/* Reset, actually completely unused (not routed) */
				pins = "GPIO205_AG23";
				ste,config = <&gpio_in_pd>;
			};
		};
	};
	/* GPIO that enabled the LDO regulator for the LCD display */
	lcd-ldo {
		lcd_pwr_en_default_mode: lcd_pwr_en_default {
			/* LCD_PWR_EN on GPIO219 */
			janice_cfg1 {
				pins = "GPIO219_AG10";
				ste,config = <&gpio_out_hi>;
			};
		};
	};
	/* GPIO that enables the WLAN internal LDO regulators */
	wlan-ldo {
		wlan_ldo_en_default: wlan_ldo_default {
			/* GPIO215 named WLAN_RST_N */
			janice_cfg1 {
				pins = "GPIO215_AH13";
				ste,config = <&gpio_out_lo>;
			};
		};
	};
	/* Flash and torch */
	flash {
		gpio_flash_default_mode: flash_default {
			janice_cfg1 {
				pins = "GPIO140_B11", "GPIO141_C12";
				ste,config = <&gpio_out_lo>;
			};
		};
	};
	/* GPIO keys */
	gpio-keys {
		gpio_keys_default_mode: gpio_keys_default {
			skomer_cfg1 {
				pins = "GPIO67_G2", /* VOL UP */
				       "GPIO91_B6", /* HOME */
				       "GPIO92_D6"; /* VOL DOWN */
				ste,config = <&gpio_in_pu>;
			};
		};
	};
	/* Interrupt line for the Atmel MXT228 touchscreen */
	tsp {
		tsp_default: tsp_default {
			janice_cfg1 {
				pins = "GPIO218_AH11";	/* TSP_INT_1V8 */
				ste,config = <&gpio_in_nopull>;
			};
		};
	};
	/* Reset line for the Yamaha YAS529 magnetometer */
	yas529 {
		yas529_default: yas529_janice {
			janice_cfg1 {
				pins = "GPIO204_AF23";
				ste,config = <&gpio_out_hi>;
			};
		};
	};
	/* Interrupt line for light/proximity sensor GP2AP002 */
	gp2ap002 {
		gp2ap002_janice_default: gp2ap002_janice {
			janice_cfg1 {
				pins = "GPIO146_D13";
				ste,config = <&gpio_in_nopull>;
			};
		};
	};
	/* Interrupt line for Invensense MPU3050 gyroscope */
	mpu3050 {
		mpu3050_janice_default: mpu3050_janice {
			janice_cfg1 {
				/* GPIO226 used for IRQ */
				pins = "GPIO226_AF8";
				ste,config = <&gpio_in_nopull>;
			};
		};
	};
	/* GPIO-based I2C bus for magnetometer and NCP6914 */
	i2c-gpio-0 {
		i2c_gpio_0_default: i2c_gpio_0 {
			janice_cfg1 {
				pins = "GPIO143_D12", "GPIO144_B13";
				ste,config = <&gpio_in_nopull>;
			};
		};
	};
	/* GPIO-based I2C bus for the Cypress touchkeys */
	i2c-gpio-1 {
		i2c_gpio_1_default: i2c_gpio_1 {
			janice_cfg1 {
				pins = "GPIO196_AG26", "GPIO197_AH24";
				ste,config = <&gpio_in_nopull>;
			};
		};
	};
	/* GPIO-based I2C bus for the Immersion ISA1200 */
	i2c-gpio-2 {
		i2c_gpio_2_default: i2c_gpio_2 {
			janice_cfg1 {
				pins = "GPIO201_AF24", "GPIO202_AF25";
				ste,config = <&gpio_in_nopull>;
			};
		};
	};
	/* GPIO-based I2C bus for the NFC */
	i2c-gpio-3 {
		i2c_gpio_3_default: i2c_gpio_3 {
			janice_cfg1 {
				pins = "GPIO151_D17", "GPIO152_D16";
				ste,config = <&gpio_in_nopull>;
			};
		};
	};
	/* GPIO-based SPI bus for the display */
	spi-gpio-0 {
		spi_gpio_0_default: spi_gpio_0 {
			janice_cfg1 {
				pins = "GPIO220_AH10", "GPIO223_AH9", "GPIO224_AG9";
				ste,config = <&gpio_out_hi>;
			};
			/* This pin is unused but belongs with this SPI block */
			janice_cfg2 {
				pins = "GPIO225_AG8";
				ste,config = <&in_pd>;
			};
		};
	};
	wlan {
		wlan_default_mode: wlan_default {
			/* GPIO216 for WL_HOST_WAKE */
			janice_cfg2 {
				pins = "GPIO216_AG12";
				ste,config = <&gpio_in_pd>;
			};
		};
	};
	bluetooth {
		bluetooth_default_mode: bluetooth_default {
			/* GPIO199 BT_WAKE and GPIO222 BT_VREG_ON */
			janice_cfg1 {
				pins = "GPIO199_AH23", "GPIO222_AJ9";
				ste,config = <&gpio_out_lo>;
			};
			/* GPIO97 BT_HOST_WAKE */
			janice_cfg2 {
				pins = "GPIO97_D9";
				ste,config = <&gpio_in_nopull>;
			};
			/* GPIO209 BT_RST_N */
			janice_cfg3 {
				pins = "GPIO209_AG15";
				ste,config = <&gpio_out_hi>;
			};
		};
	};
	/* Interrupt line for TI TSU6111 Micro USB switch */
	tsu6111 {
		tsu6111_janice_default: tsu6111_janice {
			janice_cfg1 {
				/* GPIO95 used for IRQ */
				pins = "GPIO95_E8";
				ste,config = <&gpio_in_nopull>;
			};
		};
	};
	nfc {
		pn544_janice_default: pn544_janice {
			/* Interrupt line */
			janice_cfg1 {
				pins = "GPIO32_V2";
				ste,config = <&gpio_in_nopull>;
			};
			/* Enable and firmware GPIOs */
			janice_cfg2 {
				pins = "GPIO31_V3", "GPIO88_C4";
				ste,config = <&gpio_out_lo>;
			};
		};
	};
	gsd4t {
		gsd4t_janice_default: gsd4t_janice {
			/* Reset line, start out asserted */
			janice_cfg1 {
				pins = "GPIO21_AB3";
				ste,config = <&gpio_out_lo>;
			};
			/* GPS_ON_OFF, start out deasserted (off) */
			janice_cfg2 {
				pins = "GPIO96_D8";
				ste,config = <&gpio_out_lo>;
			};
			/* Unused power enablement line, used in R0.0 and R0.1 boards */
			janice_cfg3 {
				pins = "GPIO86_C6";
				ste,config = <&gpio_in_pd>;
			};
		};
	};
};


code:
// SPDX-License-Identifier: GPL-2.0-only
/*
 * Devicetree for the Samsung Galaxy Amp SGH-I407 also known as Kyle.
 *
 * The code also refers to "Kyle AT&T" reflecting that this mobile phone
 * was customized for the AT&T subsidiary Aio Wireless (All In One) and
 * offered by the company in 2013.
 */

/dts-v1/;
#include "ste-db8500.dtsi"
#include "ste-ab8505.dtsi"
#include "ste-dbx5x0-pinctrl.dtsi"
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/leds/common.h>
#include <dt-bindings/input/input.h>
#include <dt-bindings/interrupt-controller/irq.h>

/ {
	model = "Samsung Galaxy Amp (SGH-I407)";
	compatible = "samsung,kyle", "st-ericsson,u8500";

	chosen {
		stdout-path = &serial2;
	};

	battery: battery {
		compatible = "samsung,eb425161la";
	};

	thermal-zones {
		battery-thermal {
			/* This zone will be polled by the battery temperature code */
			polling-delay = <0>;
			polling-delay-passive = <0>;
			thermal-sensors = <&bat_therm>;

			trips {
				battery-crit-hi {
					temperature = <70000>;
					hysteresis = <2000>;
					type = "critical";
				};
			};
		};
	};

	bat_therm: thermistor {
		compatible = "samsung,1404-001221";
		io-channels = <&gpadc 0x02>; /* BatTemp */
		pullup-uv = <1800000>;
		pullup-ohm = <230000>;
		pulldown-ohm = <0>;
		#thermal-sensor-cells = <0>;
	};

	/* TI TXS0206 level translator for 2.9 V */
	sd_level_translator: regulator-gpio {
		compatible = "regulator-fixed";

		/* GPIO87 EN */
		gpios = <&gpio2 23 GPIO_ACTIVE_HIGH>;
		enable-active-high;

		regulator-name = "sd-level-translator";
		regulator-min-microvolt = <2900000>;
		regulator-max-microvolt = <2900000>;
		regulator-type = "voltage";

		startup-delay-us = <200>;

		pinctrl-names = "default";
		pinctrl-0 = <&sd_level_translator_default>;
	};

	/* External LDO MIC5366-3.3YMT for eMMC */
	ldo_3v3_reg: regulator-gpio-ldo-3v3 {
		compatible = "regulator-fixed";
		regulator-name = "en-3v3-fixed-supply";
		regulator-min-microvolt = <3300000>;
		regulator-max-microvolt = <3300000>;
		gpio = <&gpio6 31 GPIO_ACTIVE_HIGH>;
		startup-delay-us = <5000>;
		enable-active-high;
		pinctrl-names = "default";
		pinctrl-0 = <&emmc_ldo_en_default_mode>;
	};

	/*
	 * External Ricoh RP152L010B-TR LCD LDO regulator for the display.
	 * LCD_PWR_EN controls both a 3.0V and 1.8V output.
	 */
	lcd_3v0_reg: regulator-gpio-lcd-3v0 {
		compatible = "regulator-fixed";
		/* Supplied in turn by VBAT */
		regulator-name = "VREG_LCD_3V0";
		regulator-min-microvolt = <3000000>;
		regulator-max-microvolt = <3000000>;
		/* GPIO219 controls this regulator */
		gpio = <&gpio6 27 GPIO_ACTIVE_HIGH>;
		enable-active-high;
		pinctrl-names = "default";
		pinctrl-0 = <&lcd_pwr_en_default_mode>;
	};
	lcd_1v8_reg: regulator-gpio-lcd-1v8 {
		compatible = "regulator-fixed";
		/* Supplied in turn by VBAT */
		regulator-name = "VREG_LCD_1V8";
		regulator-min-microvolt = <1800000>;
		regulator-max-microvolt = <1800000>;
		/* GPIO219 controls this regulator too */
		gpio = <&gpio6 27 GPIO_ACTIVE_HIGH>;
		enable-active-high;
		pinctrl-names = "default";
		pinctrl-0 = <&lcd_pwr_en_default_mode>;
	};

	wlan_en: regulator-gpio-wlan-en {
		compatible = "regulator-fixed";
		regulator-name = "wl-reg-on";
		regulator-min-microvolt = <3000000>;
		regulator-max-microvolt = <3000000>;
		startup-delay-us = <200000>;
		/* GPIO215 WLAN_EN */
		gpio = <&gpio6 23 GPIO_ACTIVE_HIGH>;
		enable-active-high;
		pinctrl-names = "default";
		pinctrl-0 = <&wlan_en_default_mode>;
	};

	vibrator {
		compatible = "gpio-vibrator";
		enable-gpios = <&gpio6 3 GPIO_ACTIVE_HIGH>;
		pinctrl-names = "default";
		pinctrl-0 = <&vibrator_default>;
	};

	gpio-keys {
		compatible = "gpio-keys";
		pinctrl-names = "default";
		pinctrl-0 = <&gpio_keys_default_mode>;

		button-home {
			linux,code = <KEY_HOME>;
			label = "HOME";
			/* GPIO91 */
			gpios = <&gpio2 27 GPIO_ACTIVE_LOW>;
		};
		button-volup {
			linux,code = <KEY_VOLUMEUP>;
			label = "VOL+";
			/* GPIO67 */
			gpios = <&gpio2 3 GPIO_ACTIVE_LOW>;
		};
		button-voldown {
			linux,code = <KEY_VOLUMEDOWN>;
			label = "VOL-";
			/* GPIO92 */
			gpios = <&gpio2 28 GPIO_ACTIVE_LOW>;
		};
	};

	ktd253: backlight {
		compatible = "kinetic,ktd253";
		/* GPIO 69 */
		enable-gpios = <&gpio2 5 GPIO_ACTIVE_HIGH>;
		/* Default to 13/32 brightness */
		default-brightness = <13>;
		pinctrl-names = "default";
		pinctrl-0 = <&gpio_backlight_default_mode>;
	};

	/* Richtek RT8515GQW Flash LED Driver IC */
	flash {
		compatible = "richtek,rt8515";
		/* GPIO 140 */
		enf-gpios = <&gpio4 12 GPIO_ACTIVE_HIGH>;
		/* GPIO 141 */
		ent-gpios = <&gpio4 13 GPIO_ACTIVE_HIGH>;
		/*
		 * RFS is 16 kOhm and RTS is 100 kOhm giving
		 * the flash max current 343mA and torch max
		 * current 55 mA.
		 */
		richtek,rfs-ohms = <16000>;
		richtek,rts-ohms = <100000>;
		pinctrl-names = "default";
		pinctrl-0 = <&gpio_flash_default_mode>;

		led {
			function = LED_FUNCTION_FLASH;
			color = <LED_COLOR_ID_WHITE>;
			flash-max-timeout-us = <250000>;
			flash-max-microamp = <343750>;
			led-max-microamp = <55000>;
		};
	};

	i2c-gpio-0 {
		compatible = "i2c-gpio";
		sda-gpios = <&gpio4 16 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
		scl-gpios = <&gpio4 15 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
		pinctrl-names = "default";
		pinctrl-0 = <&i2c_gpio_0_default>;
		#address-cells = <1>;
		#size-cells = <0>;
		/* TODO: this should be used by the NCP6914 Camera power management unit */
	};

	i2c-gpio-1 {
		compatible = "i2c-gpio";
		sda-gpios = <&gpio4 24 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
		scl-gpios = <&gpio4 23 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
		pinctrl-names = "default";
		pinctrl-0 = <&i2c_gpio_1_default>;
		#address-cells = <1>;
		#size-cells = <0>;
		magnetometer@c {
			compatible = "alps,hscdtd008a";
			reg = <0x0c>;
			avdd-supply = <&ab8500_ldo_aux1_reg>;
			dvdd-supply = <&ab8500_ldo_aux6_reg>;
		};
	};

	soc {
		// External Micro SD slot
		mmc@80126000 {
			arm,primecell-periphid = <0x10480180>;
			max-frequency = <100000000>;
			bus-width = <4>;
			cap-sd-highspeed;
			cap-mmc-highspeed;
			st,sig-pin-fbclk;
			full-pwr-cycle;
			vmmc-supply = <&ab8500_ldo_aux3_reg>;
			vqmmc-supply = <&sd_level_translator>;
			pinctrl-names = "default", "sleep";
			pinctrl-0 = <&mc0_a_1_default>;
			pinctrl-1 = <&mc0_a_1_sleep>;
			cd-gpios  = <&gpio6 25 GPIO_ACTIVE_LOW>; // GPIO217
			status = "okay";
		};

		// WLAN SDIO channel
		mmc@80118000 {
			arm,primecell-periphid = <0x10480180>;
			max-frequency = <50000000>;
			bus-width = <4>;
			non-removable;
			cap-sd-highspeed;
			vmmc-supply = <&wlan_en>;
			pinctrl-names = "default", "sleep";
			pinctrl-0 = <&mc1_a_2_default>;
			pinctrl-1 = <&mc1_a_2_sleep>;
			status = "okay";
			#address-cells = <1>;
			#size-cells = <0>;

			wifi@1 {
				compatible = "brcm,bcm4334-fmac", "brcm,bcm4329-fmac";
				reg = <1>;
				/* GPIO216 WL_HOST_WAKE */
				interrupt-parent = <&gpio6>;
				interrupts = <24 IRQ_TYPE_EDGE_FALLING>;
				interrupt-names = "host-wake";
				pinctrl-names = "default";
				pinctrl-0 = <&wlan_default_mode>;
			};
		};

		/*
		 * eMMC seems to be mostly Samsung KLM4G1YE4C "4YMD1R"
		 */
		mmc@80005000 {
			arm,primecell-periphid = <0x10480180>;
		        max-frequency = <100000000>;
			bus-width = <8>;
			non-removable;
			cap-mmc-highspeed;
			mmc-ddr-1_8v;
			no-sdio;
			no-sd;
			/* From datasheet page 26 figure 9: 300 ms set-up time for 4GB */
			post-power-on-delay-ms = <300>;
			vmmc-supply = <&ldo_3v3_reg>;
			pinctrl-names = "default", "sleep";
			pinctrl-0 = <&mc2_a_1_default>;
			pinctrl-1 = <&mc2_a_1_sleep>;

			status = "okay";
		};

		/* GBF (Bluetooth) UART */
		uart@80120000 {
			pinctrl-names = "default", "sleep";
			pinctrl-0 = <&u0_a_1_default>;
			pinctrl-1 = <&u0_a_1_sleep>;
			status = "okay";

			bluetooth {
				/* BCM4334B0 actually */
				compatible = "brcm,bcm4330-bt";
				shutdown-gpios = <&gpio6 30 GPIO_ACTIVE_HIGH>;
				device-wakeup-gpios = <&gpio6 7 GPIO_ACTIVE_HIGH>;
				host-wakeup-gpios = <&gpio3 1 GPIO_ACTIVE_HIGH>;
				pinctrl-names = "default";
				pinctrl-0 = <&bluetooth_default_mode>;
			};
		};

		/* GPF UART */
		uart@80121000 {
			status = "okay";
			pinctrl-names = "default", "sleep";
			pinctrl-0 = <&u1rxtx_a_1_default &u1ctsrts_a_1_default>;
			pinctrl-1 = <&u1rxtx_a_1_sleep &u1ctsrts_a_1_sleep>;

			gnss {
				/* The CSRG05TA03-ICJE-R is a SirfStarV 5t chip */
				compatible = "csr,csrg05ta03-icje-r";
				/* GPS_RSTN on GPIO21 */
				reset-gpios = <&gpio0 21 GPIO_ACTIVE_LOW>;
				/* GPS_ON_OFF on GPIO86 */
				sirf,onoff-gpios = <&gpio2 22 GPIO_ACTIVE_HIGH>;
				/* GPS_1V8 (VSMPS2) */
				vcc-supply = <&db8500_vsmps2_reg>;
				pinctrl-names = "default";
				pinctrl-0 = <&g05ta03_kyle_default>;
				/* According to /etc/sirfgps.conf */
				current-speed = <460800>;
			};
		};

		/* Debugging console UART connected to AB8505 USB */
		uart@80007000 {
			status = "okay";
			pinctrl-names = "default", "sleep";
			pinctrl-0 = <&u2rxtx_c_1_default>;
			pinctrl-1 = <&u2rxtx_c_1_sleep>;
		};

		prcmu@80157000 {
			ab8505 {
				phy {
					pinctrl-names = "default", "sleep";
					pinctrl-0 = <&usb_a_1_default>;
					pinctrl-1 = <&usb_a_1_sleep>;
				};

				ab8500_fg {
					line-impedance-micro-ohms = <36000>;
				};

				regulator {
					ab8500_ldo_aux1 {
						/* Used for VDD for sensors */
						regulator-name = "AUX1";
						regulator-min-microvolt = <3000000>;
						regulator-max-microvolt = <3300000>;
					};

					ab8500_ldo_aux2 {
						/* Supplies the MMS touchscreen only with 3.3V */
						regulator-name = "AUX2";
						regulator-min-microvolt = <3300000>;
						regulator-max-microvolt = <3300000>;
					};

					ab8500_ldo_aux3 {
						/* Used for voltage for external MMC/SD card */
						regulator-name = "AUX3";
						regulator-min-microvolt = <1100000>;
						regulator-max-microvolt = <3300000>;
					};

					ab8500_ldo_aux4 {
						regulator-name = "AUX4";
						/* Hammer to 3.3V for the touchscreen */
						regulator-min-microvolt = <3300000>;
						regulator-max-microvolt = <3300000>;
					};

					ab8500_ldo_aux5 {
						regulator-name = "AUX5";
						/* 1.8V for the touchscreen */
						regulator-min-microvolt = <1800000>;
						regulator-max-microvolt = <1800000>;
					};

					ab8500_ldo_aux6 {
						regulator-name = "AUX6";
						/* Used by sensors for 1.8 V in R0.1+ */
						regulator-min-microvolt = <1800000>;
						regulator-max-microvolt = <1800000>;
					};

					ab8500_ldo_aux8 {
						/* Unused */
						regulator-name = "AUX8";
					};
				};
			};
		};

		/* I2C0 */
		i2c@80004000 {
			status = "okay";

			pinctrl-names = "default", "sleep";
			pinctrl-0 = <&i2c0_a_1_default>;
			pinctrl-1 = <&i2c0_a_1_sleep>;

			proximity@44 {
				compatible = "sharp,gp2ap002s00f";
				clock-frequency = <400000>;
				reg = <0x44>;

				interrupt-parent = <&gpio4>;
				interrupts = <18 IRQ_TYPE_EDGE_FALLING>;
				vdd-supply = <&ab8500_ldo_aux1_reg>;
				vio-supply = <&ab8500_ldo_aux6_reg>;
				pinctrl-names = "default";
				pinctrl-0 = <&gp2ap002_kyle_default>;
				sharp,proximity-far-hysteresis = /bits/ 8 <0x2f>;
				sharp,proximity-close-hysteresis = /bits/ 8 <0x0f>;
			};
		};

		/* I2C2 */
		i2c@80128000 {
			status = "okay";

			pinctrl-names = "default", "sleep";
			pinctrl-0 = <&i2c2_b_2_default>;
			pinctrl-1 = <&i2c2_b_2_sleep>;

			accel@18 {
				compatible = "bosch,bma254";
				clock-frequency = <400000>;
				reg = <0x18>;

				mount-matrix = "-1", "0", "0",
					       "0", "-1", "0",
					       "0", "0", "-1";
				vdd-supply = <&ab8500_ldo_aux1_reg>;
				vddio-supply = <&ab8500_ldo_aux6_reg>;
			};
		};

		/* I2C3 */
		i2c@80110000 {
			status = "okay";

			pinctrl-names = "default", "sleep";
			pinctrl-0 = <&i2c3_c_2_default>;
			pinctrl-1 = <&i2c3_c_2_sleep>;

			/* Melfas MMS134S touchscreen */
			touchscreen@48 {
				compatible = "melfas,mms134s";
				reg = <0x48>;
				/* GPIO218 for IRQ */
				interrupt-parent = <&gpio6>;
				interrupts = <26 IRQ_TYPE_EDGE_FALLING>;
				/* AVDD is "analog supply", 2.57-3.47 V */
				avdd-supply = <&ab8500_ldo_aux2_reg>;
				/* VDD is "digital supply" 1.71-3.47V */
				vdd-supply = <&ab8500_ldo_aux5_reg>;

				touchscreen-size-x = <480>;
				touchscreen-size-y = <800>;

				pinctrl-names = "default";
				pinctrl-0 = <&mms134s_kyle_default>;
			};
		};

		mcde@a0350000 {
			status = "okay";
			pinctrl-names = "default";
			pinctrl-0 = <&dsi_default_mode>;

			dsi@a0351000 {
				panel {
					/*
					 * NT35510-based Hydis HVA40WV1
					 * Apparently some Kyle models can have a NT35512 fitted
					 * here instead. In that case the boot loader needs to
					 * modify this compatible.
					 */
					compatible = "hydis,hva40wv1", "novatek,nt35510";
					reg = <0>;
					/* v_lcd_3v0 2.3-4.8V */
					vdd-supply = <&lcd_3v0_reg>;
					/* v_lcd_1v8 1.65-3.3V */
					vddi-supply = <&lcd_1v8_reg>;
					/* GPIO 139 */
					reset-gpios = <&gpio4 11 GPIO_ACTIVE_LOW>;
					pinctrl-names = "default";
					pinctrl-0 = <&display_default_mode>;
					backlight = <&ktd253>;
				};
			};
		};
	};
};

&pinctrl {
	/*
	 * This extends the MC0_A_1 default config to include
	 * the card detect GPIO217 line.
	 */
	sdi0 {
		mc0_a_1_default {
			default_cfg1 {
				/* GPIO18, 19 & 20 unused so pull down */
				ste,config = <&gpio_in_pd>;
			};
			default_cfg4 {
				pins = "GPIO217_AH12"; /* card detect */
				ste,config = <&gpio_in_pd>;
			};
		};
	};

	mcde {
		dsi_default_mode: dsi_default {
			default_mux1 {
				/* Mux in VSI0 used for DSI TE */
				function = "lcd";
				groups = "lcdvsi0_a_1"; /* VSI0 for LCD */
			};
			default_cfg1 {
				pins = "GPIO68_E1"; /* VSI0 */
				ste,config = <&in_nopull>;
			};
		};
	};

	/* Two GPIO lines used by the display */
	display {
		display_default_mode: display_default {
			kyle_cfg1 {
				/*
				 * OLED DETECT or check_pba, this appears to be high
				 * on "PBA" which I guess is "prototype board A".
				 */
				pins = "GPIO93_B7";
				ste,config = <&gpio_in_nopull>;
			};
			kyle_cfg2 {
				pins = "GPIO139_C9";
				/*
				 * MIPI_DSI0_RESET_N resets the display, leave high
				 * (de-asserted) so we only assert reset explicitly
				 * from the display driver.
				 */
				ste,config = <&gpio_out_hi>;
			};
		};
	};

	/* GPIO that enables the LDO regulator for the LCD display */
	lcd-ldo {
		lcd_pwr_en_default_mode: lcd_pwr_en_default {
			/* LCD_PWR_EN on GPIO219 */
			kyle_cfg1 {
				pins = "GPIO219_AG10";
				ste,config = <&gpio_out_hi>;
			};
		};
	};

	backlight {
		gpio_backlight_default_mode: backlight_default {
			kyle_cfg1 {
				pins = "GPIO69_E2"; /* LCD_BL_CTRL */
				ste,config = <&gpio_out_lo>;
			};
		};
	};
	flash {
		gpio_flash_default_mode: flash_default {
			kyle_cfg1 {
				pins = "GPIO140_B11", "GPIO141_C12";
				ste,config = <&gpio_out_lo>;
			};
		};
	};
	/* GPIO that enables the 2.9V SD card level translator */
	sd-level-translator {
		sd_level_translator_default: sd_level_translator_default {
			/* level shifter on GPIO87 */
			kyle_cfg1 {
				pins = "GPIO87_B3";
				ste,config = <&gpio_out_hi>;
			};
		};
	};
	/* GPIO that enables the LDO regulator for the eMMC */
	emmc-ldo {
		emmc_ldo_en_default_mode: emmc_ldo_default {
			/* LDO enable on GPIO223 */
			kyle_cfg1 {
				pins = "GPIO223_AH9";
				ste,config = <&gpio_out_hi>;
			};
		};
	};
	/* GPIO keys */
	gpio-keys {
		gpio_keys_default_mode: gpio_keys_default {
			kyle_cfg1 {
				pins = "GPIO67_G2", /* VOL UP */
				       "GPIO91_B6", /* HOME */
				       "GPIO92_D6"; /* VOL DOWN */
					ste,config = <&gpio_in_pu>;
			};
		};
	};
	/* Interrupt line for light/proximity sensor GP2AP002 */
	gp2ap002 {
		gp2ap002_kyle_default: gp2ap002_kyle {
			kyle_cfg1 {
				pins = "GPIO146_D13";
				ste,config = <&gpio_in_nopull>;
			};
		};
	};
	/* GPIO-based I2C bus for NCP6914 */
	i2c-gpio-0 {
		i2c_gpio_0_default: i2c_gpio_0 {
			kyle_cfg1 {
				pins = "GPIO143_D12", "GPIO144_B13";
				ste,config = <&gpio_in_nopull>;
			};
		};
	};
	/* GPIO-based I2C bus for ALPS HSCD compass */
	i2c-gpio-1 {
		i2c_gpio_1_default: i2c_gpio_1 {
			kyle_cfg1 {
				pins = "GPIO151_B17", "GPIO152_D16";
				ste,config = <&gpio_in_nopull>;
			};
		};
	};
	wlan {
		wlan_default_mode: wlan_default {
			kyle_cfg1 {
				pins = "GPIO216_AG12";
				ste,config = <&gpio_in_pd>;
			};
		};
		wlan_en_default_mode: wlan_en_default {
			kyle_cfg2 {
				pins = "GPIO215_AH13";
				ste,config = <&gpio_out_lo>;
			};
		};
	};
	bluetooth {
		bluetooth_default_mode: bluetooth_default {
			kyle_cfg1 {
				pins = "GPIO199_AH23", "GPIO222_AJ9";
				ste,config = <&gpio_out_lo>;
			};
			kyle_cfg2 {
				pins = "GPIO97_D9";
				ste,config = <&gpio_in_nopull>;
			};
		};
	};
	vibrator {
		vibrator_default: vibrator_default {
			kyle_cfg1 {
				pins = "GPIO195_AG28";	/* MOT_EN */
				ste,config = <&gpio_out_lo>;
			};
		};
	};
	/* Interrupt line for the Melfas MMS134S touchscreen */
	touchscreen {
		mms134s_kyle_default: mms134s_kyle {
			kyle_cfg1 {
				pins = "GPIO218_AH11";
				ste,config = <&gpio_in_nopull>;
			};
		};
	};
	g05ta03 {
		g05ta03_kyle_default: g05ta03 {
			/* Reset line, start out de-asserted */
			kyle_cfg1 {
				pins = "GPIO21_AB3";
				ste,config = <&gpio_out_hi>;
			};
			/* GPS_ON_OFF, start out deasserted (off) */
			kyle_cfg2 {
				pins = "GPIO86_C6";
				ste,config = <&gpio_out_lo>;
			};
		};
	};
};

&ab8505_gpio {
	/* Hog a few default settings */
	pinctrl-names = "default";
	pinctrl-0 = <&gpio_default>;

	gpio {
		gpio_default: gpio_default {
			kyle_mux {
				/* Change unused pins to GPIO mode */
				function = "gpio";
				groups = "gpio3_a_1",	/* default: SysClkReq4 */
					 "gpio14_a_1";	/* default: PWMOut1 */
			};
			kyle_cfg1 {
				pins = "GPIO11_B17", "GPIO13_D17", "GPIO50_L4";
				bias-disable;
			};
		};
	};
};

repo_name: angery/linux


code:
// SPDX-License-Identifier: GPL-2.0-only
/*
 * Devicetree for the Samsung XCover 2 GT-S7710 also known as Skomer.
 */

/dts-v1/;
#include "ste-db8500.dtsi"
#include "ste-ab8505.dtsi"
#include "ste-dbx5x0-pinctrl.dtsi"
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/leds/common.h>
#include <dt-bindings/input/input.h>
#include <dt-bindings/interrupt-controller/irq.h>

/ {
	model = "Samsung XCover 2 (GT-S7710)";
	compatible = "samsung,skomer", "st-ericsson,u8500";

	chosen {
		stdout-path = &serial2;
	};

	battery: battery {
		compatible = "samsung,eb485159lu";
	};

	thermal-zones {
		battery-thermal {
			/* This zone will be polled by the battery temperature code */
			polling-delay = <0>;
			polling-delay-passive = <0>;
			thermal-sensors = <&bat_therm>;

			trips {
				battery-crit-hi {
					temperature = <70000>;
					hysteresis = <2000>;
					type = "critical";
				};
			};
		};
	};

	bat_therm: thermistor {
		compatible = "samsung,1404-001221";
		io-channels = <&gpadc 0x02>; /* BatTemp */
		pullup-uv = <1800000>;
		pullup-ohm = <230000>;
		pulldown-ohm = <0>;
		#thermal-sensor-cells = <0>;
	};

	/* TI TXS0206 level translator for 2.9 V */
	sd_level_translator: regulator-gpio {
		compatible = "regulator-fixed";

		/* GPIO87 EN */
		gpios = <&gpio2 23 GPIO_ACTIVE_HIGH>;
		enable-active-high;

		regulator-name = "sd-level-translator";
		regulator-min-microvolt = <2900000>;
		regulator-max-microvolt = <2900000>;
		regulator-type = "voltage";

		startup-delay-us = <200>;

		pinctrl-names = "default";
		pinctrl-0 = <&sd_level_translator_default>;
	};

	/* External LDO MIC5366-3.3YMT for eMMC */
	ldo_3v3_reg: regulator-gpio-ldo-3v3 {
		compatible = "regulator-fixed";
		regulator-name = "en-3v3-fixed-supply";
		regulator-min-microvolt = <3300000>;
		regulator-max-microvolt = <3300000>;
		gpio = <&gpio6 31 GPIO_ACTIVE_HIGH>;
		startup-delay-us = <5000>;
		enable-active-high;
		pinctrl-names = "default";
		pinctrl-0 = <&emmc_ldo_en_default_mode>;
	};

	wlan_en: regulator-gpio-wlan-en {
		compatible = "regulator-fixed";
		regulator-name = "wl-reg-on";
		regulator-min-microvolt = <3000000>;
		regulator-max-microvolt = <3000000>;
		startup-delay-us = <200000>;
		/* GPIO215 WLAN_EN */
		gpio = <&gpio6 23 GPIO_ACTIVE_HIGH>;
		enable-active-high;
		pinctrl-names = "default";
		pinctrl-0 = <&wlan_en_default_mode>;
	};

	vibrator {
		compatible = "gpio-vibrator";
		enable-gpios = <&gpio6 3 GPIO_ACTIVE_HIGH>;
		pinctrl-names = "default";
		pinctrl-0 = <&vibrator_default>;
	};

	gpio-keys {
		compatible = "gpio-keys";
		pinctrl-names = "default";
		pinctrl-0 = <&gpio_keys_default_mode>;

		button-home {
			linux,code = <KEY_HOME>;
			label = "HOME";
			/* GPIO91 */
			gpios = <&gpio2 27 GPIO_ACTIVE_LOW>;
		};
		button-volup {
			linux,code = <KEY_VOLUMEUP>;
			label = "VOL+";
			/* GPIO67 */
			gpios = <&gpio2 3 GPIO_ACTIVE_LOW>;
		};
		button-voldown {
			linux,code = <KEY_VOLUMEDOWN>;
			label = "VOL-";
			/* GPIO92 */
			gpios = <&gpio2 28 GPIO_ACTIVE_LOW>;
		};
		button-menu {
			linux,code = <KEY_MENU>;
			label = "MENU";
			/* GPIO204 */
			gpios = <&gpio6 12 GPIO_ACTIVE_LOW>;
		};
		button-back {
			linux,code = <KEY_BACK>;
			label = "BACK";
			/* GPIO205 */
			gpios = <&gpio6 13 GPIO_ACTIVE_LOW>;
		};
	};

	ktd253: backlight {
		compatible = "kinetic,ktd253";
		/* GPIO 69 */
		enable-gpios = <&gpio2 5 GPIO_ACTIVE_HIGH>;
		/* Default to 13/32 brightness */
		default-brightness = <13>;
		pinctrl-names = "default";
		pinctrl-0 = <&gpio_backlight_default_mode>;
	};

	/* Richtek RT8515GQW Flash LED Driver IC */
	flash {
		compatible = "richtek,rt8515";
		/* GPIO 140 */
		enf-gpios = <&gpio4 12 GPIO_ACTIVE_HIGH>;
		/* GPIO 141 */
		ent-gpios = <&gpio4 13 GPIO_ACTIVE_HIGH>;
		/*
		 * RFS is 16 kOhm and RTS is 100 kOhm giving
		 * the flash max current 343mA and torch max
		 * current 55 mA.
		 */
		richtek,rfs-ohms = <16000>;
		richtek,rts-ohms = <100000>;
		pinctrl-names = "default";
		pinctrl-0 = <&gpio_flash_default_mode>;

		led {
			function = LED_FUNCTION_FLASH;
			color = <LED_COLOR_ID_WHITE>;
			flash-max-timeout-us = <250000>;
			flash-max-microamp = <343750>;
			led-max-microamp = <55000>;
		};
	};

	i2c-gpio-0 {
		compatible = "i2c-gpio";
		sda-gpios = <&gpio4 16 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
		scl-gpios = <&gpio4 15 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
		pinctrl-names = "default";
		pinctrl-0 = <&i2c_gpio_0_default>;
		#address-cells = <1>;
		#size-cells = <0>;
		/* TODO: this should be used by the NCP6914 Camera power management unit */
	};

	i2c-gpio-1 {
		compatible = "i2c-gpio";
		sda-gpios = <&gpio4 24 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
		scl-gpios = <&gpio4 23 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
		pinctrl-names = "default";
		pinctrl-0 = <&i2c_gpio_1_default>;
		#address-cells = <1>;
		#size-cells = <0>;
		magnetometer@c {
			compatible = "alps,hscdtd008a";
			reg = <0x0c>;
			avdd-supply = <&ab8500_ldo_aux1_reg>;
			dvdd-supply = <&ab8500_ldo_aux8_reg>;
		};
	};

	soc {
		// External Micro SD slot
		mmc@80126000 {
			arm,primecell-periphid = <0x10480180>;
			max-frequency = <100000000>;
			bus-width = <4>;
			cap-sd-highspeed;
			cap-mmc-highspeed;
			/* All direction control is used */
			st,sig-pin-fbclk;
			full-pwr-cycle;
			vmmc-supply = <&ab8500_ldo_aux3_reg>;
			vqmmc-supply = <&sd_level_translator>;
			pinctrl-names = "default", "sleep";
			pinctrl-0 = <&mc0_a_1_default>;
			pinctrl-1 = <&mc0_a_1_sleep>;
			status = "okay";
		};

		// WLAN SDIO channel
		mmc@80118000 {
			arm,primecell-periphid = <0x10480180>;
			max-frequency = <50000000>;
			bus-width = <4>;
			non-removable;
			cap-sd-highspeed;
			vmmc-supply = <&wlan_en>;
			pinctrl-names = "default", "sleep";
			pinctrl-0 = <&mc1_a_2_default>;
			pinctrl-1 = <&mc1_a_2_sleep>;
			status = "okay";
			#address-cells = <1>;
			#size-cells = <0>;

			wifi@1 {
				compatible = "brcm,bcm4334-fmac", "brcm,bcm4329-fmac";
				reg = <1>;
				/* GPIO216 WL_HOST_WAKE */
				interrupt-parent = <&gpio6>;
				interrupts = <24 IRQ_TYPE_EDGE_FALLING>;
				interrupt-names = "host-wake";
				pinctrl-names = "default";
				pinctrl-0 = <&wlan_default_mode>;
			};
		};

		/*
		 * eMMC seems to be mostly Samsung KLM4G1YE4C "4YMD1R"
		 */
		mmc@80005000 {
			arm,primecell-periphid = <0x10480180>;
		        max-frequency = <100000000>;
			bus-width = <8>;
			non-removable;
			cap-mmc-highspeed;
			mmc-ddr-1_8v;
			no-sdio;
			no-sd;
			/* From datasheet page 26 figure 9: 300 ms set-up time for 4GB */
			post-power-on-delay-ms = <300>;
			vmmc-supply = <&ldo_3v3_reg>;
			pinctrl-names = "default", "sleep";
			pinctrl-0 = <&mc2_a_1_default>;
			pinctrl-1 = <&mc2_a_1_sleep>;

			status = "okay";
		};

		/* GBF (Bluetooth) UART */
		uart@80120000 {
			pinctrl-names = "default", "sleep";
			pinctrl-0 = <&u0_a_1_default>;
			pinctrl-1 = <&u0_a_1_sleep>;
			status = "okay";

			/* FIXME: not quite working yet, probably needs regulators */
			bluetooth {
				/* BCM4334B0 actually */
				compatible = "brcm,bcm4330-bt";
				shutdown-gpios = <&gpio6 30 GPIO_ACTIVE_HIGH>;
				device-wakeup-gpios = <&gpio6 7 GPIO_ACTIVE_HIGH>;
				host-wakeup-gpios = <&gpio3 1 GPIO_ACTIVE_HIGH>;
				pinctrl-names = "default";
				pinctrl-0 = <&bluetooth_default_mode>;
			};
		};

		/* GPS UART */
		uart@80121000 {
			status = "okay";
			pinctrl-names = "default", "sleep";
			pinctrl-0 = <&u1rxtx_a_1_default &u1ctsrts_a_1_default>;
			pinctrl-1 = <&u1rxtx_a_1_sleep &u1ctsrts_a_1_sleep>;

			gnss {
				/* The CSRG05TA03-ICJE-R is a SirfStarV 5t chip */
				compatible = "csr,csrg05ta03-icje-r";
				/* GPS_RSTN on GPIO209 */
				reset-gpios = <&gpio6 17 GPIO_ACTIVE_LOW>;
				/* GPS_ON_OFF on GPIO86 */
				sirf,onoff-gpios = <&gpio2 22 GPIO_ACTIVE_HIGH>;
				/* GPS_1V8 (VSMPS2) */
				vcc-supply = <&db8500_vsmps2_reg>;
				pinctrl-names = "default";
				pinctrl-0 = <&g05ta03_skomer_default>;
				/* According to /etc/sirfgps.conf */
				current-speed = <460800>;
			};
		};

		/* Debugging console UART connected to AB8505 USB */
		uart@80007000 {
			status = "okay";
			pinctrl-names = "default", "sleep";
			pinctrl-0 = <&u2rxtx_c_1_default>;
			pinctrl-1 = <&u2rxtx_c_1_sleep>;
		};

		prcmu@80157000 {
			ab8505 {
				phy {
					pinctrl-names = "default", "sleep";
					pinctrl-0 = <&usb_a_1_default>;
					pinctrl-1 = <&usb_a_1_sleep>;
				};

				ab8500_fg {
					line-impedance-micro-ohms = <16000>;
				};

				regulator {
					ab8500_ldo_aux1 {
						/* Used for VDD for sensors */
						regulator-name = "AUX1";
						regulator-min-microvolt = <3000000>;
						regulator-max-microvolt = <3300000>;
					};

					ab8500_ldo_aux2 {
						/* Supplies the Cypress TMA140 touchscreen only with 3.0V */
						regulator-name = "AUX2";
						regulator-min-microvolt = <3000000>;
						regulator-max-microvolt = <3000000>;
					};

					ab8500_ldo_aux3 {
						/* Used for voltage for external MMC/SD card */
						regulator-name = "AUX3";
						regulator-min-microvolt = <1100000>;
						regulator-max-microvolt = <3300000>;
					};

					ab8500_ldo_aux4 {
						regulator-name = "AUX4";
						/* Hammer to 3.0V for the display */
						regulator-min-microvolt = <3000000>;
						regulator-max-microvolt = <3000000>;
					};

					ab8500_ldo_aux5 {
						regulator-name = "AUX5";
						/* Intended for 1V8 for touchscreen but actually left unused */
						regulator-min-microvolt = <1050000>;
						regulator-max-microvolt = <2790000>;
					};

					ab8500_ldo_aux6 {
						regulator-name = "AUX6";
						/* Hammer to 1.8V for the display */
						regulator-min-microvolt = <1800000>;
						regulator-max-microvolt = <1800000>;
					};

					ab8500_ldo_aux8 {
						/* Mostly VIO for sensors */
						regulator-name = "AUX8";
					};
				};
			};
		};

		/* I2C0 */
		i2c@80004000 {
			status = "okay";

			pinctrl-names = "default", "sleep";
			pinctrl-0 = <&i2c0_a_1_default>;
			pinctrl-1 = <&i2c0_a_1_sleep>;

			proximity@44 {
				compatible = "sharp,gp2ap002s00f";
				clock-frequency = <400000>;
				reg = <0x44>;

				interrupt-parent = <&gpio4>;
				interrupts = <18 IRQ_TYPE_EDGE_FALLING>;
				vdd-supply = <&ab8500_ldo_aux1_reg>;
				vio-supply = <&ab8500_ldo_aux8_reg>;
				pinctrl-names = "default";
				pinctrl-0 = <&gp2ap002_skomer_default>;
				sharp,proximity-far-hysteresis = /bits/ 8 <0x2f>;
				sharp,proximity-close-hysteresis = /bits/ 8 <0x0f>;
			};
		};

		/* I2C2 */
		i2c@80128000 {
			status = "okay";

			pinctrl-names = "default", "sleep";
			pinctrl-0 = <&i2c2_b_2_default>;
			pinctrl-1 = <&i2c2_b_2_sleep>;

			accel@18 {
				compatible = "bosch,bma254";
				clock-frequency = <400000>;
				reg = <0x18>;

				/* GPIO224 used as "smart alert" interrupt */
				interrupt-parent = <&gpio7>;
				interrupts = <0 IRQ_TYPE_EDGE_RISING>;

				mount-matrix = "0", "-1", "0",
					      "1", "0", "0",
					       "0", "0", "1";
				vdd-supply = <&ab8500_ldo_aux1_reg>;
				vddio-supply = <&ab8500_ldo_aux8_reg>;
				pinctrl-names = "default";
				pinctrl-0 = <&bma254_skomer_default>;
			};
		};

		/* I2C3 */
		i2c@80110000 {
			status = "okay";

			pinctrl-names = "default", "sleep";
			pinctrl-0 = <&i2c3_c_2_default>;
			pinctrl-1 = <&i2c3_c_2_sleep>;

			/* Cypress CY8CTMA140 touchscreen */
			touchscreen@20 {
				compatible = "cypress,cy8ctma140";
				clock-frequency = <400000>;
				reg = <0x20>;

				touchscreen-size-x = <480>;
				touchscreen-size-y = <800>;
				touchscreen-max-pressure = <255>;

				/* GPIO218 for IRQ */
				interrupt-parent = <&gpio6>;
				interrupts = <26 IRQ_TYPE_EDGE_FALLING>;

				/* VDD is "digital supply" nominally 1.71-3.6V */
				vdd-supply = <&ab8500_ldo_aux2_reg>;
				/* VCPIN is "analog supply", 2.7-3.6 V */
				vcpin-supply = <&ab8500_ldo_aux2_reg>;

				pinctrl-names = "default";
				pinctrl-0 = <&tma140_skomer_default>;
			};
		};

		mcde@a0350000 {
			status = "okay";
			pinctrl-names = "default";
			pinctrl-0 = <&dsi_default_mode>;

			dsi@a0351000 {
				panel {
					/* NT35510-based Hydis HVA40WV1 */
					compatible = "hydis,hva40wv1", "novatek,nt35510";
					reg = <0>;
					/* v_lcd_3v0 2.3-4.8V */
					vdd-supply = <&ab8500_ldo_aux4_reg>;
					/* v_lcd_1v8 1.65-3.3V */
					vddi-supply = <&ab8500_ldo_aux6_reg>;
					/* GPIO 139 */
					reset-gpios = <&gpio4 11 GPIO_ACTIVE_LOW>;
					pinctrl-names = "default";
					pinctrl-0 = <&display_default_mode>;
					backlight = <&ktd253>;
				};
			};
		};
	};
};

&pinctrl {
	sdi0 {
		mc0_a_1_default {
			default_cfg1 {
				/* GPIO18, 19 & 20 unused so pull down */
				ste,config = <&gpio_in_pd>;
			};
		};
	};

	/* This is a reset line for the eMMC */
	sdi2 {
		mc2_a_1_default {
			default_cfg2 {
				pins = "GPIO130_C8"; /* FBCLK */
				ste,config = <&gpio_in_pd>;
			};
		};
	};

	mcde {
		dsi_default_mode: dsi_default {
			default_mux1 {
				/* Mux in VSI0 used for DSI TE */
				function = "lcd";
				groups = "lcdvsi0_a_1"; /* VSI0 for LCD */
			};
			default_cfg1 {
				pins = "GPIO68_E1"; /* VSI0 */
				ste,config = <&in_nopull>;
			};
		};
	};

	/* Two GPIO lines used by the display */
	display {
		display_default_mode: display_default {
			skomer_cfg1 {
				/*
				 * OLED DETECT or check_pba, this appears to be high
				 * on "PBA" which I guess is "prototype board A".
				 */
				pins = "GPIO93_B7";
				ste,config = <&gpio_in_nopull>;
			};
			skomer_cfg2 {
				pins = "GPIO139_C9";
				/*
				 * MIPI_DSI0_RESET_N resets the display, leave high
				 * (de-asserted) so we only assert reset explicitly
				 * from the display driver.
				 */
				ste,config = <&gpio_out_hi>;
			};
		};
	};
	backlight {
		gpio_backlight_default_mode: backlight_default {
			skomer_cfg1 {
				pins = "GPIO69_E2"; /* LCD_BL_CTRL */
				ste,config = <&gpio_out_lo>;
			};
		};
	};
	flash {
		gpio_flash_default_mode: flash_default {
			skomer_cfg1 {
				pins = "GPIO140_B11", "GPIO141_C12";
				ste,config = <&gpio_out_lo>;
			};
		};
	};
	/* GPIO that enables the 2.9V SD card level translator */
	sd-level-translator {
		sd_level_translator_default: sd_level_translator_default {
			/* level shifter on GPIO87 */
			skomer_cfg1 {
				pins = "GPIO87_B3";
				ste,config = <&gpio_out_hi>;
			};
		};
	};
	/* GPIO that enables the LDO regulator for the eMMC */
	emmc-ldo {
		emmc_ldo_en_default_mode: emmc_ldo_default {
			/* LDO enable on GPIO223 */
			skomer_cfg1 {
				pins = "GPIO223_AH9";
				ste,config = <&gpio_out_hi>;
			};
		};
	};
	/* GPIO keys */
	gpio-keys {
		gpio_keys_default_mode: gpio_keys_default {
			skomer_cfg1 {
				pins = "GPIO67_G2", /* VOL UP */
				       "GPIO91_B6", /* HOME */
				       "GPIO92_D6", /* VOL DOWN */
				       "GPIO204_AF23", /* MENU */
				       "GPIO205_AG23"; /* BACK */
					ste,config = <&gpio_in_pu>;
			};
		};
	};
	/* Interrupt line for BMA254 */
	bma254 {
		bma254_skomer_default: bma254_skomer {
			skomer_cfg1 {
				pins = "GPIO224_AG9";
				ste,config = <&gpio_in_pd>;
			};
		};
	};
	/* Interrupt line for light/proximity sensor GP2AP002 */
	gp2ap002 {
		gp2ap002_skomer_default: gp2ap002_skomer {
			skomer_cfg1 {
				pins = "GPIO146_D13";
				ste,config = <&gpio_in_nopull>;
			};
		};
	};
	/* GPIO-based I2C bus for NCP6914 */
	i2c-gpio-0 {
		i2c_gpio_0_default: i2c_gpio_0 {
			skomer_cfg1 {
				pins = "GPIO143_D12", "GPIO144_B13";
				ste,config = <&gpio_in_nopull>;
			};
		};
	};
	/* GPIO-based I2C bus for ALPS HSCD compass */
	i2c-gpio-1 {
		i2c_gpio_1_default: i2c_gpio_1 {
			skomer_cfg1 {
				pins = "GPIO151_B17", "GPIO152_D16";
				ste,config = <&gpio_in_nopull>;
			};
		};
	};
	wlan {
		wlan_default_mode: wlan_default {
			skomer_cfg1 {
				pins = "GPIO216_AG12";
				ste,config = <&gpio_in_pd>;
			};
		};
		wlan_en_default_mode: wlan_en_default {
			skomer_cfg2 {
				pins = "GPIO215_AH13";
				ste,config = <&gpio_out_lo>;
			};
		};
	};
	bluetooth {
		bluetooth_default_mode: bluetooth_default {
			skomer_cfg1 {
				pins = "GPIO199_AH23", "GPIO222_AJ9";
				ste,config = <&gpio_out_lo>;
			};
			skomer_cfg2 {
				pins = "GPIO97_D9";
				ste,config = <&gpio_in_nopull>;
			};
		};
	};
	vibrator {
		vibrator_default: vibrator_default {
			skomer_cfg1 {
				pins = "GPIO195_AG28";	/* MOT_EN */
				ste,config = <&gpio_out_lo>;
			};
		};
	};
	/* Interrupt line for the Cypress TMA140 touchscreen */
	touchscreen {
		tma140_skomer_default: tma140_skomer {
			skomer_cfg1 {
				pins = "GPIO218_AH11";
				ste,config = <&gpio_in_nopull>;
			};
		};
	};
	g05ta03 {
		g05ta03_skomer_default: g05ta03 {
			/* Reset line, start out de-asserted */
			skomer_cfg1 {
				pins = "GPIO209_AG15";
				ste,config = <&gpio_out_hi>;
			};
			/* GPS_ON_OFF, start out deasserted (off) */
			skomer_cfg2 {
				pins = "GPIO86_C6";
				ste,config = <&gpio_out_lo>;
			};
		};
	};
};

&ab8505_gpio {
	/* Hog a few default settings */
	pinctrl-names = "default";
	pinctrl-0 = <&gpio_default>;

	gpio {
		gpio_default: gpio_default {
			skomer_mux {
				/* Change unused pins to GPIO mode */
				function = "gpio";
				groups = "gpio3_a_1",	/* default: SysClkReq4 */
					 "gpio14_a_1";	/* default: PWMOut1 */
			};
			skomer_cfg1 {
				pins = "GPIO11_B17", "GPIO13_D17", "GPIO50_L4";
				bias-disable;
			};
		};
	};
};


code:
// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (C) 2014 STMicroelectronics (R&D) Limited.
 * Author: Giuseppe Cavallaro <peppe.cavallaro@st.com>
 */
/dts-v1/;
#include "stih407.dtsi"
#include "stihxxx-b2120.dtsi"
/ {
	model = "STiH407 B2120";
	compatible = "st,stih407-b2120", "st,stih407";

	chosen {
		stdout-path = &sbc_serial0;
	};

	memory@40000000 {
		device_type = "memory";
		reg = <0x40000000 0x80000000>;
	};

	aliases {
		serial0 = &sbc_serial0;
		ethernet0 = &ethernet0;
	};

};


code:
// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (C) 2014 STMicroelectronics R&D Limited
 */
#include <dt-bindings/clock/stih407-clks.h>
/ {
	/*
	 * Fixed 30MHz oscillator inputs to SoC
	 */
	clk_sysin: clk-sysin {
		#clock-cells = <0>;
		compatible = "fixed-clock";
		clock-frequency = <30000000>;
	};

	clk_tmdsout_hdmi: clk-tmdsout-hdmi {
		#clock-cells = <0>;
		compatible = "fixed-clock";
		clock-frequency = <0>;
	};

	clocks {
		#address-cells = <1>;
		#size-cells = <1>;
		ranges;

		/*
		 * A9 PLL.
		 */
		clockgen-a9@92b0000 {
			compatible = "st,clkgen-c32";
			reg = <0x92b0000 0x10000>;

			clockgen_a9_pll: clockgen-a9-pll {
				#clock-cells = <1>;
				compatible = "st,stih407-clkgen-plla9";

				clocks = <&clk_sysin>;
			};

			clk_m_a9: clk-m-a9 {
				#clock-cells = <0>;
				compatible = "st,stih407-clkgen-a9-mux";

				clocks = <&clockgen_a9_pll 0>,
					 <&clockgen_a9_pll 0>,
					 <&clk_s_c0_flexgen 13>,
					 <&clk_m_a9_ext2f_div2>;

				/*
				 * ARM Peripheral clock for timers
				 */
				arm_periph_clk: clk-m-a9-periphs {
					#clock-cells = <0>;
					compatible = "fixed-factor-clock";

					clocks = <&clk_m_a9>;
					clock-div = <2>;
					clock-mult = <1>;
				};
			};
		};

		clockgen-a@90ff000 {
			compatible = "st,clkgen-c32";
			reg = <0x90ff000 0x1000>;

			clk_s_a0_pll: clk-s-a0-pll {
				#clock-cells = <1>;
				compatible = "st,clkgen-pll0-a0";

				clocks = <&clk_sysin>;
			};

			clk_s_a0_flexgen: clk-s-a0-flexgen {
				compatible = "st,flexgen", "st,flexgen-stih407-a0";

				#clock-cells = <1>;

				clocks = <&clk_s_a0_pll 0>,
					 <&clk_sysin>;
			};
		};

		clk_s_c0: clockgen-c@9103000 {
			compatible = "st,clkgen-c32";
			reg = <0x9103000 0x1000>;

			clk_s_c0_pll0: clk-s-c0-pll0 {
				#clock-cells = <1>;
				compatible = "st,clkgen-pll0-c0";

				clocks = <&clk_sysin>;
			};

			clk_s_c0_pll1: clk-s-c0-pll1 {
				#clock-cells = <1>;
				compatible = "st,clkgen-pll1-c0";

				clocks = <&clk_sysin>;
			};

			clk_s_c0_quadfs: clk-s-c0-quadfs {
				#clock-cells = <1>;
				compatible = "st,quadfs-pll";

				clocks = <&clk_sysin>;
			};

			clk_s_c0_flexgen: clk-s-c0-flexgen {
				#clock-cells = <1>;
				compatible = "st,flexgen", "st,flexgen-stih407-c0";

				clocks = <&clk_s_c0_pll0 0>,
					 <&clk_s_c0_pll1 0>,
					 <&clk_s_c0_quadfs 0>,
					 <&clk_s_c0_quadfs 1>,
					 <&clk_s_c0_quadfs 2>,
					 <&clk_s_c0_quadfs 3>,
					 <&clk_sysin>;

				/*
				 * ARM Peripheral clock for timers
				 */
				clk_m_a9_ext2f_div2: clk-m-a9-ext2f-div2s {
					#clock-cells = <0>;
					compatible = "fixed-factor-clock";

					clocks = <&clk_s_c0_flexgen 13>;

					clock-output-names = "clk-m-a9-ext2f-div2";

					clock-div = <2>;
					clock-mult = <1>;
				};
			};
		};

		clockgen-d0@9104000 {
			compatible = "st,clkgen-c32";
			reg = <0x9104000 0x1000>;

			clk_s_d0_quadfs: clk-s-d0-quadfs {
				#clock-cells = <1>;
				compatible = "st,quadfs-d0";

				clocks = <&clk_sysin>;
			};

			clk_s_d0_flexgen: clk-s-d0-flexgen {
				#clock-cells = <1>;
				compatible = "st,flexgen", "st,flexgen-stih407-d0";

				clocks = <&clk_s_d0_quadfs 0>,
					 <&clk_s_d0_quadfs 1>,
					 <&clk_s_d0_quadfs 2>,
					 <&clk_s_d0_quadfs 3>,
					 <&clk_sysin>;
			};
		};

		clockgen-d2@9106000 {
			compatible = "st,clkgen-c32";
			reg = <0x9106000 0x1000>;

			clk_s_d2_quadfs: clk-s-d2-quadfs {
				#clock-cells = <1>;
				compatible = "st,quadfs-d2";

				clocks = <&clk_sysin>;
			};

			clk_s_d2_flexgen: clk-s-d2-flexgen {
				#clock-cells = <1>;
				compatible = "st,flexgen", "st,flexgen-stih407-d2";

				clocks = <&clk_s_d2_quadfs 0>,
					 <&clk_s_d2_quadfs 1>,
					 <&clk_s_d2_quadfs 2>,
					 <&clk_s_d2_quadfs 3>,
					 <&clk_sysin>,
					 <&clk_sysin>,
					 <&clk_tmdsout_hdmi>;
			};
		};

		clockgen-d3@9107000 {
			compatible = "st,clkgen-c32";
			reg = <0x9107000 0x1000>;

			clk_s_d3_quadfs: clk-s-d3-quadfs {
				#clock-cells = <1>;
				compatible = "st,quadfs-d3";

				clocks = <&clk_sysin>;
			};

			clk_s_d3_flexgen: clk-s-d3-flexgen {
				#clock-cells = <1>;
				compatible = "st,flexgen", "st,flexgen-stih407-d3";

				clocks = <&clk_s_d3_quadfs 0>,
					 <&clk_s_d3_quadfs 1>,
					 <&clk_s_d3_quadfs 2>,
					 <&clk_s_d3_quadfs 3>,
					 <&clk_sysin>;
			};
		};
	};
};


code:
// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (C) 2014 STMicroelectronics Limited.
 * Author: Giuseppe Cavallaro <peppe.cavallaro@st.com>
 */
#include "stih407-pinctrl.dtsi"
#include <dt-bindings/mfd/st-lpc.h>
#include <dt-bindings/phy/phy.h>
#include <dt-bindings/reset/stih407-resets.h>
#include <dt-bindings/interrupt-controller/irq-st.h>
/ {
	#address-cells = <1>;
	#size-cells = <1>;

	reserved-memory {
		#address-cells = <1>;
		#size-cells = <1>;
		ranges;

		gp0_reserved: rproc@45000000 {
			compatible = "shared-dma-pool";
			reg = <0x45000000 0x00400000>;
			no-map;
		};

		delta_reserved: rproc@44000000 {
			compatible = "shared-dma-pool";
			reg = <0x44000000 0x01000000>;
			no-map;
		};
	};

	cpus {
		#address-cells = <1>;
		#size-cells = <0>;
		cpu@0 {
			device_type = "cpu";
			compatible = "arm,cortex-a9";
			reg = <0>;

			/* u-boot puts hpen in SBC dmem at 0xa4 offset */
			cpu-release-addr = <0x94100A4>;

					 /* kHz     uV   */
			operating-points = <1500000 0
					    1200000 0
					    800000  0
					    500000  0>;

			clocks = <&clk_m_a9>;
			clock-names = "cpu";
			clock-latency = <100000>;
			cpu0-supply = <&pwm_regulator>;
			st,syscfg = <&syscfg_core 0x8e0>;
		};
		cpu@1 {
			device_type = "cpu";
			compatible = "arm,cortex-a9";
			reg = <1>;

			/* u-boot puts hpen in SBC dmem at 0xa4 offset */
			cpu-release-addr = <0x94100A4>;

					 /* kHz     uV   */
			operating-points = <1500000 0
					    1200000 0
					    800000  0
					    500000  0>;
		};
	};

	intc: interrupt-controller@8761000 {
		compatible = "arm,cortex-a9-gic";
		#interrupt-cells = <3>;
		interrupt-controller;
		reg = <0x08761000 0x1000>, <0x08760100 0x100>;
	};

	scu@8760000 {
		compatible = "arm,cortex-a9-scu";
		reg = <0x08760000 0x1000>;
	};

	timer@8760200 {
		interrupt-parent = <&intc>;
		compatible = "arm,cortex-a9-global-timer";
		reg = <0x08760200 0x100>;
		interrupts = <GIC_PPI 11 IRQ_TYPE_LEVEL_HIGH>;
		clocks = <&arm_periph_clk>;
	};

	l2: cache-controller@8762000 {
		compatible = "arm,pl310-cache";
		reg = <0x08762000 0x1000>;
		arm,data-latency = <3 3 3>;
		arm,tag-latency = <2 2 2>;
		cache-unified;
		cache-level = <2>;
	};

	arm-pmu {
		interrupt-parent = <&intc>;
		compatible = "arm,cortex-a9-pmu";
		interrupts = <GIC_PPI 15 IRQ_TYPE_LEVEL_HIGH>;
	};

	pwm_regulator: pwm-regulator {
		compatible = "pwm-regulator";
		pwms = <&pwm1 3 8448>;
		regulator-name = "CPU_1V0_AVS";
		regulator-min-microvolt = <784000>;
		regulator-max-microvolt = <1299000>;
		regulator-always-on;
		max-duty-cycle = <255>;
		status = "okay";
	};

	restart: restart-controller {
		compatible = "st,stih407-restart";
		st,syscfg = <&syscfg_sbc_reg>;
		status = "okay";
	};

	powerdown: powerdown-controller {
		compatible = "st,stih407-powerdown";
		#reset-cells = <1>;
	};

	softreset: softreset-controller {
		compatible = "st,stih407-softreset";
		#reset-cells = <1>;
	};

	picophyreset: picophyreset-controller {
		compatible = "st,stih407-picophyreset";
		#reset-cells = <1>;
	};

	irq-syscfg {
		compatible = "st,stih407-irq-syscfg";
		st,syscfg = <&syscfg_core>;
		st,irq-device = <ST_IRQ_SYSCFG_PMU_0>,
				<ST_IRQ_SYSCFG_PMU_1>;
		st,fiq-device = <ST_IRQ_SYSCFG_DISABLED>,
				<ST_IRQ_SYSCFG_DISABLED>;
	};

	usb2_picophy0: phy1 {
		compatible = "st,stih407-usb2-phy";
		#phy-cells = <0>;
		st,syscfg = <&syscfg_core 0x100 0xf4>;
		resets = <&softreset STIH407_PICOPHY_SOFTRESET>,
			 <&picophyreset STIH407_PICOPHY2_RESET>;
		reset-names = "global", "port";
	};

	miphy28lp_phy: miphy28lp {
		compatible = "st,miphy28lp-phy";
		st,syscfg = <&syscfg_core>;
		#address-cells = <1>;
		#size-cells = <1>;
		ranges;

		phy_port0: port@9b22000 {
			reg = <0x9b22000 0xff>,
			      <0x9b09000 0xff>,
			      <0x9b04000 0xff>;
			reg-names = "sata-up",
				    "pcie-up",
				    "pipew";

			st,syscfg = <0x114 0x818 0xe0 0xec>;
			#phy-cells = <1>;

			reset-names = "miphy-sw-rst";
			resets = <&softreset STIH407_MIPHY0_SOFTRESET>;
		};

		phy_port1: port@9b2a000 {
			reg = <0x9b2a000 0xff>,
			      <0x9b19000 0xff>,
			      <0x9b14000 0xff>;
			reg-names = "sata-up",
				    "pcie-up",
				    "pipew";

			st,syscfg = <0x118 0x81c 0xe4 0xf0>;

			#phy-cells = <1>;

			reset-names = "miphy-sw-rst";
			resets = <&softreset STIH407_MIPHY1_SOFTRESET>;
		};

		phy_port2: port@8f95000 {
			reg = <0x8f95000 0xff>,
			      <0x8f90000 0xff>;
			reg-names = "pipew",
				    "usb3-up";

			st,syscfg = <0x11c 0x820>;

			#phy-cells = <1>;

			reset-names = "miphy-sw-rst";
			resets = <&softreset STIH407_MIPHY2_SOFTRESET>;
		};
	};

	st231_gp0: st231-gp0 {
		compatible = "st,st231-rproc";
		memory-region = <&gp0_reserved>;
		resets = <&softreset STIH407_ST231_GP0_SOFTRESET>;
		reset-names = "sw_reset";
		clocks = <&clk_s_c0_flexgen CLK_ST231_GP_0>;
		clock-frequency = <600000000>;
		st,syscfg = <&syscfg_core 0x22c>;
		#mbox-cells = <1>;
		mbox-names = "vq0_rx", "vq0_tx", "vq1_rx", "vq1_tx";
		mboxes = <&mailbox0 0 2>, <&mailbox2 0 1>, <&mailbox0 0 3>, <&mailbox2 0 0>;
	};

	st231_delta: st231-delta {
		compatible = "st,st231-rproc";
		memory-region = <&delta_reserved>;
		resets = <&softreset STIH407_ST231_DMU_SOFTRESET>;
		reset-names = "sw_reset";
		clocks = <&clk_s_c0_flexgen CLK_ST231_DMU>;
		clock-frequency = <600000000>;
		st,syscfg = <&syscfg_core 0x224>;
		#mbox-cells = <1>;
		mbox-names = "vq0_rx", "vq0_tx", "vq1_rx", "vq1_tx";
		mboxes = <&mailbox0 0 0>, <&mailbox3 0 1>, <&mailbox0 0 1>, <&mailbox3 0 0>;
	};

	delta0 {
		compatible = "st,st-delta";
		clock-names = "delta",
			      "delta-st231",
			      "delta-flash-promip";
		clocks = <&clk_s_c0_flexgen CLK_VID_DMU>,
			 <&clk_s_c0_flexgen CLK_ST231_DMU>,
			 <&clk_s_c0_flexgen CLK_FLASH_PROMIP>;
	};

	soc {
		#address-cells = <1>;
		#size-cells = <1>;
		interrupt-parent = <&intc>;
		ranges;
		compatible = "simple-bus";

		syscfg_sbc: sbc-syscfg@9620000 {
			compatible = "st,stih407-sbc-syscfg", "syscon";
			reg = <0x9620000 0x1000>;
		};

		syscfg_front: front-syscfg@9280000 {
			compatible = "st,stih407-front-syscfg", "syscon";
			reg = <0x9280000 0x1000>;
		};

		syscfg_rear: rear-syscfg@9290000 {
			compatible = "st,stih407-rear-syscfg", "syscon";
			reg = <0x9290000 0x1000>;
		};

		syscfg_flash: flash-syscfg@92a0000 {
			compatible = "st,stih407-flash-syscfg", "syscon";
			reg = <0x92a0000 0x1000>;
		};

		syscfg_sbc_reg: fvdp-lite-syscfg@9600000 {
			compatible = "st,stih407-sbc-reg-syscfg", "syscon";
			reg = <0x9600000 0x1000>;
		};

		syscfg_core: core-syscfg@92b0000 {
			compatible = "st,stih407-core-syscfg", "syscon";
			reg = <0x92b0000 0x1000>;

			sti_sasg_codec: sti-sasg-codec {
				compatible = "st,stih407-sas-codec";
				#sound-dai-cells = <1>;
				status = "disabled";
				st,syscfg = <&syscfg_core>;
			};
		};

		syscfg_lpm: lpm-syscfg@94b5100 {
			compatible = "st,stih407-lpm-syscfg", "syscon";
			reg = <0x94b5100 0x1000>;
		};

		/* Display */
		vtg_main: sti-vtg-main@8d02800 {
			compatible = "st,vtg";
			reg = <0x8d02800 0x200>;
			interrupts = <GIC_SPI 108 IRQ_TYPE_LEVEL_HIGH>;
		};

		vtg_aux: sti-vtg-aux@8d00200 {
			compatible = "st,vtg";
			reg = <0x8d00200 0x100>;
			interrupts = <GIC_SPI 109 IRQ_TYPE_LEVEL_HIGH>;
		};

		serial@9830000 {
			compatible = "st,asc";
			reg = <0x9830000 0x2c>;
			interrupts = <GIC_SPI 122 IRQ_TYPE_LEVEL_HIGH>;
			clocks = <&clk_s_c0_flexgen CLK_EXT2F_A9>;
			/* Pinctrl moved out to a per-board configuration */

			status = "disabled";
		};

		serial@9831000 {
			compatible = "st,asc";
			reg = <0x9831000 0x2c>;
			interrupts = <GIC_SPI 123 IRQ_TYPE_LEVEL_HIGH>;
			pinctrl-names = "default";
			pinctrl-0 = <&pinctrl_serial1>;
			clocks = <&clk_s_c0_flexgen CLK_EXT2F_A9>;

			status = "disabled";
		};

		serial@9832000 {
			compatible = "st,asc";
			reg = <0x9832000 0x2c>;
			interrupts = <GIC_SPI 124 IRQ_TYPE_LEVEL_HIGH>;
			pinctrl-names = "default";
			pinctrl-0 = <&pinctrl_serial2>;
			clocks = <&clk_s_c0_flexgen CLK_EXT2F_A9>;

			status = "disabled";
		};

		/* SBC_ASC0 - UART10 */
		sbc_serial0: serial@9530000 {
			compatible = "st,asc";
			reg = <0x9530000 0x2c>;
			interrupts = <GIC_SPI 138 IRQ_TYPE_LEVEL_HIGH>;
			pinctrl-names = "default";
			pinctrl-0 = <&pinctrl_sbc_serial0>;
			clocks = <&clk_sysin>;

			status = "disabled";
		};

		serial@9531000 {
			compatible = "st,asc";
			reg = <0x9531000 0x2c>;
			interrupts = <GIC_SPI 139 IRQ_TYPE_LEVEL_HIGH>;
			pinctrl-names = "default";
			pinctrl-0 = <&pinctrl_sbc_serial1>;
			clocks = <&clk_sysin>;

			status = "disabled";
		};

		i2c@9840000 {
			compatible = "st,comms-ssc4-i2c";
			interrupts = <GIC_SPI 112 IRQ_TYPE_LEVEL_HIGH>;
			reg = <0x9840000 0x110>;
			clocks = <&clk_s_c0_flexgen CLK_EXT2F_A9>;
			clock-names = "ssc";
			clock-frequency = <400000>;
			pinctrl-names = "default";
			pinctrl-0 = <&pinctrl_i2c0_default>;
			#address-cells = <1>;
			#size-cells = <0>;

			status = "disabled";
		};

		i2c@9841000 {
			compatible = "st,comms-ssc4-i2c";
			reg = <0x9841000 0x110>;
			interrupts = <GIC_SPI 113 IRQ_TYPE_LEVEL_HIGH>;
			clocks = <&clk_s_c0_flexgen CLK_EXT2F_A9>;
			clock-names = "ssc";
			clock-frequency = <400000>;
			pinctrl-names = "default";
			pinctrl-0 = <&pinctrl_i2c1_default>;
			#address-cells = <1>;
			#size-cells = <0>;

			status = "disabled";
		};

		i2c@9842000 {
			compatible = "st,comms-ssc4-i2c";
			reg = <0x9842000 0x110>;
			interrupts = <GIC_SPI 114 IRQ_TYPE_LEVEL_HIGH>;
			clocks = <&clk_s_c0_flexgen CLK_EXT2F_A9>;
			clock-names = "ssc";
			clock-frequency = <400000>;
			pinctrl-names = "default";
			pinctrl-0 = <&pinctrl_i2c2_default>;
			#address-cells = <1>;
			#size-cells = <0>;

			status = "disabled";
		};

		i2c@9843000 {
			compatible = "st,comms-ssc4-i2c";
			reg = <0x9843000 0x110>;
			interrupts = <GIC_SPI 115 IRQ_TYPE_LEVEL_HIGH>;
			clocks = <&clk_s_c0_flexgen CLK_EXT2F_A9>;
			clock-names = "ssc";
			clock-frequency = <400000>;
			pinctrl-names = "default";
			pinctrl-0 = <&pinctrl_i2c3_default>;
			#address-cells = <1>;
			#size-cells = <0>;

			status = "disabled";
		};

		i2c@9844000 {
			compatible = "st,comms-ssc4-i2c";
			reg = <0x9844000 0x110>;
			interrupts = <GIC_SPI 116 IRQ_TYPE_LEVEL_HIGH>;
			clocks = <&clk_s_c0_flexgen CLK_EXT2F_A9>;
			clock-names = "ssc";
			clock-frequency = <400000>;
			pinctrl-names = "default";
			pinctrl-0 = <&pinctrl_i2c4_default>;
			#address-cells = <1>;
			#size-cells = <0>;

			status = "disabled";
		};

		i2c@9845000 {
			compatible = "st,comms-ssc4-i2c";
			reg = <0x9845000 0x110>;
			interrupts = <GIC_SPI 117 IRQ_TYPE_LEVEL_HIGH>;
			clocks = <&clk_s_c0_flexgen CLK_EXT2F_A9>;
			clock-names = "ssc";
			clock-frequency = <400000>;
			pinctrl-names = "default";
			pinctrl-0 = <&pinctrl_i2c5_default>;
			#address-cells = <1>;
			#size-cells = <0>;

			status = "disabled";
		};

		/* SSCs on SBC */
		i2c@9540000 {
			compatible = "st,comms-ssc4-i2c";
			reg = <0x9540000 0x110>;
			interrupts = <GIC_SPI 135 IRQ_TYPE_LEVEL_HIGH>;
			clocks = <&clk_sysin>;
			clock-names = "ssc";
			clock-frequency = <400000>;
			pinctrl-names = "default";
			pinctrl-0 = <&pinctrl_i2c10_default>;
			#address-cells = <1>;
			#size-cells = <0>;

			status = "disabled";
		};

		i2c@9541000 {
			compatible = "st,comms-ssc4-i2c";
			reg = <0x9541000 0x110>;
			interrupts = <GIC_SPI 136 IRQ_TYPE_LEVEL_HIGH>;
			clocks = <&clk_sysin>;
			clock-names = "ssc";
			clock-frequency = <400000>;
			pinctrl-names = "default";
			pinctrl-0 = <&pinctrl_i2c11_default>;
			#address-cells = <1>;
			#size-cells = <0>;

			status = "disabled";
		};

		spi@9840000 {
			compatible = "st,comms-ssc4-spi";
			reg = <0x9840000 0x110>;
			interrupts = <GIC_SPI 112 IRQ_TYPE_LEVEL_HIGH>;
			clocks = <&clk_s_c0_flexgen CLK_EXT2F_A9>;
			clock-names = "ssc";
			pinctrl-0 = <&pinctrl_spi0_default>;
			pinctrl-names = "default";
			#address-cells = <1>;
			#size-cells = <0>;

			status = "disabled";
		};

		spi@9841000 {
			compatible = "st,comms-ssc4-spi";
			reg = <0x9841000 0x110>;
			interrupts = <GIC_SPI 113 IRQ_TYPE_LEVEL_HIGH>;
			clocks = <&clk_s_c0_flexgen CLK_EXT2F_A9>;
			clock-names = "ssc";
			pinctrl-names = "default";
			pinctrl-0 = <&pinctrl_spi1_default>;
			#address-cells = <1>;
			#size-cells = <0>;

			status = "disabled";
		};

		spi@9842000 {
			compatible = "st,comms-ssc4-spi";
			reg = <0x9842000 0x110>;
			interrupts = <GIC_SPI 114 IRQ_TYPE_LEVEL_HIGH>;
			clocks = <&clk_s_c0_flexgen CLK_EXT2F_A9>;
			clock-names = "ssc";
			pinctrl-names = "default";
			pinctrl-0 = <&pinctrl_spi2_default>;
			#address-cells = <1>;
			#size-cells = <0>;

			status = "disabled";
		};

		spi@9843000 {
			compatible = "st,comms-ssc4-spi";
			reg = <0x9843000 0x110>;
			interrupts = <GIC_SPI 115 IRQ_TYPE_LEVEL_HIGH>;
			clocks = <&clk_s_c0_flexgen CLK_EXT2F_A9>;
			clock-names = "ssc";
			pinctrl-names = "default";
			pinctrl-0 = <&pinctrl_spi3_default>;
			#address-cells = <1>;
			#size-cells = <0>;

			status = "disabled";
		};

		spi@9844000 {
			compatible = "st,comms-ssc4-spi";
			reg = <0x9844000 0x110>;
			interrupts = <GIC_SPI 116 IRQ_TYPE_LEVEL_HIGH>;
			clocks = <&clk_s_c0_flexgen CLK_EXT2F_A9>;
			clock-names = "ssc";
			pinctrl-names = "default";
			pinctrl-0 = <&pinctrl_spi4_default>;
			#address-cells = <1>;
			#size-cells = <0>;

			status = "disabled";
		};

		/* SBC SSC */
		spi@9540000 {
			compatible = "st,comms-ssc4-spi";
			reg = <0x9540000 0x110>;
			interrupts = <GIC_SPI 135 IRQ_TYPE_LEVEL_HIGH>;
			clocks = <&clk_sysin>;
			clock-names = "ssc";
			pinctrl-names = "default";
			pinctrl-0 = <&pinctrl_spi10_default>;
			#address-cells = <1>;
			#size-cells = <0>;

			status = "disabled";
		};

		spi@9541000 {
			compatible = "st,comms-ssc4-spi";
			reg = <0x9541000 0x110>;
			interrupts = <GIC_SPI 136 IRQ_TYPE_LEVEL_HIGH>;
			clocks = <&clk_sysin>;
			clock-names = "ssc";
			pinctrl-names = "default";
			pinctrl-0 = <&pinctrl_spi11_default>;
			#address-cells = <1>;
			#size-cells = <0>;

			status = "disabled";
		};

		spi@9542000 {
			compatible = "st,comms-ssc4-spi";
			reg = <0x9542000 0x110>;
			interrupts = <GIC_SPI 137 IRQ_TYPE_LEVEL_HIGH>;
			clocks = <&clk_sysin>;
			clock-names = "ssc";
			pinctrl-names = "default";
			pinctrl-0 = <&pinctrl_spi12_default>;
			#address-cells = <1>;
			#size-cells = <0>;

			status = "disabled";
		};

		mmc0: sdhci@9060000 {
			compatible = "st,sdhci-stih407", "st,sdhci";
			status = "disabled";
			reg = <0x09060000 0x7ff>, <0x9061008 0x20>;
			reg-names = "mmc", "top-mmc-delay";
			interrupts = <GIC_SPI 92 IRQ_TYPE_LEVEL_HIGH>;
			interrupt-names = "mmcirq";
			pinctrl-names = "default";
			pinctrl-0 = <&pinctrl_mmc0>;
			clock-names = "mmc", "icn";
			clocks = <&clk_s_c0_flexgen CLK_MMC_0>,
				 <&clk_s_c0_flexgen CLK_RX_ICN_HVA>;
			bus-width = <8>;
		};

		mmc1: sdhci@9080000 {
			compatible = "st,sdhci-stih407", "st,sdhci";
			status = "disabled";
			reg = <0x09080000 0x7ff>;
			reg-names = "mmc";
			interrupts = <GIC_SPI 90 IRQ_TYPE_LEVEL_HIGH>;
			interrupt-names = "mmcirq";
			pinctrl-names = "default";
			pinctrl-0 = <&pinctrl_sd1>;
			clock-names = "mmc", "icn";
			clocks = <&clk_s_c0_flexgen CLK_MMC_1>,
				 <&clk_s_c0_flexgen CLK_RX_ICN_HVA>;
			resets = <&softreset STIH407_MMC1_SOFTRESET>;
			bus-width = <4>;
		};

		/* Watchdog and Real-Time Clock */
		lpc@8787000 {
			compatible = "st,stih407-lpc";
			reg = <0x8787000 0x1000>;
			interrupts = <GIC_SPI 129 IRQ_TYPE_EDGE_RISING>;
			clocks = <&clk_s_d3_flexgen CLK_LPC_0>;
			timeout-sec = <120>;
			st,syscfg = <&syscfg_core>;
			st,lpc-mode = <ST_LPC_MODE_WDT>;
		};

		lpc@8788000 {
			compatible = "st,stih407-lpc";
			reg = <0x8788000 0x1000>;
			interrupts = <GIC_SPI 130 IRQ_TYPE_EDGE_RISING>;
			clocks = <&clk_s_d3_flexgen CLK_LPC_1>;
			st,lpc-mode = <ST_LPC_MODE_CLKSRC>;
		};

		spifsm: spifsm@9022000{
			compatible = "st,spi-fsm";
			reg = <0x9022000 0x1000>;
			reg-names = "spi-fsm";
			clocks = <&clk_s_c0_flexgen CLK_FLASH_PROMIP>;
			clock-names = "emi_clk";
			pinctrl-names = "default";
			pinctrl-0 = <&pinctrl_fsm>;
			st,syscfg = <&syscfg_core>;
			st,boot-device-reg = <0x8c4>;
			st,boot-device-spi = <0x68>;

			status = "disabled";
		};

		sata0: sata@9b20000 {
			compatible = "st,ahci";
			reg = <0x9b20000 0x1000>;

			interrupts = <GIC_SPI 159 IRQ_TYPE_LEVEL_HIGH>;
			interrupt-names = "hostc";

			phys = <&phy_port0 PHY_TYPE_SATA>;
			phy-names = "ahci_phy";

			resets = <&powerdown STIH407_SATA0_POWERDOWN>,
				 <&softreset STIH407_SATA0_SOFTRESET>,
				 <&softreset STIH407_SATA0_PWR_SOFTRESET>;
			reset-names = "pwr-dwn", "sw-rst", "pwr-rst";

			clock-names = "ahci_clk";
			clocks = <&clk_s_c0_flexgen CLK_ICN_REG>;

			ports-implemented = <0x1>;

			status = "disabled";
		};

		sata1: sata@9b28000 {
			compatible = "st,ahci";
			reg = <0x9b28000 0x1000>;

			interrupts = <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>;
			interrupt-names = "hostc";

			phys = <&phy_port1 PHY_TYPE_SATA>;
			phy-names = "ahci_phy";

			resets = <&powerdown STIH407_SATA1_POWERDOWN>,
				 <&softreset STIH407_SATA1_SOFTRESET>,
				 <&softreset STIH407_SATA1_PWR_SOFTRESET>;
			reset-names = "pwr-dwn",
				      "sw-rst",
				      "pwr-rst";

			clock-names = "ahci_clk";
			clocks = <&clk_s_c0_flexgen CLK_ICN_REG>;

			ports-implemented = <0x1>;

			status = "disabled";
		};

		st_dwc3: dwc3@8f94000 {
			compatible = "st,stih407-dwc3";
			reg = <0x08f94000 0x1000>, <0x110 0x4>;
			reg-names = "reg-glue", "syscfg-reg";
			st,syscfg = <&syscfg_core>;
			resets = <&powerdown STIH407_USB3_POWERDOWN>,
				 <&softreset STIH407_MIPHY2_SOFTRESET>;
			reset-names = "powerdown", "softreset";
			#address-cells = <1>;
			#size-cells = <1>;
			pinctrl-names = "default";
			pinctrl-0 = <&pinctrl_usb3>;
			ranges;

			status = "disabled";

			dwc3: usb@9900000 {
				compatible = "snps,dwc3";
				reg = <0x09900000 0x100000>;
				interrupts = <GIC_SPI 155 IRQ_TYPE_LEVEL_HIGH>;
				dr_mode = "host";
				phy-names = "usb2-phy", "usb3-phy";
				phys = <&usb2_picophy0>,
				       <&phy_port2 PHY_TYPE_USB3>;
				snps,dis_u3_susphy_quirk;
			};
		};

		/* COMMS PWM Module */
		pwm0: pwm@9810000 {
			compatible = "st,sti-pwm";
			#pwm-cells = <2>;
			reg = <0x9810000 0x68>;
			interrupts = <GIC_SPI 128 IRQ_TYPE_LEVEL_HIGH>;
			pinctrl-names = "default";
			pinctrl-0 = <&pinctrl_pwm0_chan0_default>;
			clock-names = "pwm";
			clocks = <&clk_sysin>;
			st,pwm-num-chan = <1>;

			status = "disabled";
		};

		/* SBC PWM Module */
		pwm1: pwm@9510000 {
			compatible = "st,sti-pwm";
			#pwm-cells = <2>;
			reg = <0x9510000 0x68>;
			interrupts = <GIC_SPI 131 IRQ_TYPE_LEVEL_HIGH>;
			pinctrl-names = "default";
			pinctrl-0 = <&pinctrl_pwm1_chan0_default
				     &pinctrl_pwm1_chan1_default
				     &pinctrl_pwm1_chan2_default
				     &pinctrl_pwm1_chan3_default>;
			clock-names = "pwm";
			clocks = <&clk_sysin>;
			st,pwm-num-chan = <4>;

			status = "disabled";
		};

		rng10: rng@8a89000 {
			compatible = "st,rng";
			reg = <0x08a89000 0x1000>;
			clocks = <&clk_sysin>;
			status = "okay";
		};

		rng11: rng@8a8a000 {
			compatible = "st,rng";
			reg = <0x08a8a000 0x1000>;
			clocks = <&clk_sysin>;
			status = "okay";
		};

		ethernet0: dwmac@9630000 {
			device_type = "network";
			status = "disabled";
			compatible = "st,stih407-dwmac", "snps,dwmac", "snps,dwmac-3.710";
			reg = <0x9630000 0x8000>, <0x80 0x4>;
			reg-names = "stmmaceth", "sti-ethconf";

			st,syscon = <&syscfg_sbc_reg 0x80>;
			st,gmac_en;
			resets = <&softreset STIH407_ETH1_SOFTRESET>;
			reset-names = "stmmaceth";

			interrupts = <GIC_SPI 98 IRQ_TYPE_LEVEL_HIGH>,
				     <GIC_SPI 99 IRQ_TYPE_LEVEL_HIGH>;
			interrupt-names = "macirq", "eth_wake_irq";

			/* DMA Bus Mode */
			snps,pbl = <8>;

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

			clock-names = "stmmaceth", "sti-ethclk";
			clocks = <&clk_s_c0_flexgen CLK_EXT2F_A9>,
				 <&clk_s_c0_flexgen CLK_ETH_PHY>;
		};

		mailbox0: mailbox@8f00000  {
			compatible = "st,stih407-mailbox";
			reg = <0x8f00000 0x1000>;
			interrupts = <GIC_SPI 1 IRQ_TYPE_LEVEL_HIGH>;
			#mbox-cells = <2>;
			mbox-name = "a9";
			status = "okay";
		};

		mailbox1: mailbox@8f01000 {
			compatible = "st,stih407-mailbox";
			reg = <0x8f01000 0x1000>;
			#mbox-cells = <2>;
			mbox-name = "st231_gp_1";
			status = "okay";
		};

		mailbox2: mailbox@8f02000 {
			compatible = "st,stih407-mailbox";
			reg = <0x8f02000 0x1000>;
			#mbox-cells = <2>;
			mbox-name = "st231_gp_0";
			status = "okay";
		};

		mailbox3: mailbox@8f03000 {
			compatible = "st,stih407-mailbox";
			reg = <0x8f03000 0x1000>;
			#mbox-cells = <2>;
			mbox-name = "st231_audio_video";
			status = "okay";
		};

		/* fdma audio */
		fdma0: dma-controller@8e20000 {
			compatible = "st,stih407-fdma-mpe31-11", "st,slim-rproc";
			reg = <0x8e20000 0x8000>,
			      <0x8e30000 0x3000>,
			      <0x8e37000 0x1000>,
			      <0x8e38000 0x8000>;
			reg-names = "slimcore", "dmem", "peripherals", "imem";
			clocks = <&clk_s_c0_flexgen CLK_FDMA>,
				 <&clk_s_c0_flexgen CLK_EXT2F_A9>,
				 <&clk_s_c0_flexgen CLK_EXT2F_A9>,
				 <&clk_s_c0_flexgen CLK_EXT2F_A9>;
			interrupts = <GIC_SPI 5 IRQ_TYPE_LEVEL_HIGH>;
			dma-channels = <16>;
			#dma-cells = <3>;
		};

		/* fdma app */
		fdma1: dma-controller@8e40000 {
			compatible = "st,stih407-fdma-mpe31-12", "st,slim-rproc";
			reg = <0x8e40000 0x8000>,
			      <0x8e50000 0x3000>,
			      <0x8e57000 0x1000>,
			      <0x8e58000 0x8000>;
			reg-names = "slimcore", "dmem", "peripherals", "imem";
			clocks = <&clk_s_c0_flexgen CLK_FDMA>,
				<&clk_s_c0_flexgen CLK_TX_ICN_DMU>,
				<&clk_s_c0_flexgen CLK_TX_ICN_DMU>,
				<&clk_s_c0_flexgen CLK_EXT2F_A9>;

			interrupts = <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>;
			dma-channels = <16>;
			#dma-cells = <3>;

			status = "disabled";
		};

		/* fdma free running */
		fdma2: dma-controller@8e60000 {
			compatible = "st,stih407-fdma-mpe31-13", "st,slim-rproc";
			reg = <0x8e60000 0x8000>,
			      <0x8e70000 0x3000>,
			      <0x8e77000 0x1000>,
			      <0x8e78000 0x8000>;
			reg-names = "slimcore", "dmem", "peripherals", "imem";
			interrupts = <GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH>;
			dma-channels = <16>;
			#dma-cells = <3>;
			clocks = <&clk_s_c0_flexgen CLK_FDMA>,
				<&clk_s_c0_flexgen CLK_EXT2F_A9>,
				<&clk_s_c0_flexgen CLK_TX_ICN_DISP_0>,
				<&clk_s_c0_flexgen CLK_EXT2F_A9>;

			status = "disabled";
		};

		sti_uni_player0: sti-uni-player@8d80000 {
			compatible = "st,stih407-uni-player-hdmi";
			#sound-dai-cells = <0>;
			st,syscfg = <&syscfg_core>;
			clocks = <&clk_s_d0_flexgen CLK_PCM_0>;
			assigned-clocks = <&clk_s_d0_quadfs 0>, <&clk_s_d0_flexgen CLK_PCM_0>;
			assigned-clock-parents = <0>, <&clk_s_d0_quadfs 0>;
			assigned-clock-rates = <50000000>;
			reg = <0x8d80000 0x158>;
			interrupts = <GIC_SPI 84 IRQ_TYPE_LEVEL_HIGH>;
			dmas = <&fdma0 2 0 1>;
			dma-names = "tx";

			status = "disabled";
		};

		sti_uni_player1: sti-uni-player@8d81000 {
			compatible = "st,stih407-uni-player-pcm-out";
			#sound-dai-cells = <0>;
			st,syscfg = <&syscfg_core>;
			clocks = <&clk_s_d0_flexgen CLK_PCM_1>;
			assigned-clocks = <&clk_s_d0_quadfs 1>, <&clk_s_d0_flexgen CLK_PCM_1>;
			assigned-clock-parents = <0>, <&clk_s_d0_quadfs 1>;
			assigned-clock-rates = <50000000>;
			reg = <0x8d81000 0x158>;
			interrupts = <GIC_SPI 85 IRQ_TYPE_LEVEL_HIGH>;
			dmas = <&fdma0 3 0 1>;
			dma-names = "tx";

			status = "disabled";
		};

		sti_uni_player2: sti-uni-player@8d82000 {
			compatible = "st,stih407-uni-player-dac";
			#sound-dai-cells = <0>;
			st,syscfg = <&syscfg_core>;
			clocks = <&clk_s_d0_flexgen CLK_PCM_2>;
			assigned-clocks = <&clk_s_d0_quadfs 2>, <&clk_s_d0_flexgen CLK_PCM_2>;
			assigned-clock-parents = <0>, <&clk_s_d0_quadfs 2>;
			assigned-clock-rates = <50000000>;
			reg = <0x8d82000 0x158>;
			interrupts = <GIC_SPI 86 IRQ_TYPE_LEVEL_HIGH>;
			dmas = <&fdma0 4 0 1>;
			dma-names = "tx";

			status = "disabled";
		};

		sti_uni_player3: sti-uni-player@8d85000 {
			compatible = "st,stih407-uni-player-spdif";
			#sound-dai-cells = <0>;
			st,syscfg = <&syscfg_core>;
			clocks = <&clk_s_d0_flexgen CLK_SPDIFF>;
			assigned-clocks = <&clk_s_d0_quadfs 3>, <&clk_s_d0_flexgen CLK_SPDIFF>;
			assigned-clock-parents = <0>, <&clk_s_d0_quadfs 3>;
			assigned-clock-rates = <50000000>;
			reg = <0x8d85000 0x158>;
			interrupts = <GIC_SPI 89 IRQ_TYPE_LEVEL_HIGH>;
			dmas = <&fdma0 7 0 1>;
			dma-names = "tx";

			status = "disabled";
		};

		sti_uni_reader0: sti-uni-reader@8d83000 {
			compatible = "st,stih407-uni-reader-pcm_in";
			#sound-dai-cells = <0>;
			st,syscfg = <&syscfg_core>;
			reg = <0x8d83000 0x158>;
			interrupts = <GIC_SPI 87 IRQ_TYPE_LEVEL_HIGH>;
			dmas = <&fdma0 5 0 1>;
			dma-names = "rx";

			status = "disabled";
		};

		sti_uni_reader1: sti-uni-reader@8d84000 {
			compatible = "st,stih407-uni-reader-hdmi";
			#sound-dai-cells = <0>;
			st,syscfg = <&syscfg_core>;
			reg = <0x8d84000 0x158>;
			interrupts = <GIC_SPI 88 IRQ_TYPE_LEVEL_HIGH>;
			dmas = <&fdma0 6 0 1>;
			dma-names = "rx";

			status = "disabled";
		};
	};
};